. * */ namespace Friendica\Module\Api\Mastodon\Notifications; 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/ */ class Dismiss extends BaseApi { protected function post(array $request = []) { self::checkAllowedScope(self::SCOPE_WRITE); $uid = self::getCurrentUserID(); if (empty($this->parameters['id'])) { DI::mstdnError()->UnprocessableEntity(); } $Notification = DI::notification()->selectOneForUser($uid, $this->parameters['id']); $Notification->setSeen(); DI::notification()->save($Notification); System::jsonExit([]); } }