# HG changeset patch # User Ivan Komarov # Date 1288203974 0 # Node ID 15db5d3026649fa5f01b972fbd3a78dfbca09760 # Parent 3edf77c86d982862cc79028648480233a46e5f05# Parent f04d2d1937e6c62c578786b3405b07c04c2a4e96 merge of '3edf77c86d982862cc79028648480233a46e5f05' and 'f04d2d1937e6c62c578786b3405b07c04c2a4e96' diff -r 3edf77c86d98 -r 15db5d302664 libpurple/protocols/oscar/family_icq.c --- a/libpurple/protocols/oscar/family_icq.c Wed Oct 27 13:56:25 2010 +0000 +++ b/libpurple/protocols/oscar/family_icq.c Wed Oct 27 18:26:14 2010 +0000 @@ -408,27 +408,27 @@ return 0; } -static int +static void gotalias(OscarData *od, struct aim_icq_info *info) { PurpleConnection *gc = od->gc; PurpleAccount *account = purple_connection_get_account(gc); - gchar who[16], *utf8; PurpleBuddy *b; + gchar *utf8 = oscar_utf8_try_convert(account, od, info->nick); - if (info->nick[0] && (utf8 = oscar_utf8_try_convert(account, od, info->nick))) { - if (info->for_auth_request) { - oscar_auth_recvrequest(gc, g_strdup_printf("%u", info->uin), utf8, info->auth_request_reason); - } else { + if (info->for_auth_request) { + oscar_auth_recvrequest(gc, g_strdup_printf("%u", info->uin), utf8, info->auth_request_reason); + } else { + if (utf8 && *utf8) { + gchar who[16]; g_snprintf(who, sizeof(who), "%u", info->uin); serv_got_alias(gc, who, utf8); if ((b = purple_find_buddy(account, who))) { purple_blist_node_set_string((PurpleBlistNode*)b, "servernick", utf8); } - g_free(utf8); } + g_free(utf8); } - return 1; } /** diff -r 3edf77c86d98 -r 15db5d302664 pidgin/gtkaccount.c --- a/pidgin/gtkaccount.c Wed Oct 27 13:56:25 2010 +0000 +++ b/pidgin/gtkaccount.c Wed Oct 27 18:26:14 2010 +0000 @@ -2468,6 +2468,7 @@ GtkWidget *alert; GdkPixbuf *prpl_icon; struct auth_request *aa; + gboolean have_valid_alias = alias && *alias; gc = purple_account_get_connection(account); if (message != NULL && *message == '\0') @@ -2475,9 +2476,9 @@ buffer = g_strdup_printf(_("%s%s%s%s wants to add you (%s) to his or her buddy list%s%s"), remote_user, - (alias != NULL ? " (" : ""), - (alias != NULL ? alias : ""), - (alias != NULL ? ")" : ""), + (have_valid_alias ? " (" : ""), + (have_valid_alias ? alias : ""), + (have_valid_alias ? ")" : ""), (id != NULL ? id : (purple_connection_get_display_name(gc) != NULL