From 61c2259a9af0eb6220cbf7c1f01696b9c8225978 Mon Sep 17 00:00:00 2001 From: Marc Schink Date: Tue, 2 May 2017 13:37:23 +0200 Subject: [PATCH] Use account hostname for STUN server discovery Use the account hostname instead of the target hostname of the _xmpp-client._tcp SRV resource record for STUN server discovery. Otherwise, discovery fails if both hostnames are different. --- src/common/connection.py | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/src/common/connection.py b/src/common/connection.py index 5c353facf..efc77bba9 100644 --- a/src/common/connection.py +++ b/src/common/connection.py @@ -1917,8 +1917,9 @@ class Connection(CommonConnection, ConnectionHandlers): self.sm.resuming = False # back to previous state # Discover Stun server(s) - gajim.resolver.resolve('_stun._udp.' + helpers.idn_to_ascii( - self.connected_hostname), self._on_stun_resolved) + hostname = gajim.config.get_per('accounts', self.name, 'hostname') + gajim.resolver.resolve('_stun._udp.' + helpers.idn_to_ascii(hostname), + self._on_stun_resolved) def _on_stun_resolved(self, host, result_array): if len(result_array) != 0: