Commit 0c507859 authored by louiz’'s avatar louiz’

On kick, get the actor 'nick', before trying the 'jid'

'nick' attribute has been introduced recently in the XEP. We still try the
'jid' attribute for backward compatibility. And also we don’t traceback
anymore if any of these fields is not present.
parent 4a091b3d
......@@ -1641,9 +1641,11 @@ class MucTab(ChatTab):
When someone is kicked from a muc
"""
self.users.remove(user)
by = presence.find('{%s}x/{%s}item/{%s}actor' % (NS_MUC_USER, NS_MUC_USER, NS_MUC_USER))
actor_elem = presence.find('{%s}x/{%s}item/{%s}actor' % (NS_MUC_USER, NS_MUC_USER, NS_MUC_USER))
reason = presence.find('{%s}x/{%s}item/{%s}reason' % (NS_MUC_USER, NS_MUC_USER, NS_MUC_USER))
by = by.attrib['jid'] if by is not None else None
by = None
if actor_elem is not None:
by = actor_elem.get('nick') or actor_elem.get('jid')
if from_nick == self.own_nick: # we are kicked
if by:
kick_msg = _('\x191}%(spec)s \x193}You\x19%(info_col)s} have been kicked by \x193}%(by)s') % {
......
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