<?php
/**
- * @copyright Copyright (C) 2010-2022, the Friendica project
+ * @copyright Copyright (C) 2010-2023, the Friendica project
*
* @license GNU AGPL version 3 or any later version
*
$apcontact['following'] = JsonLD::fetchElement($compacted, 'as:following', '@id');
$apcontact['followers'] = JsonLD::fetchElement($compacted, 'as:followers', '@id');
$apcontact['inbox'] = (JsonLD::fetchElement($compacted, 'ldp:inbox', '@id') ?? '');
- self::unarchiveInbox($apcontact['inbox'], false);
-
$apcontact['outbox'] = JsonLD::fetchElement($compacted, 'as:outbox', '@id');
$apcontact['sharedinbox'] = '';
if (!empty($compacted['as:endpoints'])) {
$apcontact['sharedinbox'] = (JsonLD::fetchElement($compacted['as:endpoints'], 'as:sharedInbox', '@id') ?? '');
- self::unarchiveInbox($apcontact['sharedinbox'], true);
}
$apcontact['featured'] = JsonLD::fetchElement($compacted, 'toot:featured', '@id');
$apcontact['gsid'] = null;
}
+ self::unarchiveInbox($apcontact['inbox'], false, $apcontact['gsid']);
+
+ if (!empty($apcontact['sharedinbox'])) {
+ self::unarchiveInbox($apcontact['sharedinbox'], true, $apcontact['gsid']);
+ }
+
if ($apcontact['url'] == $apcontact['alias']) {
$apcontact['alias'] = null;
}
{
if (!empty($apcontact['inbox'])) {
Logger::info('Set inbox status to failure', ['inbox' => $apcontact['inbox']]);
- HTTPSignature::setInboxStatus($apcontact['inbox'], false);
+ HTTPSignature::setInboxStatus($apcontact['inbox'], false, false, $apcontact['gsid']);
}
if (!empty($apcontact['sharedinbox'])) {
if (!$available) {
// If all known personal inboxes are failing then set their shared inbox to failure as well
Logger::info('Set shared inbox status to failure', ['sharedinbox' => $apcontact['sharedinbox']]);
- HTTPSignature::setInboxStatus($apcontact['sharedinbox'], false, true);
+ HTTPSignature::setInboxStatus($apcontact['sharedinbox'], false, true, $apcontact['gsid']);
}
}
}
{
if (!empty($apcontact['inbox'])) {
Logger::info('Set inbox status to success', ['inbox' => $apcontact['inbox']]);
- HTTPSignature::setInboxStatus($apcontact['inbox'], true);
+ HTTPSignature::setInboxStatus($apcontact['inbox'], true, false, $apcontact['gsid']);
}
if (!empty($apcontact['sharedinbox'])) {
Logger::info('Set shared inbox status to success', ['sharedinbox' => $apcontact['sharedinbox']]);
- HTTPSignature::setInboxStatus($apcontact['sharedinbox'], true, true);
+ HTTPSignature::setInboxStatus($apcontact['sharedinbox'], true, true, $apcontact['gsid']);
}
}
*
* @param string $url inbox url
* @param boolean $shared Shared Inbox
+ * @param int $gsid Global server id
* @return void
*/
- private static function unarchiveInbox(string $url, bool $shared)
+ private static function unarchiveInbox(string $url, bool $shared, int $gsid = null)
{
if (empty($url)) {
return;
}
- HTTPSignature::setInboxStatus($url, true, $shared);
+ HTTPSignature::setInboxStatus($url, true, $shared, $gsid);
}
/**