# HG changeset patch # User ivan.komarov@soc.pidgin.im # Date 1288203852 0 # Node ID a1964c506f290f7e170b3769346214dff8f83756 # Parent bebd0cf0a20f7add767ceb9e497d83df0ab99e6f We should always display the "Authorize buddy?" mini-dialog, even if the buddy doesn't have a non-empty nickname. Fixes #12810. Also, why the hell did gotalias() return int? That should be void. diff -r bebd0cf0a20f -r a1964c506f29 libpurple/protocols/oscar/family_icq.c --- a/libpurple/protocols/oscar/family_icq.c Mon Oct 25 20:01:50 2010 +0000 +++ b/libpurple/protocols/oscar/family_icq.c Wed Oct 27 18:24:12 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 bebd0cf0a20f -r a1964c506f29 pidgin/gtkaccount.c --- a/pidgin/gtkaccount.c Mon Oct 25 20:01:50 2010 +0000 +++ b/pidgin/gtkaccount.c Wed Oct 27 18:24:12 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