. * */ namespace Friendica\Module\Api\Mastodon\Conversations; use Friendica\Core\System; use Friendica\Database\DBA; use Friendica\DI; use Friendica\Module\BaseApi; /** * @see https://docs.joinmastodon.org/methods/timelines/conversations/ */ class Read extends BaseApi { protected function post(array $request = []) { self::checkAllowedScope(self::SCOPE_WRITE); $uid = self::getCurrentUserID(); if (!empty($this->parameters['id'])) { DI::mstdnError()->UnprocessableEntity(); } DBA::update('mail', ['seen' => true], ['convid' => $this->parameters['id'], 'uid' => $uid]); System::jsonExit(DI::mstdnConversation()->createFromConvId($this->parameters['id'])->toArray()); } }