forked from GNUsocial/gnu-social
[COMPONENT][Notification] Additional check to avoid unnecessary notifications
This commit is contained in:
parent
17733f32d6
commit
6b4fa8c303
@ -79,6 +79,11 @@ class Notification extends Component
|
||||
continue;
|
||||
}
|
||||
if (Event::handle('NewNotificationShould', [$activity, $target]) === Event::next) {
|
||||
if ($sender->getId() === $target->getId()
|
||||
|| $activity->getActorId() === $target->getId()) {
|
||||
// The target already knows about this, no need to bother with a notification
|
||||
continue;
|
||||
}
|
||||
// TODO: use https://symfony.com/doc/current/notifier.html
|
||||
// XXX: Unideal as in failures the rollback will leave behind a false notification,
|
||||
// but most notifications (all) require flushing the objects first
|
||||
|
Loading…
Reference in New Issue
Block a user