mirror of
https://github.com/friendica/friendica
synced 2025-04-29 15:04:22 +02:00
Merge remote-tracking branch 'upstream/develop' into subscription
This commit is contained in:
commit
ff6d14a022
53 changed files with 2238 additions and 1133 deletions
|
@ -133,14 +133,14 @@ class UserNotification
|
|||
public static function setNotification(int $uri_id, int $uid)
|
||||
{
|
||||
$fields = ['id', 'uri-id', 'parent-uri-id', 'uid', 'body', 'parent', 'gravity', 'vid', 'gravity',
|
||||
'contact-id', 'author-id', 'owner-id', 'causer-id',
|
||||
'contact-id', 'author-id', 'author-gsid', 'owner-id', 'owner-gsid', 'causer-id', 'causer-gsid',
|
||||
'private', 'thr-parent', 'thr-parent-id', 'parent-uri-id', 'parent-uri', 'verb'];
|
||||
$item = Post::selectFirst($fields, ['uri-id' => $uri_id, 'uid' => $uid, 'origin' => false]);
|
||||
if (!DBA::isResult($item)) {
|
||||
return;
|
||||
}
|
||||
|
||||
$parent = Post::selectFirstPost(['author-id', 'owner-id', 'causer-id'], ['uri-id' => $item['parent-uri-id']]);
|
||||
$parent = Post::selectFirstPost(['author-id', 'author-gsid', 'owner-id', 'owner-gsid', 'causer-id', 'causer-gsid',], ['uri-id' => $item['parent-uri-id']]);
|
||||
if (!DBA::isResult($parent)) {
|
||||
return;
|
||||
}
|
||||
|
@ -195,6 +195,13 @@ class UserNotification
|
|||
}
|
||||
}
|
||||
|
||||
foreach (array_unique([$parent['author-gsid'], $parent['owner-gsid'], $parent['causer-gsid'], $item['author-gsid'], $item['owner-gsid'], $item['causer-gsid']]) as $gsid) {
|
||||
if ($gsid && DI::userGServer()->isIgnoredByUser($uid, $gsid)) {
|
||||
Logger::debug('Server is ignored by user', ['uid' => $uid, 'gsid' => $gsid, 'uri-id' => $item['uri-id']]);
|
||||
return;
|
||||
}
|
||||
}
|
||||
|
||||
$user = User::getById($uid, ['account-type', 'account_removed', 'account_expired']);
|
||||
if (in_array($user['account-type'], [User::ACCOUNT_TYPE_COMMUNITY, User::ACCOUNT_TYPE_RELAY])) {
|
||||
return;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue