summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorFlorent Le Coz <louiz@louiz.org>2014-02-03 21:33:00 +0100
committerFlorent Le Coz <louiz@louiz.org>2014-02-03 21:35:58 +0100
commit925ea453f354c69d92ea8b6a6a35f5729ba26503 (patch)
treee2f198a9f2d011b4db6e19808c556a200019ceb0 /src
parentd52e82660d2dcf7e33cd2cd942f18233a835b1d9 (diff)
downloadpoezio-925ea453f354c69d92ea8b6a6a35f5729ba26503.tar.gz
poezio-925ea453f354c69d92ea8b6a6a35f5729ba26503.tar.bz2
poezio-925ea453f354c69d92ea8b6a6a35f5729ba26503.tar.xz
poezio-925ea453f354c69d92ea8b6a6a35f5729ba26503.zip
Do not crash on /names with invalid affiliations
Diffstat (limited to 'src')
-rw-r--r--src/tabs.py9
1 files changed, 5 insertions, 4 deletions
diff --git a/src/tabs.py b/src/tabs.py
index 12a3cd62..dd58a3a1 100644
--- a/src/tabs.py
+++ b/src/tabs.py
@@ -1122,14 +1122,15 @@ class MucTab(ChatTab):
users = self.users[:]
users.sort(key=lambda x: x.nick.lower())
for user in users:
+ color = aff.get(user.affiliation, get_theme().CHAR_AFFILIATION_NONE)
if user.role == 'visitor':
- visitors.append((user, aff[user.affiliation]))
+ visitors.append((user, color))
elif user.role == 'participant':
- participants.append((user, aff[user.affiliation]))
+ participants.append((user, color))
elif user.role == 'moderator':
- moderators.append((user, aff[user.affiliation]))
+ moderators.append((user, color))
else:
- others.append((user, aff[user.affiliation]))
+ others.append((user, color))
buff = ['Users: %s \n' % len(self.users)]
for moderator in moderators: