mirror of
https://github.com/ihabunek/toot
synced 2025-02-03 12:47:32 +01:00
TOOT_VISIBILITY controls boost visibility
TOOT_VISIBILITY controls default boost visibility from CLI, and the boost visibility from TUI (no option to change in TUI yet)
This commit is contained in:
parent
8582c8ed62
commit
08a28bfb26
@ -18,10 +18,10 @@ def _account_action(app, user, account, action):
|
||||
return http.post(app, user, url).json()
|
||||
|
||||
|
||||
def _status_action(app, user, status_id, action):
|
||||
def _status_action(app, user, status_id, action, data=None):
|
||||
url = '/api/v1/statuses/{}/{}'.format(status_id, action)
|
||||
|
||||
return http.post(app, user, url).json()
|
||||
return http.post(app, user, url, data=data).json()
|
||||
|
||||
|
||||
def create_app(domain, scheme='https'):
|
||||
@ -187,8 +187,8 @@ def unfavourite(app, user, status_id):
|
||||
return _status_action(app, user, status_id, 'unfavourite')
|
||||
|
||||
|
||||
def reblog(app, user, status_id):
|
||||
return _status_action(app, user, status_id, 'reblog')
|
||||
def reblog(app, user, status_id, visibility="public"):
|
||||
return _status_action(app, user, status_id, 'reblog', data={"visibility": visibility})
|
||||
|
||||
|
||||
def unreblog(app, user, status_id):
|
||||
|
@ -169,7 +169,7 @@ def unfavourite(app, user, args):
|
||||
|
||||
|
||||
def reblog(app, user, args):
|
||||
api.reblog(app, user, args.status_id)
|
||||
api.reblog(app, user, args.status_id, visibility=args.visibility)
|
||||
print_out("<green>✓ Status reblogged</green>")
|
||||
|
||||
|
||||
|
@ -434,7 +434,12 @@ STATUS_COMMANDS = [
|
||||
Command(
|
||||
name="reblog",
|
||||
description="Reblog a status",
|
||||
arguments=[status_id_arg],
|
||||
arguments=[status_id_arg,
|
||||
(["-v", "--visibility"], {
|
||||
"type": visibility,
|
||||
"default": os.getenv("TOOT_VISIBILITY", "public"),
|
||||
"help": 'boost visibility, one of: %s' % ", ".join(VISIBILITY_CHOICES),
|
||||
})],
|
||||
require_auth=True,
|
||||
),
|
||||
Command(
|
||||
|
@ -1,5 +1,6 @@
|
||||
import logging
|
||||
import urwid
|
||||
import os
|
||||
|
||||
from concurrent.futures import ThreadPoolExecutor
|
||||
|
||||
@ -494,7 +495,7 @@ class TUI(urwid.Frame):
|
||||
def async_toggle_reblog(self, timeline, status):
|
||||
def _reblog():
|
||||
logger.info("Reblogging {}".format(status))
|
||||
api.reblog(self.app, self.user, status.id)
|
||||
api.reblog(self.app, self.user, status.id, visibility=os.getenv("TOOT_VISIBILITY", "public"))
|
||||
|
||||
def _unreblog():
|
||||
logger.info("Unreblogging {}".format(status))
|
||||
|
Loading…
x
Reference in New Issue
Block a user