From 31ab762ab6ced58c055b3225342f21d14cf0aafd Mon Sep 17 00:00:00 2001 From: "louiz@4325f9fc-e183-4c21-96ce-0ab188b42d13" Date: Mon, 9 Aug 2010 00:50:56 +0000 Subject: Display the bare JID on join and quit messages if it is known. fixed #1656 --- src/gui.py | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) diff --git a/src/gui.py b/src/gui.py index 5d6ed512..a20b48c4 100644 --- a/src/gui.py +++ b/src/gui.py @@ -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)) -- cgit v1.2.3