gobjectification: afea245e: Get all the prpls to compile (including ...
sadrul at pidgin.im
sadrul at pidgin.im
Tue Jul 13 18:04:05 EDT 2010
----------------------------------------------------------------------
Revision: afea245ee14d67972cad842c1c91d294a0401fba
Parent: f47731b3a72637e4e13f98b4d5eb915080456bc3
Author: sadrul at pidgin.im
Date: 07/13/10 14:15:45
Branch: im.pidgin.gobjectification
URL: http://d.pidgin.im/viewmtn/revision/info/afea245ee14d67972cad842c1c91d294a0401fba
Changelog:
Get all the prpls to compile (including sametime).
Changes against parent f47731b3a72637e4e13f98b4d5eb915080456bc3
patched libpurple/protocols/jabber/caps.c
patched libpurple/protocols/jabber/libxmpp.c
patched libpurple/protocols/msn/msn.c
patched libpurple/protocols/myspace/myspace.c
patched libpurple/protocols/oscar/oscar.c
patched libpurple/protocols/sametime/sametime.c
patched libpurple/protocols/yahoo/libyahoo.c
-------------- next part --------------
============================================================
--- libpurple/protocols/msn/msn.c 532b2edd73707c34b47a4b12eaae63e3ae39ebf3
+++ libpurple/protocols/msn/msn.c 943b8ab8232bc01584c015da10ea8f9a6238d9be
@@ -24,6 +24,7 @@
#define PHOTO_SUPPORT 1
#include "msn.h"
+#include "accountlist.h"
#include "accountopt.h"
#include "contact.h"
#include "msg.h"
@@ -2741,7 +2742,7 @@ static PurpleAccount *find_acct(const ch
if (acct && !purple_account_is_connected(acct))
acct = NULL;
} else { /* Otherwise find an active account for the protocol */
- GList *l = purple_accounts_get_all();
+ GList *l = purple_accounts_all();
while (l) {
if (!strcmp(prpl, purple_account_get_protocol_id(l->data))
&& purple_account_is_connected(l->data)) {
============================================================
--- libpurple/protocols/oscar/oscar.c 965032a50dc9c4a7b80702915391cb2eb0ddd18e
+++ libpurple/protocols/oscar/oscar.c ee3c932e814101d71079bf291e8991149871d2b2
@@ -31,6 +31,7 @@
#include "internal.h"
#include "account.h"
+#include "accountlist.h"
#include "accountopt.h"
#include "buddyicon.h"
#include "conversation.h"
@@ -7084,7 +7085,7 @@ static PurpleAccount *find_acct(const ch
if (acct && !purple_account_is_connected(acct))
acct = NULL;
} else { /* Otherwise find an active account for the protocol */
- GList *l = purple_accounts_get_all();
+ GList *l = purple_accounts_all();
while (l) {
if (!strcmp(prpl, purple_account_get_protocol_id(l->data))
&& purple_account_is_connected(l->data)) {
============================================================
--- libpurple/protocols/sametime/sametime.c 88f395f5b9690a48236c667b05acf60f8959d4b1
+++ libpurple/protocols/sametime/sametime.c d5685244b028f473d975f15b255bc2afa1208c01
@@ -578,8 +578,7 @@ static void mw_aware_list_on_aware(struc
struct mwServiceResolve *srvc;
GList *query;
- buddy = purple_buddy_new(acct, id, NULL);
- purple_blist_add_buddy(buddy, NULL, group, NULL);
+ buddy = purple_buddy_new(acct, id, NULL, PURPLE_BLIST_NODE(group));
bnode = (PurpleBlistNode *) buddy;
@@ -673,13 +672,13 @@ static void blist_export(PurpleConnectio
g_return_if_fail(acct != NULL);
for(gn = purple_blist_get_root(); gn;
- gn = purple_blist_node_get_sibling_next(gn)) {
+ gn = purple_blist_node_next(gn)) {
const char *owner;
const char *gname;
enum mwSametimeGroupType gtype;
gboolean gopen;
- if(! PURPLE_BLIST_NODE_IS_GROUP(gn)) continue;
+ if(! PURPLE_IS_GROUP(gn)) continue;
grp = (PurpleGroup *) gn;
/* the group's type (normal or dynamic) */
@@ -712,15 +711,15 @@ static void blist_export(PurpleConnectio
if(gtype == mwSametimeGroup_DYNAMIC)
continue;
- for(cn = purple_blist_node_get_first_child(gn);
+ for(cn = purple_blist_node_first_child(gn);
cn;
- cn = purple_blist_node_get_sibling_next(cn)) {
- if(! PURPLE_BLIST_NODE_IS_CONTACT(cn)) continue;
+ cn = purple_blist_node_next(cn)) {
+ if(! PURPLE_IS_CONTACT(cn)) continue;
- for(bn = purple_blist_node_get_first_child(cn);
+ for(bn = purple_blist_node_first_child(cn);
bn;
- bn = purple_blist_node_get_sibling_next(bn)) {
- if(! PURPLE_BLIST_NODE_IS_BUDDY(bn)) continue;
+ bn = purple_blist_node_next(bn)) {
+ if(! PURPLE_IS_BUDDY(bn)) continue;
if(! PURPLE_BLIST_NODE_SHOULD_SAVE(bn)) continue;
bdy = (PurpleBuddy *) bn;
@@ -837,7 +836,7 @@ static void buddy_add(struct mwPurplePlu
list = list_ensure(pd, group);
if(mwAwareList_addAware(list, add)) {
- purple_blist_remove_buddy(buddy);
+ purple_blist_node_remove(PURPLE_BLIST_NODE(buddy));
}
blist_schedule(pd);
@@ -865,13 +864,12 @@ static PurpleBuddy *buddy_ensure(PurpleC
buddy = purple_find_buddy_in_group(acct, id, group);
if(! buddy) {
- buddy = purple_buddy_new(acct, id, alias);
-
- purple_blist_add_buddy(buddy, NULL, group, NULL);
+ buddy = purple_buddy_new(acct, id, alias, PURPLE_BLIST_NODE(group));
+
buddy_add(pd, buddy);
}
-
- purple_blist_alias_buddy(buddy, alias);
+
+ purple_buddy_set_alias(buddy, alias);
purple_blist_server_alias_buddy(buddy, name);
purple_blist_node_set_string((PurpleBlistNode *) buddy, BUDDY_KEY_NAME, name);
purple_blist_node_set_int((PurpleBlistNode *) buddy, BUDDY_KEY_TYPE, type);
@@ -907,7 +905,6 @@ static PurpleGroup *group_ensure(PurpleC
struct mwSametimeGroup *stgroup) {
PurpleAccount *acct;
PurpleGroup *group = NULL;
- PurpleBuddyList *blist;
PurpleBlistNode *gn;
const char *name, *alias, *owner;
enum mwSametimeGroupType type;
@@ -915,9 +912,6 @@ static PurpleGroup *group_ensure(PurpleC
acct = purple_connection_get_account(gc);
owner = purple_account_get_username(acct);
- blist = purple_get_blist();
- g_return_val_if_fail(blist != NULL, NULL);
-
name = mwSametimeGroup_getName(stgroup);
alias = mwSametimeGroup_getAlias(stgroup);
type = mwSametimeGroup_getType(stgroup);
@@ -927,9 +921,9 @@ static PurpleGroup *group_ensure(PurpleC
/* first attempt at finding the group, by the name key */
for(gn = purple_blist_get_root(); gn;
- gn = purple_blist_node_get_sibling_next(gn)) {
+ gn = purple_blist_node_next(gn)) {
const char *n, *o;
- if(! PURPLE_BLIST_NODE_IS_GROUP(gn)) continue;
+ if(! PURPLE_IS_GROUP(gn)) continue;
n = purple_blist_node_get_string(gn, GROUP_KEY_NAME);
o = purple_blist_node_get_string(gn, GROUP_KEY_OWNER);
@@ -954,7 +948,6 @@ static PurpleGroup *group_ensure(PurpleC
if(! group) {
DEBUG_INFO("creating group\n");
group = purple_group_new(alias);
- purple_blist_add_group(group, NULL);
}
gn = (PurpleBlistNode *) group;
@@ -1014,17 +1007,17 @@ static void group_clear(PurpleGroup *gro
gn = (PurpleBlistNode *) group;
- for(cn = purple_blist_node_get_first_child(gn);
+ for(cn = purple_blist_node_first_child(gn);
cn;
- cn = purple_blist_node_get_sibling_next(cn)) {
- if(! PURPLE_BLIST_NODE_IS_CONTACT(cn)) continue;
+ cn = purple_blist_node_next(cn)) {
+ if(! PURPLE_IS_CONTACT(cn)) continue;
- for(bn = purple_blist_node_get_first_child(cn);
+ for(bn = purple_blist_node_first_child(cn);
bn;
- bn = purple_blist_node_get_sibling_next(bn)) {
+ bn = purple_blist_node_next(bn)) {
PurpleBuddy *gb = (PurpleBuddy *) bn;
- if(! PURPLE_BLIST_NODE_IS_BUDDY(bn)) continue;
+ if(! PURPLE_IS_BUDDY(bn)) continue;
if(purple_buddy_get_account(gb) == acct) {
DEBUG_INFO("clearing %s from group\n", NSTR(purple_buddy_get_name(gb)));
@@ -1038,15 +1031,15 @@ static void group_clear(PurpleGroup *gro
/* remove blist entries that need to go */
while(prune) {
- purple_blist_remove_buddy(prune->data);
+ purple_blist_node_remove(PURPLE_BLIST_NODE(prune->data));
prune = g_list_delete_link(prune, prune);
}
DEBUG_INFO("cleared buddies\n");
/* optionally remove group from blist */
- if(del && !purple_blist_get_group_size(group, TRUE)) {
+ if(del && !purple_group_get_size(group, TRUE)) {
DEBUG_INFO("removing empty group\n");
- purple_blist_remove_group(group);
+ purple_blist_node_remove(PURPLE_BLIST_NODE(group));
}
}
@@ -1083,17 +1076,17 @@ static void group_prune(PurpleConnection
gn = (PurpleBlistNode *) group;
- for(cn = purple_blist_node_get_first_child(gn);
+ for(cn = purple_blist_node_first_child(gn);
cn;
- cn = purple_blist_node_get_sibling_next(cn)) {
- if(! PURPLE_BLIST_NODE_IS_CONTACT(cn)) continue;
+ cn = purple_blist_node_next(cn)) {
+ if(! PURPLE_IS_CONTACT(cn)) continue;
- for(bn = purple_blist_node_get_first_child(cn);
+ for(bn = purple_blist_node_first_child(cn);
bn;
- bn = purple_blist_node_get_sibling_next(bn)) {
+ bn = purple_blist_node_next(bn)) {
PurpleBuddy *gb = (PurpleBuddy *) bn;
- if(! PURPLE_BLIST_NODE_IS_BUDDY(bn)) continue;
+ if(! PURPLE_IS_BUDDY(bn)) continue;
/* if the account is correct and they're not in our table, mark
them for pruning */
@@ -1110,7 +1103,7 @@ static void group_prune(PurpleConnection
if(prune) {
purple_account_remove_buddies(acct, prune, NULL);
while(prune) {
- purple_blist_remove_buddy(prune->data);
+ purple_blist_node_remove(PURPLE_BLIST_NODE(prune->data));
prune = g_list_delete_link(prune, prune);
}
}
@@ -1122,7 +1115,6 @@ static void blist_sync(PurpleConnection
static void blist_sync(PurpleConnection *gc, struct mwSametimeList *stlist) {
PurpleAccount *acct;
- PurpleBuddyList *blist;
PurpleBlistNode *gn;
GHashTable *stgroups;
@@ -1139,9 +1131,6 @@ static void blist_sync(PurpleConnection
acct_n = purple_account_get_username(acct);
- blist = purple_get_blist();
- g_return_if_fail(blist != NULL);
-
/* build a hash table for quick lookup while pruning the local
list, mapping group name to group structure */
stgroups = g_hash_table_new(g_str_hash, g_str_equal);
@@ -1155,12 +1144,12 @@ static void blist_sync(PurpleConnection
/* find all groups which should be pruned from the local list */
for(gn = purple_blist_get_root(); gn;
- gn = purple_blist_node_get_sibling_next(gn)) {
+ gn = purple_blist_node_next(gn)) {
PurpleGroup *grp = (PurpleGroup *) gn;
const char *gname, *owner;
struct mwSametimeGroup *stgrp;
- if(! PURPLE_BLIST_NODE_IS_GROUP(gn)) continue;
+ if(! PURPLE_IS_GROUP(gn)) continue;
/* group not belonging to this account */
if(! purple_group_on_account(grp, acct))
@@ -1301,7 +1290,7 @@ static void blist_menu_nab(PurpleBlistNo
gc = pd->gc;
g_return_if_fail(gc != NULL);
- g_return_if_fail(PURPLE_BLIST_NODE_IS_GROUP(node));
+ g_return_if_fail(PURPLE_IS_GROUP(node));
str = g_string_new(NULL);
@@ -1332,7 +1321,7 @@ static void blist_node_menu_cb(PurpleBli
PurpleMenuAction *act;
/* we only want groups */
- if(! PURPLE_BLIST_NODE_IS_GROUP(node)) return;
+ if(! PURPLE_IS_GROUP(node)) return;
group = (PurpleGroup *) node;
acct = purple_connection_get_account(pd->gc);
@@ -1369,19 +1358,19 @@ static void blist_init(PurpleAccount *ac
GList *add_buds = NULL;
for(gnode = purple_blist_get_root(); gnode;
- gnode = purple_blist_node_get_sibling_next(gnode)) {
- if(! PURPLE_BLIST_NODE_IS_GROUP(gnode)) continue;
+ gnode = purple_blist_node_next(gnode)) {
+ if(! PURPLE_IS_GROUP(gnode)) continue;
- for(cnode = purple_blist_node_get_first_child(gnode);
+ for(cnode = purple_blist_node_first_child(gnode);
cnode;
- cnode = purple_blist_node_get_sibling_next(cnode)) {
- if(! PURPLE_BLIST_NODE_IS_CONTACT(cnode))
+ cnode = purple_blist_node_next(cnode)) {
+ if(! PURPLE_IS_CONTACT(cnode))
continue;
- for(bnode = purple_blist_node_get_first_child(cnode);
+ for(bnode = purple_blist_node_first_child(cnode);
bnode;
- bnode = purple_blist_node_get_sibling_next(bnode)) {
+ bnode = purple_blist_node_next(bnode)) {
PurpleBuddy *b;
- if(!PURPLE_BLIST_NODE_IS_BUDDY(bnode))
+ if(!PURPLE_IS_BUDDY(bnode))
continue;
b = (PurpleBuddy *)bnode;
@@ -1416,12 +1405,12 @@ static void services_starting(struct mwP
/* find all the NAB groups and subscribe to them */
for(l = purple_blist_get_root(); l;
- l = purple_blist_node_get_sibling_next(l)) {
+ l = purple_blist_node_next(l)) {
PurpleGroup *group = (PurpleGroup *) l;
enum mwSametimeGroupType gt;
const char *owner;
- if(! PURPLE_BLIST_NODE_IS_GROUP(l)) continue;
+ if(! PURPLE_IS_GROUP(l)) continue;
/* if the group is ownerless, or has an owner and we're not it,
skip it */
@@ -3561,7 +3550,7 @@ static void blist_menu_conf(PurpleBlistN
GList *l;
g_return_if_fail(node != NULL);
- g_return_if_fail(PURPLE_BLIST_NODE_IS_BUDDY(node));
+ g_return_if_fail(PURPLE_IS_BUDDY(node));
acct = purple_buddy_get_account(buddy);
g_return_if_fail(acct != NULL);
@@ -3600,7 +3589,7 @@ static void blist_menu_announce(PurpleBl
GList *rcpt;
g_return_if_fail(node != NULL);
- g_return_if_fail(PURPLE_BLIST_NODE_IS_BUDDY(node));
+ g_return_if_fail(PURPLE_IS_BUDDY(node));
acct = buddy->account;
g_return_if_fail(acct != NULL);
@@ -3629,7 +3618,7 @@ static GList *mw_prpl_blist_node_menu(Pu
GList *l = NULL;
PurpleMenuAction *act;
- if(! PURPLE_BLIST_NODE_IS_BUDDY(node))
+ if(! PURPLE_IS_BUDDY(node))
return l;
l = g_list_append(l, NULL);
@@ -4447,7 +4436,7 @@ static void add_buddy_resolved(struct mw
/* uh oh, the single result isn't identical to the search
term, better safe then sorry, so let's make sure it's who
the user meant to add */
- purple_blist_remove_buddy(buddy);
+ purple_blist_node_remove(PURPLE_BLIST_NODE(buddy));
multi_resolved_query(res, gc, data);
} else {
@@ -4467,7 +4456,7 @@ static void add_buddy_resolved(struct mw
} else {
/* prompt user if more than one match was returned */
- purple_blist_remove_buddy(buddy);
+ purple_blist_node_remove(PURPLE_BLIST_NODE(buddy));
multi_resolved_query(res, gc, data);
}
@@ -4543,7 +4532,7 @@ static void mw_prpl_add_buddy(PurpleConn
g_list_free(query);
if(req == SEARCH_ERROR) {
- purple_blist_remove_buddy(buddy);
+ purple_blist_node_remove(PURPLE_BLIST_NODE(buddy));
blist_schedule(pd);
}
}
@@ -5405,7 +5394,6 @@ static void remote_group_done(struct mwP
purple_blist_node_set_string(gn, GROUP_KEY_NAME, id);
purple_blist_node_set_int(gn, GROUP_KEY_TYPE, mwSametimeGroup_DYNAMIC);
purple_blist_node_set_string(gn, GROUP_KEY_OWNER, owner);
- purple_blist_add_group(group, NULL);
group_add(pd, group);
blist_schedule(pd);
============================================================
--- libpurple/protocols/jabber/libxmpp.c cbfca2a5d3f10d83f1d05ff858ec52306c6eee68
+++ libpurple/protocols/jabber/libxmpp.c 84a94894b6d0e3fbf2e94af270f14d8fe8d769eb
@@ -27,6 +27,7 @@
#include "internal.h"
+#include "accountlist.h"
#include "accountopt.h"
#include "core.h"
#include "debug.h"
@@ -193,7 +194,7 @@ static PurpleAccount *find_acct(const ch
if (acct && !purple_account_is_connected(acct))
acct = NULL;
} else { /* Otherwise find an active account for the protocol */
- GList *l = purple_accounts_get_all();
+ GList *l = purple_accounts_all();
while (l) {
if (!strcmp(prpl, purple_account_get_protocol_id(l->data))
&& purple_account_is_connected(l->data)) {
============================================================
--- libpurple/protocols/myspace/myspace.c fcc49f29550da8cc64b9d51257c00931c6183080
+++ libpurple/protocols/myspace/myspace.c 9c81e80d28678aec9cdcde27b59cc54f97fe2bf2
@@ -36,6 +36,7 @@
#include "myspace.h"
+#include "accountlist.h"
#include "privacy.h"
static void msim_set_status(PurpleAccount *account, PurpleStatus *status);
@@ -3555,7 +3556,7 @@ msim_uri_handler(const gchar *proto, con
/* Find our account with specified user id, or use first connected account if uid=0. */
account = NULL;
- l = purple_accounts_get_all();
+ l = purple_accounts_all();
while (l) {
if (purple_account_is_connected(l->data) &&
(uid == 0 || purple_account_get_int(l->data, "uid", 0) == uid)) {
============================================================
--- libpurple/protocols/jabber/caps.c 94854151a2e4ee7ba792db4b9c0d3035f619b330
+++ libpurple/protocols/jabber/caps.c 6a6b123be27c28ecd834f5e29a8b5e2e36623d33
@@ -26,6 +26,7 @@
#include "cipher/md5hash.h"
#include "cipher/sha1hash.h"
+#include "accountlist.h"
#include "debug.h"
#include "caps.h"
#include "iq.h"
@@ -986,7 +987,7 @@ void jabber_caps_broadcast_change()
void jabber_caps_broadcast_change()
{
- GList *node, *accounts = purple_accounts_get_all_active();
+ GList *node, *accounts = purple_accounts_actives();
for (node = accounts; node; node = node->next) {
PurpleAccount *account = node->data;
============================================================
--- libpurple/protocols/yahoo/libyahoo.c 875b38564e0465d1d3f278991eb20e9cc118127e
+++ libpurple/protocols/yahoo/libyahoo.c beb2620ae9397616434ee7cc40d6d512172c52e3
@@ -24,6 +24,7 @@
#include "internal.h"
#include <account.h>
+#include <accountlist.h>
#include <core.h>
#include "libymsg.h"
@@ -67,7 +68,7 @@ static PurpleAccount *find_acct(const ch
if (acct && !purple_account_is_connected(acct))
acct = NULL;
} else { /* Otherwise find an active account for the protocol */
- GList *l = purple_accounts_get_all();
+ GList *l = purple_accounts_all();
while (l) {
if (!strcmp(prpl, purple_account_get_protocol_id(l->data))
&& purple_account_is_connected(l->data)) {
More information about the Commits
mailing list