mirror of
https://github.com/friendica/friendica
synced 2025-04-27 13:50:12 +00:00
Notifications cleared for a whole thread in case of one mark seen
This commit is contained in:
parent
4ab893a561
commit
7909d9c417
4 changed files with 32 additions and 35 deletions
|
@ -5957,11 +5957,11 @@ function api_friendica_notification_seen($type)
|
|||
$id = (!empty($_REQUEST['id']) ? intval($_REQUEST['id']) : 0);
|
||||
|
||||
try {
|
||||
$notification = DI::notify()->getByID($id);
|
||||
$notification->setSeen();
|
||||
$notify = DI::notify()->getByID($id);
|
||||
DI::notify()->setSeen(true, $notify);
|
||||
|
||||
if ($notification->otype === Notify::OTYPE_ITEM) {
|
||||
$item = Item::selectFirstForUser(api_user(), [], ['id' => $notification->iid, 'uid' => api_user()]);
|
||||
if ($notify->otype === Notify::OTYPE_ITEM) {
|
||||
$item = Item::selectFirstForUser(api_user(), [], ['id' => $notify->iid, 'uid' => api_user()]);
|
||||
if (DBA::isResult($item)) {
|
||||
// we found the item, return it to the user
|
||||
$ret = api_format_items([$item], $user_info, false, $type);
|
||||
|
@ -5973,6 +5973,8 @@ function api_friendica_notification_seen($type)
|
|||
return api_format_data('result', $type, ['result' => "success"]);
|
||||
} catch (NotFoundException $e) {
|
||||
throw new BadRequestException('Invalid argument');
|
||||
} catch (Exception $e) {
|
||||
throw new InternalServerErrorException('Internal Server exception');
|
||||
}
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue