Mercurial > pidgin.yaz
comparison libpurple/protocols/msn/userlist.c @ 20484:98613886411a
Handle special cases in buddy/group management (wrt MSN_INDIVIDUALS_GROUP and MSN_NON_IM_GROUP).
Deprecate now unused MSNP protocol commands.
author | Carlos Silva <typ0@pidgin.im> |
---|---|
date | Fri, 31 Aug 2007 18:12:35 +0000 |
parents | 115290ce3b92 |
children | ff4ae9dde291 |
comparison
equal
deleted
inserted
replaced
20483:115290ce3b92 | 20484:98613886411a |
---|---|
104 | 104 |
105 return FALSE; | 105 return FALSE; |
106 } | 106 } |
107 | 107 |
108 static gboolean | 108 static gboolean |
109 msn_userlist_user_is_in_list(MsnUser *user, int list_id) | 109 msn_userlist_user_is_in_list(MsnUser *user, MsnListId list_id) |
110 { | 110 { |
111 int list_op; | 111 int list_op; |
112 | 112 |
113 if (user == NULL) | 113 if (user == NULL) |
114 return FALSE; | 114 return FALSE; |
371 { | 371 { |
372 // got_new_entry(gc, passport, store); | 372 // got_new_entry(gc, passport, store); |
373 } | 373 } |
374 } | 374 } |
375 | 375 |
376 if (list_op & MSN_LIST_PL_OP) | |
377 { | |
378 got_new_entry(gc, passport, store); | |
379 } | |
380 | |
376 user->list_op |= list_op; | 381 user->list_op |= list_op; |
377 } | 382 } |
378 | 383 |
379 /************************************************************************** | 384 /************************************************************************** |
380 * UserList functions | 385 * UserList functions |
627 MsnCallbackState *state = NULL; | 632 MsnCallbackState *state = NULL; |
628 const char *group_id = NULL, *new_group_name; | 633 const char *group_id = NULL, *new_group_name; |
629 | 634 |
630 new_group_name = group_name == NULL ? MSN_INDIVIDUALS_GROUP_NAME : group_name; | 635 new_group_name = group_name == NULL ? MSN_INDIVIDUALS_GROUP_NAME : group_name; |
631 | 636 |
637 | |
632 g_return_if_fail(userlist != NULL); | 638 g_return_if_fail(userlist != NULL); |
633 g_return_if_fail(userlist->session != NULL); | 639 g_return_if_fail(userlist->session != NULL); |
634 | 640 |
635 | 641 |
636 purple_debug_info("MSN Userlist", "Add user: %s to group: %s\n", who, new_group_name); | 642 purple_debug_info("MSN Userlist", "Add user: %s to group: %s\n", who, new_group_name); |
667 return; | 673 return; |
668 } else { | 674 } else { |
669 msn_callback_state_set_guid(state, group_id); | 675 msn_callback_state_set_guid(state, group_id); |
670 } | 676 } |
671 | 677 |
678 /* XXX: adding user here may not be correct (should add them in the | |
679 * ACK to the ADL command), but for now we need to make sure they exist | |
680 * early enough that the ILN command doesn't screw us up */ | |
672 | 681 |
673 user = msn_userlist_find_add_user(userlist, who, who); | 682 user = msn_userlist_find_add_user(userlist, who, who); |
674 | 683 |
675 if ( msn_userlist_user_is_in_list(user, MSN_LIST_FL) ) { | 684 if ( msn_userlist_user_is_in_list(user, MSN_LIST_FL) ) { |
676 | 685 |
785 void | 794 void |
786 msn_userlist_move_buddy(MsnUserList *userlist, const char *who, | 795 msn_userlist_move_buddy(MsnUserList *userlist, const char *who, |
787 const char *old_group_name, const char *new_group_name) | 796 const char *old_group_name, const char *new_group_name) |
788 { | 797 { |
789 const char *new_group_id; | 798 const char *new_group_id; |
790 MsnCallbackState *state = msn_callback_state_new(); | 799 MsnCallbackState *state; |
791 | 800 |
792 g_return_if_fail(userlist != NULL); | 801 g_return_if_fail(userlist != NULL); |
793 g_return_if_fail(userlist->session != NULL); | 802 g_return_if_fail(userlist->session != NULL); |
794 g_return_if_fail(userlist->session->contact != NULL); | 803 g_return_if_fail(userlist->session->contact != NULL); |
795 | 804 |
805 state = msn_callback_state_new(); | |
796 msn_callback_state_set_who(state, who); | 806 msn_callback_state_set_who(state, who); |
797 msn_callback_state_set_action(state, MSN_MOVE_BUDDY); | 807 msn_callback_state_set_action(state, MSN_MOVE_BUDDY); |
798 msn_callback_state_set_old_group_name(state, old_group_name); | 808 msn_callback_state_set_old_group_name(state, old_group_name); |
799 msn_callback_state_set_new_group_name(state, new_group_name); | 809 msn_callback_state_set_new_group_name(state, new_group_name); |
800 | 810 |