From 7cd0b8d60342a9da9c7fb700a2e149061c9dcae5 Mon Sep 17 00:00:00 2001
From: Jean-Marie Traissard <jim@lapin.org>
Date: Wed, 17 May 2006 17:56:33 +0000
Subject: [PATCH] Don't print "new_nick has joined the room" after "old_nick is
 now known as new_nick". Add new_nick to roster when we receive /nick stanza.

---
 src/groupchat_control.py | 6 ++++++
 1 file changed, 6 insertions(+)

diff --git a/src/groupchat_control.py b/src/groupchat_control.py
index 2546c87d5c..ceef234fd2 100644
--- a/src/groupchat_control.py
+++ b/src/groupchat_control.py
@@ -801,6 +801,12 @@ class GroupchatControl(ChatControlBase):
 					s = _('You are now known as %s') % new_nick
 				else:
 					s = _('%s is now known as %s') % (nick, new_nick)
+					# We add new nick to muc roster here, so we don't see 
+					# that "new_nick has joined the room" when he just changed nick.
+					# add_contact_to_roster will be called a second time 
+					# after that, but that doesn't hurt
+					self.add_contact_to_roster(new_nick, show, role, affiliation,
+						status, jid)
 				self.print_conversation(s, 'info')
 
 			if not gajim.awaiting_events[self.account].has_key(self.room_jid + '/' + nick):
-- 
GitLab