The inbox-status can now be archived for a whole server

This commit is contained in:
Michael 2022-12-31 23:42:00 +00:00
parent 7942881f7e
commit e21db0fe6d
7 changed files with 105 additions and 15 deletions

View file

@ -408,7 +408,7 @@ class GServer
['nurl' => Strings::normaliseLink($url)]);
Logger::info('Set failed status for existing server', ['url' => $url]);
if (self::isDefunct($gserver)) {
Contact::update(['archive' => true], ['gsid' => $gserver['id']]);
self::archiveContacts($gserver['id']);
}
return;
}
@ -418,6 +418,18 @@ class GServer
Logger::info('Set failed status for new server', ['url' => $url]);
}
/**
* Archive server related contacts and inboxes
*
* @param integer $gsid
* @return void
*/
private static function archiveContacts(int $gsid)
{
Contact::update(['archive' => true], ['gsid' => $gsid]);
DBA::update('inbox-status', ['archive' => true], ['gsid' => $gsid]);
}
/**
* Remove unwanted content from the given URL
*