diff --git a/api/v1/http/mastodon/accounts/silence/index.php b/api/v1/http/mastodon/accounts/silence/index.php new file mode 100644 index 0000000..351ae31 --- /dev/null +++ b/api/v1/http/mastodon/accounts/silence/index.php @@ -0,0 +1,3 @@ + + + diff --git a/api/v1/http/mastodon/accounts/silence/mod.php b/api/v1/http/mastodon/accounts/silence/mod.php new file mode 100644 index 0000000..8ce06ab --- /dev/null +++ b/api/v1/http/mastodon/accounts/silence/mod.php @@ -0,0 +1,15 @@ + 'id parameter has incorrect format'], 400); + + $output = instance_http_post('/api/v1/admin/accounts/'.$id.'/action', + ['type' => 'silence' ]); + + if (!isset($_SERVER['REQUEST_URI'])) + sleep(2); + return apiresult($output); +}; +$_(); diff --git a/js/templates/instance/filter-users.html b/js/templates/instance/filter-users.html index 7430641..ed01e54 100644 --- a/js/templates/instance/filter-users.html +++ b/js/templates/instance/filter-users.html @@ -171,6 +171,8 @@
{mastodon:fields}
{note}
+
diff --git a/views/instance.php b/views/instance.php index 4814920..4310cc5 100644 --- a/views/instance.php +++ b/views/instance.php @@ -28,6 +28,13 @@ window.view.instance = { toast.info('User has been successfully suspended'); }); }, + silence: function(_id) { + const hargs = get_hash_arguments(); + http.get(`api/v1/http/mastodon/accounts/silence?instance=${hargs.instance}&id=${_id}`, + {}, function(js) { + toast.info('User has been successfully silenced'); + }); + }, }, new_accounts: { approve: function(_id) {