From 68cadd405362bc1b37a74e976b6491db815c4555 Mon Sep 17 00:00:00 2001 From: Daniel Schwarz Date: Wed, 15 Feb 2023 10:14:41 -0500 Subject: [PATCH] Boosted polls weren't working; this change fixes that. --- toot/tui/poll.py | 6 +++--- toot/tui/timeline.py | 6 +++--- 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/toot/tui/poll.py b/toot/tui/poll.py index f05042c..81756af 100644 --- a/toot/tui/poll.py +++ b/toot/tui/poll.py @@ -14,7 +14,7 @@ class Poll(urwid.ListBox): self.status = status self.app = app self.user = user - self.poll = status.data.get("poll") + self.poll = status.original.data.get("poll") self.button_group = [] self.api_exception = None self.setup_listbox() @@ -30,7 +30,7 @@ class Poll(urwid.ListBox): return urwid.LineBox(contents) def vote(self, button_widget): - poll = self.status.data.get("poll") + poll = self.status.original.data.get("poll") choices = [] for idx, button in enumerate(self.button_group): if button.get_state(): @@ -39,7 +39,7 @@ class Poll(urwid.ListBox): if len(choices): try: response = api.vote(self.app, self.user, poll["id"], choices=choices) - self.status.data["poll"] = response + self.status.original.data["poll"] = response self.api_exception = None self.poll["voted"] = True self.poll["own_votes"] = choices diff --git a/toot/tui/timeline.py b/toot/tui/timeline.py index b8c5c20..555d0c5 100644 --- a/toot/tui/timeline.py +++ b/toot/tui/timeline.py @@ -104,7 +104,7 @@ class Timeline(urwid.Columns): if not status: return None - poll = status.data.get("poll") + poll = status.original.data.get("poll") options = [ "[A]ccount" if not status.is_mine else "", @@ -256,7 +256,7 @@ class Timeline(urwid.Columns): return if key in ("p", "P"): - poll = status.data.get("poll") + poll = status.original.data.get("poll") if poll and not poll["expired"]: self._emit("poll", status) return @@ -353,7 +353,7 @@ class StatusDetails(urwid.Pile): yield ("pack", urwid.Text(m["description"])) yield ("pack", urwid.Text(("link", m["url"]))) - poll = status.data.get("poll") + poll = status.original.data.get("poll") if poll: yield ("pack", urwid.Divider()) yield ("pack", self.build_linebox(self.poll_generator(poll)))