Notifications cleared for a whole thread in case of one mark seen

This commit is contained in:
nupplaPhil 2020-01-31 21:34:12 +01:00
parent 4ab893a561
commit 7909d9c417
No known key found for this signature in database
GPG key ID: D8365C3D36B77D90
4 changed files with 32 additions and 35 deletions

View file

@ -44,8 +44,8 @@ class Notification extends BaseModule
// @TODO: Replace with parameter from router
if (DI::args()->get(1) === 'mark' && DI::args()->get(2) === 'all') {
try {
$success = DI::notify()->setAllSeen();
}catch (\Exception $e) {
$success = DI::notify()->setSeen();
} catch (\Exception $e) {
DI::logger()->warning('set all seen failed.', ['exception' => $e]);
$success = false;
}
@ -66,11 +66,11 @@ class Notification extends BaseModule
if ($request_id) {
try {
$notification = DI::notify()->getByID($request_id);
$notification->setSeen();
$notify = DI::notify()->getByID($request_id);
DI::notify()->setSeen(true, $notify);
if (!empty($notification->link)) {
System::externalRedirect($notification->link);
if (!empty($notify->link)) {
System::externalRedirect($notify->link);
}
} catch (HTTPException\NotFoundException $e) {
@ -83,4 +83,3 @@ class Notification extends BaseModule
DI::baseUrl()->redirect('notifications/system');
}
}