From f93af07882d19fd60af1696ccfa784ac4c03aa42 Mon Sep 17 00:00:00 2001
From: mathieui <mathieui@mathieui.net>
Date: Fri, 29 Jan 2021 16:07:44 +0100
Subject: XEP-0198: do not send acks when disconnected

---
 slixmpp/plugins/xep_0198/stream_management.py | 3 +++
 1 file changed, 3 insertions(+)

diff --git a/slixmpp/plugins/xep_0198/stream_management.py b/slixmpp/plugins/xep_0198/stream_management.py
index 30274ecf..1344235a 100644
--- a/slixmpp/plugins/xep_0198/stream_management.py
+++ b/slixmpp/plugins/xep_0198/stream_management.py
@@ -174,6 +174,9 @@ class XEP_0198(BasePlugin):
 
     def send_ack(self):
         """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['h'] = self.handled
         self.xmpp.send_raw(str(ack))
-- 
cgit v1.2.3