mirror of
https://github.com/friendica/friendica
synced 2025-04-23 19:50:11 +00:00
Move notification to the new paradigm
This commit is contained in:
parent
bc0734e0f1
commit
7a2d5f6a8e
16 changed files with 175 additions and 420 deletions
|
@ -22,7 +22,7 @@
|
|||
namespace Friendica\Module\Api\Mastodon\Notifications;
|
||||
|
||||
use Friendica\Core\System;
|
||||
use Friendica\Database\DBA;
|
||||
use Friendica\DI;
|
||||
use Friendica\Module\BaseApi;
|
||||
|
||||
/**
|
||||
|
@ -35,7 +35,7 @@ class Clear extends BaseApi
|
|||
self::checkAllowedScope(self::SCOPE_WRITE);
|
||||
$uid = self::getCurrentUserID();
|
||||
|
||||
DBA::update('notification', ['seen' => true], ['uid' => $uid]);
|
||||
DI::notification()->setAllSeenForUser($uid);
|
||||
|
||||
System::jsonExit([]);
|
||||
}
|
||||
|
|
|
@ -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([]);
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue