From 5f0afab060aa84a1cd1a81ade027f80b580a291d Mon Sep 17 00:00:00 2001 From: mathieui Date: Tue, 29 Apr 2014 22:14:03 +0200 Subject: Do not ask for receipts in messages without a body --- src/connection.py | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) (limited to 'src/connection.py') diff --git a/src/connection.py b/src/connection.py index 0af2b228..649cd0a2 100644 --- a/src/connection.py +++ b/src/connection.py @@ -15,10 +15,12 @@ log = logging.getLogger(__name__) import getpass import sleekxmpp +from sleekxmpp.plugins.xep_0184 import XEP_0184 -from config import config, options import common +import fixes from common import safeJID +from config import config, options class Connection(sleekxmpp.ClientXMPP): """ @@ -85,6 +87,9 @@ class Connection(sleekxmpp.ClientXMPP): self.register_plugin('xep_0085') self.register_plugin('xep_0115') + # monkey-patch xep_0184 to avoid requesting receipts for messages + # without a body + XEP_0184._filter_add_receipt_request = fixes._filter_add_receipt_request self.register_plugin('xep_0184') self.plugin['xep_0184'].auto_ack = config.get('ack_message_receipts', True) -- cgit v1.2.3