summaryrefslogtreecommitdiffstats
path: root/activities/views
diff options
context:
space:
mode:
authorAndrew Godwin2022-12-04 20:22:24 -0700
committerAndrew Godwin2022-12-04 20:23:02 -0700
commit6291fa0f5c4d30139c23c2e2f2a1daa49852c105 (patch)
treee6b904f84fe42448839e4cc5dab3ad0aaccbcabe /activities/views
parentd27be3f42619e9eaf3b8ac9333b2bf5bb290aae6 (diff)
downloadtakahe-6291fa0f5c4d30139c23c2e2f2a1daa49852c105.tar.gz
takahe-6291fa0f5c4d30139c23c2e2f2a1daa49852c105.tar.bz2
takahe-6291fa0f5c4d30139c23c2e2f2a1daa49852c105.zip
Fix mentions in replies/capitalisation
Diffstat (limited to 'activities/views')
-rw-r--r--activities/views/compose.py7
1 files changed, 6 insertions, 1 deletions
diff --git a/activities/views/compose.py b/activities/views/compose.py
index 313fe74..b4ddcf5 100644
--- a/activities/views/compose.py
+++ b/activities/views/compose.py
@@ -84,7 +84,12 @@ class Compose(FormView):
initial["visibility"] = Post.Visibilities.unlisted
else:
initial["visibility"] = self.reply_to.visibility
- initial["text"] = f"@{self.reply_to.author.handle} "
+ # Build a set of mentions for the content to start as
+ mentioned = {self.reply_to.author}
+ mentioned.update(self.reply_to.mentions.all())
+ initial["text"] = "".join(
+ f"@{identity.handle} " for identity in mentioned
+ )
return initial
def form_valid(self, form):