diff --git a/toot/tui/NOTES.md b/toot/tui/NOTES.md index 489e690..b70c657 100644 --- a/toot/tui/NOTES.md +++ b/toot/tui/NOTES.md @@ -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 diff --git a/toot/tui/app.py b/toot/tui/app.py index d3d1024..bbd4505 100644 --- a/toot/tui/app.py +++ b/toot/tui/app.py @@ -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)) diff --git a/toot/tui/compose.py b/toot/tui/compose.py index 61f6e19..da90fd0 100644 --- a/toot/tui/compose.py +++ b/toot/tui/compose.py @@ -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")