From 94436e075b680617340884fb3dd870bcef6826e5 Mon Sep 17 00:00:00 2001 From: Florent Le Coz Date: Thu, 11 Aug 2011 23:31:03 +0200 Subject: [PATCH] Fix a tb on invalid show in presence from a muc (Displays a warning in that case, so that we can laugh about it.) --- data/default_config.cfg | 20 ++++++++++---------- src/tabs.py | 5 ++++- 2 files changed, 14 insertions(+), 11 deletions(-) diff --git a/data/default_config.cfg b/data/default_config.cfg index 53357009..92bdcd60 100644 --- a/data/default_config.cfg +++ b/data/default_config.cfg @@ -14,22 +14,22 @@ port = 5222 # If it's empty, your resource will be chosen (most likely randomly) by the server # It is not recommended to use a resource that is easy to guess, because it can lead # to presence leak. -resource = +resource = # the nick you will use when joining a room with no associated nick # If this is empty, the $USER environnement variable will be used -default_nick = +default_nick = # Jabber identifiant. Specify it only if you want to connect using an existing # account on a server. This is optional and useful only for some features, # like room administration, nickname registration. # The 'server' option will be ignored if you specify a JID (Jabber identifiant) # It should be in the form nickname@server.tld -jid = +jid = # A password is needed only if you specified a jid. It will be ignored otherwise # If you leave this empty, the password will be asked at each startup -password = +password = # the rooms you will join automatically on startup, with associated nickname or not # format : room@server.tld/nickname:room2@server.tld/nickname2 @@ -49,7 +49,7 @@ after_completion = , # a list of words (separated by a semicolon (:)) that will be # highlighted if said by someone on a room -highlight_on = +highlight_on = # XHTML-IM is an XMPP extension letting users send messages # containing XHTML and CSS formating. We can use this to make @@ -107,7 +107,7 @@ autorejoin = false # For example, if you set "_", and wanted to use # the nickname "john", your alternative nickname # will be "john_" -alternative_nickname = +alternative_nickname = # Limit the number of messages you want to receive when the # multiuserchat rooms send you recent history @@ -123,7 +123,7 @@ use_log = false # If log_dir is not set, logs will be saved in $XDG_DATA_HOME/poezio/logs, # i.e. in ~/.local/share/poezio/logs/. So, you should specify the directory # you want to use instead. This directory will be created if it doesn't exist -log_dir = +log_dir = # the full path to the photo (avatar) you want to use # it should be less than 16Ko @@ -152,7 +152,7 @@ beep_on = highlight private # i.e. in ~/.local/share/poezio/themes/. Si you should specify the directory you # want to use instead. This directory will be created at startup if it doesn't # exist -themes_dir = +themes_dir = # The name of the theme file that will be used. The file should be located # in the theme_dir directory. @@ -202,5 +202,5 @@ M-i = ^I [var] # You should not edit this section, it is just used by poezio # to save various data across restarts -folded_roster_groups = -info_win_height = 2 \ No newline at end of file +folded_roster_groups = +info_win_height = 2 diff --git a/src/tabs.py b/src/tabs.py index 8f715349..e04f330e 100644 --- a/src/tabs.py +++ b/src/tabs.py @@ -931,6 +931,9 @@ class MucTab(ChatTab): display_message = False # flag to know if something significant enough # to be displayed has changed 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: msg += _('affiliation: %s, ') % affiliation display_message = True @@ -942,7 +945,7 @@ class MucTab(ChatTab): display_message = True if status != user.status: # 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] else: msg += _('status: %s, ') % status