Skip to content
This repository has been archived by the owner on Jul 10, 2023. It is now read-only.

DEV Nextcloud: fix notification problem #351

Open
wants to merge 1 commit into
base: nextcloud-dev
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 4 additions & 4 deletions lib/Notifier/ScienceMeshNotifier.php
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@
namespace OCA\ScienceMesh\Notifier;

use OCP\IURLGenerator;
use OCP\Notification\AlreadyProcessedException;
use OCP\L10N\IFactory;
use OCP\Notification\INotification;
use OCP\Notification\INotifier;

Expand Down Expand Up @@ -62,16 +62,17 @@ public function getName(): string {
}

/**
* @inheritdoc
* @param INotification $notification
* @param string $languageCode The code of the language that should be used to prepare the notification
* @return INotification
* @throws \InvalidArgumentException When the notification was not prepared by a notifier
* @throws AlreadyProcessedException When the notification is not needed anymore and should be deleted
*/

public function prepare(INotification $notification, string $languageCode): INotification {
public function prepare(INotification $notification, $languageCode) {
if ($notification->getApp() !== 'sciencemesh') {
throw new \InvalidArgumentException('Unknown app');
throw new \InvalidArgumentExceptions('Unknown app');
}

switch ($notification->getSubject()) {
Expand Down Expand Up @@ -104,7 +105,6 @@ public function prepare(INotification $notification, string $languageCode): INot
// ->setLink($this->urlGenerator->linkToRouteAbsolute('sciencemesh.app.shared'), 'GET'); // , ['id' => $notification->getObjectId()]), 'DELETE');
break;
}

$notification->addParsedAction($action);
}

Expand Down