diff options
author | Joas Schilling <coding@schilljs.com> | 2018-07-09 15:52:09 +0300 |
---|---|---|
committer | Joas Schilling <coding@schilljs.com> | 2018-07-09 15:52:09 +0300 |
commit | 0c338c914caccaf8c7b696b84752aa66843bff34 (patch) | |
tree | a1b9d6f75b58bae190e9d4e4b3412260801739ca /lib/Notification/Notifier.php | |
parent | a05afab2adc447d3517774a030874cea240e89f0 (diff) |
Use the token instead of the id to identify the room objects
Signed-off-by: Joas Schilling <coding@schilljs.com>
Diffstat (limited to 'lib/Notification/Notifier.php')
-rw-r--r-- | lib/Notification/Notifier.php | 12 |
1 files changed, 8 insertions, 4 deletions
diff --git a/lib/Notification/Notifier.php b/lib/Notification/Notifier.php index dc6aa6fbc..6d1ae9325 100644 --- a/lib/Notification/Notifier.php +++ b/lib/Notification/Notifier.php @@ -33,7 +33,6 @@ use OCP\L10N\IFactory; use OCP\Notification\INotification; use OCP\Notification\INotifier; use OCP\RichObjectStrings\Definitions; -use OCP\RichObjectStrings\InvalidObjectExeption; class Notifier implements INotifier { @@ -82,10 +81,15 @@ class Notifier implements INotifier { $l = $this->lFactory->get('spreed', $languageCode); try { - $room = $this->manager->getRoomById((int) $notification->getObjectId()); + $room = $this->manager->getRoomByToken((int) $notification->getObjectId()); } catch (RoomNotFoundException $e) { - // Room does not exist - throw new \InvalidArgumentException('Invalid room'); + try { + // Before 3.2.3 the id was passed in notifications + $room = $this->manager->getRoomById((int) $notification->getObjectId()); + } catch (RoomNotFoundException $e) { + // Room does not exist + throw new \InvalidArgumentException('Invalid room'); + } } $notification |