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>2019-07-16 14:56:08 +0300
committerJoas Schilling <coding@schilljs.com>2019-07-18 13:23:26 +0300
commitc3c735e7edfb36e2f16b66c2d9da02a6463a0bf1 (patch)
tree60755d7a50aa4f9bac7f8cb0167bbe6be901e977 /lib/Notification/Notifier.php
parentb2f41fc736b612426b70eb4b98fcd7146a943a98 (diff)
Adjust markProcessed behaviour to 17
Signed-off-by: Joas Schilling <coding@schilljs.com>
Diffstat (limited to 'lib/Notification/Notifier.php')
-rw-r--r--lib/Notification/Notifier.php10
1 files changed, 4 insertions, 6 deletions
diff --git a/lib/Notification/Notifier.php b/lib/Notification/Notifier.php
index ab49dcbe6..06bd595cb 100644
--- a/lib/Notification/Notifier.php
+++ b/lib/Notification/Notifier.php
@@ -37,6 +37,7 @@ use OCP\IURLGenerator;
use OCP\IUser;
use OCP\IUserManager;
use OCP\L10N\IFactory;
+use OCP\Notification\AlreadyProcessedException;
use OCP\Notification\IManager as INotificationManager;
use OCP\Notification\INotification;
use OCP\Notification\INotifier;
@@ -125,8 +126,7 @@ class Notifier implements INotifier {
$userId = $notification->getUser();
$user = $this->userManager->get($userId);
if (!$user instanceof IUser || $this->config->isDisabledForUser($user)) {
- $this->notificationManager->markProcessed($notification);
- throw new \InvalidArgumentException('User can not use Talk');
+ throw new AlreadyProcessedException();
}
$l = $this->lFactory->get('spreed', $languageCode);
@@ -139,8 +139,7 @@ class Notifier implements INotifier {
$room = $this->manager->getRoomById((int) $notification->getObjectId());
} catch (RoomNotFoundException $e) {
// Room does not exist
- $this->notificationManager->markProcessed($notification);
- throw new \InvalidArgumentException('Invalid room');
+ throw new AlreadyProcessedException();
}
}
@@ -148,8 +147,7 @@ class Notifier implements INotifier {
$participant = $room->getParticipant($userId);
} catch (ParticipantNotFoundException $e) {
// Room does not exist
- $this->notificationManager->markProcessed($notification);
- throw new \InvalidArgumentException('User is not part of the room anymore');
+ throw new AlreadyProcessedException();
}
$notification