changeset 27761:329c9cc323fb

propagate from branch 'im.pidgin.pidgin' (head 459f009bbc5c632b8f92f56fc2fc0239f207994c) to branch 'im.pidgin.pidgin.yaz' (head 58bee2bf50931c8a7664890c4ee2cd5892dc7457)
author Yoshiki Yazawa <yaz@honeyplanet.jp>
date Thu, 31 Jan 2008 09:30:48 +0000
parents f60ce471c174 (diff) e9cf897bd873 (current diff)
children 5a8cb321a58a
files libpurple/protocols/yahoo/yahoo.c
diffstat 5 files changed, 94 insertions(+), 70 deletions(-) [+]
line wrap: on
line diff
--- a/finch/libgnt/gnttree.c	Wed Jan 30 10:53:22 2008 +0000
+++ b/finch/libgnt/gnttree.c	Thu Jan 31 09:30:48 2008 +0000
@@ -684,7 +684,7 @@
 	GntTreeRow *row = tree->current;
 	int dist;
 
-	if (!row->parent || SEARCHING(tree))
+	if (!row || !row->parent || SEARCHING(tree))
 		return FALSE;
 
 	tree->current = row->parent;
--- a/finch/libgnt/gnttree.h	Wed Jan 30 10:53:22 2008 +0000
+++ b/finch/libgnt/gnttree.h	Thu Jan 31 09:30:48 2008 +0000
@@ -332,7 +332,7 @@
  * @param color  The color
  * @since 2.4.0
  */
