summaryrefslogtreecommitdiff
path: root/src/tabs.py
diff options
context:
space:
mode:
authorFlorent Le Coz <louiz@louiz.org>2013-11-13 00:42:08 +0100
committerFlorent Le Coz <louiz@louiz.org>2013-11-13 00:42:08 +0100
commit0c507859fb611bbec90ff7cc4abb7ff149b51153 (patch)
tree4fc02e05df29ca266638037279d0a17a536e115c /src/tabs.py
parent4a091b3d2d82df6218c4db3cf6fca0cbc52c08ba (diff)
downloadpoezio-0c507859fb611bbec90ff7cc4abb7ff149b51153.tar.gz
poezio-0c507859fb611bbec90ff7cc4abb7ff149b51153.tar.bz2
poezio-0c507859fb611bbec90ff7cc4abb7ff149b51153.tar.xz
poezio-0c507859fb611bbec90ff7cc4abb7ff149b51153.zip
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.
Diffstat (limited to 'src/tabs.py')
-rw-r--r--src/tabs.py6
1 files changed, 4 insertions, 2 deletions
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') % {