diff --git a/toot/tui/app.py b/toot/tui/app.py index 2dd53dc..5f5a2c3 100644 --- a/toot/tui/app.py +++ b/toot/tui/app.py @@ -379,7 +379,7 @@ class TUI(urwid.Frame): def _post(timeline, *args): self.post_status(*args) - composer = StatusComposer(self.max_toot_chars, in_reply_to) + composer = StatusComposer(self.max_toot_chars, self.user.username, in_reply_to) urwid.connect_signal(composer, "close", _close) urwid.connect_signal(composer, "post", _post) self.open_overlay(composer, title="Compose status") diff --git a/toot/tui/compose.py b/toot/tui/compose.py index 913ca3e..44b7e47 100644 --- a/toot/tui/compose.py +++ b/toot/tui/compose.py @@ -13,9 +13,10 @@ class StatusComposer(urwid.Frame): """ signals = ["close", "post"] - def __init__(self, max_chars, in_reply_to=None): + def __init__(self, max_chars, username, in_reply_to=None): self.in_reply_to = in_reply_to self.max_chars = max_chars + self.username = username text = self.get_initial_text(in_reply_to) self.content_edit = EditBox( @@ -46,8 +47,8 @@ class StatusComposer(urwid.Frame): if not in_reply_to: return "" - text = '@{} '.format(in_reply_to.original.account) - mentions = ['@{}'.format(m["acct"]) for m in in_reply_to.mentions] + text = '' if in_reply_to.is_mine else '@{} '.format(in_reply_to.original.account) + mentions = ['@{}'.format(m["acct"]) for m in in_reply_to.mentions if m["acct"] != self.username] if mentions: text += '\n\n{}'.format(' '.join(mentions))