-void gnt_tree_set_row_color(GntTree *, void *, int);
+void gnt_tree_set_row_color(GntTree *tree, void *key, int color);
 
 /**
  * Select a row.
--- a/libpurple/account.c	Wed Jan 30 10:53:22 2008 +0000
+++ b/libpurple/account.c	Thu Jan 31 09:30:48 2008 +0000
@@ -2200,9 +2200,13 @@
 {
 	PurplePluginProtocolInfo *prpl_info = NULL;
 	PurpleConnection *gc = purple_account_get_connection(account);
-
-	if (gc != NULL && gc->prpl != NULL)
-		prpl_info = PURPLE_PLUGIN_PROTOCOL_INFO(gc->prpl);
+	PurplePlugin *prpl = NULL;
+	
+	if (gc != NULL)
+	        prpl = purple_connection_get_prpl(gc);      
+
+	if (prpl != NULL)
+		prpl_info = PURPLE_PLUGIN_PROTOCOL_INFO(prpl);
 
 	if (prpl_info != NULL && prpl_info->add_buddy != NULL)
 		prpl_info->add_buddy(gc, buddy, purple_buddy_get_group(buddy));
@@ -2213,10 +2217,14 @@
 {
 	PurplePluginProtocolInfo *prpl_info = NULL;
 	PurpleConnection *gc = purple_account_get_connection(account);
-
-	if (gc != NULL && gc->prpl != NULL)
-		prpl_info = PURPLE_PLUGIN_PROTOCOL_INFO(gc->prpl);
-
+	PurplePlugin *prpl = NULL;
+	
+	if (gc != NULL)
+	        prpl = purple_connection_get_prpl(gc);      
+
+	if (prpl != NULL)
+		prpl_info = PURPLE_PLUGIN_PROTOCOL_INFO(prpl);
+		
 	if (prpl_info) {
 		GList *cur, *groups = NULL;
 
@@ -2248,10 +2256,14 @@
 {
 	PurplePluginProtocolInfo *prpl_info = NULL;
 	PurpleConnection *gc = purple_account_get_connection(account);
-
-	if (gc != NULL && gc->prpl != NULL)
-		prpl_info = PURPLE_PLUGIN_PROTOCOL_INFO(gc->prpl);
-
+	PurplePlugin *prpl = NULL;
+	
+	if (gc != NULL)
+	        prpl = purple_connection_get_prpl(gc);      
+
+	if (prpl != NULL)
+		prpl_info = PURPLE_PLUGIN_PROTOCOL_INFO(prpl);
+		
 	if (prpl_info && prpl_info->remove_buddy)
 		prpl_info->remove_buddy(gc, buddy, group);
 }
@@ -2261,10 +2273,14 @@
 {
 	PurplePluginProtocolInfo *prpl_info = NULL;
 	PurpleConnection *gc = purple_account_get_connection(account);
-
-	if (gc != NULL && gc->prpl != NULL)
-		prpl_info = PURPLE_PLUGIN_PROTOCOL_INFO(gc->prpl);
-
+	PurplePlugin *prpl = NULL;
+	
+	if (gc != NULL)
+	        prpl = purple_connection_get_prpl(gc);      
+
+	if (prpl != NULL)
+		prpl_info = PURPLE_PLUGIN_PROTOCOL_INFO(prpl);
+		
 	if (prpl_info) {
 		if (prpl_info->remove_buddies)
 			prpl_info->remove_buddies(gc, buddies, groups);
@@ -2285,9 +2301,13 @@
 {
 	PurplePluginProtocolInfo *prpl_info = NULL;
 	PurpleConnection *gc = purple_account_get_connection(account);
-
-	if (gc != NULL && gc->prpl != NULL)
-		prpl_info = PURPLE_PLUGIN_PROTOCOL_INFO(gc->prpl);
+	PurplePlugin *prpl = NULL;
+	
+	if (gc != NULL)
+	        prpl = purple_connection_get_prpl(gc);      
+
+	if (prpl != NULL)
+		prpl_info = PURPLE_PLUGIN_PROTOCOL_INFO(prpl);
 
 	if (prpl_info && prpl_info->remove_group)
 		prpl_info->remove_group(gc, group);
@@ -2299,11 +2319,15 @@
 {
 	PurplePluginProtocolInfo *prpl_info = NULL;
 	PurpleConnection *gc = purple_account_get_connection(account);
-
+	PurplePlugin *prpl = NULL;
+	
 	purple_account_set_password(account, new_pw);
-
-	if (gc != NULL && gc->prpl != NULL)
-		prpl_info = PURPLE_PLUGIN_PROTOCOL_INFO(gc->prpl);
+	
+	if (gc != NULL)
+	        prpl = purple_connection_get_prpl(gc);      
+
+	if (prpl != NULL)
+		prpl_info = PURPLE_PLUGIN_PROTOCOL_INFO(prpl);
 
 	if (prpl_info && prpl_info->change_passwd)
 		prpl_info->change_passwd(gc, orig_pw, new_pw);
@@ -2312,16 +2336,20 @@
 gboolean purple_account_supports_offline_message(PurpleAccount *account, PurpleBuddy *buddy)
 {
 	PurpleConnection *gc;
-	PurplePluginProtocolInfo *prpl_info;
-
+	PurplePluginProtocolInfo *prpl_info = NULL;
+	PurplePlugin *prpl = NULL;
+	
 	g_return_val_if_fail(account, FALSE);
 	g_return_val_if_fail(buddy, FALSE);
 
 	gc = purple_account_get_connection(account);
 	if (gc == NULL)
 		return FALSE;
-
-	prpl_info = PURPLE_PLUGIN_PROTOCOL_INFO(gc->prpl);
+	
+	prpl = purple_connection_get_prpl(gc);      
+
+	if (prpl != NULL)
+		prpl_info = PURPLE_PLUGIN_PROTOCOL_INFO(prpl);
 
 	if (!prpl_info || !prpl_info->offline_message)
 		return FALSE;
--- a/libpurple/protocols/yahoo/yahoo.c	Wed Jan 30 10:53:22 2008 +0000
+++ b/libpurple/protocols/yahoo/yahoo.c	Thu Jan 31 09:30:48 2008 +0000
@@ -975,22 +975,20 @@
 };
 
 static void
-yahoo_buddy_add_authorize_cb(gpointer data) {
+yahoo_buddy_add_authorize_cb(gpointer data)
+{
 	struct yahoo_add_request *add_req = data;
-
-	if (PURPLE_CONNECTION_IS_VALID(add_req->gc)) {
-		struct yahoo_packet *pkt;
-		struct yahoo_data *yd = add_req->gc->proto_data;
-
-		pkt = yahoo_packet_new(YAHOO_SERVICE_AUTH_REQ_15, YAHOO_STATUS_AVAILABLE, 0);
-		yahoo_packet_hash(pkt, "ssiii",
-						  1, add_req->id,
-						  5, add_req->who,
-						  241, add_req->protocol,
-						  13, 1,
-						  334, 0);
-		yahoo_packet_send_and_free(pkt, yd);
-	}
+	struct yahoo_packet *pkt;
+	struct yahoo_data *yd = add_req->gc->proto_data;
+
+	pkt = yahoo_packet_new(YAHOO_SERVICE_AUTH_REQ_15, YAHOO_STATUS_AVAILABLE, 0);
+	yahoo_packet_hash(pkt, "ssiii",
+					  1, add_req->id,
+					  5, add_req->who,
+					  241, add_req->protocol,
+					  13, 1,
+					  334, 0);
+	yahoo_packet_send_and_free(pkt, yd);
 
 	g_free(add_req->id);
 	g_free(add_req->who);
@@ -998,32 +996,30 @@
 }
 
 static void
-yahoo_buddy_add_deny_cb(struct yahoo_add_request *add_req, const char *msg) {
-
-	if (PURPLE_CONNECTION_IS_VALID(add_req->gc)) {
-		struct yahoo_data *yd = add_req->gc->proto_data;
-		struct yahoo_packet *pkt;
-		char *encoded_msg = NULL;
-		PurpleAccount *account = purple_connection_get_account(add_req->gc);
-
-		if (msg && *msg)
-			encoded_msg = yahoo_string_encode(add_req->gc, msg, NULL);
-
-		pkt = yahoo_packet_new(YAHOO_SERVICE_AUTH_REQ_15,
-				YAHOO_STATUS_AVAILABLE, 0);
-
-		yahoo_packet_hash(pkt, "ssiiis",
-				1, purple_normalize(account, purple_account_get_username(account)),
-				5, add_req->who,
-				13, 2,
-				334, 0,
-				97, 1,
-				14, encoded_msg ? encoded_msg : "");
-
-		yahoo_packet_send_and_free(pkt, yd);
-
-		g_free(encoded_msg);
-	}
+yahoo_buddy_add_deny_cb(struct yahoo_add_request *add_req, const char *msg)
+{
+	struct yahoo_data *yd = add_req->gc->proto_data;
+	struct yahoo_packet *pkt;
+	char *encoded_msg = NULL;
+	PurpleAccount *account = purple_connection_get_account(add_req->gc);
+
+	if (msg && *msg)
+		encoded_msg = yahoo_string_encode(add_req->gc, msg, NULL);
+
+	pkt = yahoo_packet_new(YAHOO_SERVICE_AUTH_REQ_15,
+			YAHOO_STATUS_AVAILABLE, 0);
+
+	yahoo_packet_hash(pkt, "ssiiis",
+			1, purple_normalize(account, purple_account_get_username(account)),
+			5, add_req->who,
+			13, 2,
+			334, 0,
+			97, 1,
+			14, encoded_msg ? encoded_msg : "");
+
+	yahoo_packet_send_and_free(pkt, yd);
+
+	g_free(encoded_msg);
 
 	g_free(add_req->id);
 	g_free(add_req->who);
--- a/pidgin/pidgintooltip.h	Wed Jan 30 10:53:22 2008 +0000
+++ b/pidgin/pidgintooltip.h	Thu Jan 31 09:30:48 2008 +0000
@@ -88,7 +88,7 @@
  * @since 2.4.0
  */
 gboolean pidgin_tooltip_setup_for_widget(GtkWidget *widget, gpointer userdata,
-		PidginTooltipCreate create_tooltip, PidginTooltipPaint paint_tooltip);
+		PidginTooltipCreate create_cb, PidginTooltipPaint paint_cb);
 
 /**
  * Destroy the tooltip.