diff src/server.c @ 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 9f21659ecf11
children 1e51236d825e
line wrap: on
line diff
--- 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);
 }