mirror of
https://github.com/ihabunek/toot.git
synced 2024-09-22 04:25:55 -04: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:
parent
39d7a345ed
commit
acc80f6890
@ -533,6 +533,10 @@ def unblock(app, user, account):
|
|||||||
return _account_action(app, user, account, 'unblock')
|
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):
|
def verify_credentials(app, user):
|
||||||
return http.get(app, user, '/api/v1/accounts/verify_credentials').json()
|
return http.get(app, user, '/api/v1/accounts/verify_credentials').json()
|
||||||
|
|
||||||
|
@ -510,6 +510,11 @@ def unblock(app, user, args):
|
|||||||
print_out("<green>✓ {} is no longer blocked</green>".format(args.account))
|
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):
|
def whoami(app, user, args):
|
||||||
account = api.verify_credentials(app, user)
|
account = api.verify_credentials(app, user)
|
||||||
print_account(account)
|
print_account(account)
|
||||||
|
@ -726,6 +726,12 @@ ACCOUNTS_COMMANDS = [
|
|||||||
],
|
],
|
||||||
require_auth=True,
|
require_auth=True,
|
||||||
),
|
),
|
||||||
|
Command(
|
||||||
|
name="blocked",
|
||||||
|
description="List accounts the given account muted",
|
||||||
|
arguments=[],
|
||||||
|
require_auth=True,
|
||||||
|
),
|
||||||
]
|
]
|
||||||
|
|
||||||
TAG_COMMANDS = [
|
TAG_COMMANDS = [
|
||||||
|
Loading…
Reference in New Issue
Block a user