diff options
-rw-r--r-- | data/default_config.cfg | 8 | ||||
-rw-r--r-- | src/client.py | 4 | ||||
-rw-r--r-- | src/gui.py | 18 |
3 files changed, 22 insertions, 8 deletions
diff --git a/data/default_config.cfg b/data/default_config.cfg index 879f6590..8f6123d2 100644 --- a/data/default_config.cfg +++ b/data/default_config.cfg @@ -27,7 +27,13 @@ after_completion = , # a list of words (separated by a semicolon (:)) that will be highlighted if said by # someone on a room -highlight_on = FION +highlight_on = + +# if true, no join or quit message will be displayed in the rooms +hide_enter_join = False + +# if true, no status change will be displayed in the rooms +hide_status_change = False # the file where logs are saved (useless for the moment) logfile = logs diff --git a/src/client.py b/src/client.py index 9840d259..d3561a86 100644 --- a/src/client.py +++ b/src/client.py @@ -20,8 +20,8 @@ import sys # disable any printout (this would mess the display) stderr = sys.stderr -sys.stdout = open('/dev/null', 'w') -sys.stderr = open('/dev/null', 'w') +# sys.stdout = open('/dev/null', 'w') +# sys.stderr = open('/dev/null', 'w') from connection import Connection from multiuserchat import MultiUserChat @@ -130,7 +130,9 @@ class Room(object): # New user if not user: self.users.append(User(nick, affiliation, show, status, role)) - return self.add_info(_('%(nick)s joined the room %(roomname)s') % {'nick':nick, 'roomname': self.name}) + if not config.get('hide_enter_join', "false") == "true": + return self.add_info(_('%(nick)s joined the room %(roomname)s') % {'nick':nick, 'roomname': self.name}) + return None # nick change if change_nick: if user.nick == self.own_nick: @@ -159,10 +161,14 @@ class Room(object): # user quit if status == 'offline' or role == 'none': self.users.remove(user) - return self.add_info(_('%s has left the room') % (nick)) + if not config.get('hide_enter_join', "false") == "true": + return self.add_info(_('%s has left the room') % (nick)) + return None # status change user.update(affiliation, show, status, role) - return self.add_info(_('%(nick)s changed his/her status : %(a)s, %(b)s, %(c)s, %(d)s') % {'nick':nick, 'a':affiliation, 'b':role, 'c':show, 'd':status}) + if not config.get('hide_status_change', "false") == "true": + return self.add_info(_('%(nick)s changed his/her status : %(a)s, %(b)s, %(c)s, %(d)s') % {'nick':nick, 'a':affiliation, 'b':role, 'c':show, 'd':status}) + return None class Gui(object): @@ -378,12 +384,14 @@ class Gui(object): msg = _("Error: %s") % stanza.getError() else: msg = room.on_presence(stanza, from_nick) - if room == self.current_room(): + if room == self.current_room(): + self.window.user_win.refresh(room.users) + if room == self.current_room() and msg: self.window.text_win.add_line(room, (datetime.now(), msg)) self.window.text_win.refresh(room.name) self.window.user_win.refresh(room.users) self.window.text_win.refresh() - curses.doupdate() + curses.doupdate() def room_iq(self, iq): if len(sys.argv) > 1: |