diff --git a/sat/plugins/plugin_xep_0198.py b/sat/plugins/plugin_xep_0198.py index 9c30e540..2b07b8da 100755 --- a/sat/plugins/plugin_xep_0198.py +++ b/sat/plugins/plugin_xep_0198.py @@ -202,6 +202,8 @@ class XEP_0198(object): 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 @@ class XEP_0198(object): 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)