gobjectification: 491ea758: Fixed crash when opening a conversation.

gillux at soc.pidgin.im gillux at soc.pidgin.im
Fri Jun 1 16:51:29 EDT 2012


----------------------------------------------------------------------
Revision: 491ea758f5821699082883635e903827e37d16a3
Parent:   c2334777f9c0d81115d5845188c1c2e089a9d488
Author:   gillux at soc.pidgin.im
Date:     06/01/12 16:47:41
Branch:   im.pidgin.gobjectification
URL: http://d.pidgin.im/viewmtn/revision/info/491ea758f5821699082883635e903827e37d16a3

Changelog: 

Fixed crash when opening a conversation.
PurpleConversation is not a PurpleObject yet,
so don't mix up struct-based and GObject-based code.

Changes against parent c2334777f9c0d81115d5845188c1c2e089a9d488

  patched  pidgin/gtkconv.c
  patched  pidgin/gtkconv.h

-------------- next part --------------
============================================================
--- pidgin/gtkconv.c	ae9c9251dbf28ca04d379ae0d1e8500a400559d0
+++ pidgin/gtkconv.c	5bcc4c41c3dcc3d422360974203b9ebca7b63201
@@ -5291,8 +5291,8 @@ pidgin_conv_find_gtkconv(PurpleConversat
 		PurpleBuddy *b = PURPLE_BUDDY(bn);
 		PurpleConversation *conv;
 		if ((conv = purple_find_conversation_with_account(PURPLE_CONV_TYPE_IM, purple_buddy_get_name(b), purple_buddy_get_account(b)))) {
-			if (purple_object_get_ui_data(PURPLE_OBJECT(conv)))
-				return purple_object_get_ui_data(PURPLE_OBJECT(conv));
+			if (purple_conversation_get_ui_data(conv))
+				return purple_conversation_get_ui_data(conv);
 		}
 	}
 
@@ -5380,7 +5380,7 @@ private_gtkconv_new(PurpleConversation *
 	PurpleAccount *account;
 
 	if (conv_type == PURPLE_CONV_TYPE_IM && (gtkconv = pidgin_conv_find_gtkconv(conv))) {
-		purple_object_set_ui_data(PURPLE_OBJECT(conv), gtkconv);
+		purple_conversation_set_ui_data(conv, gtkconv);
 		if (!g_list_find(gtkconv->convs, conv))
 			gtkconv->convs = g_list_prepend(gtkconv->convs, conv);
 		pidgin_conv_switch_active_conversation(conv);
@@ -5388,7 +5388,7 @@ private_gtkconv_new(PurpleConversation *
 	}
 
 	gtkconv = g_new0(PidginConversation, 1);
-	purple_object_set_ui_data(PURPLE_OBJECT(conv), gtkconv);
+	purple_conversation_set_ui_data(conv, gtkconv);
 	gtkconv->active_conv = conv;
 	gtkconv->convs = g_list_prepend(gtkconv->convs, conv);
 	gtkconv->send_history = g_list_append(NULL, NULL);
@@ -5415,7 +5415,7 @@ private_gtkconv_new(PurpleConversation *
 			g_free(gtkconv->u.im);
 
 		g_free(gtkconv);
-		purple_object_set_ui_data(PURPLE_OBJECT(conv), NULL);
+		purple_conversation_set_ui_data(conv, NULL);
 		return;
 	}
 
============================================================
--- pidgin/gtkconv.h	aa4895dd2c727f4bb89c261c8027086e3d6faf50
+++ pidgin/gtkconv.h	6e10f3e6756d66aa88b06f6ef2af1055d2741f4c
@@ -56,7 +56,7 @@ enum {
 };
 
 #define PIDGIN_CONVERSATION(conv) \
-	((PidginConversation *)purple_object_get_ui_data(PURPLE_OBJECT(conv)))
+	((PidginConversation *)purple_conversation_get_ui_data(conv))
 
 #define PIDGIN_IS_PIDGIN_CONVERSATION(conv) \
 	(purple_conversation_get_ui_ops(conv) == \


More information about the Commits mailing list