XEP-0198: do not send acks when disconnected

This commit is contained in:
mathieui 2021-01-29 16:07:44 +01:00
parent 3f739e513b
commit f93af07882

View file

@ -174,6 +174,9 @@ class XEP_0198(BasePlugin):
def send_ack(self): def send_ack(self):
"""Send the current ack count to the server.""" """Send the current ack count to the server."""
if not self.xmpp.transport:
log.debug('Disconnected: not sending ack')
return
ack = stanza.Ack(self.xmpp) ack = stanza.Ack(self.xmpp)
ack['h'] = self.handled ack['h'] = self.handled
self.xmpp.send_raw(str(ack)) self.xmpp.send_raw(str(ack))