changeset 16901:f9e7a7dacda3

merge of '45c1f04f71cf4ccbd70b37318474175c0cd4d0a9' and '7f6aca10dadc1d0a7dbbf6abc0d31311c53d0d70'
author Evan Schoenberg <evan.s@dreskin.net>
date Sat, 05 May 2007 18:14:48 +0000
parents 9f0686d3d91b (current diff) 0a3ae69a25ea (diff)
children 1dd4480dd80c 11a0f2b4ac83
files
diffstat 2 files changed, 22 insertions(+), 54 deletions(-) [+]
line wrap: on
line diff
--- a/libpurple/protocols/oscar/family_feedbag.c	Sat May 05 18:11:32 2007 +0000
+++ b/libpurple/protocols/oscar/family_feedbag.c	Sat May 05 18:14:48 2007 +0000
@@ -588,9 +588,7 @@
 	od->ssi.waiting_for_ack = TRUE;
 
 	/* Now go mail off our data and wait 4 to 6 weeks */
-	aim_ssi_addmoddel(od);
-
-	return 0;
+	return aim_ssi_addmoddel(od);;
 }
 
 /**
@@ -714,9 +712,7 @@
 		aim_ssi_itemlist_del(&od->ssi.local, cur);
 
 	/* If we've made any changes then sync our list with the server's */
-	aim_ssi_sync(od);
-
-	return 0;
+	return aim_ssi_sync(od);
 }
 
 /**
@@ -769,9 +765,7 @@
 	aim_ssi_itemlist_rebuildgroup(od->ssi.local, group);
 
 	/* Sync our local list with the server list */
-	aim_ssi_sync(od);
-
-	return 0;
+	return aim_ssi_sync(od);
 }
 
 /**
@@ -795,9 +789,7 @@
 	aim_ssi_itemlist_add(&od->ssi.local, name, 0x0000, 0xFFFF, AIM_SSI_TYPE_PERMIT, NULL);
 
 	/* Sync our local list with the server list */
-	aim_ssi_sync(od);
-
-	return 0;
+	return aim_ssi_sync(od);
 }
 
 /**
@@ -821,9 +813,7 @@
 	aim_ssi_itemlist_add(&od->ssi.local, name, 0x0000, 0xFFFF, AIM_SSI_TYPE_DENY, NULL);
 
 	/* Sync our local list with the server list */
-	aim_ssi_sync(od);
-
-	return 0;
+	return aim_ssi_sync(od);
 }
 
 /**
@@ -865,9 +855,7 @@
 	}
 
 	/* Sync our local list with the server list */
-	aim_ssi_sync(od);
-
-	return 0;
+	return aim_ssi_sync(od);
 }
 
 /**
@@ -892,9 +880,7 @@
 	aim_ssi_itemlist_del(&od->ssi.local, del);
 
 	/* Sync our local list with the server list */
-	aim_ssi_sync(od);
-
-	return 0;
+	return aim_ssi_sync(od);
 }
 
 /**
@@ -919,9 +905,7 @@
 	aim_ssi_itemlist_del(&od->ssi.local, del);
 
 	/* Sync our local list with the server list */
-	aim_ssi_sync(od);
-
-	return 0;
+	return aim_ssi_sync(od);
 }
 
 /**
@@ -977,9 +961,7 @@
 		aim_tlvlist_remove(&tmp->data, 0x0131);
 
 	/* Sync our local list with the server list */
-	aim_ssi_sync(od);
-
-	return 0;
+	return aim_ssi_sync(od);
 }
 
 /**
@@ -1009,9 +991,7 @@
 		aim_tlvlist_remove(&tmp->data, 0x013c);
 
 	/* Sync our local list with the server list */
-	aim_ssi_sync(od);
-
-	return 0;
+	return aim_ssi_sync(od);
 }
 
 /**
@@ -1037,9 +1017,7 @@
 	strcpy(group->name, newgn);
 
 	/* Sync our local list with the server list */
-	aim_ssi_sync(od);
-
-	return 0;
+	return aim_ssi_sync(od);
 }
 
 /**
@@ -1079,9 +1057,7 @@
 	aim_tlvlist_replace_32(&tmp->data, 0x00cb, vismask);
 
 	/* Sync our local list with the server list */
