Skip to content

Commit

Permalink
Merge cbe2002 into c5919bc
Browse files Browse the repository at this point in the history
  • Loading branch information
nickvergessen authored Dec 20, 2024
2 parents c5919bc + cbe2002 commit 846e17f
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions lib/NotificationGenerator.php
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@
use OCP\Notification\IManager as NotificationManager;
use OCP\Notification\INotification;
use OCP\Notification\INotifier;
use OCP\Notification\UnknownNotificationException;
use Psr\Log\LoggerInterface;

class NotificationGenerator implements INotifier {
Expand Down Expand Up @@ -101,15 +102,15 @@ public function getName(): string {

public function prepare(INotification $notification, string $languageCode): INotification {
if ($notification->getObjectType() !== 'activity_notification') {
throw new \InvalidArgumentException();
throw new UnknownNotificationException();
}

$event = $this->data->getById((int)$notification->getObjectId());
if (!$event) {
throw new AlreadyProcessedException();
}
if ($event->getAffectedUser() !== $notification->getUser()) {
throw new \InvalidArgumentException();
throw new AlreadyProcessedException();
}
$this->activityManager->setCurrentUserId($notification->getUser());
$event = $this->populateEvent($event, $languageCode);
Expand Down

0 comments on commit 846e17f

Please sign in to comment.