pidgin: af57d7a8: Update yahoo prpl to use purple_whiteboa...

andrew.victor at mxit.com andrew.victor at mxit.com
Tue Aug 30 18:26:50 EDT 2011


----------------------------------------------------------------------
Revision: af57d7a8b36956896c8ed439c0fee77a4672ff68
Parent:   4eb3a9328e7aa43404e63367e129590663678489
Author:   andrew.victor at mxit.com
Date:     08/30/11 17:00:29
Branch:   im.pidgin.pidgin
URL: http://d.pidgin.im/viewmtn/revision/info/af57d7a8b36956896c8ed439c0fee77a4672ff68

Changelog: 

Update yahoo prpl to use purple_whiteboard_get_protocol_data() and purple_whiteboard_set_protocol_data().


Changes against parent 4eb3a9328e7aa43404e63367e129590663678489

  patched  libpurple/protocols/yahoo/libymsg.c
  patched  libpurple/protocols/yahoo/yahoo_doodle.c

-------------- next part --------------
============================================================
--- libpurple/protocols/yahoo/libymsg.c	856d97927e7a317deb7093bfbc5cc0cf76d10d1b
+++ libpurple/protocols/yahoo/libymsg.c	ddc4e121826f5e9b8cf199ff182d545e053d3d5a
@@ -1061,7 +1061,7 @@ static void yahoo_process_message(Purple
 							doodle_session *ds;
 							wb = purple_whiteboard_create(account, im->from,
 											DOODLE_STATE_REQUESTED);
-							ds = wb->proto_data;
+							ds = purple_whiteboard_get_protocol_data(wb);
 							ds->imv_key = g_strdup(pair->value);
 
 							yahoo_doodle_command_send_request(gc, im->from, pair->value);
============================================================
--- libpurple/protocols/yahoo/yahoo_doodle.c	ed0a4695020d83ba6334739310332530da92f3e9
+++ libpurple/protocols/yahoo/yahoo_doodle.c	2f9d4cca29143a925fce85d21c9dfb9a72201367
@@ -161,7 +161,7 @@ static void yahoo_doodle_command_got_req
 		*/
 
 		wb = purple_whiteboard_create(account, from, DOODLE_STATE_REQUESTED);
-		ds = wb->proto_data;
+		ds = purple_whiteboard_get_protocol_data(wb);
 		ds->imv_key = g_strdup(imv_key);
 
 		yahoo_doodle_command_send_ready(gc, from, imv_key);
@@ -191,7 +191,7 @@ static void yahoo_doodle_command_got_rea
 
 	if(wb->state == DOODLE_STATE_REQUESTING)
 	{
-		doodle_session *ds = wb->proto_data;
+		doodle_session *ds = purple_whiteboard_get_protocol_data(wb);
 		purple_whiteboard_start(wb);
 
 		wb->state = DOODLE_STATE_ESTABLISHED;
@@ -450,13 +450,13 @@ void yahoo_doodle_start(PurpleWhiteboard
 	ds->brush_size  = DOODLE_BRUSH_SMALL;
 	ds->brush_color = DOODLE_COLOR_RED;
 
-	wb->proto_data = ds;
+	purple_whiteboard_set_protocol_data(wb, ds);
 }
 
 void yahoo_doodle_end(PurpleWhiteboard *wb)
 {
 	PurpleConnection *gc = purple_account_get_connection(wb->account);
-	doodle_session *ds = wb->proto_data;
+	doodle_session *ds = purple_whiteboard_get_protocol_data(wb);
 
 	/* g_debug_debug("yahoo", "doodle: yahoo_doodle_end()\n"); */
 
@@ -464,7 +464,8 @@ void yahoo_doodle_end(PurpleWhiteboard *
 		yahoo_doodle_command_send_shutdown(gc, wb->who);
 
 	g_free(ds->imv_key);
-	g_free(wb->proto_data);
+	g_free(ds);
+	purple_whiteboard_set_protocol_data(wb, NULL);
 }
 
 void yahoo_doodle_get_dimensions(const PurpleWhiteboard *wb, int *width, int *height)
@@ -494,7 +495,7 @@ void yahoo_doodle_send_draw_list(PurpleW
 
 void yahoo_doodle_send_draw_list(PurpleWhiteboard *wb, GList *draw_list)
 {
-	doodle_session *ds = wb->proto_data;
+	doodle_session *ds = purple_whiteboard_get_protocol_data(wb);
 	char *message;
 
 	g_return_if_fail(draw_list != NULL);
@@ -506,7 +507,7 @@ void yahoo_doodle_clear(PurpleWhiteboard
 
 void yahoo_doodle_clear(PurpleWhiteboard *wb)
 {
-	doodle_session *ds = wb->proto_data;
+	doodle_session *ds = purple_whiteboard_get_protocol_data(wb);
 	yahoo_doodle_command_send_clear(wb->account->gc, wb->who, ds->imv_key);
 }
 
@@ -560,14 +561,14 @@ void yahoo_doodle_get_brush(const Purple
 
 void yahoo_doodle_get_brush(const PurpleWhiteboard *wb, int *size, int *color)
 {
-	doodle_session *ds = wb->proto_data;
+	doodle_session *ds = purple_whiteboard_get_protocol_data(wb);
 	*size = ds->brush_size;
 	*color = ds->brush_color;
 }
 
 void yahoo_doodle_set_brush(PurpleWhiteboard *wb, int size, int color)
 {
-	doodle_session *ds = wb->proto_data;
+	doodle_session *ds = purple_whiteboard_get_protocol_data(wb);
 	ds->brush_size = size;
 	ds->brush_color = color;
 


More information about the Commits mailing list