|
@ -45,15 +45,21 @@ class Webmention { |
|
|
$payload = [ |
|
|
$payload = [ |
|
|
'source' => $webmention->source, |
|
|
'source' => $webmention->source, |
|
|
'target' => $webmention->target, |
|
|
'target' => $webmention->target, |
|
|
'status' => $code |
|
|
|
|
|
|
|
|
'status' => $code, |
|
|
]; |
|
|
]; |
|
|
if($webmention->webmention_endpoint) { |
|
|
if($webmention->webmention_endpoint) { |
|
|
$payload['type'] = 'webmention'; |
|
|
$payload['type'] = 'webmention'; |
|
|
} |
|
|
|
|
|
if($webmention->pingback_endpoint) { |
|
|
|
|
|
|
|
|
} elseif($webmention->pingback_endpoint) { |
|
|
$payload['type'] = 'pingback'; |
|
|
$payload['type'] = 'pingback'; |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
if($status->http_code) { |
|
|
|
|
|
$payload['http_code'] = $status->http_code; |
|
|
|
|
|
} |
|
|
|
|
|
if($raw) { |
|
|
|
|
|
$payload['http_body'] = $raw; |
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
return self::$http->post($webmention->callback, $payload); |
|
|
return self::$http->post($webmention->callback, $payload); |
|
|
} |
|
|
} |
|
|
} |
|
|
} |
|
|