mirror of
https://github.com/ihabunek/toot.git
synced 2025-02-02 15:07:51 -05:00
Propagate visibility when posting status
This commit is contained in:
parent
672bb5d008
commit
5ec8d9411d
@ -20,6 +20,8 @@ TODO/Ideas:
|
||||
* convert to ascii art?
|
||||
* use signals to avoid tightly coupling components
|
||||
* interaction with clipboard - how to copy a status to clipbard?
|
||||
* Show **notifications**
|
||||
* Show **threads**
|
||||
|
||||
Questions:
|
||||
* is it possible to make a span a urwid.Text selectable? e.g. for urls and hashtags
|
||||
|
@ -231,7 +231,7 @@ class TUI(urwid.Frame):
|
||||
urwid.connect_signal(composer, "close",
|
||||
lambda *args: self.close_overlay())
|
||||
urwid.connect_signal(composer, "post",
|
||||
lambda _, content, warning: self.post_status(content, warning))
|
||||
lambda _, content, warning, visibility: self.post_status(content, warning, visibility))
|
||||
self.open_overlay(
|
||||
widget=composer,
|
||||
title="Compose status",
|
||||
@ -243,8 +243,9 @@ class TUI(urwid.Frame):
|
||||
},
|
||||
)
|
||||
|
||||
def post_status(self, content, warning):
|
||||
data = api.post_status(self.app, self.user, content, spoiler_text=warning)
|
||||
def post_status(self, content, warning, visibility):
|
||||
data = api.post_status(self.app, self.user, content,
|
||||
spoiler_text=warning, visibility=visibility)
|
||||
status = Status(data, self.app.instance)
|
||||
self.timeline.prepend_status(status)
|
||||
self.footer.set_message("Status posted {} \\o/".format(status.id))
|
||||
|
@ -126,7 +126,7 @@ class StatusComposer(urwid.Frame):
|
||||
self.set_error_message("Cannot post an empty message")
|
||||
return
|
||||
|
||||
self._emit("post", content, warning)
|
||||
self._emit("post", content, warning, self.visibility)
|
||||
|
||||
def close(self, button):
|
||||
self._emit("close")
|
||||
|
Loading…
x
Reference in New Issue
Block a user