Block communication with Diaspora for communities

This commit is contained in:
Michael 2022-02-15 07:08:02 +00:00
parent 2b0518ac04
commit 29d83c0ffb
4 changed files with 17 additions and 7 deletions

View file

@ -818,6 +818,15 @@ class Item
$item['inform'] = trim($item['inform'] ?? '');
$item['file'] = trim($item['file'] ?? '');
// Communities aren't working with the Diaspora protoccol
if (($uid != 0) && ($item['network'] == Protocol::DIASPORA)) {
$user = User::getById($uid, ['account-type']);
if ($user['account-type'] == Contact::TYPE_COMMUNITY) {
Logger::info('Community posts are not supported via Diaspora');
return 0;
}
}
// Items cannot be stored before they happen ...
if ($item['created'] > DateTimeFormat::utcNow()) {
$item['created'] = DateTimeFormat::utcNow();