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-06-29 21:26:25 +0300
committerlovetox <philipp@hoerist.com>2020-07-07 23:42:04 +0300
commitb045c2a70c45e8a47b4a42f237a4ef80bcadbb8d (patch)
tree31bc62004b4c88f522b513f9c5b5997bc3bdd3fa
parentb5ac3d3c09ccb3b9c487d4c2061767b16af98e49 (diff)
Client: Determine allowed type and protocol correctly
Returns now the type and protocol set via custom_host instead of falling back to the allowed default type and protocol
-rw-r--r--nbxmpp/client.py4
1 files changed, 4 insertions, 0 deletions
diff --git a/nbxmpp/client.py b/nbxmpp/client.py
index 5012676..06a9696 100644
--- a/nbxmpp/client.py
+++ b/nbxmpp/client.py
@@ -244,6 +244,8 @@ class Client(Observable):
@property
def connection_types(self):
+ if self._custom_host is not None:
+ return [self._custom_host[2]]
return list(self._allowed_con_types or [ConnectionType.DIRECT_TLS,
ConnectionType.START_TLS])
@@ -263,6 +265,8 @@ class Client(Observable):
@property
def protocols(self):
+ if self._custom_host is not None:
+ return [self._custom_host[1]]
return list(self._allowed_protocols or [ConnectionProtocol.TCP,
ConnectionProtocol.WEBSOCKET])