diff libpurple/protocols/mxit/mxit.c @ 29786:f549ad844d54

propagate from branch 'im.pidgin.pidgin.next.minor' (head 42544ec892337510146c931806a95dbf69c2fe30) to branch 'im.pidgin.pidgin' (head 32a27a2c6eebcccdecd7d7cd420b3789c69cbb09)
author Mark Doliner <mark@kingant.net>
date Thu, 18 Feb 2010 09:22:01 +0000
parents 81ea740f92a4 ecc6217baa1e
children 2cb6ea4420a0
line wrap: on
line diff
--- a/libpurple/protocols/mxit/mxit.c	Thu Feb 18 09:20:29 2010 +0000
+++ b/libpurple/protocols/mxit/mxit.c	Thu Feb 18 09:22:01 2010 +0000
@@ -189,7 +189,11 @@
 
 	/* find the buddy object */
 	buddy = purple_find_buddy( session->acc, who );
-	if ( ( !buddy ) || ( !buddy->proto_data ) )
+	if ( !buddy )
+		return;
+
+	contact = purple_buddy_get_protocol_data(buddy);
+	if ( !contact )
 		return;
 
 	/* we ignore all conversations with which we have chatted with in this session */
@@ -197,7 +201,6 @@
 		return;
 
 	/* determite if this buddy is a MXit service */
-	contact = buddy->proto_data;
 	switch ( contact->type ) {
 		case MXIT_TYPE_BOT :
 		case MXIT_TYPE_CHATROOM :
@@ -259,7 +262,7 @@
  */
 static const char* mxit_list_emblem( PurpleBuddy* buddy )
 {
-	struct contact*	contact = buddy->proto_data;
+	struct contact*	contact = purple_buddy_get_protocol_data(buddy);
 
 	if ( !contact )
 		return NULL;
@@ -300,7 +303,7 @@
  */
 char* mxit_status_text( PurpleBuddy* buddy )
 {
-	struct contact*	contact = buddy->proto_data;
+	struct contact*	contact = purple_buddy_get_protocol_data(buddy);
 
 	if ( !contact )
 		return NULL;
@@ -325,7 +328,7 @@
  */
 static void mxit_tooltip( PurpleBuddy* buddy, PurpleNotifyUserInfo* info, gboolean full )
 {
-	struct contact*	contact = buddy->proto_data;
+	struct contact*	contact = purple_buddy_get_protocol_data(buddy);
 
 	if ( !contact )
 		return;
@@ -461,7 +464,7 @@
 
 	purple_debug_info( MXIT_PLUGIN_ID, "mxit_free_buddy\n" );
 
-	contact = buddy->proto_data;
+	contact = purple_buddy_get_protocol_data(buddy);
 	if ( contact ) {
 		if ( contact->statusMsg )
 			g_free( contact->statusMsg );
@@ -469,7 +472,8 @@
 			g_free( contact->avatarId );
 		g_free( contact );
 	}
-	buddy->proto_data = NULL;
+
+	purple_buddy_set_protocol_data(buddy, NULL);
 }