changeset 22231:4af9179e33df

Made account.c use purple_connection_get_prpl instead of gc->prpl. For the next minor bump would be useful to add getters for gc->flags and gc->wants_to_die. This was done with the blessing of rekkanoryo.
author Eoin Coffey <ecoffey@soc.pidgin.im>
date Thu, 31 Jan 2008 02:23:55 +0000
parents ae5917260eac
children cbf64b6f5d4a
files libpurple/account.c
diffstat 1 files changed, 54 insertions(+), 26 deletions(-) [+]
line wrap: on
line diff
--- a/libpurple/account.c	Tue Jan 29 01:51:26 2008 +0000
+++ b/libpurple/account.c	Thu Jan 31 02:23:55 2008 +0000
@@ -2200,9 +2200,13 @@
 {
 	PurplePluginProtocolInfo *prpl_info = NULL;
 	PurpleConnection *gc = purple_account_get_connection(account);
-
-	if (gc != NULL && gc->prpl != NULL)
-		prpl_info = PURPLE_PLUGIN_PROTOCOL_INFO(gc->prpl);
+	PurplePlugin *prpl = NULL;
+	
+	if (gc != NULL)
+	        prpl = purple_connection_get_prpl(gc);      
+
+	if (prpl != NULL)
+		prpl_info = PURPLE_PLUGIN_PROTOCOL_INFO(prpl);
 
 	if (prpl_info != NULL && prpl_info->add_buddy != NULL)
 		prpl_info->add_buddy(gc, buddy, purple_buddy_get_group(buddy));
@@ -2213,10 +2217,14 @@
 {
 	PurplePluginProtocolInfo *prpl_info = NULL;
 	PurpleConnection *gc = purple_account_get_connection(account);
-
-	if (gc != NULL && gc->prpl != NULL)
-		prpl_info = PURPLE_PLUGIN_PROTOCOL_INFO(gc->prpl);
-
+	PurplePlugin *prpl = NULL;
+	
+	if (gc != NULL)
+	        prpl = purple_connection_get_prpl(gc);      
+
+	if (prpl != NULL)
+		prpl_info = PURPLE_PLUGIN_PROTOCOL_INFO(prpl);
+		
 	if (prpl_info) {
 		GList *cur, *groups = NULL;
 
@@ -2248,10 +2256,14 @@
 {
 	PurplePluginProtocolInfo *prpl_info = NULL;
 	PurpleConnection *gc = purple_account_get_connection(account);
-
-	if (gc != NULL && gc->prpl != NULL)
-		prpl_info = PURPLE_PLUGIN_PROTOCOL_INFO(gc->prpl);
-
+	PurplePlugin *prpl = NULL;
+	
+	if (gc != NULL)
+	        prpl = purple_connection_get_prpl(gc);      
+
+	if (prpl != NULL)
+		prpl_info = PURPLE_PLUGIN_PROTOCOL_INFO(prpl);
+		
 	if (prpl_info && prpl_info->remove_buddy)
 		prpl_info->remove_buddy(gc, buddy, group);
 }
@@ -2261,10 +2273,14 @@
 {
 	PurplePluginProtocolInfo *prpl_info = NULL;
 	PurpleConnection *gc = purple_account_get_connection(account);
-
-	if (gc != NULL && gc->prpl != NULL)
-		prpl_info = PURPLE_PLUGIN_PROTOCOL_INFO(gc->prpl);
-
+	PurplePlugin *prpl = NULL;
+	
+	if (gc != NULL)
+	        prpl = purple_connection_get_prpl(gc);      
+
+	if (prpl != NULL)
+		prpl_info = PURPLE_PLUGIN_PROTOCOL_INFO(prpl);
+		
 	if (prpl_info) {
 		if (prpl_info->remove_buddies)
 			prpl_info->remove_buddies(gc, buddies, groups);
@@ -2285,9 +2301,13 @@
 {
 	PurplePluginProtocolInfo *prpl_info = NULL;
 	PurpleConnection *gc = purple_account_get_connection(account);
-
-	if (gc != NULL && gc->prpl != NULL)
-		prpl_info = PURPLE_PLUGIN_PROTOCOL_INFO(gc->prpl);
+	PurplePlugin *prpl = NULL;
+	
+	if (gc != NULL)
+	        prpl = purple_connection_get_prpl(gc);      
+
+	if (prpl != NULL)
+		prpl_info = PURPLE_PLUGIN_PROTOCOL_INFO(prpl);
 
 	if (prpl_info && prpl_info->remove_group)
 		prpl_info->remove_group(gc, group);
@@ -2299,11 +2319,15 @@
 {
 	PurplePluginProtocolInfo *prpl_info = NULL;
 	PurpleConnection *gc = purple_account_get_connection(account);
-
+	PurplePlugin *prpl = NULL;
+	
 	purple_account_set_password(account, new_pw);
-
-	if (gc != NULL && gc->prpl != NULL)
-		prpl_info = PURPLE_PLUGIN_PROTOCOL_INFO(gc->prpl);
+	
+	if (gc != NULL)
+	        prpl = purple_connection_get_prpl(gc);      
+
+	if (prpl != NULL)
+		prpl_info = PURPLE_PLUGIN_PROTOCOL_INFO(prpl);
 
 	if (prpl_info && prpl_info->change_passwd)
 		prpl_info->change_passwd(gc, orig_pw, new_pw);
@@ -2312,16 +2336,20 @@
 gboolean purple_account_supports_offline_message(PurpleAccount *account, PurpleBuddy *buddy)
 {
 	PurpleConnection *gc;
-	PurplePluginProtocolInfo *prpl_info;
-
+	PurplePluginProtocolInfo *prpl_info = NULL;
+	PurplePlugin *prpl = NULL;
+	
 	g_return_val_if_fail(account, FALSE);
 	g_return_val_if_fail(buddy, FALSE);
 
 	gc = purple_account_get_connection(account);
 	if (gc == NULL)
 		return FALSE;
-
-	prpl_info = PURPLE_PLUGIN_PROTOCOL_INFO(gc->prpl);
+	
+	prpl = purple_connection_get_prpl(gc);      
+
+	if (prpl != NULL)
+		prpl_info = PURPLE_PLUGIN_PROTOCOL_INFO(prpl);
 
 	if (!prpl_info || !prpl_info->offline_message)
 		return FALSE;