diff options
author | Joas Schilling <coding@schilljs.com> | 2018-07-09 18:31:50 +0300 |
---|---|---|
committer | Joas Schilling <coding@schilljs.com> | 2018-08-02 12:29:50 +0300 |
commit | b74f91ba81e7d7078d5f5823035c70735983faa8 (patch) | |
tree | 103c4672e2600991acfc9bf32b000d4d1a287495 /lib/Notification/Notifier.php | |
parent | 8005b579bfef5e8e2011363f008bd4012aa66245 (diff) |
Always send notifications for one2one chats
Signed-off-by: Joas Schilling <coding@schilljs.com>
Diffstat (limited to 'lib/Notification/Notifier.php')
-rw-r--r-- | lib/Notification/Notifier.php | 13 |
1 files changed, 11 insertions, 2 deletions
diff --git a/lib/Notification/Notifier.php b/lib/Notification/Notifier.php index b930233aa..927f643c0 100644 --- a/lib/Notification/Notifier.php +++ b/lib/Notification/Notifier.php @@ -97,7 +97,7 @@ class Notifier implements INotifier { if ($subject === 'call') { return $this->parseCall($notification, $room, $l); } - if ($subject === 'mention') { + if ($subject === 'mention' || $subject === 'chat') { return $this->parseMention($notification, $room, $l); } @@ -157,7 +157,16 @@ class Notifier implements INotifier { } $notification->setParsedMessage($parsedMessage); - if ($room->getType() === Room::ONE_TO_ONE_CALL) { + if ($notification->getSubject() === 'chat') { + $notification + ->setParsedSubject(str_replace('{user}', $user->getDisplayName(), $l->t('{user} sent you a private message'))) + ->setRichSubject( + $l->t('{user} sent you a private message'), [ + 'user' => $richSubjectUser + ] + ); + + } else if ($room->getType() === Room::ONE_TO_ONE_CALL) { $notification ->setParsedSubject( $l->t('%s mentioned you in a private conversation', [$user->getDisplayName()]) |