pidgin: 75d46d33: Use the PurpleChat accessor functions.

andrew.victor at mxit.com andrew.victor at mxit.com
Mon Oct 31 17:31:05 EDT 2011


----------------------------------------------------------------------
Revision: 75d46d336da2a157e05000cc532d4428b4d0e47c
Parent:   a7573ae2a07beb57452f4f40655052d783115e77
Author:   andrew.victor at mxit.com
Date:     10/31/11 15:21:14
Branch:   im.pidgin.pidgin
URL: http://d.pidgin.im/viewmtn/revision/info/75d46d336da2a157e05000cc532d4428b4d0e47c

Changelog: 

Use the PurpleChat accessor functions.


Changes against parent a7573ae2a07beb57452f4f40655052d783115e77

  patched  pidgin/gtkblist.c
  patched  pidgin/gtkconv.c
  patched  pidgin/gtkdialogs.c

-------------- next part --------------
============================================================
--- pidgin/gtkconv.c	2bf92aed080f88362b70cf3a4149fe3dcba795b9
+++ pidgin/gtkconv.c	b48d94dade156c67d5c5488405b63ca2ca5b055f
@@ -4604,7 +4604,7 @@ blist_node_aliased_cb(PurpleBlistNode *n
 	else if (PURPLE_BLIST_NODE_IS_BUDDY(node))
 		update_chat_alias((PurpleBuddy *)node, conv, gc, prpl_info);
 	else if (PURPLE_BLIST_NODE_IS_CHAT(node) &&
-			purple_conversation_get_account(conv) == ((PurpleChat*)node)->account)
+			purple_conversation_get_account(conv) == purple_chat_get_account((PurpleChat*)node))
 	{
 		if (old_alias == NULL || g_utf8_collate(old_alias, purple_conversation_get_title(conv)) == 0)
 			pidgin_conv_update_fields(conv, PIDGIN_CONV_SET_TITLE);
@@ -7999,7 +7999,7 @@ account_signed_off_cb(PurpleConnection *
 				if (prpl_info->chat_info_defaults != NULL)
 					comps = prpl_info->chat_info_defaults(gc, purple_conversation_get_name(conv));
 			} else {
-				comps = chat->components;
+				comps = purple_chat_get_components(chat);
 			}
 			serv_join_chat(gc, comps);
 			if (chat == NULL && comps != NULL)
============================================================
--- pidgin/gtkblist.c	f902310e3ed4f4b28baeaaa3c55c48c51713fcd0
+++ pidgin/gtkblist.c	103fb3011fde7cde954831fc3213d9f80ef83cb9
@@ -1755,7 +1755,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, purple_account_get_connection(c->account), node);
+	pidgin_append_blist_node_proto_menu(menu, purple_account_get_connection(purple_chat_get_account(c)), node);
 	pidgin_append_blist_node_extended_menu(menu, node);
 
 	pidgin_separator(menu);
@@ -2874,7 +2874,7 @@ static struct tooltip_data * create_tip_
 	if (PURPLE_BLIST_NODE_IS_BUDDY(node)) {
 		account = purple_buddy_get_account((PurpleBuddy*)(node));
 	} else if (PURPLE_BLIST_NODE_IS_CHAT(node)) {
-		account = ((PurpleChat*)(node))->account;
+		account = purple_chat_get_account((PurpleChat*)(node));
 	}
 
 	td->padding = TOOLTIP_BORDER;
@@ -3677,13 +3677,13 @@ static char *pidgin_get_tooltip_text(Pur
 		PidginBlistNode *bnode = node->ui_data;
 
 		chat = (PurpleChat *)node;
-		prpl = purple_find_prpl(purple_account_get_protocol_id(chat->account));
+		prpl = purple_find_prpl(purple_account_get_protocol_id(purple_chat_get_account(chat)));
 		prpl_info = PURPLE_PLUGIN_PROTOCOL_INFO(prpl);
 
 		connections = purple_connections_get_all();
 		if (connections && connections->next)
 		{
-			tmp = g_markup_escape_text(purple_account_get_username(chat->account), -1);
+			tmp = g_markup_escape_text(purple_account_get_username(purple_chat_get_account(chat)), -1);
 			g_string_append_printf(str, _("<b>Account:</b> %s"), tmp);
 			g_free(tmp);
 		}
@@ -3693,12 +3693,12 @@ static char *pidgin_get_tooltip_text(Pur
 		} else {
 			char *chat_name;
 			if (prpl_info && prpl_info->get_chat_name)
-				chat_name = prpl_info->get_chat_name(chat->components);
+				chat_name = prpl_info->get_chat_name(purple_chat_get_components(chat));
 			else
 				chat_name = g_strdup(purple_chat_get_name(chat));
 
 			conv = purple_find_conversation_with_account(PURPLE_CONV_TYPE_CHAT, chat_name,
-					chat->account);
+					purple_chat_get_account(chat));
 			g_free(chat_name);
 		}
 
