Mercurial > pidgin
comparison libpurple/protocols/msn/userlist.c @ 24518:4fd22591e3f0
Send FQY as the first thing when adding a buddy so that we know what network
they use. Should be helpful for adding federated buddies.
References #6755.
author | Elliott Sales de Andrade <qulogic@pidgin.im> |
---|---|
date | Sun, 07 Dec 2008 07:09:57 +0000 |
parents | f54e7398f733 |
children | 77873bca18bb |
comparison
equal
deleted
inserted
replaced
24517:2b4c909b40c4 | 24518:4fd22591e3f0 |
---|---|
754 /* Add contact in the Contact server with a SOAP request and if | 754 /* Add contact in the Contact server with a SOAP request and if |
755 successful, send ADL with MSN_LIST_AL and MSN_LIST_FL and a FQY */ | 755 successful, send ADL with MSN_LIST_AL and MSN_LIST_FL and a FQY */ |
756 msn_add_contact_to_group(userlist->session, state, who, group_id); | 756 msn_add_contact_to_group(userlist->session, state, who, group_id); |
757 } | 757 } |
758 | 758 |
759 /* | |
760 * Save a buddy address/group until we get back response from FQY | |
761 */ | |
762 void | |
763 msn_userlist_save_pending_buddy(MsnUserList *userlist, | |
764 const char *who, | |
765 const char *group_name) | |
766 { | |
767 MsnUser *user; | |
768 | |
769 g_return_if_fail(userlist != NULL); | |
770 | |
771 user = msn_user_new(userlist, who, NULL); | |
772 msn_user_set_pending_group(user, group_name); | |
773 msn_user_set_network(user, MSN_NETWORK_UNKNOWN); | |
774 userlist->pending = g_list_prepend(userlist->pending, user); | |
775 } | |
776 | |
777 /* | |
778 * Actually adds a buddy once we have the response from FQY | |
779 */ | |
780 void | |
781 msn_userlist_add_pending_buddy(MsnUserList *userlist, | |
782 const char *who, | |
783 /*MsnNetwork*/ int network) | |
784 { | |
785 MsnUser *user = NULL; | |
786 GList *l; | |
787 char *group; | |
788 | |
789 for (l = userlist->pending; l != NULL; l = l->next) | |
790 { | |
791 user = (MsnUser *)l->data; | |
792 | |
793 if (!g_strcasecmp(who, user->passport)) { | |
794 userlist->pending = g_list_delete_link(userlist->pending, l); | |
795 break; | |
796 } | |
797 } | |
798 | |
799 if (user == NULL) { | |
800 purple_debug_error("msn", "Attempting to add a pending user that does not exist.\n"); | |
801 return; | |
802 } | |
803 | |
804 /* Bit of a hack, but by adding to userlist now, the rest of the code | |
805 * will know what network to use. | |
806 */ | |
807 msn_user_set_network(user, network); | |
808 msn_userlist_add_user(userlist, user); | |
809 | |
810 group = msn_user_remove_pending_group(user); | |
811 msn_userlist_add_buddy(userlist, who, group); | |
812 g_free(group); | |
813 } | |
814 | |
759 void | 815 void |
760 msn_userlist_add_buddy_to_list(MsnUserList *userlist, const char *who, | 816 msn_userlist_add_buddy_to_list(MsnUserList *userlist, const char *who, |
761 MsnListId list_id) | 817 MsnListId list_id) |
762 { | 818 { |
763 MsnUser *user = NULL; | 819 MsnUser *user = NULL; |