gobjectification: d1370966: Hide internals of things related to Purp...

sadrul at pidgin.im sadrul at pidgin.im
Mon Jul 19 10:38:03 EDT 2010


----------------------------------------------------------------------
Revision: d1370966525e1f2ca37bc0d52bd60aa774357abf
Parent:   47d158270a19780403c75e59f02cadb72e764a93
Author:   sadrul at pidgin.im
Date:     07/18/10 19:23:48
Branch:   im.pidgin.gobjectification
URL: http://d.pidgin.im/viewmtn/revision/info/d1370966525e1f2ca37bc0d52bd60aa774357abf

Changelog: 

Hide internals of things related to PurpleConversation.

This is the first step towards gobjectifying conversations. Some of the
plugins do not compile at this moment, but libpurple, the prpls, pidgin
and finch does.

Changes against parent 47d158270a19780403c75e59f02cadb72e764a93

  patched  finch/gntconv.c
  patched  finch/gntconv.h
  patched  finch/gntsound.c
  patched  libpurple/conversation.c
  patched  libpurple/conversation.h
  patched  libpurple/protocols/gg/gg.c
  patched  libpurple/protocols/irc/irc.c
  patched  libpurple/protocols/jabber/jabber.c
  patched  libpurple/protocols/sametime/sametime.c
  patched  libpurple/protocols/yahoo/libymsg.c
  patched  libpurple/protocols/yahoo/yahoochat.c
  patched  libpurple/protocols/zephyr/zephyr.c
  patched  libpurple/server.c
  patched  pidgin/gtkblist.c
  patched  pidgin/gtkconv.c
  patched  pidgin/gtkconv.h
  patched  pidgin/gtksound.c
  patched  pidgin/gtkutils.c

