Welcome to mirror list, hosted at ThFree Co, Russian Federation.

dev.gajim.org/gajim/python-nbxmpp.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorlovetox <philipp@hoerist.com>2020-08-01 09:10:51 +0300
committerlovetox <philipp@hoerist.com>2020-08-15 09:42:45 +0300
commit10c5f7f0414f283f807a874fc1513c557f091df5 (patch)
tree5c985ca2fe5187987efe970bd5c97443ce7fb369
parent28601b512bfa9dc915de664e360022a3f3e6fe27 (diff)
Add method to disable stream management
-rw-r--r--nbxmpp/client.py9
-rw-r--r--nbxmpp/smacks.py4
2 files changed, 13 insertions, 0 deletions
diff --git a/nbxmpp/client.py b/nbxmpp/client.py
index 06a9696..23b890d 100644
--- a/nbxmpp/client.py
+++ b/nbxmpp/client.py
@@ -95,6 +95,8 @@ class Client(Observable):
self._allowed_protocols = None
self._allowed_mechs = None
+ self._sm_disabled = False
+
self._stream_id = None
self._stream_secure = False
self._stream_authenticated = False
@@ -273,6 +275,13 @@ class Client(Observable):
def set_protocols(self, protocols):
self._allowed_protocols = protocols
+ def set_sm_disabled(self, value):
+ self._sm_disabled = value
+
+ @property
+ def sm_disabled(self):
+ return self._sm_disabled
+
@property
def client_cert(self):
return self._client_cert, self._client_cert_pass
diff --git a/nbxmpp/smacks.py b/nbxmpp/smacks.py
index eafa03a..376ed8a 100644
--- a/nbxmpp/smacks.py
+++ b/nbxmpp/smacks.py
@@ -103,6 +103,10 @@ class Smacks:
def send_enable(self):
if not self.sm_supported:
return
+
+ if self._client.sm_disabled:
+ return
+
enable = Node(Namespace.STREAM_MGMT + ' enable', attrs={'resume': 'true'})
self._client.send_nonza(enable, now=False)
self._log.debug('Send enable')