Mercurial > pidgin
comparison src/protocols/msn/session.c @ 19840:5568b3ac6fce
[gaim-migrate @ 17481]
gradually got SOAP contact list and address book from Server.
Cache the info in blist.xml
committer: Ethan Blanton <elb@pidgin.im>
author | Ma Yuan <mayuan2006@gmail.com> |
---|---|
date | Sat, 14 Oct 2006 20:00:56 +0000 |
parents | c590e780b3a0 |
children |
comparison
equal
deleted
inserted
replaced
19839:2b36697b05ea | 19840:5568b3ac6fce |
---|---|
40 session->notification = msn_notification_new(session); | 40 session->notification = msn_notification_new(session); |
41 session->userlist = msn_userlist_new(session); | 41 session->userlist = msn_userlist_new(session); |
42 | 42 |
43 session->user = msn_user_new(session->userlist, | 43 session->user = msn_user_new(session->userlist, |
44 gaim_account_get_username(account), NULL); | 44 gaim_account_get_username(account), NULL); |
45 | 45 session->bnode = NULL; |
46 | |
46 /*if you want to chat with Yahoo Messenger*/ | 47 /*if you want to chat with Yahoo Messenger*/ |
47 //session->protocol_ver = WLM_YAHOO_PROT_VER; | 48 //session->protocol_ver = WLM_YAHOO_PROT_VER; |
48 session->protocol_ver = WLM_PROT_VER; | 49 session->protocol_ver = WLM_PROT_VER; |
49 session->conv_seq = 1; | 50 session->conv_seq = 1; |
50 | 51 |
256 } | 257 } |
257 | 258 |
258 swboard->flag |= flag; | 259 swboard->flag |= flag; |
259 | 260 |
260 return swboard; | 261 return swboard; |
262 } | |
263 | |
264 /*setup the bnode, for MSN SOAP contact/address book op*/ | |
265 void | |
266 msn_session_set_bnode(MsnSession *session) | |
267 { | |
268 GaimBlistNode *gnode, *cnode, *bnode; | |
269 GaimConnection *gc = gaim_account_get_connection(session->account); | |
270 | |
271 g_return_if_fail(gc != NULL); | |
272 | |
273 for (gnode = gaim_get_blist()->root; gnode; gnode = gnode->next){ | |
274 if(!GAIM_BLIST_NODE_IS_GROUP(gnode)) | |
275 continue; | |
276 for(cnode = gnode->child; cnode; cnode = cnode->next) { | |
277 if(!GAIM_BLIST_NODE_IS_CONTACT(cnode)) | |
278 continue; | |
279 for(bnode = cnode->child; bnode; bnode = bnode->next) { | |
280 GaimBuddy *b; | |
281 if(!GAIM_BLIST_NODE_IS_BUDDY(bnode)) | |
282 continue; | |
283 b = (GaimBuddy *)bnode; | |
284 if(b->account == gc->account){ | |
285 session->bnode = bnode; | |
286 return; | |
287 } | |
288 } | |
289 } | |
290 } | |
291 session->bnode = NULL; | |
292 } | |
293 | |
294 /*get bnode*/ | |
295 GaimBlistNode * | |
296 msn_session_get_bnode(MsnSession *session) | |
297 { | |
298 #if 1 | |
299 return session->bnode; | |
300 #else | |
301 return gaim_get_blist()->root; | |
302 #endif | |
261 } | 303 } |
262 | 304 |
263 static void | 305 static void |
264 msn_session_sync_users(MsnSession *session) | 306 msn_session_sync_users(MsnSession *session) |
265 { | 307 { |