diff options
author | Joas Schilling <coding@schilljs.com> | 2019-01-09 18:01:19 +0300 |
---|---|---|
committer | Joas Schilling <coding@schilljs.com> | 2019-01-09 18:01:19 +0300 |
commit | 5263cc8ba0a3bc7827790b4a520171661890f1e8 (patch) | |
tree | 39b8808a0c8fc3cde8e3e32206e065b468ffba34 /lib/Notification | |
parent | 4252b3f0cc31a47103fa58b28f45097fbb6d485e (diff) |
Remove "{actor} invited you to {call}" notification when the user joined the conversation once
Signed-off-by: Joas Schilling <coding@schilljs.com>
Diffstat (limited to 'lib/Notification')
-rw-r--r-- | lib/Notification/Hooks.php | 25 |
1 files changed, 24 insertions, 1 deletions
diff --git a/lib/Notification/Hooks.php b/lib/Notification/Hooks.php index ebf2d1db5..a0b2bfb76 100644 --- a/lib/Notification/Hooks.php +++ b/lib/Notification/Hooks.php @@ -58,7 +58,6 @@ class Hooks { } $actorId = $actor->getUID(); - $notification = $this->notificationManager->createNotification(); $dateTime = new \DateTime(); try { @@ -89,6 +88,30 @@ class Hooks { } /** + * Room invitation: "{actor} invited you to {call}" + * + * @param Room $room + */ + public function markInvitationRead(Room $room) { + $currentUser = $this->userSession->getUser(); + if (!$currentUser instanceof IUser) { + return; + } + + $notification = $this->notificationManager->createNotification(); + try { + $notification->setApp('spreed') + ->setUser($currentUser->getUID()) + ->setObject('room', $room->getToken()) + ->setSubject('invitation'); + $this->notificationManager->markProcessed($notification); + } catch (\InvalidArgumentException $e) { + $this->logger->logException($e, ['app' => 'spreed']); + return; + } + } + + /** * Call notification: "{user} wants to talk with you" * * @param Room $room |