-------------- next part --------------
============================================================
--- libpurple/server.c	c55bbac39c8a1c63bb780dd803f28ceb2e888d93
+++ libpurple/server.c	9142906f8d23f5c07cd7653605017a798f3b2dd5
@@ -738,7 +738,7 @@ void serv_got_typing_stopped(PurpleConne
 	{
 		im = PURPLE_CONV_IM(conv);
 
-		if (im->typing_state == PURPLE_NOT_TYPING)
+		if (purple_conv_im_get_typing_state(im) == PURPLE_NOT_TYPING)
 			return;
 
 		purple_conv_im_stop_typing_timeout(im);
============================================================
--- libpurple/conversation.c	f1e366cc92bbdaffc5a2d047866a38147ad1fe31
+++ libpurple/conversation.c	259bc116ed897a7b05200055670e822ab66e930b
@@ -35,6 +35,111 @@
 
 #define SEND_TYPED_TIMEOUT_SECONDS 5
 
+/**
+ * Data specific to Instant Messages.
+ */
+struct _PurpleConvIm
+{
+	PurpleConversation *conv;            /**< The parent conversation.     */
+
+	PurpleTypingState typing_state;      /**< The current typing state.    */
+	guint  typing_timeout;             /**< The typing timer handle.     */
+	time_t type_again;                 /**< The type again time.         */
+	guint  send_typed_timeout;         /**< The type again timer handle. */
+
+	PurpleBuddyIcon *icon;               /**< The buddy icon.              */
+};
+
+/**
+ * Data specific to Chats.
+ */
+struct _PurpleConvChat
+{
+	PurpleConversation *conv;          /**< The parent conversation.      */
+
+	GList *in_room;                  /**< The users in the room.        */
+	GList *ignored;                  /**< Ignored users.                */
+	char  *who;                      /**< The person who set the topic. */
+	char  *topic;                    /**< The topic.                    */
+	int    id;                       /**< The chat ID.                  */
+	char *nick;                      /**< Your nick in this chat.       */
+
+	gboolean left;                   /**< We left the chat and kept the window open */
+};
+
+/**
+ * Data for "Chat Buddies"
+ */
+struct _PurpleConvChatBuddy
+{
+	char *name;                      /**< The chat participant's name in the chat. */
+	char *alias;                     /**< The chat participant's alias, if known;
+	                                  *   @a NULL otherwise.
+	                                  */
+	char *alias_key;                 /**< A string by which this buddy will be sorted,
+	                                  *   or @c NULL if the buddy should be sorted by
+	                                  *   its @c name.  (This is currently always @c
+	                                  *   NULL.)
+	                                  */
+	gboolean buddy;                  /**< @a TRUE if this chat participant is on the
+	                                  *   buddy list; @a FALSE otherwise.
+	                                  */
+	PurpleConvChatBuddyFlags flags;  /**< A bitwise OR of flags for this participant,
+	                                  *   such as whether they are a channel operator.
+	                                  */
+};
+
+/**
+ * Description of a conversation message
+ *
+ * @since 2.2.0
+ */
+struct _PurpleConvMessage
+{
+	char *who;
+	char *what;
+	PurpleMessageFlags flags;
+	time_t when;
+	PurpleConversation *conv;  /**< @since 2.3.0 */
+	char *alias;               /**< @since 2.3.0 */
+};
+
+/**
+ * A core representation of a conversation between two or more people.
+ *
+ * The conversation can be an IM or a chat.
+ */
+struct _PurpleConversation
+{
+	PurpleConversationType type;  /**< The type of conversation.          */
+
+	PurpleAccount *account;       /**< The user using this conversation.  */
+
+
+	char *name;                 /**< The name of the conversation.      */
+	char *title;                /**< The window title.                  */
+
+	gboolean logging;           /**< The status of logging.             */
+
+	GList *logs;                /**< This conversation's logs           */
+
+	union
+	{
+		PurpleConvIm   *im;       /**< IM-specific data.                  */
+		PurpleConvChat *chat;     /**< Chat-specific data.                */
+		void *misc;             /**< Misc. data.                        */
+
+	} u;
+
+	PurpleConversationUiOps *ui_ops;           /**< UI-specific operations. */
+	void *ui_data;                           /**< UI-specific data.       */
+
+	GHashTable *data;                        /**< Plugin-specific data.   */
+
+	PurpleConnectionFlags features; /**< The supported features */
+	GList *message_history;         /**< Message history, as a GList of PurpleConvMessage's */
+};
+
 static GList *conversations = NULL;
 static GList *ims = NULL;
 static GList *chats = NULL;
@@ -792,6 +897,24 @@ purple_conversation_get_name(const Purpl
 	return conv->name;
 }
 
+PurpleBuddy *
+purple_conversation_find_buddy(const PurpleConversation *conv)
+{
+	PurpleAccount *account = purple_conversation_get_account(conv);
+	const char *cname = purple_conversation_get_name(conv);
+
+	return purple_find_buddy(account, cname);
+}
+
+GSList *
+purple_conversation_find_buddies(const PurpleConversation *conv)
+{
+	PurpleAccount *account = purple_conversation_get_account(conv);
+	const char *cname = purple_conversation_get_name(conv);
+
+	return purple_find_buddies(account, cname);
+}
+
 void
 purple_conversation_set_logging(PurpleConversation *conv, gboolean log)
 {
@@ -2203,6 +2326,24 @@ purple_conv_chat_cb_get_name(PurpleConvC
 	return cb->name;
 }
 
+const char *
+purple_conv_chat_cb_get_alias(PurpleConvChatBuddy *cb)
+{
+	return cb->alias;
+}
+
+PurpleConvChatBuddyFlags
+purple_conv_chat_cb_get_flags(PurpleConvChatBuddy *cb)
+{
+	return cb->flags;
+}
+
+gboolean
+purple_conv_chat_cb_is_buddy(PurpleConvChatBuddy *cb)
+{
+	return cb->buddy;
+}
+
 GList *
 purple_conversation_get_extended_menu(PurpleConversation *conv)
 {
@@ -2251,6 +2392,18 @@ time_t purple_conversation_message_get_t
 	return msg->when;
 }
 
+const char *
+purple_conversation_message_get_alias(PurpleConvMessage *msg)
+{
+	return msg->alias;
+}
+
+PurpleConversation *
+purple_conversation_message_get_conversation(PurpleConvMessage *msg)
+{
+	return msg->conv;
+}
+
 gboolean
 purple_conversation_do_command(PurpleConversation *conv, const gchar *cmdline,
 				const gchar *markup, gchar **error)
============================================================
--- libpurple/protocols/irc/irc.c	e7d5dec3c2dd4a3396df20a908b6450d018f733c
+++ libpurple/protocols/irc/irc.c	915392f81a4ee924cb2afabbb08fe3ce12e36254
@@ -767,7 +767,7 @@ static int irc_chat_send(PurpleConnectio
 	}
 #endif
 	purple_markup_html_to_xhtml(what, NULL, &tmp);
-	args[0] = convo->name;
+	args[0] = purple_conversation_get_name(convo);
 	args[1] = tmp;
 
 	irc_cmd_privmsg(irc, "msg", NULL, args);
============================================================
--- libpurple/protocols/jabber/jabber.c	432434199ca3d68c38a81cafd5e6de94082e3a37
+++ libpurple/protocols/jabber/jabber.c	79828606c7442cc596b2a801d89a96962dcb17bf
@@ -3054,14 +3054,15 @@ static PurpleCmdRet jabber_cmd_buzz(Purp
 static PurpleCmdRet jabber_cmd_buzz(PurpleConversation *conv,
 		const char *cmd, char **args, char **error, void *data)
 {
-	PurpleConnection *gc = purple_account_get_connection(conv->account);
+	PurpleAccount *account = purple_conversation_get_account(conv);
+	PurpleConnection *gc = purple_account_get_connection(account);
 	JabberStream *js = purple_object_get_protocol_data(PURPLE_OBJECT(gc));
 	const gchar *who;
 	gchar *description;
 	PurpleBuddy *buddy;
 	const char *alias;
 	PurpleAttentionType *attn = 
-		purple_get_attention_type_from_code(conv->account, 0);
+		purple_get_attention_type_from_code(account, 0);
 
 	if (!args || !args[0]) {
 		/* use the buddy from conversation, if it's a one-to-one conversation */
@@ -3074,7 +3075,7 @@ static PurpleCmdRet jabber_cmd_buzz(Purp
 		who = args[0];
 	}
 
-	buddy = purple_find_buddy(conv->account, who);
+	buddy = purple_find_buddy(account, who);
 	if (buddy != NULL)
 		alias = purple_buddy_get_contact_alias(buddy);
 	else
@@ -3467,7 +3468,8 @@ jabber_cmd_mood(PurpleConversation *conv
 jabber_cmd_mood(PurpleConversation *conv,
 		const char *cmd, char **args, char **error, void *data)
 {
-	PurpleConnection *pc = purple_account_get_connection(conv->account);
+	PurpleAccount *account = purple_conversation_get_account(conv);
+	PurpleConnection *pc = purple_account_get_connection(account);
 	JabberStream *js = purple_object_get_protocol_data(PURPLE_OBJECT(pc));
 
 	if (js->pep) {
============================================================
--- libpurple/protocols/zephyr/zephyr.c	a7352985056139188ec8b4178006b7b37c08ac27
+++ libpurple/protocols/zephyr/zephyr.c	d523c9a2d713aeed72f78f28b97955dec630f9fd
@@ -2612,7 +2612,7 @@ static PurpleCmdRet zephyr_purple_cmd_in
 	 * one word isn't ideal either.	 */
 
 	PurpleConvChat *gcc = purple_conversation_get_chat_data(conv);
-	int id = gcc->id;
+	int id = purple_conv_chat_get_id(gcc);
 	const char* instance = args[0];
 	zephyr_chat_set_topic(purple_conversation_get_gc(conv),id,instance);
 	return PURPLE_CMD_RET_OK;
============================================================
--- libpurple/protocols/gg/gg.c	1efcb59b2de6449e269fa4e8623d5aaf70b96565
+++ libpurple/protocols/gg/gg.c	2b80dff9f2b8b4ef1cbd42ac8f4024b1da11ada5
@@ -2330,14 +2330,16 @@ static int ggp_chat_send(PurpleConnectio
 	gchar *msg;
 	uin_t *uins;
 	int count = 0;
+	const char *cname;
 
 	if ((conv = purple_find_chat(gc, id)) == NULL)
 		return -EINVAL;
 
+	cname = purple_conversation_get_name(conv);
 	for (l = info->chats; l != NULL; l = l->next) {
 		chat = l->data;
 
-		if (g_utf8_collate(chat->name, conv->name) == 0) {
+		if (g_utf8_collate(chat->name, cname) == 0) {
 			break;
 		}
 
============================================================
--- libpurple/protocols/yahoo/libymsg.c	b8d42355b3fc14580407a40c74a364a48d81e891
+++ libpurple/protocols/yahoo/libymsg.c	bd08233f62c7367ad8f3e6b0e0af3888c09089d2
@@ -5198,7 +5198,8 @@ yahoopurple_cmd_buzz(PurpleConversation 
 	if (*args && args[0])
 		return PURPLE_CMD_RET_FAILED;
 
-	purple_prpl_send_attention(purple_account_get_connection(account), c->name, YAHOO_BUZZ);
+	purple_prpl_send_attention(purple_account_get_connection(account),
+			purple_conversation_get_name(c), YAHOO_BUZZ);
 
 	return PURPLE_CMD_RET_OK;
 }
@@ -5256,7 +5257,7 @@ gboolean yahoo_send_attention(PurpleConn
 	g_return_val_if_fail(c != NULL, FALSE);
 
 	purple_debug_info("yahoo", "Sending <ding> on account %s to buddy %s.\n",
-			username, c->name);
+			username, purple_conversation_get_name(c));
 	purple_conv_im_send_with_flags(PURPLE_CONV_IM(c), "<ding>", PURPLE_MESSAGE_INVISIBLE);
 
 	return TRUE;
============================================================
--- libpurple/conversation.h	1620eceba106a3396d19242a9c29b525b7a96a87
+++ libpurple/conversation.h	42f30ecf7cba70fa04833f0d80445f114b5c7595
@@ -248,111 +248,6 @@ struct _PurpleConversationUiOps
 	void (*_purple_reserved4)(void);
 };
 
-/**
- * Data specific to Instant Messages.
- */
-struct _PurpleConvIm
-{
-	PurpleConversation *conv;            /**< The parent conversation.     */
-
-	PurpleTypingState typing_state;      /**< The current typing state.    */
-	guint  typing_timeout;             /**< The typing timer handle.     */
-	time_t type_again;                 /**< The type again time.         */
-	guint  send_typed_timeout;         /**< The type again timer handle. */
-
-	PurpleBuddyIcon *icon;               /**< The buddy icon.              */
-};
-
-/**
- * Data specific to Chats.
- */
-struct _PurpleConvChat
-{
-	PurpleConversation *conv;          /**< The parent conversation.      */
-
-	GList *in_room;                  /**< The users in the room.        */
-	GList *ignored;                  /**< Ignored users.                */
-	char  *who;                      /**< The person who set the topic. */
-	char  *topic;                    /**< The topic.                    */
-	int    id;                       /**< The chat ID.                  */
-	char *nick;                      /**< Your nick in this chat.       */
-
-	gboolean left;                   /**< We left the chat and kept the window open */
-};
-
-/**
- * Data for "Chat Buddies"
- */
-struct _PurpleConvChatBuddy
-{
-	char *name;                      /**< The chat participant's name in the chat. */
-	char *alias;                     /**< The chat participant's alias, if known;
-	                                  *   @a NULL otherwise.
-	                                  */
-	char *alias_key;                 /**< A string by which this buddy will be sorted,
-	                                  *   or @c NULL if the buddy should be sorted by
-	                                  *   its @c name.  (This is currently always @c
-	                                  *   NULL.)
-	                                  */
-	gboolean buddy;                  /**< @a TRUE if this chat participant is on the
-	                                  *   buddy list; @a FALSE otherwise.
-	                                  */
-	PurpleConvChatBuddyFlags flags;  /**< A bitwise OR of flags for this participant,
-	                                  *   such as whether they are a channel operator.
-	                                  */
-};
-
-/**
- * Description of a conversation message
- *
- * @since 2.2.0
- */
-struct _PurpleConvMessage
-{
-	char *who;
-	char *what;
-	PurpleMessageFlags flags;
-	time_t when;
-	PurpleConversation *conv;  /**< @since 2.3.0 */
-	char *alias;               /**< @since 2.3.0 */
-};
-
-/**
- * A core representation of a conversation between two or more people.
- *
- * The conversation can be an IM or a chat.
- */
-struct _PurpleConversation
-{
-	PurpleConversationType type;  /**< The type of conversation.          */
-
-	PurpleAccount *account;       /**< The user using this conversation.  */
-
-
-	char *name;                 /**< The name of the conversation.      */
-	char *title;                /**< The window title.                  */
-
-	gboolean logging;           /**< The status of logging.             */
-
-	GList *logs;                /**< This conversation's logs           */
-
-	union
-	{
-		PurpleConvIm   *im;       /**< IM-specific data.                  */
-		PurpleConvChat *chat;     /**< Chat-specific data.                */
-		void *misc;             /**< Misc. data.                        */
-
-	} u;
-
-	PurpleConversationUiOps *ui_ops;           /**< UI-specific operations. */
-	void *ui_data;                           /**< UI-specific data.       */
-
-	GHashTable *data;                        /**< Plugin-specific data.   */
-
-	PurpleConnectionFlags features; /**< The supported features */
-	GList *message_history;         /**< Message history, as a GList of PurpleConvMessage's */
-};
-
 #ifdef __cplusplus
 extern "C" {
 #endif
@@ -529,6 +424,10 @@ const char *purple_conversation_get_name
  */
 const char *purple_conversation_get_name(const PurpleConversation *conv);
 
+PurpleBuddy * purple_conversation_find_buddy(const PurpleConversation *conv);
+
+GSList * purple_conversation_find_buddies(const PurpleConversation *conv);
+
 /**
  * Enables or disables logging for this conversation.
  *
@@ -769,6 +668,10 @@ time_t purple_conversation_message_get_t
  */
 time_t purple_conversation_message_get_timestamp(PurpleConvMessage *msg);
 
+const char * purple_conversation_message_get_alias(PurpleConvMessage *msg);
+
+PurpleConversation * purple_conversation_message_get_conversation(PurpleConvMessage *msg);
+
 /*@}*/
 
 
@@ -1373,6 +1276,12 @@ const char *purple_conv_chat_cb_get_name
  */
 const char *purple_conv_chat_cb_get_name(PurpleConvChatBuddy *cb);
 
+const char *purple_conv_chat_cb_get_alias(PurpleConvChatBuddy *cb);
+
+PurpleConvChatBuddyFlags purple_conv_chat_cb_get_flags(PurpleConvChatBuddy *cb);
+
+gboolean purple_conv_chat_cb_is_buddy(PurpleConvChatBuddy *cb);
+
 /**
  * Destroys a chat buddy
  *
============================================================
--- pidgin/gtkconv.c	6f5a6f4d041bff0f9e263f64cb66e34564186559
+++ pidgin/gtkconv.c	96a4630badf39ce20a4296fdfbe5e906af7ea152
@@ -199,14 +199,16 @@ get_conversation_blist_node(PurpleConver
 get_conversation_blist_node(PurpleConversation *conv)
 {
 	PurpleBlistNode *node = NULL;
+	PurpleAccount *account = purple_conversation_get_account(conv);
+	const char *cname = purple_conversation_get_name(conv);
 
 	switch (purple_conversation_get_type(conv)) {
 		case PURPLE_CONV_TYPE_IM:
-			node = PURPLE_BLIST_NODE(purple_find_buddy(conv->account, conv->name));
+			node = PURPLE_BLIST_NODE(purple_find_buddy(account, cname));
 			node = node ? node->parent : NULL;
 			break;
 		case PURPLE_CONV_TYPE_CHAT:
-			node = PURPLE_BLIST_NODE(purple_blist_find_chat(conv->account, conv->name));
+			node = PURPLE_BLIST_NODE(purple_blist_find_chat(account, cname));
 			break;
 		default:
 			break;
@@ -278,7 +280,8 @@ default_formatize(PidginConversation *c)
 default_formatize(PidginConversation *c)
 {
 	PurpleConversation *conv = c->active_conv;
-	gtk_imhtml_setup_entry(GTK_IMHTML(c->entry), conv->features);
+	gtk_imhtml_setup_entry(GTK_IMHTML(c->entry),
+			purple_conversation_get_features(conv));
 }
 
 static void
@@ -595,7 +598,7 @@ send_cb(GtkWidget *widget, PidginConvers
 		flags |= PURPLE_MESSAGE_IMAGES;
 
 	gc = purple_account_get_connection(account);
-	if (gc && (conv->features & PURPLE_CONNECTION_FLAGS_NO_NEWLINES)) {
+	if (gc && (purple_conversation_get_features(conv) & PURPLE_CONNECTION_FLAGS_NO_NEWLINES)) {
 		char **bufs;
 		int i;
 
@@ -1031,7 +1034,9 @@ menu_save_as_cb(gpointer data, guint act
 {
 	PidginWindow *win = data;
 	PurpleConversation *conv = pidgin_conv_window_get_active_conversation(win);
-	PurpleBuddy *buddy = purple_find_buddy(conv->account, conv->name);
+	PurpleAccount *account = purple_conversation_get_account(conv);
+	const char *cname = purple_conversation_get_name(conv);
+	PurpleBuddy *buddy = purple_find_buddy(account, cname);
 	const char *name;
 	gchar *buf;
 	gchar *c;
@@ -1039,7 +1044,7 @@ menu_save_as_cb(gpointer data, guint act
 	if (buddy != NULL)
 		name = purple_buddy_get_contact_alias(buddy);
 	else
-		name = purple_normalize(conv->account, conv->name);
+		name = purple_normalize(account, cname);
 
 	buf = g_strdup_printf("%s.html", name);
 	for (c = buf ; *c ; c++)
@@ -1364,16 +1369,14 @@ menu_logging_cb(gpointer data, guint act
 
 		purple_conversation_write(conv, NULL,
 								_("Logging started. Future messages in this conversation will be logged."),
-								conv->logs ? (PURPLE_MESSAGE_SYSTEM) :
-								             (PURPLE_MESSAGE_SYSTEM | PURPLE_MESSAGE_NO_LOG),
+								PURPLE_MESSAGE_SYSTEM,
 								time(NULL));
 	}
 	else
 	{
 		purple_conversation_write(conv, NULL,
 								_("Logging stopped. Future messages in this conversation will not be logged."),
-								conv->logs ? (PURPLE_MESSAGE_SYSTEM) :
-								             (PURPLE_MESSAGE_SYSTEM | PURPLE_MESSAGE_NO_LOG),
+								PURPLE_MESSAGE_SYSTEM,
 								time(NULL));
 
 		/* Disable the logging second, so that the above message can be logged. */
@@ -1381,7 +1384,7 @@ menu_logging_cb(gpointer data, guint act
 	}
 
 	/* Save the setting IFF it's different than the pref. */
-	switch (conv->type)
+	switch (purple_conversation_get_type(conv))
 	{
 		case PURPLE_CONV_TYPE_IM:
 			if (logging == purple_prefs_get_bool("/purple/logging/log_ims"))
@@ -1610,6 +1613,7 @@ create_chat_menu(PurpleConversation *con
 	gboolean is_me = FALSE;
 	GtkWidget *button;
 	PurpleBuddy *buddy = NULL;
+	PurpleAccount *account;
 
 	if (gc != NULL)
 		prpl_info =
@@ -1622,7 +1626,8 @@ create_chat_menu(PurpleConversation *con
 	if (menu)
 		gtk_widget_destroy(menu);
 
-	if (!strcmp(chat->nick, purple_normalize(conv->account, who)))
+	account = purple_conversation_get_account(conv);
+	if (!strcmp(purple_conv_chat_get_nick(chat), purple_normalize(account, who)))
 		is_me = TRUE;
 
 	menu = gtk_menu_new();
@@ -1698,7 +1703,7 @@ create_chat_menu(PurpleConversation *con
 	}
 
 	if (!is_me && prpl_info && !(prpl_info->options & OPT_PROTO_UNIQUE_CHATNAME)) {
-		if ((buddy = purple_find_buddy(conv->account, who)) != NULL)
+		if ((buddy = purple_find_buddy(account, who)) != NULL)
 			button = pidgin_new_item_from_stock(menu, _("Remove"), GTK_STOCK_REMOVE,
 						G_CALLBACK(menu_chat_add_remove_cb), PIDGIN_CONVERSATION(conv), 0, 0, NULL);
 		else
@@ -1719,8 +1724,8 @@ create_chat_menu(PurpleConversation *con
 
 	if (buddy != NULL)
 	{
-		if (purple_account_is_connected(conv->account))
-			pidgin_append_blist_node_proto_menu(menu, purple_account_get_connection(conv->account),
+		if (purple_account_is_connected(account))
+			pidgin_append_blist_node_proto_menu(menu, purple_account_get_connection(account),
 					(PurpleBlistNode *)buddy);
 		pidgin_append_blist_node_extended_menu(menu, (PurpleBlistNode *)buddy);
 		gtk_widget_show_all(menu);
@@ -2226,7 +2231,9 @@ pidgin_conv_switch_active_conversation(P
 	PidginConversation *gtkconv;
 	PurpleConversation *old_conv;
 	GtkIMHtml *entry;
+	PurpleAccount *account;
 	const char *protocol_name;
+	PurpleConnectionFlags features;
 
 	g_return_if_fail(conv != NULL);
 
@@ -2248,14 +2255,17 @@ pidgin_conv_switch_active_conversation(P
 		gtk_check_menu_item_get_active(GTK_CHECK_MENU_ITEM(gtkconv->win->menu.logging)));
 
 	entry = GTK_IMHTML(gtkconv->entry);
-	protocol_name = purple_account_get_protocol_name(conv->account);
+	account = purple_conversation_get_account(conv);
+	protocol_name = purple_account_get_protocol_name(account);
 	gtk_imhtml_set_protocol_name(entry, protocol_name);
 	gtk_imhtml_set_protocol_name(GTK_IMHTML(gtkconv->imhtml), protocol_name);
 
-	if (!(conv->features & PURPLE_CONNECTION_FLAGS_HTML))
+	features = purple_conversation_get_features(conv);
+
+	if (!(features & PURPLE_CONNECTION_FLAGS_HTML))
 		gtk_imhtml_clear_formatting(GTK_IMHTML(gtkconv->entry));
-	else if (conv->features & PURPLE_CONNECTION_FLAGS_FORMATTING_WBFO &&
-	         !(old_conv->features & PURPLE_CONNECTION_FLAGS_FORMATTING_WBFO))
+	else if (features & PURPLE_CONNECTION_FLAGS_FORMATTING_WBFO &&
+	         !(purple_conversation_get_features(old_conv) & PURPLE_CONNECTION_FLAGS_FORMATTING_WBFO))
 	{
 		/* The old conversation allowed formatting on parts of the
 		 * buffer, but the new one only allows it on the whole
@@ -2295,12 +2305,12 @@ pidgin_conv_switch_active_conversation(P
 
 		gtk_imhtml_toggle_fontface(entry, fontface);
 
-		if (!(conv->features & PURPLE_CONNECTION_FLAGS_NO_FONTSIZE))
+		if (!(features & PURPLE_CONNECTION_FLAGS_NO_FONTSIZE))
 			gtk_imhtml_font_set_size(entry, fontsize);
 
 		gtk_imhtml_toggle_forecolor(entry, forecolor);
 
-		if (!(conv->features & PURPLE_CONNECTION_FLAGS_NO_BGCOLOR))
+		if (!(features & PURPLE_CONNECTION_FLAGS_NO_BGCOLOR))
 		{
 			gtk_imhtml_toggle_backcolor(entry, backcolor);
 			gtk_imhtml_toggle_background(entry, background);
@@ -2318,7 +2328,7 @@ pidgin_conv_switch_active_conversation(P
 		 * here, we didn't call gtk_imhtml_clear_formatting() (because we want to
 		 * preserve the formatting exactly as it is), so we have to do this now. */
 		gtk_imhtml_set_whole_buffer_formatting_only(entry,
-			(conv->features & PURPLE_CONNECTION_FLAGS_FORMATTING_WBFO));
+			(features & PURPLE_CONNECTION_FLAGS_FORMATTING_WBFO));
 	}
 
 	purple_signal_emit(pidgin_conversations_get_handle(), "conversation-switched", conv);
@@ -2551,7 +2561,8 @@ update_tab_icon(PurpleConversation *conv
 	status = infopane_status = pidgin_conv_get_icon_stock(conv);
 
 	if (purple_conversation_get_type(conv) == PURPLE_CONV_TYPE_IM) {
-		PurpleBuddy *b = purple_find_buddy(conv->account, conv->name);
+		PurpleBuddy *b = purple_find_buddy(purple_conversation_get_account(conv),
+				purple_conversation_get_name(conv));
 		if (b)
 			emblem = pidgin_blist_get_emblem((PurpleBlistNode*)b);
 	}
@@ -2572,7 +2583,7 @@ update_tab_icon(PurpleConversation *conv
 		g_object_unref(emblem);
 
 	if (purple_prefs_get_bool(PIDGIN_PREFS_ROOT "/blist/show_protocol_icons")) {
-		emblem = pidgin_create_prpl_icon(gtkconv->active_conv->account, PIDGIN_PRPL_ICON_SMALL);
+		emblem = pidgin_create_prpl_icon(purple_conversation_get_account(gtkconv->active_conv), PIDGIN_PRPL_ICON_SMALL);
 	} else {
 		emblem = NULL;
 	}
@@ -2838,16 +2849,17 @@ icon_menu_save_cb(GtkWidget *widget, Pid
 	PurpleConversation *conv = gtkconv->active_conv;
 	const gchar *ext;
 	gchar *buf;
+	PurpleAccount *account = purple_conversation_get_account(conv);
 
 	g_return_if_fail(conv != NULL);
 
 	ext = purple_buddy_icon_get_extension(purple_conv_im_get_icon(PURPLE_CONV_IM(conv)));
 
-	buf = g_strdup_printf("%s.%s", purple_normalize(conv->account, conv->name), ext);
+	buf = g_strdup_printf("%s.%s", purple_normalize(account, purple_conversation_get_name(conv)), ext);
 
 	purple_request_file(gtkconv, _("Save Icon"), buf, TRUE,
 					 G_CALLBACK(saveicon_writefile_cb), NULL,
-					conv->account, NULL, conv,
+					account, NULL, conv,
 					gtkconv);
 
 	g_free(buf);
@@ -3191,11 +3203,15 @@ populate_menu_with_options(GtkWidget *me
 	PurpleChat *chat = NULL;
 	PurpleBuddy *buddy = NULL;
 	gboolean ret;
+	PurpleAccount *account;
+	const char *cname;
 
 	conv = gtkconv->active_conv;
+	account = purple_conversation_get_account(conv);
+	cname = purple_conversation_get_name(conv);
 
 	if (purple_conversation_get_type(conv) == PURPLE_CONV_TYPE_CHAT) {
-		chat = purple_blist_find_chat(conv->account, conv->name);
+		chat = purple_blist_find_chat(account, cname);
 
 		if ((chat == NULL) && (gtkconv->imhtml != NULL)) {
 			chat = g_object_get_data(G_OBJECT(gtkconv->imhtml), "transient_chat");
@@ -3203,7 +3219,6 @@ populate_menu_with_options(GtkWidget *me
 
 		if ((chat == NULL) && (gtkconv->imhtml != NULL)) {
 			GHashTable *components;
-			PurpleAccount *account = purple_conversation_get_account(conv);
 			PurplePlugin *prpl = purple_find_prpl(purple_account_get_protocol_id(account));
 			PurplePluginProtocolInfo *prpl_info = PURPLE_PLUGIN_PROTOCOL_INFO(prpl);
 			if (purple_account_get_connection(account) != NULL &&
@@ -3216,17 +3231,17 @@ populate_menu_with_options(GtkWidget *me
 				g_hash_table_replace(components, g_strdup("channel"),
 						g_strdup(purple_conversation_get_name(conv)));
 			}
-			chat = purple_chat_new(conv->account, NULL, components);
+			chat = purple_chat_new(account, NULL, components);
 			purple_blist_node_set_flags((PurpleBlistNode *)chat,
 					PURPLE_BLIST_NODE_FLAG_NO_SAVE);
 			g_object_set_data_full(G_OBJECT(gtkconv->imhtml), "transient_chat",
 					chat, (GDestroyNotify)purple_blist_node_remove);
 		}
 	} else {
-		if (!purple_account_is_connected(conv->account))
+		if (!purple_account_is_connected(account))
 			return FALSE;
 
-		buddy = purple_find_buddy(conv->account, conv->name);
+		buddy = purple_find_buddy(account, cname);
 
 		/* gotta remain bug-compatible :( libpurple < 2.0.2 didn't handle
 		 * removing "isolated" buddy nodes well */
@@ -3236,7 +3251,7 @@ populate_menu_with_options(GtkWidget *me
 			}
 
 			if ((buddy == NULL) && (gtkconv->imhtml != NULL)) {
-				buddy = purple_buddy_new(conv->account, conv->name, NULL, NULL);
+				buddy = purple_buddy_new(account, cname, NULL, NULL);
 				purple_blist_node_set_flags((PurpleBlistNode *)buddy,
 						PURPLE_BLIST_NODE_FLAG_NO_SAVE);
 				g_object_set_data_full(G_OBJECT(gtkconv->imhtml), "transient_buddy",
@@ -3258,9 +3273,9 @@ populate_menu_with_options(GtkWidget *me
 			/* XXX: */
 		}
 	} else if (node) {
-		if (purple_account_is_connected(conv->account))
+		if (purple_account_is_connected(account))
 			pidgin_append_blist_node_proto_menu(menu,
-					purple_account_get_connection(conv->account), node);
+					purple_account_get_connection(account), node);
 		pidgin_append_blist_node_extended_menu(menu, node);
 	}
 
@@ -3742,7 +3757,7 @@ update_send_to_selection(PidginWindow *w
 	if (win->menu.send_to == NULL)
 		return FALSE;
 
-	if (!(b = purple_find_buddy(account, conv->name)))
+	if (!(b = purple_find_buddy(account, purple_conversation_get_name(conv))))
 		return FALSE;
 
 
@@ -3902,8 +3917,8 @@ generate_send_to_items(PidginWindow *win
 
 	gtk_widget_show(menu);
 
-	if (gtkconv->active_conv->type == PURPLE_CONV_TYPE_IM) {
-		buds = purple_find_buddies(gtkconv->active_conv->account, gtkconv->active_conv->name);
+	if (purple_conversation_get_type(gtkconv->active_conv)== PURPLE_CONV_TYPE_IM) {
+		buds = purple_conversation_find_buddies(gtkconv->active_conv);
 
 		if (buds == NULL)
 		{
@@ -3996,18 +4011,21 @@ add_chat_buddy_common(PurpleConversation
 	GtkTreeIter iter;
 	gboolean is_me = FALSE;
 	gboolean is_buddy;
-	gchar *tmp, *alias_key, *name, *alias;
+	gchar *tmp, *alias_key;
+	const gchar *name, *alias;
 	int flags;
 	GdkColor *color = NULL;
+	PurpleAccount *account;
 
-	alias = cb->alias;
-	name  = cb->name;
-	flags = GPOINTER_TO_INT(cb->flags);
+	alias = purple_conv_chat_cb_get_alias(cb);
+	name  = purple_conv_chat_cb_get_name(cb);
+	flags = GPOINTER_TO_INT(purple_conv_chat_cb_get_flags(cb));
 
 	chat    = PURPLE_CONV_CHAT(conv);
 	gtkconv = PIDGIN_CONVERSATION(conv);
 	gtkchat = gtkconv->u.chat;
 	gc      = purple_conversation_get_gc(conv);
+	account = purple_conversation_get_account(conv);
 
 	if (!gc || !(prpl_info = PURPLE_PLUGIN_PROTOCOL_INFO(purple_connection_get_prpl(gc))))
 		return;
@@ -4016,10 +4034,10 @@ add_chat_buddy_common(PurpleConversation
 
 	stock = get_chat_buddy_status_icon(chat, name, flags);
 
-	if (!strcmp(chat->nick, purple_normalize(conv->account, old_name != NULL ? old_name : name)))
+	if (!strcmp(purple_conv_chat_get_nick(chat), purple_normalize(account, old_name != NULL ? old_name : name)))
 		is_me = TRUE;
 
-	is_buddy = cb->buddy;
+	is_buddy = purple_conv_chat_cb_is_buddy(cb);
 
 	tmp = g_utf8_casefold(alias, -1);
 	alias_key = g_utf8_collate_key(tmp, -1);
@@ -4084,7 +4102,7 @@ tab_complete_process_item(int *most_matc
  */
 static void
 tab_complete_process_item(int *most_matched, const char *entered, gsize entered_bytes, char **partial, char *nick_partial,
-				  GList **matches, char *name)
+				  GList **matches, const char *name)
 {
 	memcpy(nick_partial, name, entered_bytes);
 	if (purple_utf8_strcasecmp(nick_partial, entered))
@@ -4206,7 +4224,8 @@ tab_complete(PurpleConversation *conv)
 		/* Users */
 		for (; l != NULL; l = l->next) {
 			tab_complete_process_item(&most_matched, entered, entered_bytes, &partial, nick_partial,
-									  &matches, ((PurpleConvChatBuddy *)l->data)->name);
+									  &matches,
+									  purple_conv_chat_cb_get_name((PurpleConvChatBuddy *)l->data));
 		}
 
 
@@ -4379,6 +4398,7 @@ update_chat_alias(PurpleBuddy *buddy, Pu
 	char *normalized_name;
 	GtkTreeIter iter;
 	int f;
+	PurpleAccount *account;
 
 	g_return_if_fail(buddy != NULL);
 	g_return_if_fail(conv != NULL);
@@ -4389,23 +4409,24 @@ update_chat_alias(PurpleBuddy *buddy, Pu
 	if (!gtk_tree_model_get_iter_first(GTK_TREE_MODEL(model), &iter))
 		return;
 
-	normalized_name = g_strdup(purple_normalize(conv->account, purple_buddy_get_name(buddy)));
+	account = purple_conversation_get_account(conv);
+	normalized_name = g_strdup(purple_normalize(account, purple_buddy_get_name(buddy)));
 
 	do {
 		char *name;
 
 		gtk_tree_model_get(model, &iter, CHAT_USERS_NAME_COLUMN, &name, -1);
 
-		if (!strcmp(normalized_name, purple_normalize(conv->account, name))) {
+		if (!strcmp(normalized_name, purple_normalize(account, name))) {
 			const char *alias = name;
 			char *tmp;
 			char *alias_key = NULL;
 			PurpleBuddy *buddy2;
 
-			if (strcmp(chat->nick, purple_normalize(conv->account, name))) {
+			if (strcmp(purple_conv_chat_get_nick(chat), purple_normalize(account, name))) {
 				/* This user is not me, so look into updating the alias. */
 
-				if ((buddy2 = purple_find_buddy(conv->account, name)) != NULL) {
+				if ((buddy2 = purple_find_buddy(account, name)) != NULL) {
 					alias = purple_buddy_get_contact_alias(buddy2);
 				}
 
@@ -4478,6 +4499,7 @@ buddy_cb_common(PurpleBuddy *buddy, Purp
 	GtkTreeIter iter;
 	GtkTextTag *texttag;
 	int f;
+	PurpleAccount *account;
 
 	g_return_if_fail(buddy != NULL);
 	g_return_if_fail(conv != NULL);
@@ -4492,14 +4514,15 @@ buddy_cb_common(PurpleBuddy *buddy, Purp
 	if (!gtk_tree_model_get_iter_first(GTK_TREE_MODEL(model), &iter))
 		return;
 
-	normalized_name = g_strdup(purple_normalize(conv->account, purple_buddy_get_name(buddy)));
+	account = purple_conversation_get_account(conv);
+	normalized_name = g_strdup(purple_normalize(account, purple_buddy_get_name(buddy)));
 
 	do {
 		char *name;
 
 		gtk_tree_model_get(model, &iter, CHAT_USERS_NAME_COLUMN, &name, -1);
 
-		if (!strcmp(normalized_name, purple_normalize(conv->account, name))) {
+		if (!strcmp(normalized_name, purple_normalize(account, name))) {
 			gtk_list_store_set(GTK_LIST_STORE(model), &iter,
 			                   CHAT_USERS_WEIGHT_COLUMN, is_buddy ? PANGO_WEIGHT_BOLD : PANGO_WEIGHT_NORMAL, -1);
 			g_free(name);
@@ -4701,7 +4724,7 @@ pidgin_conv_userlist_create_tooltip(GtkW
 	gtk_tree_model_get(GTK_TREE_MODEL(model), &iter, CHAT_USERS_NAME_COLUMN, &who, -1);
 
 	prpl_info = PURPLE_PLUGIN_PROTOCOL_INFO(purple_connection_get_prpl(purple_account_get_connection(account)));
-	node = (PurpleBlistNode*)(purple_find_buddy(conv->account, who));
+	node = (PurpleBlistNode*)(purple_find_buddy(account, who));
 	if (node && prpl_info && (prpl_info->options & OPT_PROTO_UNIQUE_CHATNAME))
 		pidgin_blist_draw_tooltip(node, gtkconv->infopane);
 
@@ -4817,14 +4840,18 @@ pidgin_conv_create_tooltip(GtkWidget *ti
 	PurpleBlistNode *node = NULL;
 	PurpleConversation *conv;
 	PidginConversation *gtkconv = userdata;
+	PurpleAccount *account;
+	const char *cname;
 
 	conv = gtkconv->active_conv;
+	account = purple_conversation_get_account(conv);
+	cname = purple_conversation_get_name(conv);
 	if (purple_conversation_get_type(conv) == PURPLE_CONV_TYPE_CHAT) {
-		node = (PurpleBlistNode*)(purple_blist_find_chat(conv->account, conv->name));
+		node = (PurpleBlistNode*)(purple_blist_find_chat(account, cname));
 		if (!node)
 			node = g_object_get_data(G_OBJECT(gtkconv->imhtml), "transient_chat");
 	} else {
-		node = (PurpleBlistNode*)(purple_find_buddy(conv->account, conv->name));
+		node = (PurpleBlistNode*)(purple_find_buddy(account, cname));
 #if 0
 		/* Using the transient blist nodes to show the tooltip doesn't quite work yet. */
 		if (!node)
@@ -4914,10 +4941,12 @@ setup_common_pane(PidginConversation *gt
 	GtkTreePath *path;
 	PurpleConversation *conv = gtkconv->active_conv;
 	PurpleBuddy *buddy;
-	gboolean chat = (conv->type == PURPLE_CONV_TYPE_CHAT);
+	gboolean chat = (purple_conversation_get_type(conv) == PURPLE_CONV_TYPE_CHAT);
 	GtkPolicyType imhtml_sw_hscroll;
 	int buddyicon_size = 0;
+	PurpleAccount *account;
 
+	account = purple_conversation_get_account(conv);
 	/* Setup the top part of the pane */
 	vbox = gtk_vbox_new(FALSE, PIDGIN_HIG_BOX_SPACE);
 	gtk_widget_show(vbox);
@@ -5057,7 +5086,7 @@ setup_common_pane(PidginConversation *gt
 
 	gtk_widget_set_name(gtkconv->entry, "pidgin_conv_entry");
 	gtk_imhtml_set_protocol_name(GTK_IMHTML(gtkconv->entry),
-			purple_account_get_protocol_name(conv->account));
+			purple_account_get_protocol_name(account));
 
 	g_signal_connect(G_OBJECT(gtkconv->entry), "populate-popup",
 	                 G_CALLBACK(entry_popup_menu_cb), gtkconv);
@@ -5224,7 +5253,9 @@ pidgin_conv_find_gtkconv(PurpleConversat
 static PidginConversation *
 pidgin_conv_find_gtkconv(PurpleConversation * conv)
 {
-	PurpleBuddy *bud = purple_find_buddy(conv->account, conv->name);
+	PurpleAccount *account = purple_conversation_get_account(conv);
+	const char *cname = purple_conversation_get_name(conv);
+	PurpleBuddy *bud = purple_find_buddy(account, cname);
 	PurpleContact *c;
 	PurpleBlistNode *cn, *bn;
 
@@ -5239,8 +5270,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 (conv->ui_data)
-				return conv->ui_data;
+			if (purple_object_get_ui_data(PURPLE_OBJECT(conv)))
+				return purple_object_get_ui_data(PURPLE_OBJECT(conv));
 		}
 	}
 
@@ -5325,9 +5356,10 @@ private_gtkconv_new(PurpleConversation *
 	GtkWidget *pane = NULL;
 	GtkWidget *tab_cont;
 	PurpleBlistNode *convnode;
+	PurpleAccount *account;
 
 	if (conv_type == PURPLE_CONV_TYPE_IM && (gtkconv = pidgin_conv_find_gtkconv(conv))) {
-		conv->ui_data = gtkconv;
+		purple_object_set_ui_data(PURPLE_OBJECT(conv), gtkconv);
 		if (!g_list_find(gtkconv->convs, conv))
 			gtkconv->convs = g_list_prepend(gtkconv->convs, conv);
 		pidgin_conv_switch_active_conversation(conv);
@@ -5335,7 +5367,7 @@ private_gtkconv_new(PurpleConversation *
 	}
 
 	gtkconv = g_new0(PidginConversation, 1);
-	conv->ui_data = gtkconv;
+	purple_object_set_ui_data(PURPLE_OBJECT(conv), gtkconv);
 	gtkconv->active_conv = conv;
 	gtkconv->convs = g_list_prepend(gtkconv->convs, conv);
 	gtkconv->send_history = g_list_append(NULL, NULL);
@@ -5362,7 +5394,7 @@ private_gtkconv_new(PurpleConversation *
 			g_free(gtkconv->u.im);
 
 		g_free(gtkconv);
-		conv->ui_data = NULL;
+		purple_object_set_ui_data(PURPLE_OBJECT(conv), NULL);
 		return;
 	}
 
@@ -5425,10 +5457,11 @@ private_gtkconv_new(PurpleConversation *
 	else
 		gtk_widget_hide(gtkconv->infopane_hbox);
 
+	account = purple_conversation_get_account(conv);
 	gtk_imhtml_show_comments(GTK_IMHTML(gtkconv->imhtml),
 		purple_prefs_get_bool(PIDGIN_PREFS_ROOT "/conversations/show_timestamps"));
 	gtk_imhtml_set_protocol_name(GTK_IMHTML(gtkconv->imhtml),
-								 purple_account_get_protocol_name(conv->account));
+								 purple_account_get_protocol_name(account));
 
 	g_signal_connect_swapped(G_OBJECT(pane), "focus",
 	                         G_CALLBACK(gtk_widget_grab_focus),
@@ -5444,7 +5477,7 @@ private_gtkconv_new(PurpleConversation *
 		nick_colors = generate_nick_colors(&nbr_nick_colors, gtk_widget_get_style(gtkconv->imhtml)->base[GTK_STATE_NORMAL]);
 	}
 
-	if (conv->features & PURPLE_CONNECTION_FLAGS_ALLOW_CUSTOM_SMILEY)
+	if (purple_conversation_get_features(conv) & PURPLE_CONNECTION_FLAGS_ALLOW_CUSTOM_SMILEY)
 		pidgin_themes_smiley_themeize_custom(gtkconv->entry);
 }
 
@@ -5765,6 +5798,7 @@ pidgin_conv_write_conv(PurpleConversatio
 	char *bracket;
 	int tag_count = 0;
 	gboolean is_rtl_message = FALSE;
+	PurpleConnectionFlags features;
 
 	g_return_if_fail(conv != NULL);
 	gtkconv = PIDGIN_CONVERSATION(conv);
@@ -5804,6 +5838,8 @@ pidgin_conv_write_conv(PurpleConversatio
 	gc = purple_account_get_connection(account);
 	g_return_if_fail(gc != NULL || !(flags & (PURPLE_MESSAGE_SEND | PURPLE_MESSAGE_RECV)));
 
+	features = purple_conversation_get_features(conv);
+
 	/* Make sure URLs are clickable */
 	if(flags & PURPLE_MESSAGE_NO_LINKIFY)
 		displaying = g_strdup(message);
@@ -5916,12 +5952,12 @@ pidgin_conv_write_conv(PurpleConversatio
 		gtk_font_options |= GTK_IMHTML_NO_COLOURS | GTK_IMHTML_NO_FONTS | GTK_IMHTML_NO_SIZES | GTK_IMHTML_NO_FORMATTING;
 
 	/* this is gonna crash one day, I can feel it. */
-	if (PURPLE_PLUGIN_PROTOCOL_INFO(purple_find_prpl(purple_account_get_protocol_id(conv->account)))->options &
+	if (PURPLE_PLUGIN_PROTOCOL_INFO(purple_find_prpl(purple_account_get_protocol_id(account)))->options &
 	    OPT_PROTO_USE_POINTSIZE) {
 		gtk_font_options |= GTK_IMHTML_USE_POINTSIZE;
 	}
 
-	if (!(flags & PURPLE_MESSAGE_RECV) && (conv->features & PURPLE_CONNECTION_FLAGS_ALLOW_CUSTOM_SMILEY))
+	if (!(flags & PURPLE_MESSAGE_RECV) && (features & PURPLE_CONNECTION_FLAGS_ALLOW_CUSTOM_SMILEY))
 	{
 		/* We want to see our own smileys. Need to revert it after send*/
 		pidgin_themes_smiley_themeize_custom(gtkconv->imhtml);
@@ -6099,7 +6135,7 @@ pidgin_conv_write_conv(PurpleConversatio
 		gtkconv_set_unseen(gtkconv, unseen);
 	}
 
-	if (!(flags & PURPLE_MESSAGE_RECV) && (conv->features & PURPLE_CONNECTION_FLAGS_ALLOW_CUSTOM_SMILEY))
+	if (!(flags & PURPLE_MESSAGE_RECV) && (features & PURPLE_CONNECTION_FLAGS_ALLOW_CUSTOM_SMILEY))
 	{
 		/* Restore the smiley-data */
 		pidgin_themes_smiley_themeize(gtkconv->imhtml);
@@ -6363,6 +6399,7 @@ pidgin_conv_custom_smiley_add(PurpleConv
 	PidginConversation *gtkconv;
 	struct smiley_list *list;
 	const char *sml = NULL, *conv_sml;
+	PurpleAccount *account;
 
 	if (!conv || !smile || !*smile) {
 		return FALSE;
@@ -6374,7 +6411,8 @@ pidgin_conv_custom_smiley_add(PurpleConv
 
 	/* If possible add this smiley to the current theme.
 	 * The addition is only temporary: custom smilies aren't saved to disk. */
-	conv_sml = purple_account_get_protocol_name(conv->account);
+	account = purple_conversation_get_account(conv);
+	conv_sml = purple_account_get_protocol_name(account);
 	gtkconv = PIDGIN_CONVERSATION(conv);
 
 	for (list = (struct smiley_list *)current_smiley_theme->list; list; list = list->next) {
@@ -6402,8 +6440,9 @@ pidgin_conv_custom_smiley_write(PurpleCo
 	GtkIMHtmlSmiley *smiley;
 	GdkPixbufLoader *loader;
 	const char *sml;
+	PurpleAccount *account = purple_conversation_get_account(conv);
 
-	sml = purple_account_get_protocol_name(conv->account);
+	sml = purple_account_get_protocol_name(account);
 	gtkconv = PIDGIN_CONVERSATION(conv);
 	smiley = gtk_imhtml_smiley_get(GTK_IMHTML(gtkconv->imhtml), sml, smile);
 
@@ -6428,11 +6467,12 @@ pidgin_conv_custom_smiley_close(PurpleCo
 	GtkIMHtmlSmiley *smiley;
 	GdkPixbufLoader *loader;
 	const char *sml;
+	PurpleAccount *account = purple_conversation_get_account(conv);
 
 	g_return_if_fail(conv  != NULL);
 	g_return_if_fail(smile != NULL);
 
-	sml = purple_account_get_protocol_name(conv->account);
+	sml = purple_account_get_protocol_name(account);
 	gtkconv = PIDGIN_CONVERSATION(conv);
 	smiley = gtk_imhtml_smiley_get(GTK_IMHTML(gtkconv->imhtml), sml, smile);
 
@@ -6475,10 +6515,12 @@ gray_stuff_out(PidginConversation *gtkco
 	GdkPixbuf *window_icon = NULL;
 	GtkIMHtmlButtons buttons;
 	PurpleAccount *account;
+	const char *cname;
 
-	win     = pidgin_conv_get_window(gtkconv);
-	gc      = purple_conversation_get_gc(conv);
+	win = pidgin_conv_get_window(gtkconv);
+	gc = purple_conversation_get_gc(conv);
 	account = purple_conversation_get_account(conv);
+	cname = purple_conversation_get_name(conv);
 
 	if (gc != NULL)
 		prpl_info = PURPLE_PLUGIN_PROTOCOL_INFO(purple_connection_get_prpl(gc));
@@ -6505,15 +6547,15 @@ gray_stuff_out(PidginConversation *gtkco
 		gtk_widget_show(win->menu.get_info);
 		gtk_widget_hide(win->menu.invite);
 		gtk_widget_show(win->menu.alias);
- 		if (purple_privacy_check(account, purple_conversation_get_name(conv))) {
- 			gtk_widget_hide(win->menu.unblock);
- 			gtk_widget_show(win->menu.block);
- 		} else {
- 			gtk_widget_hide(win->menu.block);
- 			gtk_widget_show(win->menu.unblock);
- 		}
+		if (purple_privacy_check(account, cname)) {
+			gtk_widget_hide(win->menu.unblock);
+			gtk_widget_show(win->menu.block);
+		} else {
+			gtk_widget_hide(win->menu.block);
+			gtk_widget_show(win->menu.unblock);
+		}
 
-		if ((account == NULL) || purple_find_buddy(account, purple_conversation_get_name(conv)) == NULL) {
+		if ((account == NULL) || purple_find_buddy(account, cname) == NULL) {
 			gtk_widget_show(win->menu.add);
 			gtk_widget_hide(win->menu.remove);
 		} else {
@@ -6537,7 +6579,7 @@ gray_stuff_out(PidginConversation *gtkco
 		gtk_widget_hide(win->menu.block);
 		gtk_widget_hide(win->menu.unblock);
 
-		if ((account == NULL) || purple_blist_find_chat(account, purple_conversation_get_name(conv)) == NULL) {
+		if ((account == NULL) || purple_blist_find_chat(account, cname) == NULL) {
 			/* If the chat is NOT in the buddy list */
 			gtk_widget_show(win->menu.add);
 			gtk_widget_hide(win->menu.remove);
@@ -6561,29 +6603,30 @@ gray_stuff_out(PidginConversation *gtkco
 	{
 		/* Account is online */
 		/* Deal with the toolbar */
-		if (conv->features & PURPLE_CONNECTION_FLAGS_HTML)
+		PurpleConnectionFlags features = purple_conversation_get_features(conv);
+		if (features & PURPLE_CONNECTION_FLAGS_HTML)
 		{
 			buttons = GTK_IMHTML_ALL; /* Everything on */
-			if (conv->features & PURPLE_CONNECTION_FLAGS_NO_BGCOLOR)
+			if (features & PURPLE_CONNECTION_FLAGS_NO_BGCOLOR)
 				buttons &= ~GTK_IMHTML_BACKCOLOR;
-			if (conv->features & PURPLE_CONNECTION_FLAGS_NO_FONTSIZE)
+			if (features & PURPLE_CONNECTION_FLAGS_NO_FONTSIZE)
 			{
 				buttons &= ~GTK_IMHTML_GROW;
 				buttons &= ~GTK_IMHTML_SHRINK;
 			}
-			if (conv->features & PURPLE_CONNECTION_FLAGS_NO_URLDESC)
+			if (features & PURPLE_CONNECTION_FLAGS_NO_URLDESC)
 				buttons &= ~GTK_IMHTML_LINKDESC;
 		} else {
 			buttons = GTK_IMHTML_SMILEY | GTK_IMHTML_IMAGE;
 		}
 
 		if (!(prpl_info->options & OPT_PROTO_IM_IMAGE))
-			conv->features |= PURPLE_CONNECTION_FLAGS_NO_IMAGES;
+			features |= PURPLE_CONNECTION_FLAGS_NO_IMAGES;
 
-		if(conv->features & PURPLE_CONNECTION_FLAGS_NO_IMAGES)
+		if(features & PURPLE_CONNECTION_FLAGS_NO_IMAGES)
 			buttons &= ~GTK_IMHTML_IMAGE;
 
-		if (conv->features & PURPLE_CONNECTION_FLAGS_ALLOW_CUSTOM_SMILEY)
+		if (features & PURPLE_CONNECTION_FLAGS_ALLOW_CUSTOM_SMILEY)
 			buttons |= GTK_IMHTML_CUSTOM_SMILEY;
 		else
 			buttons &= ~GTK_IMHTML_CUSTOM_SMILEY;
@@ -6597,8 +6640,8 @@ gray_stuff_out(PidginConversation *gtkco
 		gtk_widget_set_sensitive(win->menu.add_pounce, TRUE);
 		gtk_widget_set_sensitive(win->menu.get_info, (prpl_info->get_info != NULL));
 		gtk_widget_set_sensitive(win->menu.invite, (prpl_info->chat_invite != NULL));
-		gtk_widget_set_sensitive(win->menu.insert_link, (conv->features & PURPLE_CONNECTION_FLAGS_HTML));
-		gtk_widget_set_sensitive(win->menu.insert_image, !(conv->features & PURPLE_CONNECTION_FLAGS_NO_IMAGES));
+		gtk_widget_set_sensitive(win->menu.insert_link, (features & PURPLE_CONNECTION_FLAGS_HTML));
+		gtk_widget_set_sensitive(win->menu.insert_image, !(features & PURPLE_CONNECTION_FLAGS_NO_IMAGES));
 
 		if (purple_conversation_get_type(conv) == PURPLE_CONV_TYPE_IM)
 		{
@@ -6606,11 +6649,11 @@ gray_stuff_out(PidginConversation *gtkco
 			gtk_widget_set_sensitive(win->menu.remove, (prpl_info->remove_buddy != NULL));
 			gtk_widget_set_sensitive(win->menu.send_file,
 									 (prpl_info->send_file != NULL && (!prpl_info->can_receive_file ||
-									  prpl_info->can_receive_file(gc, purple_conversation_get_name(conv)))));
+									  prpl_info->can_receive_file(gc, cname))));
 			gtk_widget_set_sensitive(g_object_get_data(G_OBJECT(win->window), "get_attention"), (prpl_info->send_attention != NULL));
 			gtk_widget_set_sensitive(win->menu.alias,
 									 (account != NULL) &&
-									 (purple_find_buddy(account, purple_conversation_get_name(conv)) != NULL));
+									 (purple_find_buddy(account, cname) != NULL));
 		}
 		else if (purple_conversation_get_type(conv) == PURPLE_CONV_TYPE_CHAT)
 		{
@@ -6618,7 +6661,7 @@ gray_stuff_out(PidginConversation *gtkco
 			gtk_widget_set_sensitive(win->menu.remove, (prpl_info->join_chat != NULL));
 			gtk_widget_set_sensitive(win->menu.alias,
 									 (account != NULL) &&
-									 (purple_blist_find_chat(account, purple_conversation_get_name(conv)) != NULL));
+									 (purple_blist_find_chat(account, cname) != NULL));
 		}
 
 	} else {
@@ -6649,7 +6692,7 @@ gray_stuff_out(PidginConversation *gtkco
 		if ((purple_conversation_get_type(conv) == PURPLE_CONV_TYPE_IM) &&
 				(gtkconv->u.im->anim))
 		{
-			PurpleBuddy *buddy = purple_find_buddy(conv->account, conv->name);
+			PurpleBuddy *buddy = purple_find_buddy(account, cname);
 			window_icon =
 				gdk_pixbuf_animation_get_static_image(gtkconv->u.im->anim);
 
@@ -6751,7 +6794,7 @@ pidgin_conv_update_fields(PurpleConversa
 			title = g_strdup(purple_conversation_get_title(conv));
 
 		if (purple_conversation_get_type(conv) == PURPLE_CONV_TYPE_IM) {
-			buddy = purple_find_buddy(account, conv->name);
+			buddy = purple_conversation_find_buddy(conv);
 			if (buddy) {
 				p = purple_buddy_get_presence(buddy);
 				markup = pidgin_blist_get_name_markup(buddy, FALSE, FALSE);
@@ -6797,7 +6840,7 @@ pidgin_conv_update_fields(PurpleConversa
 			style = "tab-label-attention";
 		} else if (gtkconv->unseen_state == PIDGIN_UNSEEN_TEXT)	{
 			atk_object_set_description(accessibility_obj, _("Unread Messages"));
-			if (gtkconv->active_conv->type == PURPLE_CONV_TYPE_CHAT)
+			if (purple_conversation_get_type(gtkconv->active_conv) == PURPLE_CONV_TYPE_CHAT)
 				style = "tab-label-unreadchat";
 			else
 				style = "tab-label-attention";
@@ -7493,7 +7536,7 @@ hide_new_pref_cb(const char *name, Purpl
 
 		conv = gtkconv->active_conv;
 
-		if (conv->type == PURPLE_CONV_TYPE_CHAT ||
+		if (purple_conversation_get_type(conv) == PURPLE_CONV_TYPE_CHAT ||
 				gtkconv->unseen_count == 0 ||
 				(when_away && !purple_status_is_available(
 							purple_account_get_active_status(
@@ -7548,6 +7591,7 @@ account_signed_off_cb(PurpleConnection *
 	for (iter = purple_get_conversations(); iter; iter = iter->next)
 	{
 		PurpleConversation *conv = iter->data;
+		PurpleAccount *account = purple_conversation_get_account(conv);
 
 		/* This seems fine in theory, but we also need to cover the
 		 * case of this account matching one of the other buddies in
@@ -7558,14 +7602,15 @@ account_signed_off_cb(PurpleConnection *
 							PIDGIN_CONV_MENU | PIDGIN_CONV_COLORIZE_TITLE);
 
 		if (PURPLE_CONNECTION_IS_CONNECTED(gc) &&
-				conv->type == PURPLE_CONV_TYPE_CHAT &&
-				conv->account == purple_connection_get_account(gc) &&
+				purple_conversation_get_type(conv) == PURPLE_CONV_TYPE_CHAT &&
+				account == purple_connection_get_account(gc) &&
 				purple_conversation_get_data(conv, "want-to-rejoin")) {
 			GHashTable *comps = NULL;
-			PurpleChat *chat = purple_blist_find_chat(conv->account, conv->name);
+			const char *cname = purple_conversation_get_name(conv);
+			PurpleChat *chat = purple_blist_find_chat(account, cname);
 			if (chat == NULL) {
 				if (PURPLE_PLUGIN_PROTOCOL_INFO(purple_connection_get_prpl(gc))->chat_info_defaults != NULL)
-					comps = PURPLE_PLUGIN_PROTOCOL_INFO(purple_connection_get_prpl(gc))->chat_info_defaults(gc, conv->name);
+					comps = PURPLE_PLUGIN_PROTOCOL_INFO(purple_connection_get_prpl(gc))->chat_info_defaults(gc, cname);
 			} else {
 				comps = purple_chat_get_components(chat);
 			}
@@ -7738,7 +7783,8 @@ message_compare(gconstpointer p1, gconst
 message_compare(gconstpointer p1, gconstpointer p2)
 {
 	const PurpleConvMessage *m1 = p1, *m2 = p2;
-	return (m1->when > m2->when);
+	return (purple_conversation_message_get_timestamp((PurpleConvMessage *)m1) >
+			purple_conversation_message_get_timestamp((PurpleConvMessage *)m2));
 }
 
 /* Adds some message history to the gtkconv. This happens in a idle-callback. */
@@ -7749,16 +7795,23 @@ add_message_history_to_gtkconv(gpointer 
 	int count = 0;
 	int timer = gtkconv->attach.timer;
 	time_t when = GPOINTER_TO_INT(g_object_get_data(G_OBJECT(gtkconv->entry), "attach-start-time"));
-	gboolean im = (gtkconv->active_conv->type == PURPLE_CONV_TYPE_IM);
+	gboolean im = (purple_conversation_get_type(gtkconv->active_conv) == PURPLE_CONV_TYPE_IM);
 
+#define ADD_PURPLE_MESSAGE(msg) pidgin_conv_write_conv(purple_conversation_message_get_conversation((msg)), \
+		purple_conversation_message_get_sender((msg)), \
+		purple_conversation_message_get_alias((msg)), \
+		purple_conversation_message_get_message((msg)), \
+		purple_conversation_message_get_flags((msg)), \
+		purple_conversation_message_get_timestamp((msg)));
+
 	gtkconv->attach.timer = 0;
 	while (gtkconv->attach.current && count < 100) {  /* XXX: 100 is a random value here */
 		PurpleConvMessage *msg = gtkconv->attach.current->data;
-		if (!im && when && when < msg->when) {
+		if (!im && when && when < purple_conversation_message_get_timestamp(msg)) {
 			gtk_imhtml_append_text(GTK_IMHTML(gtkconv->imhtml), "<BR><HR>", 0);
 			g_object_set_data(G_OBJECT(gtkconv->entry), "attach-start-time", NULL);
 		}
-		pidgin_conv_write_conv(msg->conv, msg->who, msg->alias, msg->what, msg->flags, msg->when);
+		ADD_PURPLE_MESSAGE(msg);
 		if (im) {
 			gtkconv->attach.current = g_list_delete_link(gtkconv->attach.current, gtkconv->attach.current);
 		} else {
@@ -7781,14 +7834,14 @@ add_message_history_to_gtkconv(gpointer 
 			GList *history = purple_conversation_get_message_history(conv);
 			for (; history; history = history->next) {
 				PurpleConvMessage *msg = history->data;
-				if (msg->when > when)
+				if (purple_conversation_message_get_timestamp(msg) > when)
 					msgs = g_list_prepend(msgs, msg);
 			}
 		}
 		msgs = g_list_sort(msgs, message_compare);
 		for (; msgs; msgs = g_list_delete_link(msgs, msgs)) {
 			PurpleConvMessage *msg = msgs->data;
-			pidgin_conv_write_conv(msg->conv, msg->who, msg->alias, msg->what, msg->flags, msg->when);
+			ADD_PURPLE_MESSAGE(msg);
 		}
 		gtk_imhtml_append_text(GTK_IMHTML(gtkconv->imhtml), "<BR><HR>", 0);
 		g_object_set_data(G_OBJECT(gtkconv->entry), "attach-start-time", NULL);
@@ -7798,6 +7851,7 @@ add_message_history_to_gtkconv(gpointer 
 	purple_signal_emit(pidgin_conversations_get_handle(),
 			"conversation-displayed", gtkconv);
 	return FALSE;
+#undef ADD_PURPLE_MESSAGE
 }
 
 static void
@@ -7866,16 +7920,17 @@ gboolean pidgin_conv_attach_to_conversat
 				g_return_val_if_reached(TRUE);
 		}
 		g_object_set_data(G_OBJECT(gtkconv->entry), "attach-start-time",
-				GINT_TO_POINTER(((PurpleConvMessage*)(list->data))->when));
+				GINT_TO_POINTER(purple_conversation_message_get_timestamp(list->data)));
 		gtkconv->attach.timer = g_idle_add(add_message_history_to_gtkconv, gtkconv);
 	} else {
 		purple_signal_emit(pidgin_conversations_get_handle(),
 				"conversation-displayed", gtkconv);
 	}
 
-	if (conv->type == PURPLE_CONV_TYPE_CHAT) {
+	if (purple_conversation_get_type(conv) == PURPLE_CONV_TYPE_CHAT) {
 		pidgin_conv_update_fields(conv, PIDGIN_CONV_TOPIC);
-		pidgin_conv_chat_add_users(conv, PURPLE_CONV_CHAT(conv)->in_room, TRUE);
+		pidgin_conv_chat_add_users(conv,
+				purple_conv_chat_get_users(PURPLE_CONV_CHAT(conv)), TRUE);
 	}
 
 	return TRUE;
@@ -9043,19 +9098,21 @@ infopane_entry_activate(PidginConversati
 	GtkWidget *entry = NULL;
 	PurpleConversation *conv = gtkconv->active_conv;
 	const char *text = NULL;
+	PurpleAccount *account;
 
 	if (!GTK_WIDGET_VISIBLE(gtkconv->infopane)) {
 		/* There's already an entry for alias. Let's not create another one. */
 		return FALSE;
 	}
 
-	if (!purple_account_is_connected(gtkconv->active_conv->account)) {
+	account = purple_conversation_get_account(conv);
+	if (!purple_account_is_connected(account)) {
 		/* Do not allow aliasing someone on a disconnected account. */
 		return FALSE;
 	}
 
 	if (purple_conversation_get_type(conv) == PURPLE_CONV_TYPE_IM) {
-		PurpleBuddy *buddy = purple_find_buddy(gtkconv->active_conv->account, gtkconv->active_conv->name);
+		PurpleBuddy *buddy = purple_conversation_find_buddy(conv);
 		if (!buddy)
 			/* This buddy isn't in your buddy list, so we can't alias him */
 			return FALSE;
============================================================
--- pidgin/gtkconv.h	14f29d7df218ed938bafdb7e36c274f124d39669
+++ pidgin/gtkconv.h	414f7687357e9636f052e53b08a1dcab31602acf
@@ -56,7 +56,7 @@ enum {
 };
 
 #define PIDGIN_CONVERSATION(conv) \
-	((PidginConversation *)(conv)->ui_data)
+	((PidginConversation *)purple_object_get_ui_data(PURPLE_OBJECT(conv)))
 
 #define PIDGIN_IS_PIDGIN_CONVERSATION(conv) \
 	(purple_conversation_get_ui_ops(conv) == \
============================================================
--- pidgin/gtkutils.c	c38563a7860ded3735b78cd31cc65d54a31255c7
+++ pidgin/gtkutils.c	b09b0403c9ad8a7dfeb8da475131946722eb38b4
@@ -3312,7 +3312,7 @@ save_file_cb(GtkWidget *item, const char
 		return TRUE;
 	purple_request_file(conv->active_conv, _("Save File"), NULL, TRUE,
 	                    G_CALLBACK(savefile_write_cb), NULL,
-	                    conv->active_conv->account, NULL, conv->active_conv,
+	                    purple_conversation_get_account(conv->active_conv), NULL, conv->active_conv,
 	                    (void *)url);
 	return TRUE;
 }
============================================================
--- pidgin/gtkblist.c	712a39e1a7d0ad4914544514b7603e1d37858ce9
+++ pidgin/gtkblist.c	cf6c26c868ab30f73bfa46b3efd26d0a558baffd
@@ -4647,12 +4647,17 @@ conversation_updated_cb(PurpleConversati
 	GList *convs = NULL;
 	GList *ims, *chats;
 	GList *l = NULL;
+	PurpleAccount *account;
+	const char *cname;
 
 	if (type != PURPLE_CONV_UPDATE_UNSEEN)
 		return;
 
-	if(conv->account != NULL && conv->name != NULL) {
-		PurpleBuddy *buddy = purple_find_buddy(conv->account, conv->name);
+	account = purple_conversation_get_account(conv);
+	cname = purple_conversation_get_name(conv);
+
+	if(account != NULL && cname != NULL) {
+		PurpleBuddy *buddy = purple_find_buddy(account, cname);
 		if(buddy != NULL)
 			pidgin_blist_update_buddy((PurpleBlistNode *)buddy, TRUE);
 	}
@@ -4761,10 +4766,12 @@ conversation_created_cb(PurpleConversati
 static void
 conversation_created_cb(PurpleConversation *conv, PidginBuddyList *gtkblist)
 {
-	switch (conv->type) {
+	PurpleAccount *account = purple_conversation_get_account(conv);
+	const char *cname = purple_conversation_get_name(conv);
+	switch (purple_conversation_get_type(conv)) {
 		case PURPLE_CONV_TYPE_IM:
 			{
-				GSList *buddies = purple_find_buddies(conv->account, conv->name);
+				GSList *buddies = purple_find_buddies(account, cname);
 				while (buddies) {
 					PurpleBlistNode *buddy = buddies->data;
 					struct _pidgin_blist_node *ui = purple_blist_node_get_ui_data(PURPLE_BLIST_NODE(buddy));
@@ -4785,7 +4792,7 @@ conversation_created_cb(PurpleConversati
 			break;
 		case PURPLE_CONV_TYPE_CHAT:
 			{
-				PurpleChat *chat = purple_blist_find_chat(conv->account, conv->name);
+				PurpleChat *chat = purple_blist_find_chat(account, cname);
 				struct _pidgin_blist_node *ui;
 				if (!chat)
 					break;
============================================================
--- pidgin/gtksound.c	54026c79b3d8711de42312d856fadd3a29d43c17
+++ pidgin/gtksound.c	323b4e2c0eef330c314c827c9d52f84f206ebb76
@@ -91,13 +91,16 @@ chat_nick_matches_name(PurpleConversatio
 	char *nick = NULL;
 	char *name = NULL;
 	gboolean ret = FALSE;
+	PurpleAccount *account;
+
 	chat = purple_conversation_get_chat_data(conv);
+	account = purple_conversation_get_account(conv);
 
 	if (chat==NULL)
 		return ret;
 
-	nick = g_strdup(purple_normalize(conv->account, chat->nick));
-	name = g_strdup(purple_normalize(conv->account, aname));
+	nick = g_strdup(purple_normalize(account, purple_conv_chat_get_nick(chat)));
+	name = g_strdup(purple_normalize(account, aname));
 
 	if (g_utf8_collate(nick, name) == 0)
 		ret = TRUE;
@@ -212,7 +215,8 @@ chat_msg_received_cb(PurpleAccount *acco
 	if (chat_nick_matches_name(conv, sender))
 		return;
 
-	if (flags & PURPLE_MESSAGE_NICK || purple_utf8_has_word(message, chat->nick))
+	if (flags & PURPLE_MESSAGE_NICK || purple_utf8_has_word(message,
+				purple_conv_chat_get_nick(chat)))
 		/* This isn't quite right; if you have the PURPLE_SOUND_CHAT_NICK event disabled
 		 * and the PURPLE_SOUND_CHAT_SAY event enabled, you won't get a sound at all */
 		play_conv_event(conv, PURPLE_SOUND_CHAT_NICK);
============================================================
--- libpurple/protocols/yahoo/yahoochat.c	37a308993cfdf5ae0d07d3b7c418fe2a75a233d2
+++ libpurple/protocols/yahoo/yahoochat.c	4f492bdd00f01c867de53ffb1f17b64fdf686cdb
@@ -1170,17 +1170,18 @@ void yahoo_c_invite(PurpleConnection *gc
 void yahoo_c_invite(PurpleConnection *gc, int id, const char *msg, const char *name)
 {
 	PurpleConversation *c;
+	const char *cname = NULL;
 
 	c = purple_find_chat(gc, id);
-	if (!c || !c->name)
+	if (!c || !(cname = purple_conversation_get_name(c)))
 		return;
 
 	if (id != YAHOO_CHAT_ID) {
 		yahoo_conf_invite(gc, c, purple_connection_get_display_name(gc), name,
-							purple_conversation_get_name(c), msg);
+							cname, msg);
 	} else {
 		yahoo_chat_invite(gc, purple_connection_get_display_name(gc), name,
-							purple_conversation_get_name(c), msg);
+							cname, msg);
 	}
 }
 
============================================================
--- libpurple/protocols/sametime/sametime.c	d5685244b028f473d975f15b255bc2afa1208c01
+++ libpurple/protocols/sametime/sametime.c	ebc955997a18dc6968a41e29219554f786e6068c
@@ -2467,12 +2467,12 @@ static void convo_error(struct mwConvers
   text = g_strconcat(_("Unable to send message: "), tmp, NULL);
   
   gconv = convo_get_gconv(conv);
-  if(gconv && !purple_conv_present_error(idb->user, gconv->account, text)) {
+  if(gconv && !purple_conv_present_error(idb->user, purple_conversation_get_account(gconv), text)) {
     
     g_free(text);
     text = g_strdup_printf(_("Unable to send message to %s:"),
 			   (idb->user)? idb->user: "(unknown)");
-    purple_notify_error(purple_account_get_connection(gconv->account),
+    purple_notify_error(purple_conversation_get_gc(gconv),
 		      NULL, text, tmp);
   }
   
============================================================
--- finch/gntconv.c	e3f43505221763d51b2d44c9b99d01fd26fbb01d
+++ finch/gntconv.c	22fb7cb7059e5732681c54e42afe688a00dc99ab
@@ -1045,8 +1045,9 @@ static const char *
 }
 
 static const char *
-chat_flag_text(PurpleConvChatBuddyFlags flags)
+chat_flag_text(PurpleConvChatBuddy *cb)
 {
+	PurpleConvChatBuddyFlags flags = purple_conv_chat_cb_get_flags(cb);
 	if (flags & PURPLE_CBFLAGS_FOUNDER)
 		return "~";
 	if (flags & PURPLE_CBFLAGS_OP)
@@ -1076,10 +1077,10 @@ finch_chat_add_users(PurpleConversation 
 		for (iter = users; iter; iter = iter->next)
 		{
 			PurpleConvChatBuddy *cbuddy = iter->data;
-			char *str;
+			const char *str;
 
-			if ((str = cbuddy->alias) == NULL)
-				str = cbuddy->name;
+			if ((str = purple_conv_chat_cb_get_alias(cbuddy)) == NULL)
+				str = purple_conv_chat_cb_get_name(cbuddy);
 			g_string_append_printf(string, "[ %s ]", str);
 		}
 
@@ -1092,10 +1093,14 @@ finch_chat_add_users(PurpleConversation 
 	{
 		PurpleConvChatBuddy *cbuddy = users->data;
 		GntTree *tree = GNT_TREE(ggc->u.chat->userlist);
-		gnt_entry_add_suggest(entry, cbuddy->name);
-		gnt_entry_add_suggest(entry, cbuddy->alias);
-		gnt_tree_add_row_after(tree, g_strdup(cbuddy->name),
-				gnt_tree_create_row(tree, chat_flag_text(cbuddy->flags), cbuddy->alias), NULL, NULL);
+		const char *name = purple_conv_chat_cb_get_name(cbuddy);
+		const char *alias = purple_conv_chat_cb_get_alias(cbuddy);
+		gnt_entry_add_suggest(entry, name);
+		gnt_entry_add_suggest(entry, alias);
+		gnt_tree_add_row_after(tree, g_strdup(name),
+				gnt_tree_create_row(tree,
+					chat_flag_text(cbuddy),
+					alias), NULL, NULL);
 	}
 }
 
@@ -1114,7 +1119,7 @@ finch_chat_rename_user(PurpleConversatio
 	gnt_entry_add_suggest(entry, new_n);
 	gnt_entry_add_suggest(entry, new_a);
 	gnt_tree_add_row_after(tree, g_strdup(new_n),
-			gnt_tree_create_row(tree, chat_flag_text(cb->flags), new_a), NULL, NULL);
+			gnt_tree_create_row(tree, chat_flag_text(cb), new_a), NULL, NULL);
 }
 
 static void
@@ -1135,7 +1140,7 @@ finch_chat_update_user(PurpleConversatio
 {
 	PurpleConvChatBuddy *cb = purple_conv_chat_cb_find(PURPLE_CONV_CHAT(conv), user);
 	FinchConv *ggc = purple_conversation_get_ui_data(conv);
-	gnt_tree_change_text(GNT_TREE(ggc->u.chat->userlist), (gpointer)user, 0, chat_flag_text(cb->flags));
+	gnt_tree_change_text(GNT_TREE(ggc->u.chat->userlist), (gpointer)user, 0, chat_flag_text(cb));
 }
 
 static void
============================================================
--- finch/gntconv.h	e984893c5c04f0d20fea57943e945c475ce755a6
+++ finch/gntconv.h	5b713474544c23965cb5b27c1a4a72739f80c131
@@ -33,7 +33,7 @@
 #include "conversation.h"
 
 /* Grabs the conv out of a PurpleConverstation */
-#define FINCH_CONV(conv) ((FinchConv *)(conv)->ui_data)
+#define FINCH_CONV(conv) ((FinchConv *)purple_object_get_ui_data(PURPLE_OBJECT(conv)))
 
 /***************************************************************************
  * @name GNT Conversations API
============================================================
--- finch/gntsound.c	5bd28a2f3f6e4e20199aa67f682430556d76272c
+++ finch/gntsound.c	feb89b6599af3484fd0f091ca464426f7c9525f3
@@ -150,7 +150,7 @@ chat_nick_matches_name(PurpleConversatio
 		return ret;
 
 	account = purple_conversation_get_account(conv);
-	nick = g_strdup(purple_normalize(account, chat->nick));
+	nick = g_strdup(purple_normalize(account, purple_conv_chat_get_nick(chat)));
 	name = g_strdup(purple_normalize(account, aname));
 
 	if (g_utf8_collate(nick, name) == 0)
@@ -268,7 +268,7 @@ chat_msg_received_cb(PurpleAccount *acco
 	if (chat_nick_matches_name(conv, sender))
 		return;
 
-	if (flags & PURPLE_MESSAGE_NICK || purple_utf8_has_word(message, chat->nick))
+	if (flags & PURPLE_MESSAGE_NICK || purple_utf8_has_word(message, purple_conv_chat_get_nick(chat)))
 		play_conv_event(conv, PURPLE_SOUND_CHAT_NICK);
 	else
 		play_conv_event(conv, event);


More information about the Commits mailing list