im.pidgin.pidgin: 04e7d54475c3ddf91ad523e3e58521bc4fa59c85
ecoffey at soc.pidgin.im
ecoffey at soc.pidgin.im
Wed Jan 30 21:31:08 EST 2008
-----------------------------------------------------------------
Revision: 04e7d54475c3ddf91ad523e3e58521bc4fa59c85
Ancestor: ae7f8e3acb446776f833c3b44514295ae56184b3
Author: ecoffey at soc.pidgin.im
Date: 2008-01-31T02:23:55
Branch: im.pidgin.pidgin
Modified files:
libpurple/account.c
ChangeLog:
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.
-------------- next part --------------
============================================================
--- libpurple/account.c 3222057e6c050dd6e14b726c94ce5570f19a507e
+++ libpurple/account.c 4d59135382cc3ef5ce38072eb7f30c26c1e349c2
@@ -2200,9 +2200,13 @@ purple_account_add_buddy(PurpleAccount *
{
PurplePluginProtocolInfo *prpl_info = NULL;
PurpleConnection *gc = purple_account_get_connection(account);
+ PurplePlugin *prpl = NULL;
+
+ if (gc != NULL)
+ prpl = purple_connection_get_prpl(gc);
- if (gc != NULL && gc->prpl != NULL)
- prpl_info = PURPLE_PLUGIN_PROTOCOL_INFO(gc->prpl);
+ 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 @@ purple_account_add_buddies(PurpleAccount
{
PurplePluginProtocolInfo *prpl_info = NULL;
PurpleConnection *gc = purple_account_get_connection(account);
+ PurplePlugin *prpl = NULL;
+
+ if (gc != NULL)
+ prpl = purple_connection_get_prpl(gc);
- if (gc != NULL && gc->prpl != NULL)
- prpl_info = PURPLE_PLUGIN_PROTOCOL_INFO(gc->prpl);
-
+ if (prpl != NULL)
+ prpl_info = PURPLE_PLUGIN_PROTOCOL_INFO(prpl);
+
if (prpl_info) {
GList *cur, *groups = NULL;
@@ -2248,10 +2256,14 @@ purple_account_remove_buddy(PurpleAccoun
{
PurplePluginProtocolInfo *prpl_info = NULL;
PurpleConnection *gc = purple_account_get_connection(account);
+ PurplePlugin *prpl = NULL;
+
+ if (gc != NULL)
+ prpl = purple_connection_get_prpl(gc);
- if (gc != NULL && gc->prpl != NULL)
- prpl_info = PURPLE_PLUGIN_PROTOCOL_INFO(gc->prpl);
-
+ 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 @@ purple_account_remove_buddies(PurpleAcco
{
PurplePluginProtocolInfo *prpl_info = NULL;
PurpleConnection *gc = purple_account_get_connection(account);
+ PurplePlugin *prpl = NULL;
+
+ if (gc != NULL)
+ prpl = purple_connection_get_prpl(gc);
- if (gc != NULL && gc->prpl != NULL)
- prpl_info = PURPLE_PLUGIN_PROTOCOL_INFO(gc->prpl);
-
+ 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 @@ purple_account_remove_group(PurpleAccoun
{
PurplePluginProtocolInfo *prpl_info = NULL;
PurpleConnection *gc = purple_account_get_connection(account);
+ PurplePlugin *prpl = NULL;
+
+ if (gc != NULL)
+ prpl = purple_connection_get_prpl(gc);
- if (gc != NULL && gc->prpl != NULL)
- prpl_info = PURPLE_PLUGIN_PROTOCOL_INFO(gc->prpl);
+ 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 @@ purple_account_change_password(PurpleAcc
{
PurplePluginProtocolInfo *prpl_info = NULL;
PurpleConnection *gc = purple_account_get_connection(account);
-
+ PurplePlugin *prpl = NULL;
+
purple_account_set_password(account, new_pw);
+
+ if (gc != NULL)
+ prpl = purple_connection_get_prpl(gc);
- if (gc != NULL && gc->prpl != NULL)
- prpl_info = PURPLE_PLUGIN_PROTOCOL_INFO(gc->prpl);
+ 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
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 = purple_connection_get_prpl(gc);
- prpl_info = PURPLE_PLUGIN_PROTOCOL_INFO(gc->prpl);
+ if (prpl != NULL)
+ prpl_info = PURPLE_PLUGIN_PROTOCOL_INFO(prpl);
if (!prpl_info || !prpl_info->offline_message)
return FALSE;
More information about the Commits
mailing list