comparison libpurple/protocols/msn/msn.c @ 24674:f3950234b164

If the MSN user is in the userlist already, then check whether we know the network before adding them. If it's unknown (because the buddy's in the AB or privacy lists only), then request network with an FQY. References #3322. References #6755.
author Elliott Sales de Andrade <qulogic@pidgin.im>
date Sun, 14 Dec 2008 05:24:32 +0000
parents eae0e194658e
children 3e39e4652c36 ca01403251f1 68f4edb42f39 a959b17ffc57 9ea6842536ba
comparison
equal deleted inserted replaced
24673:daabf16bd511 24674:f3950234b164
1416 msn_add_buddy(PurpleConnection *gc, PurpleBuddy *buddy, PurpleGroup *group) 1416 msn_add_buddy(PurpleConnection *gc, PurpleBuddy *buddy, PurpleGroup *group)
1417 { 1417 {
1418 MsnSession *session; 1418 MsnSession *session;
1419 MsnUserList *userlist; 1419 MsnUserList *userlist;
1420 const char *who; 1420 const char *who;
1421 MsnUser *user;
1421 1422
1422 session = gc->proto_data; 1423 session = gc->proto_data;
1423 userlist = session->userlist; 1424 userlist = session->userlist;
1424 who = msn_normalize(gc->account, buddy->name); 1425 who = msn_normalize(gc->account, buddy->name);
1425 1426
1444 #endif 1445 #endif
1445 1446
1446 /* XXX - Would group ever be NULL here? I don't think so... 1447 /* XXX - Would group ever be NULL here? I don't think so...
1447 * shx: Yes it should; MSN handles non-grouped buddies, and this is only 1448 * shx: Yes it should; MSN handles non-grouped buddies, and this is only
1448 * internal. */ 1449 * internal. */
1449 if (msn_userlist_find_user(userlist, who) != NULL) { 1450 user = msn_userlist_find_user(userlist, who);
1450 /* We already know this buddy. This function takes care of users 1451 if ((user != NULL) && (user->networkid != MSN_NETWORK_UNKNOWN)) {
1451 already in the list and stuff... */ 1452 /* We already know this buddy and their network. This function knows
1453 what to do with users already in the list and stuff... */
1452 msn_userlist_add_buddy(userlist, who, group ? group->name : NULL); 1454 msn_userlist_add_buddy(userlist, who, group ? group->name : NULL);
1453 } else { 1455 } else {
1454 /* We need to check the network for this buddy first */ 1456 /* We need to check the network for this buddy first */
1455 msn_userlist_save_pending_buddy(userlist, who, group ? group->name : NULL); 1457 msn_userlist_save_pending_buddy(userlist, who, group ? group->name : NULL);
1456 msn_notification_send_fqy(session, who); 1458 msn_notification_send_fqy(session, who);