Defer txt record lookup until connection attempt

Don't try to resolve _xmppconnect records for servers before trying to connect.
Prevent warnings from gajim.c.resolver for accounts with "connect on startup" disabled.
This commit is contained in:
Sebastian Wagner 2018-03-02 17:38:33 +01:00 committed by Philipp Hörist
parent 113cd51c11
commit e740d12727
1 changed files with 4 additions and 5 deletions

View File

@ -709,11 +709,6 @@ class Connection(CommonConnection, ConnectionHandlers):
self._nec_gc_stanza_message_outgoing)
app.ged.register_event_handler('stanza-message-outgoing',
ged.OUT_CORE, self._nec_stanza_message_outgoing)
h = app.config.get_per('accounts', self.name, 'hostname')
if h:
app.resolver.resolve('_xmppconnect.' + helpers.idn_to_ascii(h),
self._on_resolve_txt, type_='txt')
# END __init__
def cleanup(self):
@ -1093,6 +1088,10 @@ class Connection(CommonConnection, ConnectionHandlers):
]
self._hostname = hostname
if h:
app.resolver.resolve('_xmppconnect.' + helpers.idn_to_ascii(h),
self._on_resolve_txt, type_='txt')
if use_srv and self._proxy is None:
self._srv_hosts = []