From 59e9efe1189f30c4cefb0cc267f6f731cdb86ac8 Mon Sep 17 00:00:00 2001 From: autumn Date: Sun, 5 Mar 2023 21:33:59 +0000 Subject: [PATCH] remove any generated @'s in replies to prevent accidentally mentioning somebody else on the same instance --- README.md | 3 +++ reply.py | 1 + 2 files changed, 4 insertions(+) diff --git a/README.md b/README.md index fda1675..f736ca4 100644 --- a/README.md +++ b/README.md @@ -1,5 +1,8 @@ # pleroma-ebooks +this is a very slightly modified version of +current changes: removes any generated @'s in replies to prevent accidentally mentioning somebody else on the same instance + It's like [@AgathaSorceress's mstdn-ebooks] but it supports Pleroma better. [@AgathaSorceress's mstdn-ebooks]: https://github.com/AgathaSorceress/mstdn-ebooks diff --git a/reply.py b/reply.py index 57fe2a6..960067d 100755 --- a/reply.py +++ b/reply.py @@ -82,6 +82,7 @@ class ReplyBot: async def reply(self, notification): toot = await utils.make_post(self.cfg) # generate a toot + toot = re.sub(r"@\S+\s", r"", toot) # remove any generated @'s await self.pleroma.reply(notification['status'], toot, cw=self.cfg['cw']) @staticmethod