remove any generated @'s in replies to prevent accidentally mentioning somebody else on the same instance

This commit is contained in:
autumn 2023-03-05 21:33:59 +00:00
parent 03305c4a55
commit 59e9efe118
2 changed files with 4 additions and 0 deletions

View file

@ -1,5 +1,8 @@
# pleroma-ebooks
this is a very slightly modified version of <https://github.com/ioistired/pleroma-ebooks>
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

View file

@ -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