pidgin: 9e35a4c3: Ignore nicknames which are just the user...
evands at pidgin.im
evands at pidgin.im
Fri Aug 29 10:05:52 EDT 2008
-----------------------------------------------------------------
Revision: 9e35a4c328ef329e275972ceb8660700e8b73c5c
Ancestor: b0f72750dd0dc066e8044540e70af0c179625fbc
Author: evands at pidgin.im
Date: 2008-08-29T14:01:14
Branch: im.pidgin.pidgin
URL: http://d.pidgin.im/viewmtn/revision/info/9e35a4c328ef329e275972ceb8660700e8b73c5c
Modified files:
libpurple/protocols/jabber/buddy.c
ChangeLog:
Ignore nicknames which are just the user portion of the JID, as these aren't useful. Instead, prefer the fullname in that situation for serverside alias purposes.
-------------- next part --------------
============================================================
--- libpurple/protocols/jabber/buddy.c 0764e412d2fad47344ddfc23304678fd61817c3d
+++ libpurple/protocols/jabber/buddy.c 2aa329f3a4ac342a997375d97dd0807ddc7ff11f
@@ -1251,7 +1251,6 @@ static void jabber_vcard_parse(JabberStr
text = xmlnode_get_data(child);
if(text && !strcmp(child->name, "FN")) {
- /* If we havne't found a name yet, use this one as the serverside name */
if (!serverside_alias)
serverside_alias = g_strdup(text);
@@ -1275,11 +1274,14 @@ static void jabber_vcard_parse(JabberStr
g_free(text2);
}
} else if(text && !strcmp(child->name, "NICKNAME")) {
- /* Prefer the Nickcname to the Full Name as the serverside alias */
- g_free(serverside_alias);
- serverside_alias = g_strdup(text);
-
- purple_notify_user_info_add_pair(user_info, _("Nickname"), text);
+ /* Prefer the Nickcname to the Full Name as the serverside alias if it's not just part of the jid.
+ * Ignore it if it's part of the jid. */
+ if (strstr(bare_jid, text) == NULL) {
+ g_free(serverside_alias);
+ serverside_alias = g_strdup(text);
+
+ purple_notify_user_info_add_pair(user_info, _("Nickname"), text);
+ }
} else if(text && !strcmp(child->name, "BDAY")) {
purple_notify_user_info_add_pair(user_info, _("Birthday"), text);
} else if(!strcmp(child->name, "ADR")) {
More information about the Commits
mailing list