# HG changeset patch # User Evan Schoenberg # Date 1220018474 0 # Node ID 32828b3c0d4f385b0b4a71735776eb8d169e4b19 # Parent 5e51360bb22cdec8af8765629f9bdc8308fab955 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. diff -r 5e51360bb22c -r 32828b3c0d4f libpurple/protocols/jabber/buddy.c --- a/libpurple/protocols/jabber/buddy.c Fri Aug 29 13:59:59 2008 +0000 +++ b/libpurple/protocols/jabber/buddy.c Fri Aug 29 14:01:14 2008 +0000 @@ -1251,7 +1251,6 @@ 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 @@ 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")) {