1
0
mirror of https://github.com/ihabunek/toot.git synced 2024-11-03 04:17:21 -05:00

Merge pull request #317 from danschwarz/action_fix

Account overlay - don't allow mute/block/unfollow own account
This commit is contained in:
Ivan Habunek 2023-02-22 08:41:54 +01:00 committed by GitHub
commit 48770a3120
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -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()