From 0c507859fb611bbec90ff7cc4abb7ff149b51153 Mon Sep 17 00:00:00 2001 From: Florent Le Coz Date: Wed, 13 Nov 2013 00:42:08 +0100 Subject: On kick, get the actor 'nick', before trying the 'jid' MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit '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. --- src/tabs.py | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) (limited to 'src') diff --git a/src/tabs.py b/src/tabs.py index 4dc01316..598cf82a 100644 --- a/src/tabs.py +++ b/src/tabs.py @@ -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') % { -- cgit v1.2.3