summaryrefslogtreecommitdiff
blob: 9b14852566edbb50b0e0fb4f414ec14c2ced5b12 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
http://developer.pidgin.im/viewmtn/revision/info/b4c65c273f2934560d9e643a124b31ac2d2328f2

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.

#
#
# patch "libpurple/protocols/oscar/family_icq.c"
#  from [6e79de6d0d602cb32962d5a6eb9884d41ecf4d2a]
#    to [da2f91e3871e683861698a416bb17e6f4fc7eca1]
# 
# patch "pidgin/gtkaccount.c"
#  from [67355ddf08aa04ea8bc82450a9b0276a03937981]
#    to [c6c6f42af0d54071a143aeab36b4165866907064]
#
============================================================
--- libpurple/protocols/oscar/family_icq.c	6e79de6d0d602cb32962d5a6eb9884d41ecf4d2a
+++ libpurple/protocols/oscar/family_icq.c	da2f91e3871e683861698a416bb17e6f4fc7eca1
@@ -408,27 +408,27 @@ int aim_icq_sendsms(OscarData *od, const
 	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;
 }
 
 /**
============================================================
--- pidgin/gtkaccount.c	67355ddf08aa04ea8bc82450a9b0276a03937981
+++ pidgin/gtkaccount.c	c6c6f42af0d54071a143aeab36b4165866907064
@@ -2468,6 +2468,7 @@ pidgin_accounts_request_authorization(Pu
 	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 @@ pidgin_accounts_request_authorization(Pu
 
 	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