diff libpurple/protocols/oscar/family_icq.c @ 31075:a1964c506f29

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.
author ivan.komarov@soc.pidgin.im
date Wed, 27 Oct 2010 18:24:12 +0000
parents 11c54d781835
children a8cc50c2279f
line wrap: on
line diff
--- 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;
 }
 
 /**