changeset 9135:6038664a67fe

[gaim-migrate @ 9919] Display name changes are now shown in the conversation windows. Patch by Robert Mibus. committer: Tailor Script <tailor@pidgin.im>
author Christian Hammond <chipx86@chipx86.com>
date Sun, 30 May 2004 21:26:41 +0000
parents 6d7bb1274755
children e46869c572be
files ChangeLog src/server.c
diffstat 2 files changed, 25 insertions(+), 3 deletions(-) [+]
line wrap: on
line diff
--- a/ChangeLog	Sun May 30 21:00:36 2004 +0000
+++ b/ChangeLog	Sun May 30 21:26:41 2004 +0000
@@ -1,6 +1,9 @@
 Gaim: The Pimpin' Penguin IM Client that's good for the soul!
 
 version 0.79cvs:
+	New Features:
+	* Display name changes are now shown in the conversation windows.
+	  (Robert Mibus)
 	Bug Fixes:
 	* Non-looping animated icons no longer cause Gaim to freeze
 	* Fixed a crash in SILC that sometimes happened when resolving
--- a/src/server.c	Sun May 30 21:00:36 2004 +0000
+++ b/src/server.c	Sun May 30 21:26:41 2004 +0000
@@ -481,13 +481,32 @@
 	}
 }
 
-void serv_got_alias(GaimConnection *gc, const char *who, const char *alias) {
-	GSList *buds, *buddies = gaim_find_buddies(gc->account, who);
+void
+serv_got_alias(GaimConnection *gc, const char *who, const char *alias)
+{
+	GaimAccount *account = gaim_connection_get_account(gc);
+	GSList *buds, *buddies = gaim_find_buddies(account, who);
 	GaimBuddy *b;
+	GaimConversation *conv;
 
-	for(buds = buddies; buds; buds = buds->next) {
+	for (buds = buddies; buds; buds = buds->next)
+	{
 		b = buds->data;
 		gaim_blist_server_alias_buddy(b, alias);
+
+		conv = gaim_find_conversation_with_account(b->name, account);
+
+		if (conv != NULL && b->server_alias != NULL &&
+			strcmp(b->server_alias, alias))
+		{
+			char *tmp = g_strdup_printf(_("%s is now known as %s.\n"),
+										who, alias);
+
+			gaim_conversation_write(conv, NULL, tmp, GAIM_MESSAGE_SYSTEM,
+									time(NULL));
+
+			g_free(tmp);
+		}
 	}
 	g_slist_free(buddies);
 }