changeset 31076:bbf7096ae66c

merge of '598ef461d4de936afef7298e55152cc7ecaa9b70' and 'b4c65c273f2934560d9e643a124b31ac2d2328f2'
author ivan.komarov@soc.pidgin.im
date Wed, 27 Oct 2010 18:26:14 +0000
parents e7365705f151 (current diff) a1964c506f29 (diff)
children 1d5f8e977b54
files
diffstat 2 files changed, 12 insertions(+), 11 deletions(-) [+]
line wrap: on
line diff
--- 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;
 }
 
 /**
--- 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