diff options
author | lovetox <philipp@hoerist.com> | 2020-08-01 09:10:51 +0300 |
---|---|---|
committer | lovetox <philipp@hoerist.com> | 2020-08-15 09:42:45 +0300 |
commit | 10c5f7f0414f283f807a874fc1513c557f091df5 (patch) | |
tree | 5c985ca2fe5187987efe970bd5c97443ce7fb369 | |
parent | 28601b512bfa9dc915de664e360022a3f3e6fe27 (diff) |
Add method to disable stream management
-rw-r--r-- | nbxmpp/client.py | 9 | ||||
-rw-r--r-- | nbxmpp/smacks.py | 4 |
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') |