Commit 4624a918 authored by Yann Leboulanger's avatar Yann Leboulanger

fix some bugs with non-normalized jids

parent 8a4f987e
...@@ -484,7 +484,7 @@ class ConnectionBytestream: ...@@ -484,7 +484,7 @@ class ConnectionBytestream:
gajim.socks5queue.activate_proxy(host['idx']) gajim.socks5queue.activate_proxy(host['idx'])
break break
raise common.xmpp.NodeProcessed raise common.xmpp.NodeProcessed
jid = streamhost.getAttr('jid') jid = gajim.parse_jid(streamhost.getAttr('jid'))
if 'streamhost-used' in file_props and \ if 'streamhost-used' in file_props and \
file_props['streamhost-used'] is True: file_props['streamhost-used'] is True:
raise common.xmpp.NodeProcessed raise common.xmpp.NodeProcessed
...@@ -1122,7 +1122,7 @@ class ConnectionVcard: ...@@ -1122,7 +1122,7 @@ class ConnectionVcard:
storage = query.getTag('storage') storage = query.getTag('storage')
metas = storage.getTags('meta') metas = storage.getTags('meta')
for meta in metas: for meta in metas:
jid = meta.getAttr('jid') jid = gajim.parse_jid(meta.getAttr('jid'))
tag = meta.getAttr('tag') tag = meta.getAttr('tag')
data = {'jid': jid} data = {'jid': jid}
order = meta.getAttr('order') order = meta.getAttr('order')
...@@ -1483,7 +1483,7 @@ class ConnectionHandlers(ConnectionVcard, ConnectionBytestream, ConnectionDisco, ...@@ -1483,7 +1483,7 @@ class ConnectionHandlers(ConnectionVcard, ConnectionBytestream, ConnectionDisco,
if not print_status: if not print_status:
print_status = conf.getTagData('show_status') print_status = conf.getTagData('show_status')
bm = {'name': conf.getAttr('name'), bm = {'name': conf.getAttr('name'),
'jid': conf.getAttr('jid'), 'jid': gajim.parse_jid(conf.getAttr('jid')),
'autojoin': autojoin_val, 'autojoin': autojoin_val,
'minimize': minimize_val, 'minimize': minimize_val,
'password': conf.getTagData('password'), 'password': conf.getTagData('password'),
...@@ -1503,7 +1503,7 @@ class ConnectionHandlers(ConnectionVcard, ConnectionBytestream, ConnectionDisco, ...@@ -1503,7 +1503,7 @@ class ConnectionHandlers(ConnectionVcard, ConnectionBytestream, ConnectionDisco,
# http://www.xmpp.org/extensions/xep-0145.html # http://www.xmpp.org/extensions/xep-0145.html
notes = storage.getTags('note') notes = storage.getTags('note')
for note in notes: for note in notes:
jid = note.getAttr('jid') jid = gajim.parse_jid(note.getAttr('jid'))
annotation = note.getData() annotation = note.getData()
self.annotations[jid] = annotation self.annotations[jid] = annotation
...@@ -1718,7 +1718,7 @@ class ConnectionHandlers(ConnectionVcard, ConnectionBytestream, ConnectionDisco, ...@@ -1718,7 +1718,7 @@ class ConnectionHandlers(ConnectionVcard, ConnectionBytestream, ConnectionDisco,
if addressTag and jid == gajim.get_jid_from_account(self.name): if addressTag and jid == gajim.get_jid_from_account(self.name):
address = addressTag.getTag('address', attrs={'type': 'ofrom'}) address = addressTag.getTag('address', attrs={'type': 'ofrom'})
if address: if address:
frm = address.getAttr('jid') frm = gajim.parse_jid(address.getAttr('jid'))
jid = gajim.get_jid_without_resource(frm) jid = gajim.get_jid_without_resource(frm)
# invitations # invitations
...@@ -1736,7 +1736,7 @@ class ConnectionHandlers(ConnectionVcard, ConnectionBytestream, ConnectionDisco, ...@@ -1736,7 +1736,7 @@ class ConnectionHandlers(ConnectionVcard, ConnectionBytestream, ConnectionDisco,
xtags = msg.getTags('x') xtags = msg.getTags('x')
for xtag in xtags: for xtag in xtags:
if xtag.getNamespace() == common.xmpp.NS_CONFERENCE and not invite: if xtag.getNamespace() == common.xmpp.NS_CONFERENCE and not invite:
room_jid = xtag.getAttr('jid') room_jid = gajim.parse_jid(xtag.getAttr('jid'))
is_continued = False is_continued = False
if xtag.getTag('continue'): if xtag.getTag('continue'):
is_continued = True is_continued = True
...@@ -1923,7 +1923,7 @@ class ConnectionHandlers(ConnectionVcard, ConnectionBytestream, ConnectionDisco, ...@@ -1923,7 +1923,7 @@ class ConnectionHandlers(ConnectionVcard, ConnectionBytestream, ConnectionDisco,
def dispatch_invite_message(self, invite, frm): def dispatch_invite_message(self, invite, frm):
item = invite.getTag('invite') item = invite.getTag('invite')
jid_from = item.getAttr('from') jid_from = gajim.parse_jid(item.getAttr('from'))
reason = item.getTagData('reason') reason = item.getTagData('reason')
item = invite.getTag('password') item = invite.getTag('password')
password = invite.getTagData('password') password = invite.getTagData('password')
...@@ -2127,7 +2127,7 @@ class ConnectionHandlers(ConnectionVcard, ConnectionBytestream, ConnectionDisco, ...@@ -2127,7 +2127,7 @@ class ConnectionHandlers(ConnectionVcard, ConnectionBytestream, ConnectionDisco,
r = destroy.getTagData('reason') r = destroy.getTagData('reason')
if r: if r:
reason += ' (%s)' % r reason += ' (%s)' % r
jid = destroy.getAttr('jid') jid = gajim.parse_jid(destroy.getAttr('jid'))
if jid: if jid:
reason += '\n' + _('You can join this room instead: %s') % jid reason += '\n' + _('You can join this room instead: %s') % jid
statusCode = ['destroyed'] statusCode = ['destroyed']
...@@ -2274,7 +2274,7 @@ class ConnectionHandlers(ConnectionVcard, ConnectionBytestream, ConnectionDisco, ...@@ -2274,7 +2274,7 @@ class ConnectionHandlers(ConnectionVcard, ConnectionBytestream, ConnectionDisco,
users_dict = {} users_dict = {}
for item in items: for item in items:
if item.has_attr('jid') and item.has_attr('affiliation'): if item.has_attr('jid') and item.has_attr('affiliation'):
jid = item.getAttr('jid') jid = gajim.parse_jid(item.getAttr('jid'))
affiliation = item.getAttr('affiliation') affiliation = item.getAttr('affiliation')
users_dict[jid] = {'affiliation': affiliation} users_dict[jid] = {'affiliation': affiliation}
if item.has_attr('nick'): if item.has_attr('nick'):
......
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