summaryrefslogtreecommitdiff
path: root/src/gui.py
diff options
context:
space:
mode:
authorlouiz@4325f9fc-e183-4c21-96ce-0ab188b42d13 <louiz@4325f9fc-e183-4c21-96ce-0ab188b42d13>2010-06-13 01:50:28 +0000
committerlouiz@4325f9fc-e183-4c21-96ce-0ab188b42d13 <louiz@4325f9fc-e183-4c21-96ce-0ab188b42d13>2010-06-13 01:50:28 +0000
commit9456f7fc35538f98414eeac8e11745672317692c (patch)
tree740eaeaa066efe6e5cea869a3760f0876b8071a2 /src/gui.py
parentd03ce7e869efdec9efed855a73539b33027a52c8 (diff)
downloadpoezio-9456f7fc35538f98414eeac8e11745672317692c.tar.gz
poezio-9456f7fc35538f98414eeac8e11745672317692c.tar.bz2
poezio-9456f7fc35538f98414eeac8e11745672317692c.tar.xz
poezio-9456f7fc35538f98414eeac8e11745672317692c.zip
show only what has really changed, in the change-status-messages. fixed #1473
Diffstat (limited to 'src/gui.py')
-rw-r--r--src/gui.py25
1 files changed, 21 insertions, 4 deletions
diff --git a/src/gui.py b/src/gui.py
index da70c1df..685bcb97 100644
--- a/src/gui.py
+++ b/src/gui.py
@@ -388,12 +388,29 @@ class Gui(object):
self.add_message_to_room(room, _('%s has left the room') % (from_nick))
# status change
else:
- user.update(affiliation, show, status, role)
hide_status_change = config.get('hide_status_change', -1) if config.get('hide_status_change', -1) >= -1 else -1
- if hide_status_change == -1 or \
+ if (hide_status_change == -1 or \
user.has_talked_since(hide_status_change) or\
- user.nick == room.own_nick:
- self.add_message_to_room(room, _('%(nick)s changed his/her status : %(a)s, %(b)s, %(c)s, %(d)s') % {'nick':from_nick, 'a':affiliation, 'b':role, 'c':show, 'd':status})
+ user.nick == room.own_nick)\
+ and\
+ (affiliation != user.affiliation or\
+ role != user.role or\
+ show != user.show or\
+ status != user.status):
+ msg = _('%s changed his/her status: ')% from_nick
+ if affiliation != user.affiliation:
+ msg += _('affiliation: %s,') % affiliation
+ if role != user.role:
+ msg += _('role: %s,') % role
+ if show != user.show:
+ msg += _('show: %s,') % show
+ if status != user.status:
+ msg += _('status: %s,') % status
+ # (a)s, %(b)s, %(c)s, %(d)s') % {'nick':from_nick, 'a':affiliation, 'b':role, 'c':show, 'd':status})
+ user.update(affiliation, show, status, role)
+ msg = msg[:-1] # remove the last ","
+ self.add_message_to_room(room, msg)
+
if room == self.current_room():
self.window.user_win.refresh(room.users)
self.window.input.refresh()