diff options
author | lovetox <philipp@hoerist.com> | 2020-06-29 21:26:25 +0300 |
---|---|---|
committer | lovetox <philipp@hoerist.com> | 2020-06-29 21:26:39 +0300 |
commit | dafb82e82694cace846fb1148f02e97610a21bb5 (patch) | |
tree | 31bc62004b4c88f522b513f9c5b5997bc3bdd3fa /nbxmpp | |
parent | 00c51071aab2cc188aaaed49107ddd0fc4bea5f9 (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
Diffstat (limited to 'nbxmpp')
-rw-r--r-- | nbxmpp/client.py | 4 |
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]) |