From 3a72d5f2614f291e39aab3c991f57d10fead0956 Mon Sep 17 00:00:00 2001 From: Daniel Schwarz Date: Tue, 21 Feb 2023 20:43:09 -0500 Subject: [PATCH] Account overlay - don't allow mute/block/unfollow own account --- toot/tui/overlays.py | 19 +++++++++++-------- 1 file changed, 11 insertions(+), 8 deletions(-) diff --git a/toot/tui/overlays.py b/toot/tui/overlays.py index e6c1777..df7085f 100644 --- a/toot/tui/overlays.py +++ b/toot/tui/overlays.py @@ -224,16 +224,19 @@ class Account(urwid.ListBox): yield Button(f"Confirm {self.last_action}", on_press=take_action, user_data=self) yield Button("Cancel", on_press=cancel_action, user_data=self) else: - if relationship['requested']: - yield urwid.Text(("light grey", "< Follow request is pending >")) + if self.user.username == account["acct"]: + yield urwid.Text(("light gray", "This is your account")) else: - yield Button("Unfollow" if relationship['following'] else "Follow", - on_press=confirm_action, user_data=self) + if relationship['requested']: + yield urwid.Text(("light gray", "< Follow request is pending >")) + else: + yield Button("Unfollow" if relationship['following'] else "Follow", + on_press=confirm_action, user_data=self) - yield Button("Unmute" if relationship['muting'] else "Mute", - on_press=confirm_action, user_data=self) - yield Button("Unblock" if relationship['blocking'] else "Block", - on_press=confirm_action, user_data=self) + yield Button("Unmute" if relationship['muting'] else "Mute", + on_press=confirm_action, user_data=self) + yield Button("Unblock" if relationship['blocking'] else "Block", + on_press=confirm_action, user_data=self) yield urwid.Divider("─") yield urwid.Divider()