pidgin: 4730e565: Convert code to use the purple_account a...

andrew.victor at mxit.com andrew.victor at mxit.com
Sat Oct 1 18:31:24 EDT 2011


----------------------------------------------------------------------
Revision: 4730e56543918ba684e021d0b24d229b8c27f03d
Parent:   8540c88ef7d1366f37d8406f5088b3d0e425d944
Author:   andrew.victor at mxit.com
Date:     10/01/11 17:04:35
Branch:   im.pidgin.pidgin
URL: http://d.pidgin.im/viewmtn/revision/info/4730e56543918ba684e021d0b24d229b8c27f03d

Changelog: 

Convert code to use the purple_account accessor functions.


Changes against parent 8540c88ef7d1366f37d8406f5088b3d0e425d944

  patched  libpurple/conversation.c
  patched  libpurple/protocols/irc/irc.c
  patched  libpurple/protocols/jabber/jabber.c
  patched  libpurple/protocols/msn/contact.c
  patched  libpurple/protocols/msn/error.c
  patched  libpurple/protocols/msn/httpconn.c
  patched  libpurple/protocols/msn/msg.c
  patched  libpurple/protocols/msn/nexus.c
  patched  libpurple/protocols/msn/notification.c
  patched  libpurple/protocols/msn/oim.c
  patched  libpurple/protocols/msn/servconn.c
  patched  libpurple/protocols/msn/session.c
  patched  libpurple/protocols/msn/switchboard.c
  patched  libpurple/protocols/msn/user.c
  patched  libpurple/protocols/myspace/myspace.c
  patched  libpurple/protocols/silc/silc.c
  patched  libpurple/protocols/yahoo/libymsg.c
  patched  libpurple/protocols/zephyr/zephyr.c
  patched  pidgin/gtkblist.c
  patched  pidgin/gtkconv.c
  patched  pidgin/gtkpounce.c
  patched  pidgin/gtkprivacy.c
  patched  pidgin/plugins/adiumthemes/webkit.c
  patched  pidgin/plugins/xmppconsole.c

