From 6291fa0f5c4d30139c23c2e2f2a1daa49852c105 Mon Sep 17 00:00:00 2001 From: Andrew Godwin Date: Sun, 4 Dec 2022 20:22:24 -0700 Subject: Fix mentions in replies/capitalisation --- activities/views/compose.py | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) (limited to 'activities/views') 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): -- cgit v1.2.3