Fix a tb on invalid show in presence from a muc

(Displays a warning in that case, so that we can laugh about it.)
This commit is contained in:
Florent Le Coz 2011-08-11 23:31:03 +02:00
parent 9426b25902
commit 94436e075b
2 changed files with 14 additions and 11 deletions

View file

@ -931,6 +931,9 @@ class MucTab(ChatTab):
display_message = False # flag to know if something significant enough display_message = False # flag to know if something significant enough
# to be displayed has changed # to be displayed has changed
msg = _('\x193%s\x195 changed: ')% from_nick.replace('"', '\\"') msg = _('\x193%s\x195 changed: ')% from_nick.replace('"', '\\"')
if show not in SHOW_NAME:
self.core.information("%s from room %s sent an invalid show: %s" %\
(from_nick, from_room, show), "warning")
if affiliation != user.affiliation: if affiliation != user.affiliation:
msg += _('affiliation: %s, ') % affiliation msg += _('affiliation: %s, ') % affiliation
display_message = True display_message = True
@ -942,7 +945,7 @@ class MucTab(ChatTab):
display_message = True display_message = True
if status != user.status: if status != user.status:
# if the user sets his status to nothing # if the user sets his status to nothing
if not status: if not status and show in SHOW_NAME:
msg += _('show: %s, ') % SHOW_NAME[show] msg += _('show: %s, ') % SHOW_NAME[show]
else: else:
msg += _('status: %s, ') % status msg += _('status: %s, ') % status