-------------- next part --------------
============================================================
--- libpurple/conversation.c	96f150214dbf8261c2bbccc2b0857eae0dfca25d
+++ libpurple/conversation.c	10e36f0b1dcd8c41eca3bad912c5b222ef0efaf3
@@ -526,7 +526,7 @@ purple_conversation_new(PurpleConversati
 
 		chats = g_list_prepend(chats, conv);
 
-		if ((disp = purple_connection_get_display_name(account->gc)))
+		if ((disp = purple_connection_get_display_name(purple_account_get_connection(account))))
 			purple_conv_chat_set_nick(conv->u.chat, disp);
 		else
 			purple_conv_chat_set_nick(conv->u.chat,
@@ -815,7 +815,7 @@ purple_conversation_get_gc(const PurpleC
 	if (account == NULL)
 		return NULL;
 
-	return account->gc;
+	return purple_account_get_connection(account);
 }
 
 void
============================================================
--- libpurple/protocols/irc/irc.c	052e8967ed217d8d5a10fea149f1e8d72016d99f
+++ libpurple/protocols/irc/irc.c	6afa1bb71a1a1e36e3659aa48047aedde17ea410
@@ -645,9 +645,10 @@ static void read_input(struct irc_conn *
 
 static void read_input(struct irc_conn *irc, int len)
 {
+	PurpleConnection *connection = purple_account_get_connection(irc->account);
 	char *cur, *end;
 
-	irc->account->gc->last_received = time(NULL);
+	connection->last_received = time(NULL);
 	irc->inbufused += len;
 	irc->inbuf[irc->inbufused] = '\0';
 
============================================================
--- libpurple/protocols/jabber/jabber.c	f5620e7536bc1de28a5692c34f3c353614397754
+++ libpurple/protocols/jabber/jabber.c	591890cc0c0297288cf79d6ba6be9225539cb150
@@ -3163,7 +3163,7 @@ static PurpleCmdRet jabber_cmd_buzz(Purp
 		const char *cmd, char **args, char **error, void *data)
 {
 	PurpleAccount *account = purple_conversation_get_account(conv);
-	JabberStream *js = purple_connection_get_protocol_data(account->gc);
+	JabberStream *js = purple_connection_get_protocol_data(purple_account_get_connection(account));
 	const gchar *who;
 	gchar *description;
 	PurpleBuddy *buddy;
@@ -3575,7 +3575,7 @@ jabber_cmd_mood(PurpleConversation *conv
 		const char *cmd, char **args, char **error, void *data)
 {
 	PurpleAccount *account = purple_conversation_get_account(conv);
-	JabberStream *js = purple_connection_get_protocol_data(account->gc);
+	JabberStream *js = purple_connection_get_protocol_data(purple_account_get_connection(account));
 
 	if (js->pep) {
 		/* if no argument was given, unset mood */
============================================================
--- libpurple/protocols/zephyr/zephyr.c	3a8e1bff516fc37654cf0afd6792a08e91d9b6df
+++ libpurple/protocols/zephyr/zephyr.c	77c87d8b719f8f302d07be2211a216fdffbf2cf6
@@ -1842,7 +1842,7 @@ static void zephyr_login(PurpleAccount *
 	if (zephyr_subscribe_to(zephyr,"MESSAGE","PERSONAL",zephyr->username,NULL) != ZERR_NONE) {
 		/* XXX don't translate this yet. It could be written better */
 		/* XXX error messages could be handled with more detail */
-		purple_notify_error(account->gc, NULL,
+		purple_notify_error(purple_account_get_connection(account), NULL,
 				  "Unable to subscribe to messages", "Unable to subscribe to initial messages");
 		return;
 	}
============================================================
--- libpurple/protocols/yahoo/libymsg.c	bd9527e1554a3816d566f4ef5c704dc4f082a3f9
+++ libpurple/protocols/yahoo/libymsg.c	8b54ee89c365e905e68e7e972931ab7aee147a6c
@@ -5213,7 +5213,7 @@ yahoopurple_cmd_buzz(PurpleConversation 
 	if (*args && args[0])
 		return PURPLE_CMD_RET_FAILED;
 
-	purple_prpl_send_attention(account->gc, purple_conversation_get_name(c), YAHOO_BUZZ);
+	purple_prpl_send_attention(purple_account_get_connection(account), purple_conversation_get_name(c), YAHOO_BUZZ);
 
 	return PURPLE_CMD_RET_OK;
 }
============================================================
--- pidgin/gtkconv.c	2745238db3c74c773815ff86fa10c9ced8eb531f
+++ pidgin/gtkconv.c	2c322847b757a588e843d7bef0e8e1b735e51436
@@ -1746,7 +1746,7 @@ create_chat_menu(PurpleConversation *con
 	if (buddy != NULL)
 	{
 		if (purple_account_is_connected(account))
-			pidgin_append_blist_node_proto_menu(menu, account->gc,
+			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);
@@ -1772,7 +1772,7 @@ gtkconv_chat_popup_menu_cb(GtkWidget *wi
 	gtkconv = PIDGIN_CONVERSATION(conv);
 	gtkchat = gtkconv->u.chat;
 	account = purple_conversation_get_account(conv);
-	gc      = account->gc;
+	gc      = purple_account_get_connection(account);
 
 	model = gtk_tree_view_get_model(GTK_TREE_VIEW(gtkchat->list));
 
@@ -1808,7 +1808,7 @@ right_click_chat_cb(GtkWidget *widget, G
 
 	gtkchat = gtkconv->u.chat;
 	account = purple_conversation_get_account(conv);
-	gc      = account->gc;
+	gc      = purple_account_get_connection(account);
 
 	model = gtk_tree_view_get_model(GTK_TREE_VIEW(gtkchat->list));
 
@@ -2678,7 +2678,7 @@ redraw_icon(gpointer data)
 	gtkconv = PIDGIN_CONVERSATION(conv);
 	account = purple_conversation_get_account(conv);
 
-	if (!(account && account->gc)) {
+	if (!(account && purple_account_get_connection(account))) {
 		gtkconv->u.im->icon_timer = 0;
 		return FALSE;
 	}
@@ -3303,7 +3303,7 @@ populate_menu_with_options(GtkWidget *me
 		}
 	} else if (node) {
 		if (purple_account_is_connected(account))
-			pidgin_append_blist_node_proto_menu(menu, account->gc, node);
+			pidgin_append_blist_node_proto_menu(menu, purple_account_get_connection(account), node);
 		pidgin_append_blist_node_extended_menu(menu, node);
 	}
 
@@ -4770,7 +4770,7 @@ pidgin_conv_userlist_create_tooltip(GtkW
 	PurpleAccount *account = purple_conversation_get_account(conv);
 	char *who = NULL;
 
-	if (account->gc == NULL)
+	if (purple_account_get_connection(account) == NULL)
 		return FALSE;
 
 	if (!gtk_tree_model_get_iter(GTK_TREE_MODEL(model), &iter, path))
@@ -4778,7 +4778,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(account->gc->prpl);
+	prpl_info = PURPLE_PLUGIN_PROTOCOL_INFO(purple_account_get_connection(account)->prpl);
 	node = (PurpleBlistNode*)(purple_find_buddy(purple_conversation_get_account(conv), who));
 	if (node && prpl_info && (prpl_info->options & OPT_PROTO_UNIQUE_CHATNAME))
 		pidgin_blist_draw_tooltip(node, gtkconv->infopane);
============================================================
--- libpurple/protocols/msn/msg.c	2a76bc96aa6f5db741088e1d6755f908019cb2f8
+++ libpurple/protocols/msn/msg.c	eff188d1177bac3130fb75f3fd1d1187ab428240
@@ -627,7 +627,7 @@ msn_plain_msg(MsnCmdProc *cmdproc, MsnMe
 	const char *passport;
 	const char *value;
 
-	gc = cmdproc->session->account->gc;
+	gc = purple_account_get_connection(cmdproc->session->account);
 
 	body = msn_message_get_bin_data(msg, &body_len);
 	body_enc = g_markup_escape_text(body, body_len);
@@ -713,7 +713,7 @@ msn_control_msg(MsnCmdProc *cmdproc, Msn
 	PurpleConnection *gc;
 	char *passport;
 
-	gc = cmdproc->session->account->gc;
+  	gc = purple_account_get_connection(cmdproc->session->account);
 	passport = msg->remote_user;
 
 	if (msn_message_get_header_value(msg, "TypingUser") == NULL)
@@ -762,7 +762,7 @@ datacast_inform_user(MsnSwitchBoard *swb
 
 	if (swboard->conv == NULL) {
 		if (chat)
-			swboard->conv = purple_find_chat(account->gc, swboard->chat_id);
+			swboard->conv = purple_find_chat(purple_account_get_connection(account), swboard->chat_id);
 		else {
 			swboard->conv = purple_find_conversation_with_account(PURPLE_CONV_TYPE_IM,
 									who, account);
@@ -991,21 +991,23 @@ msn_datacast_msg(MsnCmdProc *cmdproc, Ms
 		/* Nudge */
 		PurpleAccount *account;
 		const char *user;
+		PurpleConnection *gc;
 
 		account = cmdproc->session->account;
 		user = msg->remote_user;
+		gc = purple_account_get_connection(account);
 
 		if (cmdproc->servconn->type == MSN_SERVCONN_SB) {
 			MsnSwitchBoard *swboard = cmdproc->data;
 			if (swboard->current_users > 1 ||
 				((swboard->conv != NULL) &&
 				 purple_conversation_get_type(swboard->conv) == PURPLE_CONV_TYPE_CHAT))
-				purple_prpl_got_attention_in_chat(account->gc, swboard->chat_id, user, MSN_NUDGE);
+				purple_prpl_got_attention_in_chat(gc, swboard->chat_id, user, MSN_NUDGE);
 
 			else
-				purple_prpl_got_attention(account->gc, user, MSN_NUDGE);
+				purple_prpl_got_attention(gc, user, MSN_NUDGE);
 		} else {
-			purple_prpl_got_attention(account->gc, user, MSN_NUDGE);
+			purple_prpl_got_attention(gc, user, MSN_NUDGE);
 		}
 
 	} else if (!strcmp(id, "2")) {
============================================================
--- libpurple/protocols/msn/switchboard.c	5da66f3d15024b12f90845eb547015040c81c219
+++ libpurple/protocols/msn/switchboard.c	b9c0b6f6d4ccef969a653349eabd0dcee49ff81a
@@ -312,7 +312,7 @@ msn_switchboard_add_user(MsnSwitchBoard 
 
 			swboard->chat_id = msn_switchboard_get_chat_id();
 			swboard->flag |= MSN_SB_FLAG_IM;
-			swboard->conv = serv_got_joined_chat(account->gc,
+			swboard->conv = serv_got_joined_chat(purple_account_get_connection(account),
 												 swboard->chat_id,
 												 "MSN Chat");
 
@@ -750,7 +750,7 @@ out_cmd(MsnCmdProc *cmdproc, MsnCommand 
 	PurpleConnection *gc;
 	MsnSwitchBoard *swboard;
 
-	gc = cmdproc->session->account->gc;
+	gc = purple_account_get_connection(cmdproc->session->account);
 	swboard = cmdproc->data;
 
 	if (swboard->current_users > 1)
============================================================
--- pidgin/gtkpounce.c	c0872ce72e73913d5a44840f2000cb27c9b71a33
+++ pidgin/gtkpounce.c	91cb352e3bb67038d882c0212da4497f10d43d16
@@ -476,7 +476,7 @@ reset_send_msg_entry(PidginPounceDialog 
 {
 	PurpleAccount *account = pidgin_account_option_menu_get_selected(dialog->account_menu);
 	gtk_imhtml_setup_entry(GTK_IMHTML(dialog->send_msg_entry),
-			(account && account->gc) ? account->gc->flags : PURPLE_CONNECTION_HTML);
+			(account && purple_account_get_connection(account)) ? purple_account_get_connection(account)->flags : PURPLE_CONNECTION_HTML);
 }
 
 void
@@ -1483,7 +1483,7 @@ pounce_cb(PurplePounce *pounce, PurplePo
 			purple_conversation_write(conv, NULL, message,
 									PURPLE_MESSAGE_SEND, time(NULL));
 
-			serv_send_im(account->gc, (char *)pouncee, (char *)message, 0);
+			serv_send_im(purple_account_get_connection(account), (char *)pouncee, (char *)message, 0);
 		}
 	}
 
============================================================
--- pidgin/gtkblist.c	3b908cf961e761643197cc60827add394d508630
+++ pidgin/gtkblist.c	b0441c6f8cf8483cda5e65cc1d80570fefe5312f
@@ -1519,7 +1519,7 @@ pidgin_blist_make_buddy_menu(GtkWidget *
 
 	if (prpl_info && prpl_info->send_file) {
 		if (!prpl_info->can_receive_file ||
-			prpl_info->can_receive_file(buddy->account->gc, buddy->name))
+			prpl_info->can_receive_file(purple_account_get_connection(buddy->account), buddy->name))
 		{
 			pidgin_new_item_from_stock(menu, _("_Send File..."),
 									 PIDGIN_STOCK_TOOLBAR_SEND_FILE,
@@ -1547,7 +1547,7 @@ pidgin_blist_make_buddy_menu(GtkWidget *
 				NULL, G_CALLBACK(gtk_blist_menu_showoffline_cb), node, 0, 0, NULL);
 	}
 
-	pidgin_append_blist_node_proto_menu(menu, buddy->account->gc, node);
+	pidgin_append_blist_node_proto_menu(menu, purple_account_get_connection(buddy->account), node);
 	pidgin_append_blist_node_extended_menu(menu, node);
 
 	if (!contact_expanded && contact != NULL)
@@ -1600,7 +1600,7 @@ gtk_blist_key_press_cb(GtkWidget *tv, Gd
 			return FALSE;
 		}
 		if(buddy)
-			pidgin_retrieve_user_info(buddy->account->gc, buddy->name);
+			pidgin_retrieve_user_info(purple_account_get_connection(buddy->account), buddy->name);
 	} else {
 		switch (event->keyval) {
 			case GDK_F2:
@@ -1753,7 +1753,7 @@ create_chat_menu(PurpleBlistNode *node, 
 	pidgin_new_item_from_stock(menu, _("View _Log"), NULL,
 			G_CALLBACK(gtk_blist_menu_showlog_cb), node, 0, 0, NULL);
 
-	pidgin_append_blist_node_proto_menu(menu, c->account->gc, node);
+	pidgin_append_blist_node_proto_menu(menu, purple_account_get_connection(c->account), node);
 	pidgin_append_blist_node_extended_menu(menu, node);
 
 	pidgin_separator(menu);
@@ -1838,7 +1838,7 @@ create_buddy_menu(PurpleBlistNode *node,
 
 				if(buddy == b)
 					continue;
-				if(!buddy->account->gc)
+				if(!purple_account_get_connection(buddy->account))
 					continue;
 				if(!show_offline && !PURPLE_BUDDY_IS_ONLINE(buddy))
 					continue;
@@ -1967,7 +1967,7 @@ gtk_blist_button_press_cb(GtkWidget *tv,
 			prpl_info = PURPLE_PLUGIN_PROTOCOL_INFO(prpl);
 
 		if (prpl && prpl_info->get_info)
-			pidgin_retrieve_user_info(b->account->gc, b->name);
+			pidgin_retrieve_user_info(purple_account_get_connection(b->account), b->name);
 		handled = TRUE;
 	}
 
@@ -2673,8 +2673,8 @@ static GdkPixbuf *pidgin_blist_get_buddy
 		account = purple_buddy_get_account(buddy);
 	}
 
-	if(account && account->gc) {
-		prpl_info = PURPLE_PLUGIN_PROTOCOL_INFO(account->gc->prpl);
+	if(account && purple_account_get_connection(account)) {
+		prpl_info = PURPLE_PLUGIN_PROTOCOL_INFO(purple_account_get_connection(account)->prpl);
 	}
 
 #if 0
@@ -3681,7 +3681,7 @@ static char *pidgin_get_tooltip_text(Pur
 		connections = purple_connections_get_all();
 		if (connections && connections->next)
 		{
-			tmp = g_markup_escape_text(chat->account->username, -1);
+			tmp = g_markup_escape_text(purple_account_get_username(chat->account), -1);
 			g_string_append_printf(str, _("<b>Account:</b> %s"), tmp);
 			g_free(tmp);
 		}
@@ -3713,7 +3713,7 @@ static char *pidgin_get_tooltip_text(Pur
 		}
 
 		if (prpl_info && prpl_info->chat_info != NULL)
-			cur = prpl_info->chat_info(chat->account->gc);
+			cur = prpl_info->chat_info(purple_account_get_connection(chat->account));
 		else
 			cur = NULL;
 
@@ -4235,7 +4235,7 @@ pidgin_blist_get_name_markup(PurpleBuddy
 		if (prpl != NULL)
 			prpl_info = PURPLE_PLUGIN_PROTOCOL_INFO(prpl);
 
-		if (prpl_info && prpl_info->status_text && b->account->gc) {
+		if (prpl_info && prpl_info->status_text && purple_account_get_connection(b->account)) {
 			char *tmp = prpl_info->status_text(b);
 			const char *end;
 
============================================================
--- libpurple/protocols/msn/error.c	0aa59b69acf25ea8a8452b810cb23d2bde37252a
+++ libpurple/protocols/msn/error.c	bfb252c753f7cb79299d76c71d83891b4193c864
@@ -274,7 +274,7 @@ msn_error_handle(MsnSession *session, un
 	if (debug)
 		purple_debug_warning("msn", "error %d: %s\n", type, buf);
 	else
-		purple_notify_error(session->account->gc, NULL, buf, NULL);
+		purple_notify_error(purple_account_get_connection(session->account), NULL, buf, NULL);
 	g_free(buf);
 }
 
============================================================
--- libpurple/protocols/msn/notification.c	d568c550413334155dfcabc1b8673c1316437b12
+++ libpurple/protocols/msn/notification.c	1e03efe939388d3bb5a63d2b207eeb42e1462b8a
@@ -1390,7 +1390,7 @@ url_cmd(MsnCmdProc *cmdproc, MsnCommand 
 
 	session = cmdproc->session;
 	account = session->account;
-	gc = account->gc;
+	gc = purple_account_get_connection(account);
 
 	rru = cmd->params[1];
 	url = cmd->params[2];
@@ -2011,7 +2011,7 @@ initial_email_msg(MsnCmdProc *cmdproc, M
 	const char *unread;
 
 	session = cmdproc->session;
-	gc = session->account->gc;
+	gc = purple_account_get_connection(session->account);
 
 	if (strcmp(msg->remote_user, "Hotmail"))
 		/* This isn't an official message. */
@@ -2062,7 +2062,7 @@ initial_mdata_msg(MsnCmdProc *cmdproc, M
 	const char *mdata, *unread;
 
 	session = cmdproc->session;
-	gc = session->account->gc;
+	gc = purple_account_get_connection(session->account);
 
 	if (strcmp(msg->remote_user, "Hotmail"))
 		/* This isn't an official message. */
@@ -2134,7 +2134,7 @@ email_msg(MsnCmdProc *cmdproc, MsnMessag
 	char *from, *subject, *tmp;
 
 	session = cmdproc->session;
-	gc = session->account->gc;
+	gc = purple_account_get_connection(session->account);
 
 	if (strcmp(msg->remote_user, "Hotmail"))
 		/* This isn't an official message. */
@@ -2219,7 +2219,7 @@ system_msg(MsnCmdProc *cmdproc, MsnMessa
 		}
 
 		if (*buf != '\0')
-			purple_notify_info(cmdproc->session->account->gc, NULL, buf, NULL);
+			purple_notify_info(purple_account_get_connection(cmdproc->session->account), NULL, buf, NULL);
 	}
 
 	g_hash_table_destroy(table);
============================================================
--- libpurple/protocols/msn/servconn.c	837f49664be01471e06f5b056f485e643764a8ef
+++ libpurple/protocols/msn/servconn.c	9cd871a8ae4566771f95a9d281edfeb2be16a1bf
@@ -421,8 +421,10 @@ read_cb(gpointer data, gint source, Purp
 
 	servconn = data;
 
-	if (servconn->type == MSN_SERVCONN_NS)
-		servconn->session->account->gc->last_received = time(NULL);
+	if (servconn->type == MSN_SERVCONN_NS) {
+		PurpleConnection *gc = purple_account_get_connection(servconn->session->account);
+		gc->last_received = time(NULL);
+	}
 
 	len = read(servconn->fd, buf, sizeof(buf) - 1);
 	if (len < 0 && errno == EAGAIN)
============================================================
--- libpurple/protocols/msn/session.c	ecc04c767dd6d9c5f66fcc137c59e6b6d0e0cbf3
+++ libpurple/protocols/msn/session.c	942c0db801f3605c4ee4b56cfb23853109c5dbbb
@@ -459,7 +459,7 @@ msn_session_set_login_step(MsnSession *s
 	if (session->logged_in)
 		return;
 
-	gc = session->account->gc;
+	gc = purple_account_get_connection(session->account);
 
 	session->login_step = step;
 
============================================================
--- libpurple/protocols/msn/user.c	3e245a94e3db64d5eeb3943788fdf9af3c7f91ef
+++ libpurple/protocols/msn/user.c	89093932f4c0236e67e2baeb427b2788a9b1d5d9
@@ -566,7 +566,7 @@ queue_buddy_icon_request(MsnUser *user)
 		return;
 	}
 
-	if (!buddy_icon_cached(account->gc, obj)) {
+	if (!buddy_icon_cached(purple_account_get_connection(account), obj)) {
 		MsnUserList *userlist;
 
 		userlist = user->userlist;
============================================================
--- pidgin/gtkprivacy.c	35ede01236778088df25073ff624a7147be823c9
+++ pidgin/gtkprivacy.c	743e1fc257b3c00dd75889ba535ac08bb02c2dc0
@@ -211,7 +211,7 @@ select_account_cb(GtkWidget *dropdown, P
 	dialog->account = account;
 
 	for (i = 0; i < menu_entry_count; i++) {
-		if (menu_entries[i].num == account->perm_deny) {
+		if (menu_entries[i].num == purple_account_get_privacy_type(account)) {
 			gtk_combo_box_set_active(GTK_COMBO_BOX(dialog->type_menu), i);
 			break;
 		}
@@ -230,7 +230,7 @@ type_changed_cb(GtkComboBox *combo, Pidg
 {
 	int new_type = menu_entries[gtk_combo_box_get_active(combo)].num;
 
-	dialog->account->perm_deny = new_type;
+	purple_account_set_privacy_type(dialog->account, new_type);
 	serv_set_permit_deny(purple_account_get_connection(dialog->account));
 
 	gtk_widget_hide(dialog->allow_widget);
@@ -371,7 +371,7 @@ privacy_dialog_new(void)
 		gtk_combo_box_append_text(GTK_COMBO_BOX(dialog->type_menu),
 		                          _(menu_entries[i].text));
 
-		if (menu_entries[i].num == dialog->account->perm_deny)
+		if (menu_entries[i].num == purple_account_get_privacy_type(dialog->account))
 			selected = i;
 	}
 
@@ -411,12 +411,12 @@ privacy_dialog_new(void)
 
 	type_changed_cb(GTK_COMBO_BOX(dialog->type_menu), dialog);
 #if 0
-	if (dialog->account->perm_deny == PURPLE_PRIVACY_ALLOW_USERS) {
+	if (purple_account_get_privacy_type(dialog->account) == PURPLE_PRIVACY_ALLOW_USERS) {
 		gtk_widget_show(dialog->allow_widget);
 		gtk_widget_show(dialog->button_box);
 		dialog->in_allow_list = TRUE;
 	}
-	else if (dialog->account->perm_deny == PURPLE_PRIVACY_DENY_USERS) {
+	else if (purple_account_get_privacy_type(dialog->account) == PURPLE_PRIVACY_DENY_USERS) {
 		gtk_widget_show(dialog->block_widget);
 		gtk_widget_show(dialog->button_box);
 		dialog->in_allow_list = FALSE;
============================================================
--- libpurple/protocols/msn/nexus.c	3fdfb40d70dba287aa7341a5f69c9ffb57b2ff92
+++ libpurple/protocols/msn/nexus.c	9e67013ee05a64ffc50542de9e6b04830586c7f7
@@ -390,7 +390,7 @@ msn_nexus_connect(MsnNexus *nexus)
 	msn_session_set_login_step(session, MSN_LOGIN_STEP_GET_COOKIE);
 
 	username = purple_account_get_username(session->account);
-	password = purple_connection_get_password(session->account->gc);
+	password = purple_connection_get_password(purple_account_get_connection(session->account));
 	if (g_utf8_strlen(password, -1) > 16) {
 		/* max byte size for 16 utf8 characters is 64 + 1 for the null */
 		gchar truncated[65];
============================================================
--- libpurple/protocols/silc/silc.c	02dd9bb10e84e6399df513dd8fe0296f7c238403
+++ libpurple/protocols/silc/silc.c	6ed985aab444b003fca699035914a52540901bfa
@@ -555,7 +555,7 @@ silcpurple_login(PurpleAccount *account)
 	char *username, *hostname, *realname, **up;
 	int i;
 
-	gc = account->gc;
+	gc = purple_account_get_connection(account);
 	if (!gc)
 		return;
 	purple_connection_set_protocol_data(gc, NULL);
============================================================
--- libpurple/protocols/msn/httpconn.c	eb77536bdfa7a2901f12fc98a106a165687936c2
+++ libpurple/protocols/msn/httpconn.c	2d94c8c4203604fc85b65647f555053cd8fb68fc
@@ -285,8 +285,10 @@ read_cb(gpointer data, gint source, Purp
 	httpconn = data;
 	servconn = httpconn->servconn;
 
-	if (servconn->type == MSN_SERVCONN_NS)
-		servconn->session->account->gc->last_received = time(NULL);
+	if (servconn->type == MSN_SERVCONN_NS) {
+		PurpleConnection *gc = purple_account_get_connection(servconn->session);
+		gc->last_received = time(NULL);
+	}
 
 	len = read(httpconn->fd, buf, sizeof(buf) - 1);
 	if (len < 0 && errno == EAGAIN)
============================================================
--- libpurple/protocols/msn/contact.c	b4c18ff4aab916791e4dbd4f2424f0a9d6dfac2f
+++ libpurple/protocols/msn/contact.c	ed7cd7de034213cfe5d3334512827ffa86aa1e62
@@ -968,7 +968,7 @@ msn_get_address_cb(MsnSoapMessage *req, 
 	purple_debug_misc("msn", "Got the Address Book!\n");
 
 	if (msn_parse_addressbook(session, resp->xml)) {
-		msn_send_privacy(session->account->gc);
+		msn_send_privacy(purple_account_get_connection(session->account));
 		msn_notification_dump_contact(session);
 	} else {
 		/* This is making us loop infinitely when we fail to parse the
@@ -1251,7 +1251,7 @@ msn_add_contact_to_group(MsnSession *ses
 		body = g_markup_escape_text(user->invite_message, -1);
 
 		/* Ignore the cast, we treat it as const anyway. */
-		tmp = (char *)purple_connection_get_display_name(session->account->gc);
+		tmp = (char *)purple_connection_get_display_name(purple_account_get_connection(session->account));
 		tmp = tmp ? g_markup_escape_text(tmp, -1) : g_strdup("");
 
 		invite = g_strdup_printf(MSN_CONTACT_INVITE_MESSAGE_XML, body, tmp);
============================================================
--- libpurple/protocols/msn/oim.c	2a81eabd7aa57fccd6708da34d6b477abd06a967
+++ libpurple/protocols/msn/oim.c	00d90adb900e220d1660adb62c689f4075926769
@@ -695,7 +695,7 @@ msn_oim_report_to_user(MsnOimRecvData *r
 	purple_debug_info("msn", "oim Date:{%s},passport{%s}\n",
 	                  date, passport);
 
-	serv_got_im(rdata->oim->session->account->gc, passport, decode_msg, 0,
+	serv_got_im(purple_account_get_connection(rdata->oim->session->account), passport, decode_msg, 0,
 	            stamp);
 
 	/*Now get the oim message ID from the oim_list.
@@ -785,7 +785,7 @@ msn_parse_oim_xml(MsnOim *oim, xmlnode *
 
 		/* XXX/khc: pretty sure this is wrong */
 		if (count > 0)
-			purple_notify_emails(session->account->gc, count, FALSE, NULL,
+			purple_notify_emails(purple_account_get_connection(session->account), count, FALSE, NULL,
 				NULL, passports, urls, NULL, NULL);
 		g_free(unread);
 	}
============================================================
--- pidgin/plugins/xmppconsole.c	9e25d1eeabf0da6f6a01a3228263b86449daa299
+++ pidgin/plugins/xmppconsole.c	479fbed8e1b986efd0b809952f684dc6c3d2f42b
@@ -733,10 +733,10 @@ dropdown_changed_cb(GtkComboBox *widget,
 
 	account = purple_accounts_find(gtk_combo_box_get_active_text(GTK_COMBO_BOX(console->dropdown)),
 				    "prpl-jabber");
-	if (!account || !account->gc)
+	if (!account || !purple_account_get_connection(account))
 		return;
 
-	console->gc = account->gc;
+	console->gc = purple_account_get_connection(account);
 	gtk_imhtml_clear(GTK_IMHTML(console->imhtml));
 }
 
============================================================
--- libpurple/protocols/myspace/myspace.c	25b212e602342628070fa37da7070e5749a31a7d
+++ libpurple/protocols/myspace/myspace.c	b79382e6706dac93900f75d37e4ccdf08ec20596
@@ -2543,7 +2543,7 @@ msim_set_status(PurpleAccount *account, 
 
 	/* If we should be idle, set that status. Time is irrelevant here. */
 	if (purple_presence_is_idle(pres) && status_code != MSIM_STATUS_CODE_OFFLINE_OR_HIDDEN)
-		msim_set_idle(account->gc, 1);
+		msim_set_idle(purple_account_get_connection(account), 1);
 }
 
 /**
@@ -2864,7 +2864,7 @@ static const char *msim_normalize(const 
 		const char *username;
 
 		/* If the account does not exist, we can't look up the user. */
-		if (!account || !account->gc)
+		if (!account || !purple_account_get_connection(account))
 			return str;
 
 		id = atol(str);
============================================================
--- pidgin/plugins/adiumthemes/webkit.c	50318afff13e57181f2dc7cc02a3a1d9936c538d
+++ pidgin/plugins/adiumthemes/webkit.c	5337f227e8631c02a7bd3dc02f01eeb922f86877
@@ -452,7 +452,7 @@ webkit_on_displaying_im_msg(PurpleAccoun
 	}
 	purple_conversation_set_data(conv, "webkit-lastflags", GINT_TO_POINTER(flags));
 
-	smileyed = smiley_parse_markup(stripped, purple_conversation_get_account(conv)->protocol_id);
+	smileyed = smiley_parse_markup(stripped, purple_account_get_protocol_id(purple_conversation_get_account(conv)));
 	msg = replace_message_tokens(message_html, conv, name, alias, smileyed, flags, mtime);
 	escape = gtk_webview_quote_js_string(msg);
 	script = g_strdup_printf("%s(%s)", func, escape);


More information about the Commits mailing list