[COMPONENT][Notification] Add event to decide whether local actors should be bothered
This commit is contained in:
parent
4d8e39bf69
commit
846ec37cd9
|
@ -82,12 +82,14 @@ class Notification extends Component
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
// TODO: use https://symfony.com/doc/current/notifier.html
|
if (Event::handle('NewNotificationShould', [$activity, $target]) === Event::next) {
|
||||||
DB::persist(Entity\Notification::create([
|
// TODO: use https://symfony.com/doc/current/notifier.html
|
||||||
'activity_id' => $activity->getId(),
|
DB::persist(Entity\Notification::create([
|
||||||
'target_id' => $target->getId(),
|
'activity_id' => $activity->getId(),
|
||||||
'reason' => $reason,
|
'target_id' => $target->getId(),
|
||||||
]));
|
'reason' => $reason,
|
||||||
|
]));
|
||||||
|
}
|
||||||
} else {
|
} else {
|
||||||
// We have no authority nor responsibility of notifying remote actors of a remote actor's doing
|
// We have no authority nor responsibility of notifying remote actors of a remote actor's doing
|
||||||
if ($sender->getIsLocal()) {
|
if ($sender->getIsLocal()) {
|
||||||
|
|
Loading…
Reference in New Issue
Block a user