diff --git a/toot/api.py b/toot/api.py index ad0859e..a5d5a14 100644 --- a/toot/api.py +++ b/toot/api.py @@ -533,6 +533,10 @@ def unblock(app, user, account): return _account_action(app, user, account, 'unblock') +def blocked(app, user): + return _get_response_list(app, user, "/api/v1/blocks") + + def verify_credentials(app, user): return http.get(app, user, '/api/v1/accounts/verify_credentials').json() diff --git a/toot/commands.py b/toot/commands.py index c1bf0ab..57a9756 100644 --- a/toot/commands.py +++ b/toot/commands.py @@ -510,6 +510,11 @@ def unblock(app, user, args): print_out("✓ {} is no longer blocked".format(args.account)) +def blocked(app, user, args): + response = api.blocked(app, user) + print_acct_list(response) + + def whoami(app, user, args): account = api.verify_credentials(app, user) print_account(account) diff --git a/toot/console.py b/toot/console.py index db21926..ecfc03f 100644 --- a/toot/console.py +++ b/toot/console.py @@ -726,6 +726,12 @@ ACCOUNTS_COMMANDS = [ ], require_auth=True, ), + Command( + name="blocked", + description="List accounts the given account muted", + arguments=[], + require_auth=True, + ), ] TAG_COMMANDS = [