|
From: <rl...@us...> - 2006-09-09 20:27:52
|
Revision: 17203
http://svn.sourceforge.net/gaim/?rev=17203&view=rev
Author: rlaager
Date: 2006-09-09 13:27:48 -0700 (Sat, 09 Sep 2006)
Log Message:
-----------
Part of SF Patch #1554627 from Richard Nelson (wabz)
"The msn protocol currently calls serv_got_alias on all
buddy status changes (as they are NLN commands),
resulting in lots of unnecessary blist.xml write schedules.
serv_got_alias already checks if the alias has actually
changed before printing to the conv. The first hunk in
this patch checks it a bit earlier."
The second hunk checks in the MSN prpl, which also avoids
an extra call to msn_user_set_friendly_name().
Modified Paths:
--------------
trunk/libgaim/protocols/msn/notification.c
trunk/libgaim/server.c
Modified: trunk/libgaim/protocols/msn/notification.c
===================================================================
--- trunk/libgaim/protocols/msn/notification.c 2006-09-09 19:41:34 UTC (rev 17202)
+++ trunk/libgaim/protocols/msn/notification.c 2006-09-09 20:27:48 UTC (rev 17203)
@@ -664,7 +664,7 @@
MsnUser *user;
MsnObject *msnobj;
int clientid;
- const char *state, *passport, *friendly;
+ const char *state, *passport, *friendly, *old_friendly;
session = cmdproc->session;
account = session->account;
@@ -676,10 +676,13 @@
user = msn_userlist_find_user(session->userlist, passport);
- serv_got_alias(gc, passport, friendly);
+ old_friendly = msn_user_get_friendly_name(user);
+ if (old_friendly && strcmp(old_friendly, friendly))
+ {
+ serv_got_alias(gc, passport, friendly);
+ msn_user_set_friendly_name(user, friendly);
+ }
- msn_user_set_friendly_name(user, friendly);
-
if (session->protocol_ver >= 9)
{
if (cmd->param_count == 5)
Modified: trunk/libgaim/server.c
===================================================================
--- trunk/libgaim/server.c 2006-09-09 19:41:34 UTC (rev 17202)
+++ trunk/libgaim/server.c 2006-09-09 20:27:48 UTC (rev 17203)
@@ -215,12 +215,13 @@
for (buds = buddies; buds; buds = buds->next)
{
b = buds->data;
+ if (b->server_alias && !strcmp(b->server_alias, alias))
+ continue;
gaim_blist_server_alias_buddy(b, alias);
conv = gaim_find_conversation_with_account(GAIM_CONV_TYPE_IM, b->name, account);
- if (conv != NULL && b->server_alias != NULL &&
- strcmp(b->server_alias, alias))
+ if (conv != NULL)
{
char *tmp = g_strdup_printf(_("%s is now known as %s.\n"),
who, alias);
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|