From 39d7a345ed907ceebdc6350a4b7656b62ca84ae4 Mon Sep 17 00:00:00 2001 From: Florian Obser Date: Fri, 21 Jul 2023 16:02:52 +0200 Subject: [PATCH] Implemented "muted" command This lists accounts the logged in user has muted. It is useful for creating regular backups. --- toot/api.py | 4 ++++ toot/commands.py | 5 +++++ toot/console.py | 6 ++++++ 3 files changed, 15 insertions(+) diff --git a/toot/api.py b/toot/api.py index f0857a9..ad0859e 100644 --- a/toot/api.py +++ b/toot/api.py @@ -521,6 +521,10 @@ def unmute(app, user, account): return _account_action(app, user, account, 'unmute') +def muted(app, user): + return _get_response_list(app, user, "/api/v1/mutes") + + def block(app, user, account): return _account_action(app, user, account, 'block') diff --git a/toot/commands.py b/toot/commands.py index f74e3e6..c1bf0ab 100644 --- a/toot/commands.py +++ b/toot/commands.py @@ -493,6 +493,11 @@ def unmute(app, user, args): print_out("✓ {} is no longer muted".format(args.account)) +def muted(app, user, args): + response = api.muted(app, user) + print_acct_list(response) + + def block(app, user, args): account = api.find_account(app, user, args.account) api.block(app, user, account['id']) diff --git a/toot/console.py b/toot/console.py index 3076517..db21926 100644 --- a/toot/console.py +++ b/toot/console.py @@ -704,6 +704,12 @@ ACCOUNTS_COMMANDS = [ ], require_auth=True, ), + Command( + name="muted", + description="List accounts the given account muted", + arguments=[], + require_auth=True, + ), Command( name="block", description="Block an account",