Unsuccessful ActivitiyPub transmission are now deferred

This commit is contained in:
Michael 2018-10-23 03:54:18 +00:00
parent 65f29800ff
commit e3e714a45f
4 changed files with 34 additions and 14 deletions

View file

@ -272,9 +272,11 @@ class HTTPSignature
/**
* @brief Transmit given data to a target for a user
*
* @param $data
* @param $target
* @param $uid
* @param array $data Data that is about to be send
* @param string $target The URL of the inbox
* @param integer $uid User id of the sender
*
* @return boolean Was the transmission successful?
*/
public static function transmit($data, $target, $uid)
{
@ -303,8 +305,11 @@ class HTTPSignature
$headers[] = 'Content-Type: application/activity+json';
$postResult = Network::post($target, $content, $headers);
$return_code = $postResult->getReturnCode();
logger('Transmit to ' . $target . ' returned ' . $postResult->getReturnCode());
logger('Transmit to ' . $target . ' returned ' . $return_code);
return ($return_code >= 200) && ($return_code <= 299);
}
/**