-	aim_ssi_sync(od);
-
-	return 0;
+	return aim_ssi_sync(od);
 }
 
 /**
@@ -1171,9 +1147,7 @@
 	aim_tlvlist_replace_32(&tmp->data, 0x00c9, presence);
 
 	/* Sync our local list with the server list */
-	aim_ssi_sync(od);
-
-	return 0;
+	return aim_ssi_sync(od);
 }
 
 /*
--- a/libpurple/protocols/oscar/oscar.c	Sat May 05 18:11:32 2007 +0000
+++ b/libpurple/protocols/oscar/oscar.c	Sat May 05 18:14:48 2007 +0000
@@ -5098,7 +5098,6 @@
 	purple_debug_info("oscar",
 			   "ssi: %s has given you permission to add him to your buddy list\n", sn);
 
-	/* XXX Should data->nick store the alias and nombre just have the sn? -evands */
 	buddy = purple_find_buddy(gc->account, sn);
 	if (buddy && (purple_buddy_get_alias_only(buddy)))
 		nombre = g_strdup_printf("%s (%s)", sn, purple_buddy_get_alias_only(buddy));
@@ -5106,10 +5105,12 @@
 		nombre = g_strdup(sn);
 
 	dialog_msg = g_strdup_printf(_("The user %s has given you permission to add you to their buddy list.  Do you want to add them?"), nombre);
+	g_free(nombre);
+
 	data = g_new(struct name_data, 1);
 	data->gc = gc;
 	data->name = g_strdup(sn);
-	data->nick = NULL;
+	data->nick = (buddy ? g_strdup(purple_buddy_get_alias_only(buddy)) : NULL);
 
 	purple_request_yes_no(gc, NULL, _("Authorization Given"), dialog_msg,
 						PURPLE_DEFAULT_ACTION_NONE,
@@ -5117,9 +5118,7 @@
 						data,
 						G_CALLBACK(purple_icq_buddyadd),
 						G_CALLBACK(oscar_free_name_data));
-
 	g_free(dialog_msg);
-	g_free(nombre);
 
 	return 1;
 }
@@ -5130,7 +5129,6 @@
 	char *sn;
 	char *msg;
 	PurpleAccount *account = purple_connection_get_account(gc);
-	gchar *nombre;
 	gchar *reason = NULL;
 	struct name_data *data;
 	PurpleBuddy *buddy;
@@ -5144,10 +5142,6 @@
 			   "ssi: received authorization request from %s\n", sn);
 
 	buddy = purple_find_buddy(account, sn);
-	if (buddy && (purple_buddy_get_alias_only(buddy)))
-		nombre = g_strdup_printf("%s (%s)", sn, purple_buddy_get_alias_only(buddy));
-	else
-		nombre = g_strdup(sn);
 
 	if (msg != NULL)
 		reason = purple_plugin_oscar_decode_im_part(account, sn, AIM_CHARSET_CUSTOM, 0x0000, msg, strlen(msg));
@@ -5155,12 +5149,12 @@
 	data = g_new(struct name_data, 1);
 	data->gc = gc;
 	data->name = g_strdup(sn);
-	data->nick = NULL;
-
-	purple_account_request_authorization(account, nombre, NULL, NULL,
+	data->nick = (buddy ? g_strdup(purple_buddy_get_alias_only(buddy)) : NULL);
+
+	purple_account_request_authorization(account, sn, NULL,
+			(buddy ? purple_buddy_get_alias_only(buddy) : NULL),
 			reason, buddy != NULL, G_CALLBACK(purple_auth_grant),
 			G_CALLBACK(purple_auth_dontgrant_msgprompt), data);
-	g_free(nombre);
 	g_free(reason);
 
 	return 1;
@@ -5791,8 +5785,8 @@
 	comment_utf8 = comment ? oscar_utf8_try_convert(gc->account, comment) : NULL;
 
 	data->gc = gc;
-	data->name = g_strdup(buddy->name);
-	data->nick = NULL;
+	data->name = g_strdup(purple_buddy_get_name(buddy));
+	data->nick = g_strdup(purple_buddy_get_alias_only(buddy));
 
 	title = g_strdup_printf(_("Buddy Comment for %s"), data->name);
 	purple_request_input(gc, title, _("Buddy Comment:"), NULL,