From 3fe26ae4dd7281f426883aae74d4f94ef997eb2d Mon Sep 17 00:00:00 2001 From: Tulir Asokan Date: Sat, 19 Dec 2020 12:49:43 +0200 Subject: [PATCH] Strip spaces around messages when hashing for deduplication. Fixes #553 --- mautrix_telegram/portal/deduplication.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/mautrix_telegram/portal/deduplication.py b/mautrix_telegram/portal/deduplication.py index 6086731e..938f7317 100644 --- a/mautrix_telegram/portal/deduplication.py +++ b/mautrix_telegram/portal/deduplication.py @@ -61,7 +61,7 @@ class PortalDedup: if isinstance(event, MessageService): hash_content = [event.date.timestamp(), event.from_id, event.action] else: - hash_content = [event.date.timestamp(), event.message] + hash_content = [event.date.timestamp(), event.message.strip()] if event.fwd_from: hash_content += [event.fwd_from.from_id, event.fwd_from.channel_id] elif isinstance(event, Message) and event.media: