Move dismiss stored notification to specific endpoint

Signed-off-by: Vitor Mattos <vitor@php.rio>
This commit is contained in:
Vitor Mattos
2023-01-17 15:24:18 -03:00
parent 13eff2db46
commit 4cc5f43b56
7 changed files with 59 additions and 34 deletions

View File

@ -29,6 +29,7 @@ use InvalidArgumentException;
use OC\User\NoUserException;
use OCA\Talk\Config;
use OCA\Talk\Exceptions\ParticipantNotFoundException;
use OCA\Talk\Manager;
use OCA\Talk\Participant;
use OCA\Talk\Room;
use OCP\AppFramework\Utility\ITimeFactory;
@ -52,6 +53,7 @@ class RecordingService {
private ParticipantService $participantService,
private IRootFolder $rootFolder,
private IManager $notificationManager,
private Manager $roomManager,
private ITimeFactory $timeFactory,
private Config $config,
private RoomService $roomService
@ -172,4 +174,15 @@ class RecordingService {
]);
$this->notificationManager->notify($notification);
}
public function notificationDismiss(string $roomToken, string $userId, string $dateTime): void {
$room = $this->roomManager->getRoomByToken($roomToken);
$notification = $this->notificationManager->createNotification();
$notification->setApp('spreed')
->setObject('chat', (string) $room->getToken())
->setSubject('record_file_stored')
->setDateTime($this->timeFactory->getDateTime('@' . $dateTime))
->setUser($userId);
$this->notificationManager->markProcessed($notification);
}
}