pidgin: 9f1793f1: Rather access PurpleBuddy->proto_data us...

andrew.victor at mxit.com andrew.victor at mxit.com
Tue Aug 23 17:46:00 EDT 2011


----------------------------------------------------------------------
Revision: 9f1793f116343561096097a6b2083faabd04eccd
Parent:   26e5b871bbc256c56e36eb87726f3c58a4b8ce2f
Author:   andrew.victor at mxit.com
Date:     08/23/11 16:57:19
Branch:   im.pidgin.pidgin
URL: http://d.pidgin.im/viewmtn/revision/info/9f1793f116343561096097a6b2083faabd04eccd

Changelog: 

Rather access PurpleBuddy->proto_data using the accessor functions.


Changes against parent 26e5b871bbc256c56e36eb87726f3c58a4b8ce2f

  patched  libpurple/protocols/mxit/roster.c

-------------- next part --------------
============================================================
--- libpurple/protocols/mxit/roster.c	ae6f9c71fb91f9383a7118f6d4a7c7f44bbf6d9e
+++ libpurple/protocols/mxit/roster.c	556b93161c6b7b3bda59e690bc7d68ee2a07af00
@@ -293,14 +293,15 @@ static PurpleBuddy* mxit_update_buddy_gr
  */
 static PurpleBuddy* mxit_update_buddy_group( struct MXitSession* session, PurpleBuddy* buddy, PurpleGroup* group )
 {
-	struct contact*		contact			= NULL;
 	PurpleGroup*		current_group	= purple_buddy_get_group( buddy );
-	PurpleBuddy*		newbuddy		= NULL;
 
 	/* make sure the groups actually differs */
 	if ( strcmp( current_group->name, group->name ) != 0 ) {
 		/* groupnames does not match, so we need to make the update */
 
+		struct contact*		contact		= purple_buddy_get_protocol_data( buddy );
+		PurpleBuddy*		newbuddy	= NULL;
+
 		purple_debug_info( MXIT_PLUGIN_ID, "Moving '%s' from group '%s' to '%s'\n", buddy->alias, current_group->name, group->name );
 
 		/*
@@ -310,9 +311,9 @@ static PurpleBuddy* mxit_update_buddy_gr
 		 * again. This is really not ideal and very irritating, but how else then?
 		 */
 
-		/* create new buddy */
+		/* create new buddy, and transfer 'contact' data */
 		newbuddy = purple_buddy_new( session->acc, buddy->name, buddy->alias );
-		purple_buddy_set_protocol_data( newbuddy, purple_buddy_get_protocol_data( buddy ) );
+		purple_buddy_set_protocol_data( newbuddy, contact );
 		purple_buddy_set_protocol_data( buddy, NULL );
 
 		/* remove the buddy */
@@ -322,7 +323,6 @@ static PurpleBuddy* mxit_update_buddy_gr
 		purple_blist_add_buddy( newbuddy, NULL, group, NULL );
 
 		/* now re-instate his presence again */
-		contact = newbuddy->proto_data;
 		if ( contact ) {
 
 			/* update the buddy's status (reference: "libpurple/prpl.h") */


More information about the Commits mailing list