# HG changeset patch # User andrew.victor@mxit.com # Date 1314133039 0 # Node ID e9ea7790482992142668bd257014b7684cca3c43 # Parent 2b387aaeb89d057022ab1006f3f216fbc259061c Rather access PurpleBuddy->proto_data using the accessor functions. diff -r 2b387aaeb89d -r e9ea77904829 libpurple/protocols/mxit/roster.c --- a/libpurple/protocols/mxit/roster.c Tue Aug 23 20:48:43 2011 +0000 +++ b/libpurple/protocols/mxit/roster.c Tue Aug 23 20:57:19 2011 +0000 @@ -293,14 +293,15 @@ */ 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 @@ * 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 @@ 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") */