Move notification to the new paradigm

This commit is contained in:
Hypolite Petovan 2021-09-18 00:03:32 -04:00
parent bc0734e0f1
commit 7a2d5f6a8e
16 changed files with 175 additions and 420 deletions

View file

@ -25,6 +25,7 @@ use Friendica\Core\System;
use Friendica\Database\DBA;
use Friendica\DI;
use Friendica\Module\BaseApi;
use Friendica\Network\HTTPException\ForbiddenException;
/**
* @see https://docs.joinmastodon.org/methods/notifications/
@ -40,7 +41,9 @@ class Dismiss extends BaseApi
DI::mstdnError()->UnprocessableEntity();
}
DBA::update('notification', ['seen' => true], ['uid' => $uid, 'id' => $parameters['id']]);
$Notification = DI::notification()->selectOneForUser($uid, $parameters['id']);
$Notification->setSeen();
DI::notification()->save($Notification);
System::jsonExit([]);
}