Commit 76962db8 authored by Yann Leboulanger's avatar Yann Leboulanger

update servers.xml from xmpp.org. Fixes #5797

parent c961463f
This diff is collapsed.
......@@ -3408,10 +3408,9 @@ class AccountCreationWizardWindow:
# parse servers.xml
servers_xml = os.path.join(gajim.DATA_DIR, 'other', 'servers.xml')
servers = gtkgui_helpers.parse_server_xml(servers_xml)
servers_model = gtk.ListStore(str, int)
servers_model = gtk.ListStore(str)
for server in servers:
if not server[2]['hidden']:
servers_model.append((str(server[0]), int(server[1])))
servers_model.append((server,))
completion.set_model(servers_model)
completion.set_text_column(0)
......
......@@ -361,35 +361,8 @@ class ServersXMLHandler(xml.sax.ContentHandler):
def startElement(self, name, attributes):
if name == 'item':
# we will get the port next time so we just set it 0 here
sitem = [None, 0, {}]
sitem[2]['digest'] = {}
sitem[2]['hidden'] = False
for attribute in attributes.getNames():
if attribute == 'jid':
jid = attributes.getValue(attribute)
sitem[0] = jid
elif attribute == 'hidden':
hidden = attributes.getValue(attribute)
if hidden.lower() in ('1', 'y', 'yes', 't', 'true', 'on'):
sitem[2]['hidden'] = True
self.servers.append(sitem)
elif name == 'active':
for attribute in attributes.getNames():
if attribute == 'port':
port = attributes.getValue(attribute)
# we received the jid last time, so we now assign the port
# number to the last jid in the list
self.servers[-1][1] = port
elif name == 'digest':
algo, digest = None, None
for attribute in attributes.getNames():
if attribute == 'algo':
algo = attributes.getValue(attribute)
elif attribute == 'value':
digest = attributes.getValue(attribute)
hd = HashDigest(algo, digest)
self.servers[-1][2]['digest'][hd.algo] = hd
if 'jid' in attributes.getNames():
self.servers.append(attributes.getValue('jid'))
def endElement(self, name):
pass
......
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