fix <x/> tag handling

This commit is contained in:
louiz@4325f9fc-e183-4c21-96ce-0ab188b42d13 2010-07-20 09:57:31 +00:00
parent 5eeebb36bf
commit f4dbe478eb

View file

@ -127,8 +127,12 @@ class Connection(threading.Thread):
"""
check if it's a normal or a muc presence
"""
x = presence.getTag('x')
if x and x.getAttr('xmlns') == 'http://jabber.org/protocol/muc#user':
is_muc = False
tags = presence.getTags('x')
for tag in tags:
if tag.getAttr('xmlns') == 'http://jabber.org/protocol/muc#user':
is_muc = True
if is_muc:
self.handler_muc_presence(connection, presence)
else:
self.handler_normal_presence(connection, presence)