Archive inboxes after 5 days of delivery failures

This commit is contained in:
Michael 2019-03-25 21:51:32 +00:00
parent 854cc3e472
commit 198e150ba8
4 changed files with 115 additions and 13 deletions

View file

@ -465,6 +465,18 @@ class Transmitter
return $receivers;
}
/**
* Check if an inbox is archived
*
* @param string $url Inbox url
*
* @return boolean "true" if inbox is archived
*/
private static function archivedInbox($url)
{
return DBA::exists('inbox-status', ['url' => $url, 'archive' => true]);
}
/**
* Fetches a list of inboxes of followers of a given user
*
@ -506,7 +518,9 @@ class Transmitter
} else {
$target = $profile['sharedinbox'];
}
$inboxes[$target] = $target;
if (!self::archivedInbox($target)) {
$inboxes[$target] = $target;
}
}
}
DBA::close($contacts);
@ -563,7 +577,9 @@ class Transmitter
} else {
$target = $profile['sharedinbox'];
}
$inboxes[$target] = $target;
if (!self::archivedInbox($target)) {
$inboxes[$target] = $target;
}
}
}
}