Browse Source

include additional info in callback and status API

main
Aaron Parecki 6 years ago
parent
commit
e72c8cf675
No known key found for this signature in database GPG Key ID: 276C2817346D6056
2 changed files with 12 additions and 3 deletions
  1. +3
    -0
      controllers/API.php
  2. +9
    -3
      lib/Telegraph/Webmention.php

+ 3
- 0
controllers/API.php View File

@ -301,6 +301,9 @@ class API {
if($status && $status->http_code) if($status && $status->http_code)
$data['http_code'] = (int)$status->http_code; $data['http_code'] = (int)$status->http_code;
if($status && $status->raw_response)
$data['http_body'] = $status->raw_response;
if($summary) if($summary)
$data['summary'] = $summary; $data['summary'] = $summary;

+ 9
- 3
lib/Telegraph/Webmention.php View File

@ -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);
} }
} }

Loading…
Cancel
Save