Merge pull request #11322 from annando/community-notification
Reduce amount of notifications by communities
This commit is contained in:
commit
6a9c2173fb
1 changed files with 8 additions and 0 deletions
|
@ -417,6 +417,14 @@ class UserNotification
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// Don't notify about reshares by communities of our own posts or each time someone comments
|
||||||
|
if (($item['verb'] == Activity::ANNOUNCE) && DBA::exists('contact', ['id' => $item['contact-id'], 'contact-type' => Contact::TYPE_COMMUNITY])) {
|
||||||
|
$post = Post::selectFirst(['origin', 'gravity'], ['uri-id' => $item['thr-parent-id'], 'uid' => $uid]);
|
||||||
|
if ($post['origin'] || ($post['gravity'] != GRAVITY_PARENT)) {
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
// Check if the contact posted or shared something directly
|
// Check if the contact posted or shared something directly
|
||||||
if (DBA::exists('contact', ['id' => $item['contact-id'], 'notify_new_posts' => true])) {
|
if (DBA::exists('contact', ['id' => $item['contact-id'], 'notify_new_posts' => true])) {
|
||||||
return true;
|
return true;
|
||||||
|
|
Loading…
Reference in a new issue