*/
public static function markForArchival(array $contact)
{
- if ((!isset($contact['url']) || !isset($contact['uri-id'])) && !empty($contact['id'])) {
+ if ((!isset($contact['uri-id']) || !isset($contact['url']) || !isset($contact['archive']) || !isset($contact['self']) || !isset($contact['term-date'])) && !empty($contact['id'])) {
$fields = ['id', 'uri-id', 'url', 'archive', 'self', 'term-date'];
$contact = DBA::selectFirst('contact', $fields, ['id' => $contact['id']]);
if (!DBA::isResult($contact)) {
}
}
- if (!$api_mode && !$item['origin']) {
+ if (!$api_mode && !$item['deleted'] && !$item['origin']) {
Logger::debug('Post is not ours and is not stored', ['id' => $item['id'], 'uri-id' => $item['uri-id']]);
return false;
}
Logger::notice('Got exception', ['code' => $th->getCode(), 'message' => $th->getMessage()]);
return -25;
}
- Item::incrementOutbound(Protocol::DFRN);
+
$xml = $postResult->getBodyString();
$curl_stat = $postResult->getReturnCode();
if (!empty($contact['gsid'])) {
GServer::setReachableById($contact['gsid'], Protocol::DFRN);
+ Item::incrementOutbound(Protocol::DFRN);
}
if (!empty($res->message)) {
return 0;
}
$return_code = $postResult->getReturnCode();
- Item::incrementOutbound(Protocol::DIASPORA);
} else {
Logger::notice('test_mode');
return 200;
if (!empty($contact['gsid']) && (empty($return_code) || $postResult->isTimeout())) {
GServer::setFailureById($contact['gsid']);
} elseif (!empty($contact['gsid']) && ($return_code >= 200) && ($return_code <= 299)) {
+ Item::incrementOutbound(Protocol::DIASPORA);
GServer::setReachableById($contact['gsid'], Protocol::DIASPORA);
}
self::setInboxStatus($target, ($return_code >= 200) && ($return_code <= 299));
- Item::incrementOutbound(Protocol::ACTIVITYPUB);
+ if (($return_code >= 200) && ($return_code <= 299)) {
+ Item::incrementOutbound(Protocol::ACTIVITYPUB);
+ }
return $postResult;
}
continue;
}
- Logger::info('Delivery', ['batch' => $in_batch, 'target' => $post_uriid, 'uid' => $sender_uid, 'guid' => $target_item['guid'] ?? '', 'to' => $contact]);
+ Logger::info('Delivery', ['cmd' => $cmd, 'batch' => $in_batch, 'target' => $post_uriid, 'uid' => $sender_uid, 'guid' => $target_item['guid'] ?? '', 'to' => $contact]);
// Ensure that posts with our own protocol arrives before Diaspora posts arrive.
// Situation is that sometimes Friendica servers receive Friendica posts over the Diaspora protocol first.