Don't send item notifications to deleted user accounts
This commit is contained in:
parent
2d0af812b1
commit
48b1dceb19
1 changed files with 5 additions and 1 deletions
|
@ -178,11 +178,15 @@ class UserNotification
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
$user = User::getById($uid, ['account-type']);
|
$user = User::getById($uid, ['account-type', 'account_removed', 'account_expired']);
|
||||||
if (in_array($user['account-type'], [User::ACCOUNT_TYPE_COMMUNITY, User::ACCOUNT_TYPE_RELAY])) {
|
if (in_array($user['account-type'], [User::ACCOUNT_TYPE_COMMUNITY, User::ACCOUNT_TYPE_RELAY])) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if ($user['account_removed'] || $user['account_expired']) {
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
$author = Contact::getById($item['author-id'], ['contact-type']);
|
$author = Contact::getById($item['author-id'], ['contact-type']);
|
||||||
if (empty($author)) {
|
if (empty($author)) {
|
||||||
return;
|
return;
|
||||||
|
|
Loading…
Reference in a new issue