From d9b9d9483ed04a1df605e34048267acf07eacd5e Mon Sep 17 00:00:00 2001 From: Tatu Wikman Date: Sat, 10 Oct 2020 21:51:39 +0300 Subject: [PATCH] url: don't check urls in reply messages, fixes #80 --- modules/url.py | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/modules/url.py b/modules/url.py index d69fced..7501efc 100644 --- a/modules/url.py +++ b/modules/url.py @@ -53,11 +53,15 @@ class MatrixModule(BotModule): if len(event.body) < 1: return - # skip edited content to prevent spamming the same thing multiple times if "content" in event.source: + # skip edited content to prevent spamming the same thing multiple times if "m.new_content" in event.source["content"]: self.logger.debug(f"Skipping edited event to prevent spam") return + # skip reply messages to prevent spam + if "m.relates_to" in event.source["content"]: + self.logger.debug("Skipping reply message to prevent spam") + return # are we on in this room? status = self.status.get(room.room_id, "OFF")