gobjectification: 95d27dfe: Do a similar replacement for MSN with th...

qulogic at pidgin.im qulogic at pidgin.im
Wed Aug 13 00:51:08 EDT 2008


-----------------------------------------------------------------
Revision: 95d27dfeb5abcc926e73f2eeb69f8145c8c8606e
Ancestor: 98362897a71f535d36df5fbde6edd629c5f2270f
Author: qulogic at pidgin.im
Date: 2008-08-13T04:41:24
Branch: im.pidgin.gobjectification
URL: http://d.pidgin.im/viewmtn/revision/info/95d27dfeb5abcc926e73f2eeb69f8145c8c8606e

Modified files:
        libpurple/protocols/msn/userlist.c
        libpurple/protocols/msnp9/userlist.c

ChangeLog: 

Do a similar replacement for MSN with the PURPLE_CONNECTION_IS_VALID 
thing and g_object_ref magic.

-------------- next part --------------
============================================================
--- libpurple/protocols/msn/userlist.c	8dfc23c31785ca40f1c816e16a4d9c99a909087f
+++ libpurple/protocols/msn/userlist.c	f0e2819f07b3c2276d0ae12b2c84e27016fad186
@@ -46,7 +46,7 @@ msn_accept_add_cb(gpointer data)
 
 	purple_debug_misc("msn", "Accepted the new buddy: %s\n", pa->who);
 
-	if (PURPLE_CONNECTION_IS_VALID(pa->gc))
+	if (PURPLE_CONNECTION_IS_CONNECTED(pa->gc))
 	{
 		MsnSession *session = purple_object_get_protocol_data(PURPLE_OBJECT(pa->gc));
 		MsnUserList *userlist = session->userlist;
@@ -58,6 +58,7 @@ msn_accept_add_cb(gpointer data)
 
 	g_free(pa->who);
 	g_free(pa->friendly);
+	g_object_unref(G_OBJECT(pa->gc));
 	g_free(pa);
 }
 
@@ -68,7 +69,7 @@ msn_cancel_add_cb(gpointer data)
 
 	purple_debug_misc("msn", "Denied the new buddy: %s\n", pa->who);
 
-	if (PURPLE_CONNECTION_IS_VALID(pa->gc))
+	if (PURPLE_CONNECTION_IS_CONNECTED(pa->gc))
 	{
 		MsnSession *session = purple_object_get_protocol_data(PURPLE_OBJECT(pa->gc));
 		MsnUserList *userlist = session->userlist;
@@ -82,6 +83,7 @@ msn_cancel_add_cb(gpointer data)
 
 	g_free(pa->who);
 	g_free(pa->friendly);
+	g_object_unref(G_OBJECT(pa->gc));
 	g_free(pa);
 }
 
@@ -99,7 +101,8 @@ got_new_entry(PurpleConnection *gc, cons
 	acct = purple_connection_get_account(gc);
 	purple_account_request_authorization(acct, passport, NULL, friendly, NULL,
 										 purple_find_buddy(acct, passport) != NULL,
-										 msn_accept_add_cb, msn_cancel_add_cb, pa);
+										 msn_accept_add_cb, msn_cancel_add_cb,
+										 g_object_ref(G_OBJECT(pa)));
 
 }
 
============================================================
--- libpurple/protocols/msnp9/userlist.c	bb60da1377dd7cddaa8460e6e6811ea8c80e2922
+++ libpurple/protocols/msnp9/userlist.c	fafdd024222ed32ccd61b5b65f1b2b230b8b9f3f
@@ -44,7 +44,7 @@ msn_accept_add_cb(gpointer data)
 	MsnSession *session;
 	MsnUserList *userlist;
 
-	if (PURPLE_CONNECTION_IS_VALID(pa->gc)) {
+	if (PURPLE_CONNECTION_IS_CONNECTED(pa->gc)) {
 		session = purple_object_get_protocol_data(PURPLE_OBJECT(pa->gc));
 		userlist = session->userlist;
 
@@ -53,6 +53,7 @@ msn_accept_add_cb(gpointer data)
 
 	g_free(pa->who);
 	g_free(pa->friendly);
+	g_object_unref(G_OBJECT(pa->gc));
 	g_free(pa);
 }
 
@@ -63,7 +64,7 @@ msn_cancel_add_cb(gpointer data)
 	MsnSession *session;
 	MsnUserList *userlist;
 
-	if (PURPLE_CONNECTION_IS_VALID(pa->gc)) {
+	if (PURPLE_CONNECTION_IS_CONNECTED(pa->gc)) {
 		session = purple_object_get_protocol_data(PURPLE_OBJECT(pa->gc));
 		userlist = session->userlist;
 
@@ -72,6 +73,7 @@ msn_cancel_add_cb(gpointer data)
 
 	g_free(pa->who);
 	g_free(pa->friendly);
+	g_object_unref(G_OBJECT(pa->gc));
 	g_free(pa);
 }
 
@@ -87,7 +89,8 @@ got_new_entry(PurpleConnection *gc, cons
 	
 	purple_account_request_authorization(purple_connection_get_account(gc), passport, NULL, friendly, NULL,
 					   purple_find_buddy(purple_connection_get_account(gc), passport) != NULL,
-					   msn_accept_add_cb, msn_cancel_add_cb, pa);
+					   msn_accept_add_cb, msn_cancel_add_cb,
+					   g_object_ref(G_OBJECT(pa)));
 }
 
 /**************************************************************************


More information about the Commits mailing list