. * */ namespace Friendica\Module\Api\Mastodon\Accounts; use Friendica\Core\System; use Friendica\DI; use Friendica\Model\Contact; use Friendica\Module\BaseApi; /** * @see https://docs.joinmastodon.org/methods/accounts/ */ class Unblock extends BaseApi { public function post() { self::checkAllowedScope(self::SCOPE_FOLLOW); $uid = self::getCurrentUserID(); if (empty(static::$parameters['id'])) { DI::mstdnError()->UnprocessableEntity(); } Contact\User::setBlocked(static::$parameters['id'], $uid, false); System::jsonExit(DI::mstdnRelationship()->createFromContactId(static::$parameters['id'], $uid)->toArray()); } }