From aa763cc1d0fba825cca1c85a0cac2a7b738b58dd Mon Sep 17 00:00:00 2001 From: Jason McBrayer Date: Mon, 4 Jun 2018 09:09:34 -0400 Subject: [PATCH] Don't include self-mention when replying on a thread you're in. --- brutaldon/views.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/brutaldon/views.py b/brutaldon/views.py index eba9c86..9c42bcb 100644 --- a/brutaldon/views.py +++ b/brutaldon/views.py @@ -313,8 +313,9 @@ def reply(request, id): toot = mastodon.status(id) context = mastodon.status_context(id) initial_text = '@' + toot.account.acct + " " - for mention in toot.mentions: + for mention in [x for x in toot.mentions if x.acct != request.session['user'].acct]: initial_text +=('@' + mention.acct + " ") + initial_text += "\n" form = PostForm({'status': initial_text, 'visibility': toot.visibility, 'spoiler_text': toot.spoiler_text})