diff options
author | louiz@4325f9fc-e183-4c21-96ce-0ab188b42d13 <louiz@4325f9fc-e183-4c21-96ce-0ab188b42d13> | 2010-08-09 00:50:56 +0000 |
---|---|---|
committer | louiz@4325f9fc-e183-4c21-96ce-0ab188b42d13 <louiz@4325f9fc-e183-4c21-96ce-0ab188b42d13> | 2010-08-09 00:50:56 +0000 |
commit | 31ab762ab6ced58c055b3225342f21d14cf0aafd (patch) | |
tree | 48a04269362a2693783fc4c0036351ae6df2d505 /src | |
parent | b59e6781d1b5a43cc5aaed42296b8b3d269b092a (diff) | |
download | poezio-31ab762ab6ced58c055b3225342f21d14cf0aafd.tar.gz poezio-31ab762ab6ced58c055b3225342f21d14cf0aafd.tar.bz2 poezio-31ab762ab6ced58c055b3225342f21d14cf0aafd.tar.xz poezio-31ab762ab6ced58c055b3225342f21d14cf0aafd.zip |
Display the bare JID on join and quit messages if it is known. fixed #1656
Diffstat (limited to 'src')
-rw-r--r-- | src/gui.py | 11 |
1 files changed, 9 insertions, 2 deletions
@@ -476,6 +476,7 @@ class Gui(object): show = stanza.getShow() status = stanza.getStatus() role = stanza.getRole() + jid = stanza.getJid() if not room.joined: # user in the room BEFORE us. # ignore redondant presence message, see bug #1509 if from_nick not in [user.nick for user in room.users]: @@ -500,7 +501,10 @@ class Gui(object): show, status, role)) hide_exit_join = config.get('hide_exit_join', -1) if hide_exit_join != 0: - self.add_message_to_room(room, _("%(nick)s joined the room %(roomname)s") % {'nick':from_nick, 'roomname': room.name}) + if not jid: + self.add_message_to_room(room, _("%(nick)s joined the room") % {'nick':from_nick}) + else: + self.add_message_to_room(room, _("%(nick)s (%(jid)s) joined the room") % {'nick':from_nick, 'jid':jid}) # nick change elif change_nick: if user.nick == room.own_nick: @@ -549,7 +553,10 @@ class Gui(object): room.users.remove(user) hide_exit_join = config.get('hide_exit_join', -1) if config.get('hide_exit_join', -1) >= -1 else -1 if hide_exit_join == -1 or user.has_talked_since(hide_exit_join): - self.add_message_to_room(room, _('%s has left the room') % (from_nick)) + if not jid: + self.add_message_to_room(room, _('%s has left the room') % (from_nick)) + else: + self.add_message_to_room(room, _('%(nick)s (%(jid)s) has left the room') % {'nick':from_nick, 'jid':jid}) private_room = self.get_room_by_name(stanza.getFrom()) if private_room: self.add_message_to_room(private_room, _('%s has left the room') % (from_nick)) |