From 7f2b19cee35a1c4ceff868ee6aa000608de7716e Mon Sep 17 00:00:00 2001 From: jesopo Date: Wed, 20 Feb 2019 16:10:37 +0000 Subject: [PATCH] Only send TAGMSG when it's definitely supported (message_tracking.py) --- modules/message_tracking.py | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/modules/message_tracking.py b/modules/message_tracking.py index 5b2c1180..15dfe8d6 100644 --- a/modules/message_tracking.py +++ b/modules/message_tracking.py @@ -3,12 +3,14 @@ from src import ModuleManager, utils MSGID_TAG = "draft/msgid" READ_TAG = "+draft/read" DELIVERED_TAG = "+draft/delivered" +MESSAGE_TAG_CAPS = set(["draft/message-tags-0.2", "message-tags"]) class Module(ModuleManager.BaseModule): @utils.hook("received.message.private") @utils.hook("received.notice.private") def privmsg(self, event): - if MSGID_TAG in event["tags"]: + if MSGID_TAG in event["tags"] and ( + event["server"].agreed_capabilities & MESSAGE_TAG_CAPS): target = event.get("channel", event["user"]) msgid = event["tags"][MSGID_TAG] tags = {DELIVERED_TAG: msgid, READ_TAG: msgid}