1
0
mirror of https://github.com/ihabunek/toot synced 2024-12-23 07:27:12 +01:00

Implemented "blocked" command

This lists accounts the logged in user has blocked. It is useful for
creating regular backups.
This commit is contained in:
Florian Obser 2023-07-21 16:15:13 +02:00
parent 39d7a345ed
commit acc80f6890
3 changed files with 15 additions and 0 deletions

View File

@ -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()

View File

@ -510,6 +510,11 @@ def unblock(app, user, args):
print_out("<green>✓ {} is no longer blocked</green>".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)

View File

@ -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 = [