]> git.mxchange.org Git - friendica.git/blobdiff - src/Module/Api/Mastodon/Tags/Unfollow.php
Merge branch 'develop' into show_image_upload_limit
[friendica.git] / src / Module / Api / Mastodon / Tags / Unfollow.php
index a20b824b8d3547a2dfbe70a1e53eabbf21c1c50e..f3fbad2e5ab0e3e4cd3003c22679447e7da1f6a9 100644 (file)
@@ -21,7 +21,8 @@
 
 namespace Friendica\Module\Api\Mastodon\Tags;
 
-use Friendica\App\Router;
+use Friendica\Core\System;
+use Friendica\Database\DBA;
 use Friendica\DI;
 use Friendica\Module\BaseApi;
 
@@ -39,6 +40,11 @@ class Unfollow extends BaseApi
                        DI::mstdnError()->UnprocessableEntity();
                }
 
-               $this->response->unsupported(Router::POST, $request);
+               $term = ['uid' => $uid, 'term' => '#' . ltrim($this->parameters['hashtag'], '#')];
+
+               DBA::delete('search', $term);
+
+               $hashtag = new \Friendica\Object\Api\Mastodon\Tag($this->baseUrl, $term, [], false);
+               System::jsonExit($hashtag->toArray());
        }
 }