Commit b7568582 authored by Yann Leboulanger's avatar Yann Leboulanger

warn user when custom hostname is wrong. Fixes #7489

parent ccf5baad
......@@ -1136,10 +1136,20 @@ def connect(self, data=None):
else:
use_custom = gajim.config.get_per('accounts', self.name,
'use_custom_host')
custom_h = gajim.config.get_per('accounts', self.name,
'custom_host')
custom_p = gajim.config.get_per('accounts', self.name,
'custom_port')
if use_custom:
custom_h = gajim.config.get_per('accounts', self.name,
'custom_host')
custom_p = gajim.config.get_per('accounts', self.name,
'custom_port')
try:
helpers.idn_to_ascii(custom_h)
except Exception:
gajim.nec.push_incoming_event(InformationEvent(None,
conn=self, level='error',
pri_txt=_('Wrong Custom Hostname'),
sec_txt='Wrong custom hostname "%s". Ignoring it.' \
% custom_h))
use_custom = False
# create connection if it doesn't already exist
self.connected = 1
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment