Merge pull request #390 from fobser/muted_blocked_commands
Add "muted" & "blocked" commands
This commit is contained in:
commit
09aa4e8a1a
3 changed files with 30 additions and 0 deletions
|
@ -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')
|
||||
|
||||
|
@ -529,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()
|
||||
|
||||
|
|
|
@ -493,6 +493,11 @@ def unmute(app, user, args):
|
|||
print_out("<green>✓ {} is no longer muted</green>".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'])
|
||||
|
@ -505,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)
|
||||
|
|
|
@ -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",
|
||||
|
@ -720,6 +726,12 @@ ACCOUNTS_COMMANDS = [
|
|||
],
|
||||
require_auth=True,
|
||||
),
|
||||
Command(
|
||||
name="blocked",
|
||||
description="List accounts the given account muted",
|
||||
arguments=[],
|
||||
require_auth=True,
|
||||
),
|
||||
]
|
||||
|
||||
TAG_COMMANDS = [
|
||||
|
|
Loading…
Reference in a new issue