<?php
/**
- * @copyright Copyright (C) 2010-2022, the Friendica project
+ * @copyright Copyright (C) 2010-2023, the Friendica project
*
* @license GNU AGPL version 3 or any later version
*
namespace Friendica\Module\Api\Mastodon;
-use Friendica\App\Router;
-use Friendica\Core\Logger;
+use Friendica\Core\System;
+use Friendica\Database\DBA;
use Friendica\DI;
use Friendica\Module\BaseApi;
DI::mstdnError()->UnprocessableEntity();
}
- $this->response->unsupported(Router::GET, $request);
+ $tag = ltrim($this->parameters['hashtag'], '#');
+ $following = DBA::exists('search', ['uid' => $uid, 'term' => '#' . $tag]);
+
+ $hashtag = new \Friendica\Object\Api\Mastodon\Tag($this->baseUrl, ['name' => $tag], [], $following);
+ System::jsonExit($hashtag->toArray());
}
}