Mercurial > pidgin
changeset 20432:703fc3437ab5
Store account specific settings in the account, not in some random blist
node that happens to be on this account (!!!)
author | Stu Tomlinson <stu@nosnilmot.com> |
---|---|
date | Sat, 26 May 2007 15:07:26 +0000 |
parents | 67cda4e0dac8 |
children | df8f443ae65f |
files | libpurple/protocols/msn/contact.c libpurple/protocols/msn/notification.c libpurple/protocols/msn/session.c libpurple/protocols/msn/session.h |
diffstat | 4 files changed, 7 insertions(+), 57 deletions(-) [+] |
line wrap: on
line diff
--- a/libpurple/protocols/msn/contact.c Sat May 26 15:06:40 2007 +0000 +++ b/libpurple/protocols/msn/contact.c Sat May 26 15:07:26 2007 +0000 @@ -169,7 +169,7 @@ LastChangeNode = xmlnode_get_child(service,"LastChange"); LastChangeStr = xmlnode_get_data(LastChangeNode); purple_debug_misc("MSNCL","LastChangeNode0 %s\n",LastChangeStr); - purple_blist_node_set_string(msn_session_get_bnode(contact->session),"CLLastChange",LastChangeStr); + purple_account_set_string(session->account, "CLLastChange",LastChangeStr); purple_debug_misc("MSNCL","LastChangeNode %s\n",LastChangeStr); memberships =xmlnode_get_child(service,"Memberships"); @@ -242,8 +242,8 @@ /*free the read buffer*/ msn_soap_free_read_buf(soapconn); - abLastChange = purple_blist_node_get_string(msn_session_get_bnode(contact->session),"ablastChange"); - dynamicItemLastChange = purple_blist_node_get_string(msn_session_get_bnode(contact->session),"dynamicItemLastChange"); + abLastChange = purple_account_get_string(session->account, "ablastChange", NULL); + dynamicItemLastChange = purple_account_get_string(session->account, "dynamicItemLastChange", NULL); msn_get_address_book(contact, abLastChange, dynamicItemLastChange); } @@ -485,12 +485,12 @@ LastChangeNode = xmlnode_get_child(abNode,"lastChange"); lastchange = xmlnode_get_data(LastChangeNode); purple_debug_info("MsnAB"," lastchanged Time:{%s}\n",lastchange); - purple_blist_node_set_string(msn_session_get_bnode(contact->session),"ablastChange",lastchange); - + purple_account_set_string(session->account, "ablastChange", lastchange); + DynamicItemLastChangedNode = xmlnode_get_child(abNode,"DynamicItemLastChanged"); dynamicChange = xmlnode_get_data(DynamicItemLastChangedNode); purple_debug_info("MsnAB"," DynamicItemLastChanged :{%s}\n",dynamicChange); - purple_blist_node_set_string(msn_session_get_bnode(contact->session),"DynamicItemLastChanged",lastchange); + purple_account_set_string(session->account, "DynamicItemLastChanged", lastchange); } xmlnode_free(node);
--- a/libpurple/protocols/msn/notification.c Sat May 26 15:06:40 2007 +0000 +++ b/libpurple/protocols/msn/notification.c Sat May 26 15:07:26 2007 +0000 @@ -1584,9 +1584,8 @@ /*starting retrieve the contact list*/ msn_userlist_load(session); - msn_session_set_bnode(session); session->contact = msn_contact_new(session); - clLastChange = purple_blist_node_get_string(msn_session_get_bnode(session),"CLLastChange"); + clLastChange = purple_account_get_string(session->account, "CLLastChange", NULL); msn_get_contact_list(session->contact, clLastChange); // msn_contact_connect(session->contact); }
--- a/libpurple/protocols/msn/session.c Sat May 26 15:06:40 2007 +0000 +++ b/libpurple/protocols/msn/session.c Sat May 26 15:07:26 2007 +0000 @@ -261,51 +261,6 @@ return swboard; } -/*setup the bnode, for MSN SOAP contact/address book op*/ -void -msn_session_set_bnode(MsnSession *session) -{ - PurpleBlistNode *gnode, *cnode, *bnode; - PurpleConnection *gc = purple_account_get_connection(session->account); - - g_return_if_fail(gc != NULL); - - /* The core used to use msn_add_buddy to add all buddies before - * being logged in. This no longer happens, so we manually iterate - * over the whole buddy list to identify sync issues. */ - for (gnode = purple_get_blist()->root; gnode; gnode = gnode->next) - { - if(!PURPLE_BLIST_NODE_IS_GROUP(gnode)) - continue; - for(cnode = gnode->child; cnode; cnode = cnode->next) { - if(!PURPLE_BLIST_NODE_IS_CONTACT(cnode)) - continue; - for(bnode = cnode->child; bnode; bnode = bnode->next) { - PurpleBuddy *b; - if(!PURPLE_BLIST_NODE_IS_BUDDY(bnode)) - continue; - b = (PurpleBuddy *)bnode; - if(b->account == gc->account){ - session->bnode = bnode; - return; - } - } - } - } - session->bnode = NULL; -} - -/*get bnode*/ -PurpleBlistNode * -msn_session_get_bnode(MsnSession *session) -{ -#if 1 - return session->bnode; -#else - return purple_get_blist()->root; -#endif -} - static void msn_session_sync_users(MsnSession *session) {
--- a/libpurple/protocols/msn/session.h Sat May 26 15:06:40 2007 +0000 +++ b/libpurple/protocols/msn/session.h Sat May 26 15:07:26 2007 +0000 @@ -246,8 +246,4 @@ void msn_session_report_user(MsnSession *session,const char *passport, char *msg,PurpleMessageFlags flags); -void msn_session_set_bnode(MsnSession *session); - -PurpleBlistNode *msn_session_get_bnode(MsnSession *session); - #endif /* _MSN_SESSION_H_ */