From b045c2a70c45e8a47b4a42f237a4ef80bcadbb8d Mon Sep 17 00:00:00 2001 From: lovetox Date: Mon, 29 Jun 2020 20:26:25 +0200 Subject: 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 --- nbxmpp/client.py | 4 ++++ 1 file changed, 4 insertions(+) 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]) -- cgit v1.2.3