# HG changeset patch # User Goffi # Date 1549065925 -3600 # Node ID fdc53c8a54396ac7c4a4a418f0050e92d962cb99 # Parent 25639611c3033f895d635ac8e572c69e85208c25 plugin XEP-0198: don't use hooks on components diff -r 25639611c303 -r fdc53c8a5439 sat/plugins/plugin_xep_0198.py --- a/sat/plugins/plugin_xep_0198.py Sat Jan 26 20:08:33 2019 +0100 +++ b/sat/plugins/plugin_xep_0198.py Sat Feb 02 01:05:25 2019 +0100 @@ -202,6 +202,8 @@ return True def _disconnectedTrigger(self, client, reason): + if client.is_component: + return True session = client._xep_0198_session session.enabled = False if session.resume_enabled: @@ -406,18 +408,20 @@ d.addCallback(lambda __: client.presence.available()) def onReceive(self, element, client): - session = client._xep_0198_session - if session.enabled and element.name.lower() in C.STANZA_NAMES: - session.in_counter += 1 % MAX_COUNTER + if not client.is_component: + session = client._xep_0198_session + if session.enabled and element.name.lower() in C.STANZA_NAMES: + session.in_counter += 1 % MAX_COUNTER def onSend(self, obj, client): - session = client._xep_0198_session - if (session.enabled - and domish.IElement.providedBy(obj) - and obj.name.lower() in C.STANZA_NAMES): - session.out_counter += 1 % MAX_COUNTER - session.buffer.appendleft(obj) - self.checkAcks(client) + if not client.is_component: + session = client._xep_0198_session + if (session.enabled + and domish.IElement.providedBy(obj) + and obj.name.lower() in C.STANZA_NAMES): + session.out_counter += 1 % MAX_COUNTER + session.buffer.appendleft(obj) + self.checkAcks(client) def onAckRequest(self, r_elt, client): self.sendAck(client)