@@ -3715,7 +3715,7 @@ static char *pidgin_get_tooltip_text(Pur
 		}
 
 		if (prpl_info && prpl_info->chat_info != NULL)
-			cur = prpl_info->chat_info(purple_account_get_connection(chat->account));
+			cur = prpl_info->chat_info(purple_account_get_connection(purple_chat_get_account(chat)));
 		else
 			cur = NULL;
 
@@ -3724,13 +3724,13 @@ static char *pidgin_get_tooltip_text(Pur
 			pce = cur->data;
 
 			if (!pce->secret && (!pce->required &&
-				g_hash_table_lookup(chat->components, pce->identifier) == NULL))
+				g_hash_table_lookup(purple_chat_get_components(chat), pce->identifier) == NULL))
 			{
 				tmp = purple_text_strip_mnemonic(pce->label);
 				name = g_markup_escape_text(tmp, -1);
 				g_free(tmp);
 				value = g_markup_escape_text(g_hash_table_lookup(
-										chat->components, pce->identifier), -1);
+										purple_chat_get_components(chat), pce->identifier), -1);
 				g_string_append_printf(str, "\n<b>%s</b> %s",
 							name ? name : "",
 							value ? value : "");
@@ -4099,7 +4099,7 @@ pidgin_blist_get_status_icon(PurpleBlist
 		if(buddy)
 			account = purple_buddy_get_account(buddy);
 		else
-			account = chat->account;
+			account = purple_chat_get_account(chat);
 
 		prpl = purple_find_prpl(purple_account_get_protocol_id(account));
 		if(!prpl)
@@ -6706,7 +6706,7 @@ static void pidgin_blist_update_chat(Pur
 
 	chat = (PurpleChat*)node;
 
-	if(purple_account_is_connected(chat->account)) {
+	if(purple_account_is_connected(purple_chat_get_account(chat))) {
 		GtkTreeIter iter;
 		GdkPixbuf *status, *avatar, *emblem, *prpl_icon;
 		const gchar *color, *font;
@@ -6770,7 +6770,7 @@ static void pidgin_blist_update_chat(Pur
 		g_free(mark);
 		mark = tmp;
 
-		prpl_icon = pidgin_create_prpl_icon(chat->account, PIDGIN_PRPL_ICON_SMALL);
+		prpl_icon = pidgin_create_prpl_icon(purple_chat_get_account(chat), PIDGIN_PRPL_ICON_SMALL);
 
 		if (theme != NULL)
 			bgcolor = pidgin_blist_theme_get_contact_color(theme);
@@ -7420,11 +7420,11 @@ static gboolean autojoin_cb(PurpleConnec
 
 			chat = (PurpleChat *)cnode;
 
-			if(chat->account != account)
+			if(purple_chat_get_account(chat) != account)
 				continue;
 
 			if (purple_blist_node_get_bool((PurpleBlistNode*)chat, "gtk-autojoin"))
-				serv_join_chat(gc, chat->components);
+				serv_join_chat(gc, purple_chat_get_components(chat));
 		}
 	}
 
============================================================
--- pidgin/gtkdialogs.c	59e789688b7714eb7e9fd00359a1181a39d6bb85
+++ pidgin/gtkdialogs.c	d3eb8153e75bbf8edc44c26abca1a4e7d7dc9dbd
@@ -1155,7 +1155,7 @@ pidgin_dialogs_alias_chat(PurpleChat *ch
 					   chat->alias, FALSE, FALSE, NULL,
 					   _("Alias"), G_CALLBACK(pidgin_dialogs_alias_chat_cb),
 					   _("Cancel"), NULL,
-					   chat->account, NULL, NULL,
+					   purple_chat_get_account(chat), NULL, NULL,
 					   chat);
 }
 
@@ -1275,7 +1275,7 @@ pidgin_dialogs_remove_group_cb(PurpleGro
 		} else if (PURPLE_BLIST_NODE_IS_CHAT(cnode)) {
 			PurpleChat *chat = (PurpleChat *)cnode;
 			cnode = cnode->next;
-			if (purple_account_is_connected(chat->account))
+			if (purple_account_is_connected(purple_chat_get_account(chat)))
 				purple_blist_remove_chat(chat);
 		} else {
 			cnode = cnode->next;
@@ -1362,7 +1362,7 @@ pidgin_dialogs_remove_chat(PurpleChat *c
 			name ? name : "");
 
 	purple_request_action(chat, NULL, _("Remove Chat"), text, 0,
-						chat->account, NULL, NULL,
+						purple_chat_get_account(chat), NULL, NULL,
 						chat, 2,
 						_("_Remove Chat"), G_CALLBACK(pidgin_dialogs_remove_chat_cb),
 						_("Cancel"), NULL);


More information about the Commits mailing list