Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/nextcloud/spreed.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJoas Schilling <coding@schilljs.com>2018-07-09 15:52:09 +0300
committerJoas Schilling <coding@schilljs.com>2018-07-09 15:52:09 +0300
commit0c338c914caccaf8c7b696b84752aa66843bff34 (patch)
treea1b9d6f75b58bae190e9d4e4b3412260801739ca /lib/Notification/Notifier.php
parenta05afab2adc447d3517774a030874cea240e89f0 (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.php12
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