libpurple/protocols/msn/userlist.c

Tue, 29 Jun 2010 23:33:52 +0000

author
Jorge Villaseñor <masca@cpw.pidgin.im>
date
Tue, 29 Jun 2010 23:33:52 +0000
branch
soc.2010.msn-tlc
changeset 31037
457c61e53d50
parent 30961
885064b16c54
child 31106
d7a39e5eb4c1
permissions
-rw-r--r--

Move queue logic in requesting user display out of slp code.

9198
e8eb6d5eb9eb [gaim-migrate @ 9993]
Christian Hammond <chipx86@chipx86.com>
parents: 9197
diff changeset
1 /**
e8eb6d5eb9eb [gaim-migrate @ 9993]
Christian Hammond <chipx86@chipx86.com>
parents: 9197
diff changeset
2 * @file userlist.c MSN user list support
e8eb6d5eb9eb [gaim-migrate @ 9993]
Christian Hammond <chipx86@chipx86.com>
parents: 9197
diff changeset
3 *
15884
4de1981757fc sed -ie 's/gaim/purple/g'
Sean Egan <seanegan@pidgin.im>
parents: 15435
diff changeset
4 * purple
9198
e8eb6d5eb9eb [gaim-migrate @ 9993]
Christian Hammond <chipx86@chipx86.com>
parents: 9197
diff changeset
5 *
15884
4de1981757fc sed -ie 's/gaim/purple/g'
Sean Egan <seanegan@pidgin.im>
parents: 15435
diff changeset
6 * Purple is the legal property of its developers, whose names are too numerous
9198
e8eb6d5eb9eb [gaim-migrate @ 9993]
Christian Hammond <chipx86@chipx86.com>
parents: 9197
diff changeset
7 * to list here. Please refer to the COPYRIGHT file distributed with this
e8eb6d5eb9eb [gaim-migrate @ 9993]
Christian Hammond <chipx86@chipx86.com>
parents: 9197
diff changeset
8 * source distribution.
e8eb6d5eb9eb [gaim-migrate @ 9993]
Christian Hammond <chipx86@chipx86.com>
parents: 9197
diff changeset
9 *
e8eb6d5eb9eb [gaim-migrate @ 9993]
Christian Hammond <chipx86@chipx86.com>
parents: 9197
diff changeset
10 * This program is free software; you can redistribute it and/or modify
e8eb6d5eb9eb [gaim-migrate @ 9993]
Christian Hammond <chipx86@chipx86.com>
parents: 9197
diff changeset
11 * it under the terms of the GNU General Public License as published by
e8eb6d5eb9eb [gaim-migrate @ 9993]
Christian Hammond <chipx86@chipx86.com>
parents: 9197
diff changeset
12 * the Free Software Foundation; either version 2 of the License, or
e8eb6d5eb9eb [gaim-migrate @ 9993]
Christian Hammond <chipx86@chipx86.com>
parents: 9197
diff changeset
13 * (at your option) any later version.
e8eb6d5eb9eb [gaim-migrate @ 9993]
Christian Hammond <chipx86@chipx86.com>
parents: 9197
diff changeset
14 *
e8eb6d5eb9eb [gaim-migrate @ 9993]
Christian Hammond <chipx86@chipx86.com>
parents: 9197
diff changeset
15 * This program is distributed in the hope that it will be useful,
e8eb6d5eb9eb [gaim-migrate @ 9993]
Christian Hammond <chipx86@chipx86.com>
parents: 9197
diff changeset
16 * but WITHOUT ANY WARRANTY; without even the implied warranty of
e8eb6d5eb9eb [gaim-migrate @ 9993]
Christian Hammond <chipx86@chipx86.com>
parents: 9197
diff changeset
17 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
e8eb6d5eb9eb [gaim-migrate @ 9993]
Christian Hammond <chipx86@chipx86.com>
parents: 9197
diff changeset
18 * GNU General Public License for more details.
e8eb6d5eb9eb [gaim-migrate @ 9993]
Christian Hammond <chipx86@chipx86.com>
parents: 9197
diff changeset
19 *
e8eb6d5eb9eb [gaim-migrate @ 9993]
Christian Hammond <chipx86@chipx86.com>
parents: 9197
diff changeset
20 * You should have received a copy of the GNU General Public License
e8eb6d5eb9eb [gaim-migrate @ 9993]
Christian Hammond <chipx86@chipx86.com>
parents: 9197
diff changeset
21 * along with this program; if not, write to the Free Software
19859
71d37b57eff2 The FSF changed its address a while ago; our files were out of date.
John Bailey <rekkanoryo@rekkanoryo.org>
parents: 19335
diff changeset
22 * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02111-1301 USA
9198
e8eb6d5eb9eb [gaim-migrate @ 9993]
Christian Hammond <chipx86@chipx86.com>
parents: 9197
diff changeset
23 */
30945
b875cf477e19 Remove unnecesary includes from msn.h.
Jorge Villaseñor <masca@cpw.pidgin.im>
parents: 30944
diff changeset
24
30961
885064b16c54 Include internal.h on each c file to avoid windows breakage as recommended by Daniel.
Jorge Villaseñor <masca@cpw.pidgin.im>
parents: 30948
diff changeset
25 #include "internal.h"
30945
b875cf477e19 Remove unnecesary includes from msn.h.
Jorge Villaseñor <masca@cpw.pidgin.im>
parents: 30944
diff changeset
26 #include "debug.h"
b875cf477e19 Remove unnecesary includes from msn.h.
Jorge Villaseñor <masca@cpw.pidgin.im>
parents: 30944
diff changeset
27 #include "request.h"
b875cf477e19 Remove unnecesary includes from msn.h.
Jorge Villaseñor <masca@cpw.pidgin.im>
parents: 30944
diff changeset
28
9193
6e76f1367896 [gaim-migrate @ 9988]
Felipe Contreras <felipe.contreras@gmail.com>
parents:
diff changeset
29 #include "msn.h"
30948
7c0f65436e40 msn_email_is_valid looks a lot like a util function, move it there.
Jorge Villaseñor <masca@cpw.pidgin.im>
parents: 30945
diff changeset
30 #include "msnutils.h"
9193
6e76f1367896 [gaim-migrate @ 9988]
Felipe Contreras <felipe.contreras@gmail.com>
parents:
diff changeset
31 #include "userlist.h"
6e76f1367896 [gaim-migrate @ 9988]
Felipe Contreras <felipe.contreras@gmail.com>
parents:
diff changeset
32
23771
c98f7e879218 killing MsnContact which just wraps MsnSession
Ka-Hing Cheung <khc@pidgin.im>
parents: 21369
diff changeset
33 #include "contact.h"
c98f7e879218 killing MsnContact which just wraps MsnSession
Ka-Hing Cheung <khc@pidgin.im>
parents: 21369
diff changeset
34
9193
6e76f1367896 [gaim-migrate @ 9988]
Felipe Contreras <felipe.contreras@gmail.com>
parents:
diff changeset
35 const char *lists[] = { "FL", "AL", "BL", "RL" };
6e76f1367896 [gaim-migrate @ 9988]
Felipe Contreras <felipe.contreras@gmail.com>
parents:
diff changeset
36
6e76f1367896 [gaim-migrate @ 9988]
Felipe Contreras <felipe.contreras@gmail.com>
parents:
diff changeset
37 typedef struct
6e76f1367896 [gaim-migrate @ 9988]
Felipe Contreras <felipe.contreras@gmail.com>
parents:
diff changeset
38 {
15884
4de1981757fc sed -ie 's/gaim/purple/g'
Sean Egan <seanegan@pidgin.im>
parents: 15435
diff changeset
39 PurpleConnection *gc;
9193
6e76f1367896 [gaim-migrate @ 9988]
Felipe Contreras <felipe.contreras@gmail.com>
parents:
diff changeset
40 char *who;
12380
0b1e1b2ad52a [gaim-migrate @ 14684]
Daniel Atallah <datallah@pidgin.im>
parents: 12318
diff changeset
41 char *friendly;
9193
6e76f1367896 [gaim-migrate @ 9988]
Felipe Contreras <felipe.contreras@gmail.com>
parents:
diff changeset
42
6e76f1367896 [gaim-migrate @ 9988]
Felipe Contreras <felipe.contreras@gmail.com>
parents:
diff changeset
43 } MsnPermitAdd;
6e76f1367896 [gaim-migrate @ 9988]
Felipe Contreras <felipe.contreras@gmail.com>
parents:
diff changeset
44
6e76f1367896 [gaim-migrate @ 9988]
Felipe Contreras <felipe.contreras@gmail.com>
parents:
diff changeset
45 /**************************************************************************
6e76f1367896 [gaim-migrate @ 9988]
Felipe Contreras <felipe.contreras@gmail.com>
parents:
diff changeset
46 * Callbacks
6e76f1367896 [gaim-migrate @ 9988]
Felipe Contreras <felipe.contreras@gmail.com>
parents:
diff changeset
47 **************************************************************************/
6e76f1367896 [gaim-migrate @ 9988]
Felipe Contreras <felipe.contreras@gmail.com>
parents:
diff changeset
48 static void
19335
4613b53d5741 Warning fixes in the aftermath of resiak's authorize_cb and deny_cb type fixing.
Daniel Atallah <datallah@pidgin.im>
parents: 15884
diff changeset
49 msn_accept_add_cb(gpointer data)
9193
6e76f1367896 [gaim-migrate @ 9988]
Felipe Contreras <felipe.contreras@gmail.com>
parents:
diff changeset
50 {
19335
4613b53d5741 Warning fixes in the aftermath of resiak's authorize_cb and deny_cb type fixing.
Daniel Atallah <datallah@pidgin.im>
parents: 15884
diff changeset
51 MsnPermitAdd *pa = data;
20733
a179242f6bef Further cleanup of the msn prpl including preventing the authorization request callback from crashing if triggered after the account is disconnected. Also removal of some extraneous debuggery, there is more that needs to be removed.
Daniel Atallah <datallah@pidgin.im>
parents: 20646
diff changeset
52
23830
1436e3de5d6c The great MSN debug message cleanup! Threw in a few whitespace fixes,
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 23783
diff changeset
53 purple_debug_misc("msn", "Accepted the new buddy: %s\n", pa->who);
9193
6e76f1367896 [gaim-migrate @ 9988]
Felipe Contreras <felipe.contreras@gmail.com>
parents:
diff changeset
54
20733
a179242f6bef Further cleanup of the msn prpl including preventing the authorization request callback from crashing if triggered after the account is disconnected. Also removal of some extraneous debuggery, there is more that needs to be removed.
Daniel Atallah <datallah@pidgin.im>
parents: 20646
diff changeset
55 if (PURPLE_CONNECTION_IS_VALID(pa->gc))
a179242f6bef Further cleanup of the msn prpl including preventing the authorization request callback from crashing if triggered after the account is disconnected. Also removal of some extraneous debuggery, there is more that needs to be removed.
Daniel Atallah <datallah@pidgin.im>
parents: 20646
diff changeset
56 {
a179242f6bef Further cleanup of the msn prpl including preventing the authorization request callback from crashing if triggered after the account is disconnected. Also removal of some extraneous debuggery, there is more that needs to be removed.
Daniel Atallah <datallah@pidgin.im>
parents: 20646
diff changeset
57 MsnSession *session = pa->gc->proto_data;
a179242f6bef Further cleanup of the msn prpl including preventing the authorization request callback from crashing if triggered after the account is disconnected. Also removal of some extraneous debuggery, there is more that needs to be removed.
Daniel Atallah <datallah@pidgin.im>
parents: 20646
diff changeset
58 MsnUserList *userlist = session->userlist;
29040
0db6fc500d6c *** Plucked rev aada73f0d8a35997280d570f47caf30907fe68df (bcc0147bab874ca52c55ad4900545e17528bf8fd):
Daniel Atallah <datallah@pidgin.im>
parents: 28731
diff changeset
59 PurpleAccount *account = purple_connection_get_account(pa->gc);
23441
fd45c23a3eb2 Delete trailing whitespace
Mark Doliner <markdoliner@pidgin.im>
parents: 22981
diff changeset
60
20733
a179242f6bef Further cleanup of the msn prpl including preventing the authorization request callback from crashing if triggered after the account is disconnected. Also removal of some extraneous debuggery, there is more that needs to be removed.
Daniel Atallah <datallah@pidgin.im>
parents: 20646
diff changeset
61 msn_userlist_add_buddy_to_list(userlist, pa->who, MSN_LIST_AL);
29040
0db6fc500d6c *** Plucked rev aada73f0d8a35997280d570f47caf30907fe68df (bcc0147bab874ca52c55ad4900545e17528bf8fd):
Daniel Atallah <datallah@pidgin.im>
parents: 28731
diff changeset
62 purple_privacy_deny_remove(account, pa->who, TRUE);
0db6fc500d6c *** Plucked rev aada73f0d8a35997280d570f47caf30907fe68df (bcc0147bab874ca52c55ad4900545e17528bf8fd):
Daniel Atallah <datallah@pidgin.im>
parents: 28731
diff changeset
63 purple_privacy_permit_add(account, pa->who, TRUE);
20569
66628c75dada Make block/unblock work right, as well as being add by a buddy. Finally fixes #723
Carlos Silva <typ0@pidgin.im>
parents: 20567
diff changeset
64
23771
c98f7e879218 killing MsnContact which just wraps MsnSession
Ka-Hing Cheung <khc@pidgin.im>
parents: 21369
diff changeset
65 msn_del_contact_from_list(session, NULL, pa->who, MSN_LIST_PL);
20569
66628c75dada Make block/unblock work right, as well as being add by a buddy. Finally fixes #723
Carlos Silva <typ0@pidgin.im>
parents: 20567
diff changeset
66 }
9193
6e76f1367896 [gaim-migrate @ 9988]
Felipe Contreras <felipe.contreras@gmail.com>
parents:
diff changeset
67
6e76f1367896 [gaim-migrate @ 9988]
Felipe Contreras <felipe.contreras@gmail.com>
parents:
diff changeset
68 g_free(pa->who);
12380
0b1e1b2ad52a [gaim-migrate @ 14684]
Daniel Atallah <datallah@pidgin.im>
parents: 12318
diff changeset
69 g_free(pa->friendly);
9193
6e76f1367896 [gaim-migrate @ 9988]
Felipe Contreras <felipe.contreras@gmail.com>
parents:
diff changeset
70 g_free(pa);
6e76f1367896 [gaim-migrate @ 9988]
Felipe Contreras <felipe.contreras@gmail.com>
parents:
diff changeset
71 }
6e76f1367896 [gaim-migrate @ 9988]
Felipe Contreras <felipe.contreras@gmail.com>
parents:
diff changeset
72
6e76f1367896 [gaim-migrate @ 9988]
Felipe Contreras <felipe.contreras@gmail.com>
parents:
diff changeset
73 static void
19335
4613b53d5741 Warning fixes in the aftermath of resiak's authorize_cb and deny_cb type fixing.
Daniel Atallah <datallah@pidgin.im>
parents: 15884
diff changeset
74 msn_cancel_add_cb(gpointer data)
9193
6e76f1367896 [gaim-migrate @ 9988]
Felipe Contreras <felipe.contreras@gmail.com>
parents:
diff changeset
75 {
19335
4613b53d5741 Warning fixes in the aftermath of resiak's authorize_cb and deny_cb type fixing.
Daniel Atallah <datallah@pidgin.im>
parents: 15884
diff changeset
76 MsnPermitAdd *pa = data;
20566
a11100eb3656 Fix some compiler warnings
Carlos Silva <typ0@pidgin.im>
parents: 20565
diff changeset
77
23830
1436e3de5d6c The great MSN debug message cleanup! Threw in a few whitespace fixes,
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 23783
diff changeset
78 purple_debug_misc("msn", "Denied the new buddy: %s\n", pa->who);
9193
6e76f1367896 [gaim-migrate @ 9988]
Felipe Contreras <felipe.contreras@gmail.com>
parents:
diff changeset
79
20733
a179242f6bef Further cleanup of the msn prpl including preventing the authorization request callback from crashing if triggered after the account is disconnected. Also removal of some extraneous debuggery, there is more that needs to be removed.
Daniel Atallah <datallah@pidgin.im>
parents: 20646
diff changeset
80 if (PURPLE_CONNECTION_IS_VALID(pa->gc))
9193
6e76f1367896 [gaim-migrate @ 9988]
Felipe Contreras <felipe.contreras@gmail.com>
parents:
diff changeset
81 {
6e76f1367896 [gaim-migrate @ 9988]
Felipe Contreras <felipe.contreras@gmail.com>
parents:
diff changeset
82 MsnSession *session = pa->gc->proto_data;
6e76f1367896 [gaim-migrate @ 9988]
Felipe Contreras <felipe.contreras@gmail.com>
parents:
diff changeset
83 MsnUserList *userlist = session->userlist;
21368
d270fe91b138 finish converting the rest of stuff to the new soap api, signing on, getting
Ka-Hing Cheung <khc@pidgin.im>
parents: 20603
diff changeset
84 MsnCallbackState *state = msn_callback_state_new(session);
20733
a179242f6bef Further cleanup of the msn prpl including preventing the authorization request callback from crashing if triggered after the account is disconnected. Also removal of some extraneous debuggery, there is more that needs to be removed.
Daniel Atallah <datallah@pidgin.im>
parents: 20646
diff changeset
85
20569
66628c75dada Make block/unblock work right, as well as being add by a buddy. Finally fixes #723
Carlos Silva <typ0@pidgin.im>
parents: 20567
diff changeset
86 msn_callback_state_set_action(state, MSN_DENIED_BUDDY);
9193
6e76f1367896 [gaim-migrate @ 9988]
Felipe Contreras <felipe.contreras@gmail.com>
parents:
diff changeset
87
20564
35675dd4a44d Make buddy and group management actually work, add some SOAP templates, redesign some parts of code and separate some bigger functions into its smaller tasks which are completely unrelated to each other
Carlos Silva <typ0@pidgin.im>
parents: 20560
diff changeset
88 msn_userlist_add_buddy_to_list(userlist, pa->who, MSN_LIST_BL);
23771
c98f7e879218 killing MsnContact which just wraps MsnSession
Ka-Hing Cheung <khc@pidgin.im>
parents: 21369
diff changeset
89 msn_del_contact_from_list(session, state, pa->who, MSN_LIST_PL);
9193
6e76f1367896 [gaim-migrate @ 9988]
Felipe Contreras <felipe.contreras@gmail.com>
parents:
diff changeset
90 }
6e76f1367896 [gaim-migrate @ 9988]
Felipe Contreras <felipe.contreras@gmail.com>
parents:
diff changeset
91
6e76f1367896 [gaim-migrate @ 9988]
Felipe Contreras <felipe.contreras@gmail.com>
parents:
diff changeset
92 g_free(pa->who);
12380
0b1e1b2ad52a [gaim-migrate @ 14684]
Daniel Atallah <datallah@pidgin.im>
parents: 12318
diff changeset
93 g_free(pa->friendly);
9193
6e76f1367896 [gaim-migrate @ 9988]
Felipe Contreras <felipe.contreras@gmail.com>
parents:
diff changeset
94 g_free(pa);
6e76f1367896 [gaim-migrate @ 9988]
Felipe Contreras <felipe.contreras@gmail.com>
parents:
diff changeset
95 }
6e76f1367896 [gaim-migrate @ 9988]
Felipe Contreras <felipe.contreras@gmail.com>
parents:
diff changeset
96
6e76f1367896 [gaim-migrate @ 9988]
Felipe Contreras <felipe.contreras@gmail.com>
parents:
diff changeset
97 static void
27101
754a5afb2df7 Parse the invite message out of the pending membership list so that it can
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 27099
diff changeset
98 got_new_entry(PurpleConnection *gc, const char *passport, const char *friendly, const char *message)
9193
6e76f1367896 [gaim-migrate @ 9988]
Felipe Contreras <felipe.contreras@gmail.com>
parents:
diff changeset
99 {
20733
a179242f6bef Further cleanup of the msn prpl including preventing the authorization request callback from crashing if triggered after the account is disconnected. Also removal of some extraneous debuggery, there is more that needs to be removed.
Daniel Atallah <datallah@pidgin.im>
parents: 20646
diff changeset
100 PurpleAccount *acct;
9193
6e76f1367896 [gaim-migrate @ 9988]
Felipe Contreras <felipe.contreras@gmail.com>
parents:
diff changeset
101 MsnPermitAdd *pa;
6e76f1367896 [gaim-migrate @ 9988]
Felipe Contreras <felipe.contreras@gmail.com>
parents:
diff changeset
102
12380
0b1e1b2ad52a [gaim-migrate @ 14684]
Daniel Atallah <datallah@pidgin.im>
parents: 12318
diff changeset
103 pa = g_new0(MsnPermitAdd, 1);
9193
6e76f1367896 [gaim-migrate @ 9988]
Felipe Contreras <felipe.contreras@gmail.com>
parents:
diff changeset
104 pa->who = g_strdup(passport);
12381
9a27a50d3864 [gaim-migrate @ 14685]
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 12380
diff changeset
105 pa->friendly = g_strdup(friendly);
12380
0b1e1b2ad52a [gaim-migrate @ 14684]
Daniel Atallah <datallah@pidgin.im>
parents: 12318
diff changeset
106 pa->gc = gc;
20733
a179242f6bef Further cleanup of the msn prpl including preventing the authorization request callback from crashing if triggered after the account is disconnected. Also removal of some extraneous debuggery, there is more that needs to be removed.
Daniel Atallah <datallah@pidgin.im>
parents: 20646
diff changeset
107
a179242f6bef Further cleanup of the msn prpl including preventing the authorization request callback from crashing if triggered after the account is disconnected. Also removal of some extraneous debuggery, there is more that needs to be removed.
Daniel Atallah <datallah@pidgin.im>
parents: 20646
diff changeset
108 acct = purple_connection_get_account(gc);
27101
754a5afb2df7 Parse the invite message out of the pending membership list so that it can
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 27099
diff changeset
109 purple_account_request_authorization(acct, passport, NULL, friendly, message,
20733
a179242f6bef Further cleanup of the msn prpl including preventing the authorization request callback from crashing if triggered after the account is disconnected. Also removal of some extraneous debuggery, there is more that needs to be removed.
Daniel Atallah <datallah@pidgin.im>
parents: 20646
diff changeset
110 purple_find_buddy(acct, passport) != NULL,
a179242f6bef Further cleanup of the msn prpl including preventing the authorization request callback from crashing if triggered after the account is disconnected. Also removal of some extraneous debuggery, there is more that needs to be removed.
Daniel Atallah <datallah@pidgin.im>
parents: 20646
diff changeset
111 msn_accept_add_cb, msn_cancel_add_cb, pa);
9193
6e76f1367896 [gaim-migrate @ 9988]
Felipe Contreras <felipe.contreras@gmail.com>
parents:
diff changeset
112
6e76f1367896 [gaim-migrate @ 9988]
Felipe Contreras <felipe.contreras@gmail.com>
parents:
diff changeset
113 }
6e76f1367896 [gaim-migrate @ 9988]
Felipe Contreras <felipe.contreras@gmail.com>
parents:
diff changeset
114
6e76f1367896 [gaim-migrate @ 9988]
Felipe Contreras <felipe.contreras@gmail.com>
parents:
diff changeset
115 /**************************************************************************
6e76f1367896 [gaim-migrate @ 9988]
Felipe Contreras <felipe.contreras@gmail.com>
parents:
diff changeset
116 * Server functions
6e76f1367896 [gaim-migrate @ 9988]
Felipe Contreras <felipe.contreras@gmail.com>
parents:
diff changeset
117 **************************************************************************/
6e76f1367896 [gaim-migrate @ 9988]
Felipe Contreras <felipe.contreras@gmail.com>
parents:
diff changeset
118
6e76f1367896 [gaim-migrate @ 9988]
Felipe Contreras <felipe.contreras@gmail.com>
parents:
diff changeset
119 void
6e76f1367896 [gaim-migrate @ 9988]
Felipe Contreras <felipe.contreras@gmail.com>
parents:
diff changeset
120 msn_got_lst_user(MsnSession *session, MsnUser *user,
29306
dff954e98aea Use our MsnListOp enum in more places instead of int. I'm assuming
Mark Doliner <markdoliner@pidgin.im>
parents: 29300
diff changeset
121 MsnListOp list_op, GSList *group_ids)
9193
6e76f1367896 [gaim-migrate @ 9988]
Felipe Contreras <felipe.contreras@gmail.com>
parents:
diff changeset
122 {
15884
4de1981757fc sed -ie 's/gaim/purple/g'
Sean Egan <seanegan@pidgin.im>
parents: 15435
diff changeset
123 PurpleConnection *gc;
4de1981757fc sed -ie 's/gaim/purple/g'
Sean Egan <seanegan@pidgin.im>
parents: 15435
diff changeset
124 PurpleAccount *account;
9193
6e76f1367896 [gaim-migrate @ 9988]
Felipe Contreras <felipe.contreras@gmail.com>
parents:
diff changeset
125 const char *passport;
6e76f1367896 [gaim-migrate @ 9988]
Felipe Contreras <felipe.contreras@gmail.com>
parents:
diff changeset
126 const char *store;
27101
754a5afb2df7 Parse the invite message out of the pending membership list so that it can
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 27099
diff changeset
127 const char *message;
9193
6e76f1367896 [gaim-migrate @ 9988]
Felipe Contreras <felipe.contreras@gmail.com>
parents:
diff changeset
128
6e76f1367896 [gaim-migrate @ 9988]
Felipe Contreras <felipe.contreras@gmail.com>
parents:
diff changeset
129 account = session->account;
15884
4de1981757fc sed -ie 's/gaim/purple/g'
Sean Egan <seanegan@pidgin.im>
parents: 15435
diff changeset
130 gc = purple_account_get_connection(account);
9193
6e76f1367896 [gaim-migrate @ 9988]
Felipe Contreras <felipe.contreras@gmail.com>
parents:
diff changeset
131
6e76f1367896 [gaim-migrate @ 9988]
Felipe Contreras <felipe.contreras@gmail.com>
parents:
diff changeset
132 passport = msn_user_get_passport(user);
23783
cf52f8bc3b93 Remove MSN's use of a "store name" in favour of the "friendly name"
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 23782
diff changeset
133 store = msn_user_get_friendly_name(user);
27101
754a5afb2df7 Parse the invite message out of the pending membership list so that it can
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 27099
diff changeset
134 message = msn_user_get_invite_message(user);
23441
fd45c23a3eb2 Delete trailing whitespace
Mark Doliner <markdoliner@pidgin.im>
parents: 22981
diff changeset
135
20569
66628c75dada Make block/unblock work right, as well as being add by a buddy. Finally fixes #723
Carlos Silva <typ0@pidgin.im>
parents: 20567
diff changeset
136 msn_user_set_op(user, list_op);
9193
6e76f1367896 [gaim-migrate @ 9988]
Felipe Contreras <felipe.contreras@gmail.com>
parents:
diff changeset
137
6e76f1367896 [gaim-migrate @ 9988]
Felipe Contreras <felipe.contreras@gmail.com>
parents:
diff changeset
138 if (list_op & MSN_LIST_FL_OP)
6e76f1367896 [gaim-migrate @ 9988]
Felipe Contreras <felipe.contreras@gmail.com>
parents:
diff changeset
139 {
6e76f1367896 [gaim-migrate @ 9988]
Felipe Contreras <felipe.contreras@gmail.com>
parents:
diff changeset
140 GSList *c;
6e76f1367896 [gaim-migrate @ 9988]
Felipe Contreras <felipe.contreras@gmail.com>
parents:
diff changeset
141 for (c = group_ids; c != NULL; c = g_slist_next(c))
6e76f1367896 [gaim-migrate @ 9988]
Felipe Contreras <felipe.contreras@gmail.com>
parents:
diff changeset
142 {
22981
b83a23981419 Fix a number of leaks. As far as I can tell, MSNP14 now logs in without
Daniel Atallah <datallah@pidgin.im>
parents: 22942
diff changeset
143 char *group_id = c->data;
9193
6e76f1367896 [gaim-migrate @ 9988]
Felipe Contreras <felipe.contreras@gmail.com>
parents:
diff changeset
144 msn_user_add_group_id(user, group_id);
6e76f1367896 [gaim-migrate @ 9988]
Felipe Contreras <felipe.contreras@gmail.com>
parents:
diff changeset
145 }
6e76f1367896 [gaim-migrate @ 9988]
Felipe Contreras <felipe.contreras@gmail.com>
parents:
diff changeset
146
6e76f1367896 [gaim-migrate @ 9988]
Felipe Contreras <felipe.contreras@gmail.com>
parents:
diff changeset
147 /* FIXME: It might be a real alias */
13449
8def834a5bea [gaim-migrate @ 15823]
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 13126
diff changeset
148 /* Umm, what? This might fix bug #1385130 */
8def834a5bea [gaim-migrate @ 15823]
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 13126
diff changeset
149 serv_got_alias(gc, passport, store);
9193
6e76f1367896 [gaim-migrate @ 9988]
Felipe Contreras <felipe.contreras@gmail.com>
parents:
diff changeset
150 }
6e76f1367896 [gaim-migrate @ 9988]
Felipe Contreras <felipe.contreras@gmail.com>
parents:
diff changeset
151
6e76f1367896 [gaim-migrate @ 9988]
Felipe Contreras <felipe.contreras@gmail.com>
parents:
diff changeset
152 if (list_op & MSN_LIST_AL_OP)
6e76f1367896 [gaim-migrate @ 9988]
Felipe Contreras <felipe.contreras@gmail.com>
parents:
diff changeset
153 {
6e76f1367896 [gaim-migrate @ 9988]
Felipe Contreras <felipe.contreras@gmail.com>
parents:
diff changeset
154 /* These are users who are allowed to see our status. */
15884
4de1981757fc sed -ie 's/gaim/purple/g'
Sean Egan <seanegan@pidgin.im>
parents: 15435
diff changeset
155 purple_privacy_deny_remove(account, passport, TRUE);
4de1981757fc sed -ie 's/gaim/purple/g'
Sean Egan <seanegan@pidgin.im>
parents: 15435
diff changeset
156 purple_privacy_permit_add(account, passport, TRUE);
9193
6e76f1367896 [gaim-migrate @ 9988]
Felipe Contreras <felipe.contreras@gmail.com>
parents:
diff changeset
157 }
6e76f1367896 [gaim-migrate @ 9988]
Felipe Contreras <felipe.contreras@gmail.com>
parents:
diff changeset
158
6e76f1367896 [gaim-migrate @ 9988]
Felipe Contreras <felipe.contreras@gmail.com>
parents:
diff changeset
159 if (list_op & MSN_LIST_BL_OP)
6e76f1367896 [gaim-migrate @ 9988]
Felipe Contreras <felipe.contreras@gmail.com>
parents:
diff changeset
160 {
6e76f1367896 [gaim-migrate @ 9988]
Felipe Contreras <felipe.contreras@gmail.com>
parents:
diff changeset
161 /* These are users who are not allowed to see our status. */
15884
4de1981757fc sed -ie 's/gaim/purple/g'
Sean Egan <seanegan@pidgin.im>
parents: 15435
diff changeset
162 purple_privacy_permit_remove(account, passport, TRUE);
4de1981757fc sed -ie 's/gaim/purple/g'
Sean Egan <seanegan@pidgin.im>
parents: 15435
diff changeset
163 purple_privacy_deny_add(account, passport, TRUE);
9193
6e76f1367896 [gaim-migrate @ 9988]
Felipe Contreras <felipe.contreras@gmail.com>
parents:
diff changeset
164 }
6e76f1367896 [gaim-migrate @ 9988]
Felipe Contreras <felipe.contreras@gmail.com>
parents:
diff changeset
165
6e76f1367896 [gaim-migrate @ 9988]
Felipe Contreras <felipe.contreras@gmail.com>
parents:
diff changeset
166 if (list_op & MSN_LIST_RL_OP)
6e76f1367896 [gaim-migrate @ 9988]
Felipe Contreras <felipe.contreras@gmail.com>
parents:
diff changeset
167 {
12318
942b7c089acb [gaim-migrate @ 14622]
Richard Laager <rlaager@pidgin.im>
parents: 11638
diff changeset
168 /* These are users who have us on their buddy list. */
13829
ac73840b2117 [gaim-migrate @ 16271]
Mark Doliner <markdoliner@pidgin.im>
parents: 13694
diff changeset
169 /*
ac73840b2117 [gaim-migrate @ 16271]
Mark Doliner <markdoliner@pidgin.im>
parents: 13694
diff changeset
170 * TODO: What is store name set to when this happens?
ac73840b2117 [gaim-migrate @ 16271]
Mark Doliner <markdoliner@pidgin.im>
parents: 13694
diff changeset
171 * For one of my accounts "something@hotmail.com"
ac73840b2117 [gaim-migrate @ 16271]
Mark Doliner <markdoliner@pidgin.im>
parents: 13694
diff changeset
172 * the store name was "something." Maybe we
ac73840b2117 [gaim-migrate @ 16271]
Mark Doliner <markdoliner@pidgin.im>
parents: 13694
diff changeset
173 * should use the friendly name, instead? --KingAnt
ac73840b2117 [gaim-migrate @ 16271]
Mark Doliner <markdoliner@pidgin.im>
parents: 13694
diff changeset
174 */
9193
6e76f1367896 [gaim-migrate @ 9988]
Felipe Contreras <felipe.contreras@gmail.com>
parents:
diff changeset
175
10583
6e191c459a4a [gaim-migrate @ 11985]
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 10568
diff changeset
176 if (!(list_op & (MSN_LIST_AL_OP | MSN_LIST_BL_OP)))
9225
dd246a09719b [gaim-migrate @ 10021]
Christian Hammond <chipx86@chipx86.com>
parents: 9223
diff changeset
177 {
27101
754a5afb2df7 Parse the invite message out of the pending membership list so that it can
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 27099
diff changeset
178 /* got_new_entry(gc, passport, store, NULL); */
9225
dd246a09719b [gaim-migrate @ 10021]
Christian Hammond <chipx86@chipx86.com>
parents: 9223
diff changeset
179 }
9193
6e76f1367896 [gaim-migrate @ 9988]
Felipe Contreras <felipe.contreras@gmail.com>
parents:
diff changeset
180 }
6e76f1367896 [gaim-migrate @ 9988]
Felipe Contreras <felipe.contreras@gmail.com>
parents:
diff changeset
181
20567
2417aff6ff3b Handle special cases in buddy/group management (wrt MSN_INDIVIDUALS_GROUP and MSN_NON_IM_GROUP).
Carlos Silva <typ0@pidgin.im>
parents: 20566
diff changeset
182 if (list_op & MSN_LIST_PL_OP)
2417aff6ff3b Handle special cases in buddy/group management (wrt MSN_INDIVIDUALS_GROUP and MSN_NON_IM_GROUP).
Carlos Silva <typ0@pidgin.im>
parents: 20566
diff changeset
183 {
29177
2d9cdf5ded46 Set user->authorized for pending buddies meaning we're authorized to add
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 29040
diff changeset
184 user->authorized = TRUE;
27101
754a5afb2df7 Parse the invite message out of the pending membership list so that it can
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 27099
diff changeset
185 got_new_entry(gc, passport, store, message);
20567
2417aff6ff3b Handle special cases in buddy/group management (wrt MSN_INDIVIDUALS_GROUP and MSN_NON_IM_GROUP).
Carlos Silva <typ0@pidgin.im>
parents: 20566
diff changeset
186 }
9193
6e76f1367896 [gaim-migrate @ 9988]
Felipe Contreras <felipe.contreras@gmail.com>
parents:
diff changeset
187 }
6e76f1367896 [gaim-migrate @ 9988]
Felipe Contreras <felipe.contreras@gmail.com>
parents:
diff changeset
188
6e76f1367896 [gaim-migrate @ 9988]
Felipe Contreras <felipe.contreras@gmail.com>
parents:
diff changeset
189 /**************************************************************************
6e76f1367896 [gaim-migrate @ 9988]
Felipe Contreras <felipe.contreras@gmail.com>
parents:
diff changeset
190 * UserList functions
6e76f1367896 [gaim-migrate @ 9988]
Felipe Contreras <felipe.contreras@gmail.com>
parents:
diff changeset
191 **************************************************************************/
6e76f1367896 [gaim-migrate @ 9988]
Felipe Contreras <felipe.contreras@gmail.com>
parents:
diff changeset
192
6e76f1367896 [gaim-migrate @ 9988]
Felipe Contreras <felipe.contreras@gmail.com>
parents:
diff changeset
193 MsnUserList*
6e76f1367896 [gaim-migrate @ 9988]
Felipe Contreras <felipe.contreras@gmail.com>
parents:
diff changeset
194 msn_userlist_new(MsnSession *session)
6e76f1367896 [gaim-migrate @ 9988]
Felipe Contreras <felipe.contreras@gmail.com>
parents:
diff changeset
195 {
6e76f1367896 [gaim-migrate @ 9988]
Felipe Contreras <felipe.contreras@gmail.com>
parents:
diff changeset
196 MsnUserList *userlist;
9198
e8eb6d5eb9eb [gaim-migrate @ 9993]
Christian Hammond <chipx86@chipx86.com>
parents: 9197
diff changeset
197
9193
6e76f1367896 [gaim-migrate @ 9988]
Felipe Contreras <felipe.contreras@gmail.com>
parents:
diff changeset
198 userlist = g_new0(MsnUserList, 1);
6e76f1367896 [gaim-migrate @ 9988]
Felipe Contreras <felipe.contreras@gmail.com>
parents:
diff changeset
199
6e76f1367896 [gaim-migrate @ 9988]
Felipe Contreras <felipe.contreras@gmail.com>
parents:
diff changeset
200 userlist->session = session;
9860
8f54a6091294 [gaim-migrate @ 10739]
Felipe Contreras <felipe.contreras@gmail.com>
parents: 9857
diff changeset
201 userlist->buddy_icon_requests = g_queue_new();
23441
fd45c23a3eb2 Delete trailing whitespace
Mark Doliner <markdoliner@pidgin.im>
parents: 22981
diff changeset
202
13126
afce0fe97885 [gaim-migrate @ 15487]
Evan Schoenberg <evands@pidgin.im>
parents: 12381
diff changeset
203 /* buddy_icon_window is the number of allowed simultaneous buddy icon requests.
afce0fe97885 [gaim-migrate @ 15487]
Evan Schoenberg <evands@pidgin.im>
parents: 12381
diff changeset
204 * XXX With smarter rate limiting code, we could allow more at once... 5 was the limit set when
afce0fe97885 [gaim-migrate @ 15487]
Evan Schoenberg <evands@pidgin.im>
parents: 12381
diff changeset
205 * we weren't retrieiving any more than 5 per MSN session. */
afce0fe97885 [gaim-migrate @ 15487]
Evan Schoenberg <evands@pidgin.im>
parents: 12381
diff changeset
206 userlist->buddy_icon_window = 1;
9193
6e76f1367896 [gaim-migrate @ 9988]
Felipe Contreras <felipe.contreras@gmail.com>
parents:
diff changeset
207
6e76f1367896 [gaim-migrate @ 9988]
Felipe Contreras <felipe.contreras@gmail.com>
parents:
diff changeset
208 return userlist;
6e76f1367896 [gaim-migrate @ 9988]
Felipe Contreras <felipe.contreras@gmail.com>
parents:
diff changeset
209 }
6e76f1367896 [gaim-migrate @ 9988]
Felipe Contreras <felipe.contreras@gmail.com>
parents:
diff changeset
210
6e76f1367896 [gaim-migrate @ 9988]
Felipe Contreras <felipe.contreras@gmail.com>
parents:
diff changeset
211 void
6e76f1367896 [gaim-migrate @ 9988]
Felipe Contreras <felipe.contreras@gmail.com>
parents:
diff changeset
212 msn_userlist_destroy(MsnUserList *userlist)
6e76f1367896 [gaim-migrate @ 9988]
Felipe Contreras <felipe.contreras@gmail.com>
parents:
diff changeset
213 {
6e76f1367896 [gaim-migrate @ 9988]
Felipe Contreras <felipe.contreras@gmail.com>
parents:
diff changeset
214 GList *l;
6e76f1367896 [gaim-migrate @ 9988]
Felipe Contreras <felipe.contreras@gmail.com>
parents:
diff changeset
215
13855
24cff9e060d7 [gaim-migrate @ 16507]
Ma Yuan <mayuan2006@gmail.com>
parents: 13829
diff changeset
216 /*destroy userlist*/
9193
6e76f1367896 [gaim-migrate @ 9988]
Felipe Contreras <felipe.contreras@gmail.com>
parents:
diff changeset
217 for (l = userlist->users; l != NULL; l = l->next)
6e76f1367896 [gaim-migrate @ 9988]
Felipe Contreras <felipe.contreras@gmail.com>
parents:
diff changeset
218 {
30944
4f1fc7c401fd Remove msn_user_destroy in favor of msn_user_unref.
Jorge Villaseñor <masca@cpw.pidgin.im>
parents: 30936
diff changeset
219 msn_user_unref(l->data);
9193
6e76f1367896 [gaim-migrate @ 9988]
Felipe Contreras <felipe.contreras@gmail.com>
parents:
diff changeset
220 }
6e76f1367896 [gaim-migrate @ 9988]
Felipe Contreras <felipe.contreras@gmail.com>
parents:
diff changeset
221 g_list_free(userlist->users);
6e76f1367896 [gaim-migrate @ 9988]
Felipe Contreras <felipe.contreras@gmail.com>
parents:
diff changeset
222
13855
24cff9e060d7 [gaim-migrate @ 16507]
Ma Yuan <mayuan2006@gmail.com>
parents: 13829
diff changeset
223 /*destroy group list*/
9193
6e76f1367896 [gaim-migrate @ 9988]
Felipe Contreras <felipe.contreras@gmail.com>
parents:
diff changeset
224 for (l = userlist->groups; l != NULL; l = l->next)
6e76f1367896 [gaim-migrate @ 9988]
Felipe Contreras <felipe.contreras@gmail.com>
parents:
diff changeset
225 {
6e76f1367896 [gaim-migrate @ 9988]
Felipe Contreras <felipe.contreras@gmail.com>
parents:
diff changeset
226 msn_group_destroy(l->data);
6e76f1367896 [gaim-migrate @ 9988]
Felipe Contreras <felipe.contreras@gmail.com>
parents:
diff changeset
227 }
6e76f1367896 [gaim-migrate @ 9988]
Felipe Contreras <felipe.contreras@gmail.com>
parents:
diff changeset
228 g_list_free(userlist->groups);
9895
9ee0674ce68b [gaim-migrate @ 10784]
Felipe Contreras <felipe.contreras@gmail.com>
parents: 9861
diff changeset
229
9ee0674ce68b [gaim-migrate @ 10784]
Felipe Contreras <felipe.contreras@gmail.com>
parents: 9861
diff changeset
230 g_queue_free(userlist->buddy_icon_requests);
13126
afce0fe97885 [gaim-migrate @ 15487]
Evan Schoenberg <evands@pidgin.im>
parents: 12381
diff changeset
231
afce0fe97885 [gaim-migrate @ 15487]
Evan Schoenberg <evands@pidgin.im>
parents: 12381
diff changeset
232 if (userlist->buddy_icon_request_timer)
15884
4de1981757fc sed -ie 's/gaim/purple/g'
Sean Egan <seanegan@pidgin.im>
parents: 15435
diff changeset
233 purple_timeout_remove(userlist->buddy_icon_request_timer);
13126
afce0fe97885 [gaim-migrate @ 15487]
Evan Schoenberg <evands@pidgin.im>
parents: 12381
diff changeset
234
9857
56db8557dfed [gaim-migrate @ 10736]
Felipe Contreras <felipe.contreras@gmail.com>
parents: 9225
diff changeset
235 g_free(userlist);
9193
6e76f1367896 [gaim-migrate @ 9988]
Felipe Contreras <felipe.contreras@gmail.com>
parents:
diff changeset
236 }
6e76f1367896 [gaim-migrate @ 9988]
Felipe Contreras <felipe.contreras@gmail.com>
parents:
diff changeset
237
20473
91e1b3a49d10 msn.tgz from SF Patch #1621854 from Ka-Hing Cheung
Ka-Hing Cheung <khc@pidgin.im>
parents: 20472
diff changeset
238 MsnUser *
91e1b3a49d10 msn.tgz from SF Patch #1621854 from Ka-Hing Cheung
Ka-Hing Cheung <khc@pidgin.im>
parents: 20472
diff changeset
239 msn_userlist_find_add_user(MsnUserList *userlist,const char *passport,const char *userName)
91e1b3a49d10 msn.tgz from SF Patch #1621854 from Ka-Hing Cheung
Ka-Hing Cheung <khc@pidgin.im>
parents: 20472
diff changeset
240 {
91e1b3a49d10 msn.tgz from SF Patch #1621854 from Ka-Hing Cheung
Ka-Hing Cheung <khc@pidgin.im>
parents: 20472
diff changeset
241 MsnUser *user;
91e1b3a49d10 msn.tgz from SF Patch #1621854 from Ka-Hing Cheung
Ka-Hing Cheung <khc@pidgin.im>
parents: 20472
diff changeset
242
91e1b3a49d10 msn.tgz from SF Patch #1621854 from Ka-Hing Cheung
Ka-Hing Cheung <khc@pidgin.im>
parents: 20472
diff changeset
243 user = msn_userlist_find_user(userlist, passport);
20479
03c44889c50f Revert some whitespace changes.
Richard Laager <rlaager@pidgin.im>
parents: 20473
diff changeset
244 if (user == NULL)
03c44889c50f Revert some whitespace changes.
Richard Laager <rlaager@pidgin.im>
parents: 20473
diff changeset
245 {
20473
91e1b3a49d10 msn.tgz from SF Patch #1621854 from Ka-Hing Cheung
Ka-Hing Cheung <khc@pidgin.im>
parents: 20472
diff changeset
246 user = msn_user_new(userlist, passport, userName);
91e1b3a49d10 msn.tgz from SF Patch #1621854 from Ka-Hing Cheung
Ka-Hing Cheung <khc@pidgin.im>
parents: 20472
diff changeset
247 msn_userlist_add_user(userlist, user);
20564
35675dd4a44d Make buddy and group management actually work, add some SOAP templates, redesign some parts of code and separate some bigger functions into its smaller tasks which are completely unrelated to each other
Carlos Silva <typ0@pidgin.im>
parents: 20560
diff changeset
248 } else {
23783
cf52f8bc3b93 Remove MSN's use of a "store name" in favour of the "friendly name"
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 23782
diff changeset
249 msn_user_set_friendly_name(user, userName);
20473
91e1b3a49d10 msn.tgz from SF Patch #1621854 from Ka-Hing Cheung
Ka-Hing Cheung <khc@pidgin.im>
parents: 20472
diff changeset
250 }
91e1b3a49d10 msn.tgz from SF Patch #1621854 from Ka-Hing Cheung
Ka-Hing Cheung <khc@pidgin.im>
parents: 20472
diff changeset
251 return user;
91e1b3a49d10 msn.tgz from SF Patch #1621854 from Ka-Hing Cheung
Ka-Hing Cheung <khc@pidgin.im>
parents: 20472
diff changeset
252 }
91e1b3a49d10 msn.tgz from SF Patch #1621854 from Ka-Hing Cheung
Ka-Hing Cheung <khc@pidgin.im>
parents: 20472
diff changeset
253
9193
6e76f1367896 [gaim-migrate @ 9988]
Felipe Contreras <felipe.contreras@gmail.com>
parents:
diff changeset
254 void
6e76f1367896 [gaim-migrate @ 9988]
Felipe Contreras <felipe.contreras@gmail.com>
parents:
diff changeset
255 msn_userlist_add_user(MsnUserList *userlist, MsnUser *user)
6e76f1367896 [gaim-migrate @ 9988]
Felipe Contreras <felipe.contreras@gmail.com>
parents:
diff changeset
256 {
20021
ab95bfa36836 Please NEWS and continue to ChangeLog things.
Sean Egan <seanegan@pidgin.im>
parents: 19859
diff changeset
257 userlist->users = g_list_prepend(userlist->users, user);
9193
6e76f1367896 [gaim-migrate @ 9988]
Felipe Contreras <felipe.contreras@gmail.com>
parents:
diff changeset
258 }
6e76f1367896 [gaim-migrate @ 9988]
Felipe Contreras <felipe.contreras@gmail.com>
parents:
diff changeset
259
6e76f1367896 [gaim-migrate @ 9988]
Felipe Contreras <felipe.contreras@gmail.com>
parents:
diff changeset
260 void
6e76f1367896 [gaim-migrate @ 9988]
Felipe Contreras <felipe.contreras@gmail.com>
parents:
diff changeset
261 msn_userlist_remove_user(MsnUserList *userlist, MsnUser *user)
6e76f1367896 [gaim-migrate @ 9988]
Felipe Contreras <felipe.contreras@gmail.com>
parents:
diff changeset
262 {
6e76f1367896 [gaim-migrate @ 9988]
Felipe Contreras <felipe.contreras@gmail.com>
parents:
diff changeset
263 userlist->users = g_list_remove(userlist->users, user);
6e76f1367896 [gaim-migrate @ 9988]
Felipe Contreras <felipe.contreras@gmail.com>
parents:
diff changeset
264 }
6e76f1367896 [gaim-migrate @ 9988]
Felipe Contreras <felipe.contreras@gmail.com>
parents:
diff changeset
265
6e76f1367896 [gaim-migrate @ 9988]
Felipe Contreras <felipe.contreras@gmail.com>
parents:
diff changeset
266 MsnUser *
6e76f1367896 [gaim-migrate @ 9988]
Felipe Contreras <felipe.contreras@gmail.com>
parents:
diff changeset
267 msn_userlist_find_user(MsnUserList *userlist, const char *passport)
6e76f1367896 [gaim-migrate @ 9988]
Felipe Contreras <felipe.contreras@gmail.com>
parents:
diff changeset
268 {
6e76f1367896 [gaim-migrate @ 9988]
Felipe Contreras <felipe.contreras@gmail.com>
parents:
diff changeset
269 GList *l;
6e76f1367896 [gaim-migrate @ 9988]
Felipe Contreras <felipe.contreras@gmail.com>
parents:
diff changeset
270
6e76f1367896 [gaim-migrate @ 9988]
Felipe Contreras <felipe.contreras@gmail.com>
parents:
diff changeset
271 g_return_val_if_fail(passport != NULL, NULL);
6e76f1367896 [gaim-migrate @ 9988]
Felipe Contreras <felipe.contreras@gmail.com>
parents:
diff changeset
272
6e76f1367896 [gaim-migrate @ 9988]
Felipe Contreras <felipe.contreras@gmail.com>
parents:
diff changeset
273 for (l = userlist->users; l != NULL; l = l->next)
6e76f1367896 [gaim-migrate @ 9988]
Felipe Contreras <felipe.contreras@gmail.com>
parents:
diff changeset
274 {
6e76f1367896 [gaim-migrate @ 9988]
Felipe Contreras <felipe.contreras@gmail.com>
parents:
diff changeset
275 MsnUser *user = (MsnUser *)l->data;
6e76f1367896 [gaim-migrate @ 9988]
Felipe Contreras <felipe.contreras@gmail.com>
parents:
diff changeset
276
6e76f1367896 [gaim-migrate @ 9988]
Felipe Contreras <felipe.contreras@gmail.com>
parents:
diff changeset
277 g_return_val_if_fail(user->passport != NULL, NULL);
6e76f1367896 [gaim-migrate @ 9988]
Felipe Contreras <felipe.contreras@gmail.com>
parents:
diff changeset
278
26726
b81bcec8f359 Updates for GTK+ 3.0. Remove some deprecated functions (someone should
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 26474
diff changeset
279 if (!g_ascii_strcasecmp(passport, user->passport)){
9193
6e76f1367896 [gaim-migrate @ 9988]
Felipe Contreras <felipe.contreras@gmail.com>
parents:
diff changeset
280 return user;
20473
91e1b3a49d10 msn.tgz from SF Patch #1621854 from Ka-Hing Cheung
Ka-Hing Cheung <khc@pidgin.im>
parents: 20472
diff changeset
281 }
9193
6e76f1367896 [gaim-migrate @ 9988]
Felipe Contreras <felipe.contreras@gmail.com>
parents:
diff changeset
282 }
6e76f1367896 [gaim-migrate @ 9988]
Felipe Contreras <felipe.contreras@gmail.com>
parents:
diff changeset
283
6e76f1367896 [gaim-migrate @ 9988]
Felipe Contreras <felipe.contreras@gmail.com>
parents:
diff changeset
284 return NULL;
6e76f1367896 [gaim-migrate @ 9988]
Felipe Contreras <felipe.contreras@gmail.com>
parents:
diff changeset
285 }
6e76f1367896 [gaim-migrate @ 9988]
Felipe Contreras <felipe.contreras@gmail.com>
parents:
diff changeset
286
20609
b92d0b5ab89d Make use of the GQueue in MsnSoapConn to manage the SOAP requests, allowing them to work perfectly even when dispatching multiple requests at once.
Carlos Silva <typ0@pidgin.im>
parents: 20603
diff changeset
287 MsnUser *
b92d0b5ab89d Make use of the GQueue in MsnSoapConn to manage the SOAP requests, allowing them to work perfectly even when dispatching multiple requests at once.
Carlos Silva <typ0@pidgin.im>
parents: 20603
diff changeset
288 msn_userlist_find_user_with_id(MsnUserList *userlist, const char *uid)
b92d0b5ab89d Make use of the GQueue in MsnSoapConn to manage the SOAP requests, allowing them to work perfectly even when dispatching multiple requests at once.
Carlos Silva <typ0@pidgin.im>
parents: 20603
diff changeset
289 {
b92d0b5ab89d Make use of the GQueue in MsnSoapConn to manage the SOAP requests, allowing them to work perfectly even when dispatching multiple requests at once.
Carlos Silva <typ0@pidgin.im>
parents: 20603
diff changeset
290 GList *l;
b92d0b5ab89d Make use of the GQueue in MsnSoapConn to manage the SOAP requests, allowing them to work perfectly even when dispatching multiple requests at once.
Carlos Silva <typ0@pidgin.im>
parents: 20603
diff changeset
291
22672
2718711bca23 who in the right mind uses 8 space tab?
Ka-Hing Cheung <khc@pidgin.im>
parents: 22671
diff changeset
292 g_return_val_if_fail(uid != NULL, NULL);
20609
b92d0b5ab89d Make use of the GQueue in MsnSoapConn to manage the SOAP requests, allowing them to work perfectly even when dispatching multiple requests at once.
Carlos Silva <typ0@pidgin.im>
parents: 20603
diff changeset
293
22672
2718711bca23 who in the right mind uses 8 space tab?
Ka-Hing Cheung <khc@pidgin.im>
parents: 22671
diff changeset
294 for (l = userlist->users; l != NULL; l = l->next) {
2718711bca23 who in the right mind uses 8 space tab?
Ka-Hing Cheung <khc@pidgin.im>
parents: 22671
diff changeset
295 MsnUser *user = (MsnUser *)l->data;
20609
b92d0b5ab89d Make use of the GQueue in MsnSoapConn to manage the SOAP requests, allowing them to work perfectly even when dispatching multiple requests at once.
Carlos Silva <typ0@pidgin.im>
parents: 20603
diff changeset
296
b92d0b5ab89d Make use of the GQueue in MsnSoapConn to manage the SOAP requests, allowing them to work perfectly even when dispatching multiple requests at once.
Carlos Silva <typ0@pidgin.im>
parents: 20603
diff changeset
297 if (user->uid == NULL) {
b92d0b5ab89d Make use of the GQueue in MsnSoapConn to manage the SOAP requests, allowing them to work perfectly even when dispatching multiple requests at once.
Carlos Silva <typ0@pidgin.im>
parents: 20603
diff changeset
298 continue;
b92d0b5ab89d Make use of the GQueue in MsnSoapConn to manage the SOAP requests, allowing them to work perfectly even when dispatching multiple requests at once.
Carlos Silva <typ0@pidgin.im>
parents: 20603
diff changeset
299 }
b92d0b5ab89d Make use of the GQueue in MsnSoapConn to manage the SOAP requests, allowing them to work perfectly even when dispatching multiple requests at once.
Carlos Silva <typ0@pidgin.im>
parents: 20603
diff changeset
300
26726
b81bcec8f359 Updates for GTK+ 3.0. Remove some deprecated functions (someone should
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 26474
diff changeset
301 if ( !g_ascii_strcasecmp(uid, user->uid) ) {
20609
b92d0b5ab89d Make use of the GQueue in MsnSoapConn to manage the SOAP requests, allowing them to work perfectly even when dispatching multiple requests at once.
Carlos Silva <typ0@pidgin.im>
parents: 20603
diff changeset
302 return user;
b92d0b5ab89d Make use of the GQueue in MsnSoapConn to manage the SOAP requests, allowing them to work perfectly even when dispatching multiple requests at once.
Carlos Silva <typ0@pidgin.im>
parents: 20603
diff changeset
303 }
b92d0b5ab89d Make use of the GQueue in MsnSoapConn to manage the SOAP requests, allowing them to work perfectly even when dispatching multiple requests at once.
Carlos Silva <typ0@pidgin.im>
parents: 20603
diff changeset
304 }
b92d0b5ab89d Make use of the GQueue in MsnSoapConn to manage the SOAP requests, allowing them to work perfectly even when dispatching multiple requests at once.
Carlos Silva <typ0@pidgin.im>
parents: 20603
diff changeset
305
b92d0b5ab89d Make use of the GQueue in MsnSoapConn to manage the SOAP requests, allowing them to work perfectly even when dispatching multiple requests at once.
Carlos Silva <typ0@pidgin.im>
parents: 20603
diff changeset
306 return NULL;
b92d0b5ab89d Make use of the GQueue in MsnSoapConn to manage the SOAP requests, allowing them to work perfectly even when dispatching multiple requests at once.
Carlos Silva <typ0@pidgin.im>
parents: 20603
diff changeset
307 }
b92d0b5ab89d Make use of the GQueue in MsnSoapConn to manage the SOAP requests, allowing them to work perfectly even when dispatching multiple requests at once.
Carlos Silva <typ0@pidgin.im>
parents: 20603
diff changeset
308
22671
1be93db097eb another patch from Maiku, this time handling IPG so we can receive paging.
Ka-Hing Cheung <khc@pidgin.im>
parents: 21369
diff changeset
309 MsnUser *
1be93db097eb another patch from Maiku, this time handling IPG so we can receive paging.
Ka-Hing Cheung <khc@pidgin.im>
parents: 21369
diff changeset
310 msn_userlist_find_user_with_mobile_phone(MsnUserList *userlist, const char *number)
1be93db097eb another patch from Maiku, this time handling IPG so we can receive paging.
Ka-Hing Cheung <khc@pidgin.im>
parents: 21369
diff changeset
311 {
1be93db097eb another patch from Maiku, this time handling IPG so we can receive paging.
Ka-Hing Cheung <khc@pidgin.im>
parents: 21369
diff changeset
312 GList *l;
1be93db097eb another patch from Maiku, this time handling IPG so we can receive paging.
Ka-Hing Cheung <khc@pidgin.im>
parents: 21369
diff changeset
313
1be93db097eb another patch from Maiku, this time handling IPG so we can receive paging.
Ka-Hing Cheung <khc@pidgin.im>
parents: 21369
diff changeset
314 g_return_val_if_fail(number != NULL, NULL);
1be93db097eb another patch from Maiku, this time handling IPG so we can receive paging.
Ka-Hing Cheung <khc@pidgin.im>
parents: 21369
diff changeset
315
1be93db097eb another patch from Maiku, this time handling IPG so we can receive paging.
Ka-Hing Cheung <khc@pidgin.im>
parents: 21369
diff changeset
316 for (l = userlist->users; l != NULL; l = l->next) {
1be93db097eb another patch from Maiku, this time handling IPG so we can receive paging.
Ka-Hing Cheung <khc@pidgin.im>
parents: 21369
diff changeset
317 MsnUser *user = (MsnUser *)l->data;
29300
8d9c8a4a03af Combine the CurrentMedia and MsnUserPhoneInfo structs. This makes
Mark Doliner <markdoliner@pidgin.im>
parents: 29282
diff changeset
318 const char *user_number = msn_user_get_mobile_phone(user);
22671
1be93db097eb another patch from Maiku, this time handling IPG so we can receive paging.
Ka-Hing Cheung <khc@pidgin.im>
parents: 21369
diff changeset
319
29300
8d9c8a4a03af Combine the CurrentMedia and MsnUserPhoneInfo structs. This makes
Mark Doliner <markdoliner@pidgin.im>
parents: 29282
diff changeset
320 if (user_number && !g_ascii_strcasecmp(number, user_number))
22671
1be93db097eb another patch from Maiku, this time handling IPG so we can receive paging.
Ka-Hing Cheung <khc@pidgin.im>
parents: 21369
diff changeset
321 return user;
1be93db097eb another patch from Maiku, this time handling IPG so we can receive paging.
Ka-Hing Cheung <khc@pidgin.im>
parents: 21369
diff changeset
322 }
1be93db097eb another patch from Maiku, this time handling IPG so we can receive paging.
Ka-Hing Cheung <khc@pidgin.im>
parents: 21369
diff changeset
323
1be93db097eb another patch from Maiku, this time handling IPG so we can receive paging.
Ka-Hing Cheung <khc@pidgin.im>
parents: 21369
diff changeset
324 return NULL;
1be93db097eb another patch from Maiku, this time handling IPG so we can receive paging.
Ka-Hing Cheung <khc@pidgin.im>
parents: 21369
diff changeset
325 }
1be93db097eb another patch from Maiku, this time handling IPG so we can receive paging.
Ka-Hing Cheung <khc@pidgin.im>
parents: 21369
diff changeset
326
9193
6e76f1367896 [gaim-migrate @ 9988]
Felipe Contreras <felipe.contreras@gmail.com>
parents:
diff changeset
327 void
6e76f1367896 [gaim-migrate @ 9988]
Felipe Contreras <felipe.contreras@gmail.com>
parents:
diff changeset
328 msn_userlist_add_group(MsnUserList *userlist, MsnGroup *group)
6e76f1367896 [gaim-migrate @ 9988]
Felipe Contreras <felipe.contreras@gmail.com>
parents:
diff changeset
329 {
6e76f1367896 [gaim-migrate @ 9988]
Felipe Contreras <felipe.contreras@gmail.com>
parents:
diff changeset
330 userlist->groups = g_list_append(userlist->groups, group);
6e76f1367896 [gaim-migrate @ 9988]
Felipe Contreras <felipe.contreras@gmail.com>
parents:
diff changeset
331 }
6e76f1367896 [gaim-migrate @ 9988]
Felipe Contreras <felipe.contreras@gmail.com>
parents:
diff changeset
332
6e76f1367896 [gaim-migrate @ 9988]
Felipe Contreras <felipe.contreras@gmail.com>
parents:
diff changeset
333 void
6e76f1367896 [gaim-migrate @ 9988]
Felipe Contreras <felipe.contreras@gmail.com>
parents:
diff changeset
334 msn_userlist_remove_group(MsnUserList *userlist, MsnGroup *group)
6e76f1367896 [gaim-migrate @ 9988]
Felipe Contreras <felipe.contreras@gmail.com>
parents:
diff changeset
335 {
6e76f1367896 [gaim-migrate @ 9988]
Felipe Contreras <felipe.contreras@gmail.com>
parents:
diff changeset
336 userlist->groups = g_list_remove(userlist->groups, group);
6e76f1367896 [gaim-migrate @ 9988]
Felipe Contreras <felipe.contreras@gmail.com>
parents:
diff changeset
337 }
6e76f1367896 [gaim-migrate @ 9988]
Felipe Contreras <felipe.contreras@gmail.com>
parents:
diff changeset
338
6e76f1367896 [gaim-migrate @ 9988]
Felipe Contreras <felipe.contreras@gmail.com>
parents:
diff changeset
339 MsnGroup *
13855
24cff9e060d7 [gaim-migrate @ 16507]
Ma Yuan <mayuan2006@gmail.com>
parents: 13829
diff changeset
340 msn_userlist_find_group_with_id(MsnUserList *userlist, const char * id)
9193
6e76f1367896 [gaim-migrate @ 9988]
Felipe Contreras <felipe.contreras@gmail.com>
parents:
diff changeset
341 {
6e76f1367896 [gaim-migrate @ 9988]
Felipe Contreras <felipe.contreras@gmail.com>
parents:
diff changeset
342 GList *l;
6e76f1367896 [gaim-migrate @ 9988]
Felipe Contreras <felipe.contreras@gmail.com>
parents:
diff changeset
343
6e76f1367896 [gaim-migrate @ 9988]
Felipe Contreras <felipe.contreras@gmail.com>
parents:
diff changeset
344 g_return_val_if_fail(userlist != NULL, NULL);
13855
24cff9e060d7 [gaim-migrate @ 16507]
Ma Yuan <mayuan2006@gmail.com>
parents: 13829
diff changeset
345 g_return_val_if_fail(id != NULL, NULL);
9193
6e76f1367896 [gaim-migrate @ 9988]
Felipe Contreras <felipe.contreras@gmail.com>
parents:
diff changeset
346
6e76f1367896 [gaim-migrate @ 9988]
Felipe Contreras <felipe.contreras@gmail.com>
parents:
diff changeset
347 for (l = userlist->groups; l != NULL; l = l->next)
6e76f1367896 [gaim-migrate @ 9988]
Felipe Contreras <felipe.contreras@gmail.com>
parents:
diff changeset
348 {
6e76f1367896 [gaim-migrate @ 9988]
Felipe Contreras <felipe.contreras@gmail.com>
parents:
diff changeset
349 MsnGroup *group = l->data;
6e76f1367896 [gaim-migrate @ 9988]
Felipe Contreras <felipe.contreras@gmail.com>
parents:
diff changeset
350
26726
b81bcec8f359 Updates for GTK+ 3.0. Remove some deprecated functions (someone should
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 26474
diff changeset
351 if (!g_ascii_strcasecmp(group->id,id))
9193
6e76f1367896 [gaim-migrate @ 9988]
Felipe Contreras <felipe.contreras@gmail.com>
parents:
diff changeset
352 return group;
6e76f1367896 [gaim-migrate @ 9988]
Felipe Contreras <felipe.contreras@gmail.com>
parents:
diff changeset
353 }
6e76f1367896 [gaim-migrate @ 9988]
Felipe Contreras <felipe.contreras@gmail.com>
parents:
diff changeset
354
6e76f1367896 [gaim-migrate @ 9988]
Felipe Contreras <felipe.contreras@gmail.com>
parents:
diff changeset
355 return NULL;
6e76f1367896 [gaim-migrate @ 9988]
Felipe Contreras <felipe.contreras@gmail.com>
parents:
diff changeset
356 }
6e76f1367896 [gaim-migrate @ 9988]
Felipe Contreras <felipe.contreras@gmail.com>
parents:
diff changeset
357
6e76f1367896 [gaim-migrate @ 9988]
Felipe Contreras <felipe.contreras@gmail.com>
parents:
diff changeset
358 MsnGroup *
6e76f1367896 [gaim-migrate @ 9988]
Felipe Contreras <felipe.contreras@gmail.com>
parents:
diff changeset
359 msn_userlist_find_group_with_name(MsnUserList *userlist, const char *name)
6e76f1367896 [gaim-migrate @ 9988]
Felipe Contreras <felipe.contreras@gmail.com>
parents:
diff changeset
360 {
6e76f1367896 [gaim-migrate @ 9988]
Felipe Contreras <felipe.contreras@gmail.com>
parents:
diff changeset
361 GList *l;
6e76f1367896 [gaim-migrate @ 9988]
Felipe Contreras <felipe.contreras@gmail.com>
parents:
diff changeset
362
6e76f1367896 [gaim-migrate @ 9988]
Felipe Contreras <felipe.contreras@gmail.com>
parents:
diff changeset
363 g_return_val_if_fail(userlist != NULL, NULL);
6e76f1367896 [gaim-migrate @ 9988]
Felipe Contreras <felipe.contreras@gmail.com>
parents:
diff changeset
364 g_return_val_if_fail(name != NULL, NULL);
6e76f1367896 [gaim-migrate @ 9988]
Felipe Contreras <felipe.contreras@gmail.com>
parents:
diff changeset
365
6e76f1367896 [gaim-migrate @ 9988]
Felipe Contreras <felipe.contreras@gmail.com>
parents:
diff changeset
366 for (l = userlist->groups; l != NULL; l = l->next)
6e76f1367896 [gaim-migrate @ 9988]
Felipe Contreras <felipe.contreras@gmail.com>
parents:
diff changeset
367 {
6e76f1367896 [gaim-migrate @ 9988]
Felipe Contreras <felipe.contreras@gmail.com>
parents:
diff changeset
368 MsnGroup *group = l->data;
6e76f1367896 [gaim-migrate @ 9988]
Felipe Contreras <felipe.contreras@gmail.com>
parents:
diff changeset
369
26726
b81bcec8f359 Updates for GTK+ 3.0. Remove some deprecated functions (someone should
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 26474
diff changeset
370 if ((group->name != NULL) && !g_ascii_strcasecmp(name, group->name))
9193
6e76f1367896 [gaim-migrate @ 9988]
Felipe Contreras <felipe.contreras@gmail.com>
parents:
diff changeset
371 return group;
6e76f1367896 [gaim-migrate @ 9988]
Felipe Contreras <felipe.contreras@gmail.com>
parents:
diff changeset
372 }
6e76f1367896 [gaim-migrate @ 9988]
Felipe Contreras <felipe.contreras@gmail.com>
parents:
diff changeset
373
6e76f1367896 [gaim-migrate @ 9988]
Felipe Contreras <felipe.contreras@gmail.com>
parents:
diff changeset
374 return NULL;
6e76f1367896 [gaim-migrate @ 9988]
Felipe Contreras <felipe.contreras@gmail.com>
parents:
diff changeset
375 }
6e76f1367896 [gaim-migrate @ 9988]
Felipe Contreras <felipe.contreras@gmail.com>
parents:
diff changeset
376
13855
24cff9e060d7 [gaim-migrate @ 16507]
Ma Yuan <mayuan2006@gmail.com>
parents: 13829
diff changeset
377 const char *
9193
6e76f1367896 [gaim-migrate @ 9988]
Felipe Contreras <felipe.contreras@gmail.com>
parents:
diff changeset
378 msn_userlist_find_group_id(MsnUserList *userlist, const char *group_name)
6e76f1367896 [gaim-migrate @ 9988]
Felipe Contreras <felipe.contreras@gmail.com>
parents:
diff changeset
379 {
6e76f1367896 [gaim-migrate @ 9988]
Felipe Contreras <felipe.contreras@gmail.com>
parents:
diff changeset
380 MsnGroup *group;
9198
e8eb6d5eb9eb [gaim-migrate @ 9993]
Christian Hammond <chipx86@chipx86.com>
parents: 9197
diff changeset
381
9193
6e76f1367896 [gaim-migrate @ 9988]
Felipe Contreras <felipe.contreras@gmail.com>
parents:
diff changeset
382 group = msn_userlist_find_group_with_name(userlist, group_name);
6e76f1367896 [gaim-migrate @ 9988]
Felipe Contreras <felipe.contreras@gmail.com>
parents:
diff changeset
383
6e76f1367896 [gaim-migrate @ 9988]
Felipe Contreras <felipe.contreras@gmail.com>
parents:
diff changeset
384 if (group != NULL)
6e76f1367896 [gaim-migrate @ 9988]
Felipe Contreras <felipe.contreras@gmail.com>
parents:
diff changeset
385 return msn_group_get_id(group);
6e76f1367896 [gaim-migrate @ 9988]
Felipe Contreras <felipe.contreras@gmail.com>
parents:
diff changeset
386 else
13855
24cff9e060d7 [gaim-migrate @ 16507]
Ma Yuan <mayuan2006@gmail.com>
parents: 13829
diff changeset
387 return NULL;
9193
6e76f1367896 [gaim-migrate @ 9988]
Felipe Contreras <felipe.contreras@gmail.com>
parents:
diff changeset
388 }
6e76f1367896 [gaim-migrate @ 9988]
Felipe Contreras <felipe.contreras@gmail.com>
parents:
diff changeset
389
6e76f1367896 [gaim-migrate @ 9988]
Felipe Contreras <felipe.contreras@gmail.com>
parents:
diff changeset
390 const char *
13855
24cff9e060d7 [gaim-migrate @ 16507]
Ma Yuan <mayuan2006@gmail.com>
parents: 13829
diff changeset
391 msn_userlist_find_group_name(MsnUserList *userlist, const char * group_id)
9193
6e76f1367896 [gaim-migrate @ 9988]
Felipe Contreras <felipe.contreras@gmail.com>
parents:
diff changeset
392 {
6e76f1367896 [gaim-migrate @ 9988]
Felipe Contreras <felipe.contreras@gmail.com>
parents:
diff changeset
393 MsnGroup *group;
9198
e8eb6d5eb9eb [gaim-migrate @ 9993]
Christian Hammond <chipx86@chipx86.com>
parents: 9197
diff changeset
394
9193
6e76f1367896 [gaim-migrate @ 9988]
Felipe Contreras <felipe.contreras@gmail.com>
parents:
diff changeset
395 group = msn_userlist_find_group_with_id(userlist, group_id);
6e76f1367896 [gaim-migrate @ 9988]
Felipe Contreras <felipe.contreras@gmail.com>
parents:
diff changeset
396
6e76f1367896 [gaim-migrate @ 9988]
Felipe Contreras <felipe.contreras@gmail.com>
parents:
diff changeset
397 if (group != NULL)
6e76f1367896 [gaim-migrate @ 9988]
Felipe Contreras <felipe.contreras@gmail.com>
parents:
diff changeset
398 return msn_group_get_name(group);
6e76f1367896 [gaim-migrate @ 9988]
Felipe Contreras <felipe.contreras@gmail.com>
parents:
diff changeset
399 else
6e76f1367896 [gaim-migrate @ 9988]
Felipe Contreras <felipe.contreras@gmail.com>
parents:
diff changeset
400 return NULL;
6e76f1367896 [gaim-migrate @ 9988]
Felipe Contreras <felipe.contreras@gmail.com>
parents:
diff changeset
401 }
6e76f1367896 [gaim-migrate @ 9988]
Felipe Contreras <felipe.contreras@gmail.com>
parents:
diff changeset
402
6e76f1367896 [gaim-migrate @ 9988]
Felipe Contreras <felipe.contreras@gmail.com>
parents:
diff changeset
403 void
13855
24cff9e060d7 [gaim-migrate @ 16507]
Ma Yuan <mayuan2006@gmail.com>
parents: 13829
diff changeset
404 msn_userlist_rename_group_id(MsnUserList *userlist, const char * group_id,
9193
6e76f1367896 [gaim-migrate @ 9988]
Felipe Contreras <felipe.contreras@gmail.com>
parents:
diff changeset
405 const char *new_name)
6e76f1367896 [gaim-migrate @ 9988]
Felipe Contreras <felipe.contreras@gmail.com>
parents:
diff changeset
406 {
6e76f1367896 [gaim-migrate @ 9988]
Felipe Contreras <felipe.contreras@gmail.com>
parents:
diff changeset
407 MsnGroup *group;
6e76f1367896 [gaim-migrate @ 9988]
Felipe Contreras <felipe.contreras@gmail.com>
parents:
diff changeset
408
6e76f1367896 [gaim-migrate @ 9988]
Felipe Contreras <felipe.contreras@gmail.com>
parents:
diff changeset
409 group = msn_userlist_find_group_with_id(userlist, group_id);
6e76f1367896 [gaim-migrate @ 9988]
Felipe Contreras <felipe.contreras@gmail.com>
parents:
diff changeset
410
6e76f1367896 [gaim-migrate @ 9988]
Felipe Contreras <felipe.contreras@gmail.com>
parents:
diff changeset
411 if (group != NULL)
6e76f1367896 [gaim-migrate @ 9988]
Felipe Contreras <felipe.contreras@gmail.com>
parents:
diff changeset
412 msn_group_set_name(group, new_name);
6e76f1367896 [gaim-migrate @ 9988]
Felipe Contreras <felipe.contreras@gmail.com>
parents:
diff changeset
413 }
6e76f1367896 [gaim-migrate @ 9988]
Felipe Contreras <felipe.contreras@gmail.com>
parents:
diff changeset
414
6e76f1367896 [gaim-migrate @ 9988]
Felipe Contreras <felipe.contreras@gmail.com>
parents:
diff changeset
415 void
13855
24cff9e060d7 [gaim-migrate @ 16507]
Ma Yuan <mayuan2006@gmail.com>
parents: 13829
diff changeset
416 msn_userlist_remove_group_id(MsnUserList *userlist, const char * group_id)
9193
6e76f1367896 [gaim-migrate @ 9988]
Felipe Contreras <felipe.contreras@gmail.com>
parents:
diff changeset
417 {
6e76f1367896 [gaim-migrate @ 9988]
Felipe Contreras <felipe.contreras@gmail.com>
parents:
diff changeset
418 MsnGroup *group;
6e76f1367896 [gaim-migrate @ 9988]
Felipe Contreras <felipe.contreras@gmail.com>
parents:
diff changeset
419
6e76f1367896 [gaim-migrate @ 9988]
Felipe Contreras <felipe.contreras@gmail.com>
parents:
diff changeset
420 group = msn_userlist_find_group_with_id(userlist, group_id);
6e76f1367896 [gaim-migrate @ 9988]
Felipe Contreras <felipe.contreras@gmail.com>
parents:
diff changeset
421
6e76f1367896 [gaim-migrate @ 9988]
Felipe Contreras <felipe.contreras@gmail.com>
parents:
diff changeset
422 if (group != NULL)
10533
4c2ad22fad20 [gaim-migrate @ 11862]
Felipe Contreras <felipe.contreras@gmail.com>
parents: 10504
diff changeset
423 {
9193
6e76f1367896 [gaim-migrate @ 9988]
Felipe Contreras <felipe.contreras@gmail.com>
parents:
diff changeset
424 msn_userlist_remove_group(userlist, group);
10533
4c2ad22fad20 [gaim-migrate @ 11862]
Felipe Contreras <felipe.contreras@gmail.com>
parents: 10504
diff changeset
425 msn_group_destroy(group);
4c2ad22fad20 [gaim-migrate @ 11862]
Felipe Contreras <felipe.contreras@gmail.com>
parents: 10504
diff changeset
426 }
9193
6e76f1367896 [gaim-migrate @ 9988]
Felipe Contreras <felipe.contreras@gmail.com>
parents:
diff changeset
427 }
6e76f1367896 [gaim-migrate @ 9988]
Felipe Contreras <felipe.contreras@gmail.com>
parents:
diff changeset
428
24410
b164a5ceb95f Add some strings before string freeze for some not-done code. Should be
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 23833
diff changeset
429 typedef struct {
b164a5ceb95f Add some strings before string freeze for some not-done code. Should be
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 23833
diff changeset
430 MsnSession *session;
b164a5ceb95f Add some strings before string freeze for some not-done code. Should be
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 23833
diff changeset
431 char *uid;
b164a5ceb95f Add some strings before string freeze for some not-done code. Should be
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 23833
diff changeset
432 } MsnUserlistABData;
b164a5ceb95f Add some strings before string freeze for some not-done code. Should be
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 23833
diff changeset
433
b164a5ceb95f Add some strings before string freeze for some not-done code. Should be
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 23833
diff changeset
434 static void
b164a5ceb95f Add some strings before string freeze for some not-done code. Should be
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 23833
diff changeset
435 userlist_ab_delete_cb(void *data, int choice)
b164a5ceb95f Add some strings before string freeze for some not-done code. Should be
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 23833
diff changeset
436 {
b164a5ceb95f Add some strings before string freeze for some not-done code. Should be
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 23833
diff changeset
437 MsnUserlistABData *ab = (MsnUserlistABData *)data;
b164a5ceb95f Add some strings before string freeze for some not-done code. Should be
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 23833
diff changeset
438
b164a5ceb95f Add some strings before string freeze for some not-done code. Should be
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 23833
diff changeset
439 /* msn_delete_contact(ab->session, ab->uid, (gboolean)choice); */
b164a5ceb95f Add some strings before string freeze for some not-done code. Should be
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 23833
diff changeset
440
b164a5ceb95f Add some strings before string freeze for some not-done code. Should be
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 23833
diff changeset
441 g_free(ab->uid);
b164a5ceb95f Add some strings before string freeze for some not-done code. Should be
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 23833
diff changeset
442 g_free(ab);
b164a5ceb95f Add some strings before string freeze for some not-done code. Should be
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 23833
diff changeset
443 }
b164a5ceb95f Add some strings before string freeze for some not-done code. Should be
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 23833
diff changeset
444
9193
6e76f1367896 [gaim-migrate @ 9988]
Felipe Contreras <felipe.contreras@gmail.com>
parents:
diff changeset
445 void
20564
35675dd4a44d Make buddy and group management actually work, add some SOAP templates, redesign some parts of code and separate some bigger functions into its smaller tasks which are completely unrelated to each other
Carlos Silva <typ0@pidgin.im>
parents: 20560
diff changeset
446 msn_userlist_rem_buddy(MsnUserList *userlist, const char *who)
9193
6e76f1367896 [gaim-migrate @ 9988]
Felipe Contreras <felipe.contreras@gmail.com>
parents:
diff changeset
447 {
20564
35675dd4a44d Make buddy and group management actually work, add some SOAP templates, redesign some parts of code and separate some bigger functions into its smaller tasks which are completely unrelated to each other
Carlos Silva <typ0@pidgin.im>
parents: 20560
diff changeset
448 MsnUser *user = NULL;
23441
fd45c23a3eb2 Delete trailing whitespace
Mark Doliner <markdoliner@pidgin.im>
parents: 22981
diff changeset
449
20564
35675dd4a44d Make buddy and group management actually work, add some SOAP templates, redesign some parts of code and separate some bigger functions into its smaller tasks which are completely unrelated to each other
Carlos Silva <typ0@pidgin.im>
parents: 20560
diff changeset
450 g_return_if_fail(userlist != NULL);
35675dd4a44d Make buddy and group management actually work, add some SOAP templates, redesign some parts of code and separate some bigger functions into its smaller tasks which are completely unrelated to each other
Carlos Silva <typ0@pidgin.im>
parents: 20560
diff changeset
451 g_return_if_fail(userlist->session != NULL);
35675dd4a44d Make buddy and group management actually work, add some SOAP templates, redesign some parts of code and separate some bigger functions into its smaller tasks which are completely unrelated to each other
Carlos Silva <typ0@pidgin.im>
parents: 20560
diff changeset
452 g_return_if_fail(who != NULL);
23441
fd45c23a3eb2 Delete trailing whitespace
Mark Doliner <markdoliner@pidgin.im>
parents: 22981
diff changeset
453
9193
6e76f1367896 [gaim-migrate @ 9988]
Felipe Contreras <felipe.contreras@gmail.com>
parents:
diff changeset
454 user = msn_userlist_find_user(userlist, who);
6e76f1367896 [gaim-migrate @ 9988]
Felipe Contreras <felipe.contreras@gmail.com>
parents:
diff changeset
455
20564
35675dd4a44d Make buddy and group management actually work, add some SOAP templates, redesign some parts of code and separate some bigger functions into its smaller tasks which are completely unrelated to each other
Carlos Silva <typ0@pidgin.im>
parents: 20560
diff changeset
456 msn_userlist_rem_buddy_from_list(userlist, who, MSN_LIST_FL);
13866
b6a2c8d390ef [gaim-migrate @ 16716]
Ma Yuan <mayuan2006@gmail.com>
parents: 13865
diff changeset
457
20564
35675dd4a44d Make buddy and group management actually work, add some SOAP templates, redesign some parts of code and separate some bigger functions into its smaller tasks which are completely unrelated to each other
Carlos Silva <typ0@pidgin.im>
parents: 20560
diff changeset
458 /* delete the contact from address book via soap action */
35675dd4a44d Make buddy and group management actually work, add some SOAP templates, redesign some parts of code and separate some bigger functions into its smaller tasks which are completely unrelated to each other
Carlos Silva <typ0@pidgin.im>
parents: 20560
diff changeset
459 if (user != NULL) {
24410
b164a5ceb95f Add some strings before string freeze for some not-done code. Should be
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 23833
diff changeset
460 if (0 /*not ready yet*/ && userlist->session->passport_info.email_enabled) {
b164a5ceb95f Add some strings before string freeze for some not-done code. Should be
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 23833
diff changeset
461 MsnUserlistABData *ab = g_new0(MsnUserlistABData, 1);
b164a5ceb95f Add some strings before string freeze for some not-done code. Should be
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 23833
diff changeset
462 ab->session = userlist->session;
b164a5ceb95f Add some strings before string freeze for some not-done code. Should be
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 23833
diff changeset
463 ab->uid = g_strdup(user->uid); /* Not necessary? */
b164a5ceb95f Add some strings before string freeze for some not-done code. Should be
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 23833
diff changeset
464 purple_request_yes_no(userlist->session->account,
b164a5ceb95f Add some strings before string freeze for some not-done code. Should be
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 23833
diff changeset
465 _("Delete Buddy from Address Book?"),
b164a5ceb95f Add some strings before string freeze for some not-done code. Should be
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 23833
diff changeset
466 _("Do you want to delete this buddy from your address book as well?"),
b164a5ceb95f Add some strings before string freeze for some not-done code. Should be
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 23833
diff changeset
467 user->passport, 0, userlist->session->account, user->passport,
b164a5ceb95f Add some strings before string freeze for some not-done code. Should be
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 23833
diff changeset
468 NULL, ab,
b164a5ceb95f Add some strings before string freeze for some not-done code. Should be
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 23833
diff changeset
469 G_CALLBACK(userlist_ab_delete_cb), G_CALLBACK(userlist_ab_delete_cb));
b164a5ceb95f Add some strings before string freeze for some not-done code. Should be
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 23833
diff changeset
470 } else
24419
d093f97dcba7 Use the MSN passport in more places instead of the Contact ID if it's
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 24410
diff changeset
471 msn_delete_contact(userlist->session, user);
20564
35675dd4a44d Make buddy and group management actually work, add some SOAP templates, redesign some parts of code and separate some bigger functions into its smaller tasks which are completely unrelated to each other
Carlos Silva <typ0@pidgin.im>
parents: 20560
diff changeset
472 }
35675dd4a44d Make buddy and group management actually work, add some SOAP templates, redesign some parts of code and separate some bigger functions into its smaller tasks which are completely unrelated to each other
Carlos Silva <typ0@pidgin.im>
parents: 20560
diff changeset
473 }
9193
6e76f1367896 [gaim-migrate @ 9988]
Felipe Contreras <felipe.contreras@gmail.com>
parents:
diff changeset
474
20564
35675dd4a44d Make buddy and group management actually work, add some SOAP templates, redesign some parts of code and separate some bigger functions into its smaller tasks which are completely unrelated to each other
Carlos Silva <typ0@pidgin.im>
parents: 20560
diff changeset
475 void
35675dd4a44d Make buddy and group management actually work, add some SOAP templates, redesign some parts of code and separate some bigger functions into its smaller tasks which are completely unrelated to each other
Carlos Silva <typ0@pidgin.im>
parents: 20560
diff changeset
476 msn_userlist_rem_buddy_from_list(MsnUserList *userlist, const char *who,
35675dd4a44d Make buddy and group management actually work, add some SOAP templates, redesign some parts of code and separate some bigger functions into its smaller tasks which are completely unrelated to each other
Carlos Silva <typ0@pidgin.im>
parents: 20560
diff changeset
477 MsnListId list_id)
9193
6e76f1367896 [gaim-migrate @ 9988]
Felipe Contreras <felipe.contreras@gmail.com>
parents:
diff changeset
478 {
6e76f1367896 [gaim-migrate @ 9988]
Felipe Contreras <felipe.contreras@gmail.com>
parents:
diff changeset
479 MsnUser *user;
20564
35675dd4a44d Make buddy and group management actually work, add some SOAP templates, redesign some parts of code and separate some bigger functions into its smaller tasks which are completely unrelated to each other
Carlos Silva <typ0@pidgin.im>
parents: 20560
diff changeset
480 const gchar *list;
20569
66628c75dada Make block/unblock work right, as well as being add by a buddy. Finally fixes #723
Carlos Silva <typ0@pidgin.im>
parents: 20567
diff changeset
481 MsnListOp list_op = 1 << list_id;
9193
6e76f1367896 [gaim-migrate @ 9988]
Felipe Contreras <felipe.contreras@gmail.com>
parents:
diff changeset
482
6e76f1367896 [gaim-migrate @ 9988]
Felipe Contreras <felipe.contreras@gmail.com>
parents:
diff changeset
483 user = msn_userlist_find_user(userlist, who);
23441
fd45c23a3eb2 Delete trailing whitespace
Mark Doliner <markdoliner@pidgin.im>
parents: 22981
diff changeset
484
20564
35675dd4a44d Make buddy and group management actually work, add some SOAP templates, redesign some parts of code and separate some bigger functions into its smaller tasks which are completely unrelated to each other
Carlos Silva <typ0@pidgin.im>
parents: 20560
diff changeset
485 g_return_if_fail(user != NULL);
23441
fd45c23a3eb2 Delete trailing whitespace
Mark Doliner <markdoliner@pidgin.im>
parents: 22981
diff changeset
486
30936
8beec3081849 This are MsnUser functions, move them there.
Jorge Villaseñor <masca@cpw.pidgin.im>
parents: 29306
diff changeset
487 if ( !msn_user_is_in_list(user, list_id)) {
9193
6e76f1367896 [gaim-migrate @ 9988]
Felipe Contreras <felipe.contreras@gmail.com>
parents:
diff changeset
488 list = lists[list_id];
23830
1436e3de5d6c The great MSN debug message cleanup! Threw in a few whitespace fixes,
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 23783
diff changeset
489 purple_debug_info("msn", "User %s is not in list %s, not removing.\n", who, list);
9193
6e76f1367896 [gaim-migrate @ 9988]
Felipe Contreras <felipe.contreras@gmail.com>
parents:
diff changeset
490 return;
6e76f1367896 [gaim-migrate @ 9988]
Felipe Contreras <felipe.contreras@gmail.com>
parents:
diff changeset
491 }
6e76f1367896 [gaim-migrate @ 9988]
Felipe Contreras <felipe.contreras@gmail.com>
parents:
diff changeset
492
20569
66628c75dada Make block/unblock work right, as well as being add by a buddy. Finally fixes #723
Carlos Silva <typ0@pidgin.im>
parents: 20567
diff changeset
493 msn_user_unset_op(user, list_op);
9193
6e76f1367896 [gaim-migrate @ 9988]
Felipe Contreras <felipe.contreras@gmail.com>
parents:
diff changeset
494
25153
7e8bdb57a11f Make the add/remove buddy from list functions take a MsnUser* instead of the
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 24784
diff changeset
495 msn_notification_rem_buddy_from_list(userlist->session->notification, list_id, user);
9193
6e76f1367896 [gaim-migrate @ 9988]
Felipe Contreras <felipe.contreras@gmail.com>
parents:
diff changeset
496 }
6e76f1367896 [gaim-migrate @ 9988]
Felipe Contreras <felipe.contreras@gmail.com>
parents:
diff changeset
497
13861
dc0021ad2b73 [gaim-migrate @ 16653]
Ma Yuan <mayuan2006@gmail.com>
parents: 13857
diff changeset
498 /*add buddy*/
9193
6e76f1367896 [gaim-migrate @ 9988]
Felipe Contreras <felipe.contreras@gmail.com>
parents:
diff changeset
499 void
20569
66628c75dada Make block/unblock work right, as well as being add by a buddy. Finally fixes #723
Carlos Silva <typ0@pidgin.im>
parents: 20567
diff changeset
500 msn_userlist_add_buddy(MsnUserList *userlist, const char *who, const char *group_name)
9193
6e76f1367896 [gaim-migrate @ 9988]
Felipe Contreras <felipe.contreras@gmail.com>
parents:
diff changeset
501 {
6e76f1367896 [gaim-migrate @ 9988]
Felipe Contreras <felipe.contreras@gmail.com>
parents:
diff changeset
502 MsnUser *user;
20564
35675dd4a44d Make buddy and group management actually work, add some SOAP templates, redesign some parts of code and separate some bigger functions into its smaller tasks which are completely unrelated to each other
Carlos Silva <typ0@pidgin.im>
parents: 20560
diff changeset
503 MsnCallbackState *state = NULL;
35675dd4a44d Make buddy and group management actually work, add some SOAP templates, redesign some parts of code and separate some bigger functions into its smaller tasks which are completely unrelated to each other
Carlos Silva <typ0@pidgin.im>
parents: 20560
diff changeset
504 const char *group_id = NULL, *new_group_name;
23441
fd45c23a3eb2 Delete trailing whitespace
Mark Doliner <markdoliner@pidgin.im>
parents: 22981
diff changeset
505
20564
35675dd4a44d Make buddy and group management actually work, add some SOAP templates, redesign some parts of code and separate some bigger functions into its smaller tasks which are completely unrelated to each other
Carlos Silva <typ0@pidgin.im>
parents: 20560
diff changeset
506 new_group_name = group_name == NULL ? MSN_INDIVIDUALS_GROUP_NAME : group_name;
9194
1ff43e1a77e5 [gaim-migrate @ 9989]
Christian Hammond <chipx86@chipx86.com>
parents: 9193
diff changeset
507
20564
35675dd4a44d Make buddy and group management actually work, add some SOAP templates, redesign some parts of code and separate some bigger functions into its smaller tasks which are completely unrelated to each other
Carlos Silva <typ0@pidgin.im>
parents: 20560
diff changeset
508 g_return_if_fail(userlist != NULL);
35675dd4a44d Make buddy and group management actually work, add some SOAP templates, redesign some parts of code and separate some bigger functions into its smaller tasks which are completely unrelated to each other
Carlos Silva <typ0@pidgin.im>
parents: 20560
diff changeset
509 g_return_if_fail(userlist->session != NULL);
35675dd4a44d Make buddy and group management actually work, add some SOAP templates, redesign some parts of code and separate some bigger functions into its smaller tasks which are completely unrelated to each other
Carlos Silva <typ0@pidgin.im>
parents: 20560
diff changeset
510
23830
1436e3de5d6c The great MSN debug message cleanup! Threw in a few whitespace fixes,
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 23783
diff changeset
511 purple_debug_info("msn", "Add user: %s to group: %s\n", who, new_group_name);
20564
35675dd4a44d Make buddy and group management actually work, add some SOAP templates, redesign some parts of code and separate some bigger functions into its smaller tasks which are completely unrelated to each other
Carlos Silva <typ0@pidgin.im>
parents: 20560
diff changeset
512
28731
46a9f7c534b1 The MSN servers are a bit more strict about what's allowed in emails than
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 27361
diff changeset
513 if (!msn_email_is_valid(who))
11057
08abd0227bd2 [gaim-migrate @ 13009]
Jason Roth <jroth2@users.sourceforge.net>
parents: 11039
diff changeset
514 {
11638
1821b40269a3 [gaim-migrate @ 13914]
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 11624
diff changeset
515 /* only notify the user about problems adding to the friends list
1821b40269a3 [gaim-migrate @ 13914]
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 11624
diff changeset
516 * maybe we should do something else for other lists, but it probably
1821b40269a3 [gaim-migrate @ 13914]
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 11624
diff changeset
517 * won't cause too many problems if we just ignore it */
23441
fd45c23a3eb2 Delete trailing whitespace
Mark Doliner <markdoliner@pidgin.im>
parents: 22981
diff changeset
518
20564
35675dd4a44d Make buddy and group management actually work, add some SOAP templates, redesign some parts of code and separate some bigger functions into its smaller tasks which are completely unrelated to each other
Carlos Silva <typ0@pidgin.im>
parents: 20560
diff changeset
519 char *str = g_strdup_printf(_("Unable to add \"%s\"."), who);
23441
fd45c23a3eb2 Delete trailing whitespace
Mark Doliner <markdoliner@pidgin.im>
parents: 22981
diff changeset
520
20564
35675dd4a44d Make buddy and group management actually work, add some SOAP templates, redesign some parts of code and separate some bigger functions into its smaller tasks which are completely unrelated to each other
Carlos Silva <typ0@pidgin.im>
parents: 20560
diff changeset
521 purple_notify_error(NULL, NULL, str,
22942
2bf494f8e2a4 Change the string "screen name" to "username" everywhere. I think most
Mark Doliner <markdoliner@pidgin.im>
parents: 22672
diff changeset
522 _("The username specified is invalid."));
20564
35675dd4a44d Make buddy and group management actually work, add some SOAP templates, redesign some parts of code and separate some bigger functions into its smaller tasks which are completely unrelated to each other
Carlos Silva <typ0@pidgin.im>
parents: 20560
diff changeset
523 g_free(str);
11638
1821b40269a3 [gaim-migrate @ 13914]
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 11624
diff changeset
524
11057
08abd0227bd2 [gaim-migrate @ 13009]
Jason Roth <jroth2@users.sourceforge.net>
parents: 11039
diff changeset
525 return;
08abd0227bd2 [gaim-migrate @ 13009]
Jason Roth <jroth2@users.sourceforge.net>
parents: 11039
diff changeset
526 }
08abd0227bd2 [gaim-migrate @ 13009]
Jason Roth <jroth2@users.sourceforge.net>
parents: 11039
diff changeset
527
23782
56c9f93017e1 Update MSN Contact tokens when an invalid token error is returned.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 23776
diff changeset
528 state = msn_callback_state_new(userlist->session);
56c9f93017e1 Update MSN Contact tokens when an invalid token error is returned.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 23776
diff changeset
529 msn_callback_state_set_who(state, who);
56c9f93017e1 Update MSN Contact tokens when an invalid token error is returned.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 23776
diff changeset
530 msn_callback_state_set_new_group_name(state, new_group_name);
56c9f93017e1 Update MSN Contact tokens when an invalid token error is returned.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 23776
diff changeset
531
20564
35675dd4a44d Make buddy and group management actually work, add some SOAP templates, redesign some parts of code and separate some bigger functions into its smaller tasks which are completely unrelated to each other
Carlos Silva <typ0@pidgin.im>
parents: 20560
diff changeset
532 group_id = msn_userlist_find_group_id(userlist, new_group_name);
35675dd4a44d Make buddy and group management actually work, add some SOAP templates, redesign some parts of code and separate some bigger functions into its smaller tasks which are completely unrelated to each other
Carlos Silva <typ0@pidgin.im>
parents: 20560
diff changeset
533
35675dd4a44d Make buddy and group management actually work, add some SOAP templates, redesign some parts of code and separate some bigger functions into its smaller tasks which are completely unrelated to each other
Carlos Silva <typ0@pidgin.im>
parents: 20560
diff changeset
534 if (group_id == NULL)
9193
6e76f1367896 [gaim-migrate @ 9988]
Felipe Contreras <felipe.contreras@gmail.com>
parents:
diff changeset
535 {
20564
35675dd4a44d Make buddy and group management actually work, add some SOAP templates, redesign some parts of code and separate some bigger functions into its smaller tasks which are completely unrelated to each other
Carlos Silva <typ0@pidgin.im>
parents: 20560
diff changeset
536 /* Whoa, we must add that group first. */
23830
1436e3de5d6c The great MSN debug message cleanup! Threw in a few whitespace fixes,
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 23783
diff changeset
537 purple_debug_info("msn", "Adding user %s to a new group, creating group %s first\n", who, new_group_name);
23441
fd45c23a3eb2 Delete trailing whitespace
Mark Doliner <markdoliner@pidgin.im>
parents: 22981
diff changeset
538
20564
35675dd4a44d Make buddy and group management actually work, add some SOAP templates, redesign some parts of code and separate some bigger functions into its smaller tasks which are completely unrelated to each other
Carlos Silva <typ0@pidgin.im>
parents: 20560
diff changeset
539 msn_callback_state_set_action(state, MSN_ADD_BUDDY);
9193
6e76f1367896 [gaim-migrate @ 9988]
Felipe Contreras <felipe.contreras@gmail.com>
parents:
diff changeset
540
20564
35675dd4a44d Make buddy and group management actually work, add some SOAP templates, redesign some parts of code and separate some bigger functions into its smaller tasks which are completely unrelated to each other
Carlos Silva <typ0@pidgin.im>
parents: 20560
diff changeset
541 msn_add_group(userlist->session, state, new_group_name);
35675dd4a44d Make buddy and group management actually work, add some SOAP templates, redesign some parts of code and separate some bigger functions into its smaller tasks which are completely unrelated to each other
Carlos Silva <typ0@pidgin.im>
parents: 20560
diff changeset
542 return;
35675dd4a44d Make buddy and group management actually work, add some SOAP templates, redesign some parts of code and separate some bigger functions into its smaller tasks which are completely unrelated to each other
Carlos Silva <typ0@pidgin.im>
parents: 20560
diff changeset
543 } else {
35675dd4a44d Make buddy and group management actually work, add some SOAP templates, redesign some parts of code and separate some bigger functions into its smaller tasks which are completely unrelated to each other
Carlos Silva <typ0@pidgin.im>
parents: 20560
diff changeset
544 msn_callback_state_set_guid(state, group_id);
35675dd4a44d Make buddy and group management actually work, add some SOAP templates, redesign some parts of code and separate some bigger functions into its smaller tasks which are completely unrelated to each other
Carlos Silva <typ0@pidgin.im>
parents: 20560
diff changeset
545 }
23441
fd45c23a3eb2 Delete trailing whitespace
Mark Doliner <markdoliner@pidgin.im>
parents: 22981
diff changeset
546
20567
2417aff6ff3b Handle special cases in buddy/group management (wrt MSN_INDIVIDUALS_GROUP and MSN_NON_IM_GROUP).
Carlos Silva <typ0@pidgin.im>
parents: 20566
diff changeset
547 /* XXX: adding user here may not be correct (should add them in the
23441
fd45c23a3eb2 Delete trailing whitespace
Mark Doliner <markdoliner@pidgin.im>
parents: 22981
diff changeset
548 * ACK to the ADL command), but for now we need to make sure they exist
20567
2417aff6ff3b Handle special cases in buddy/group management (wrt MSN_INDIVIDUALS_GROUP and MSN_NON_IM_GROUP).
Carlos Silva <typ0@pidgin.im>
parents: 20566
diff changeset
549 * early enough that the ILN command doesn't screw us up */
20564
35675dd4a44d Make buddy and group management actually work, add some SOAP templates, redesign some parts of code and separate some bigger functions into its smaller tasks which are completely unrelated to each other
Carlos Silva <typ0@pidgin.im>
parents: 20560
diff changeset
550
35675dd4a44d Make buddy and group management actually work, add some SOAP templates, redesign some parts of code and separate some bigger functions into its smaller tasks which are completely unrelated to each other
Carlos Silva <typ0@pidgin.im>
parents: 20560
diff changeset
551 user = msn_userlist_find_add_user(userlist, who, who);
35675dd4a44d Make buddy and group management actually work, add some SOAP templates, redesign some parts of code and separate some bigger functions into its smaller tasks which are completely unrelated to each other
Carlos Silva <typ0@pidgin.im>
parents: 20560
diff changeset
552
30936
8beec3081849 This are MsnUser functions, move them there.
Jorge Villaseñor <masca@cpw.pidgin.im>
parents: 29306
diff changeset
553 if ( msn_user_is_in_list(user, MSN_LIST_FL) ) {
20564
35675dd4a44d Make buddy and group management actually work, add some SOAP templates, redesign some parts of code and separate some bigger functions into its smaller tasks which are completely unrelated to each other
Carlos Silva <typ0@pidgin.im>
parents: 20560
diff changeset
554
23830
1436e3de5d6c The great MSN debug message cleanup! Threw in a few whitespace fixes,
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 23783
diff changeset
555 purple_debug_info("msn", "User %s already exists\n", who);
20564
35675dd4a44d Make buddy and group management actually work, add some SOAP templates, redesign some parts of code and separate some bigger functions into its smaller tasks which are completely unrelated to each other
Carlos Silva <typ0@pidgin.im>
parents: 20560
diff changeset
556
35675dd4a44d Make buddy and group management actually work, add some SOAP templates, redesign some parts of code and separate some bigger functions into its smaller tasks which are completely unrelated to each other
Carlos Silva <typ0@pidgin.im>
parents: 20560
diff changeset
557 msn_userlist_rem_buddy_from_list(userlist, who, MSN_LIST_BL);
35675dd4a44d Make buddy and group management actually work, add some SOAP templates, redesign some parts of code and separate some bigger functions into its smaller tasks which are completely unrelated to each other
Carlos Silva <typ0@pidgin.im>
parents: 20560
diff changeset
558
30936
8beec3081849 This are MsnUser functions, move them there.
Jorge Villaseñor <masca@cpw.pidgin.im>
parents: 29306
diff changeset
559 if (msn_user_is_in_group(user, group_id)) {
23830
1436e3de5d6c The great MSN debug message cleanup! Threw in a few whitespace fixes,
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 23783
diff changeset
560 purple_debug_info("msn", "User %s is already in group %s, returning\n", who, new_group_name);
23782
56c9f93017e1 Update MSN Contact tokens when an invalid token error is returned.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 23776
diff changeset
561 msn_callback_state_free(state);
9193
6e76f1367896 [gaim-migrate @ 9988]
Felipe Contreras <felipe.contreras@gmail.com>
parents:
diff changeset
562 return;
6e76f1367896 [gaim-migrate @ 9988]
Felipe Contreras <felipe.contreras@gmail.com>
parents:
diff changeset
563 }
6e76f1367896 [gaim-migrate @ 9988]
Felipe Contreras <felipe.contreras@gmail.com>
parents:
diff changeset
564 }
23441
fd45c23a3eb2 Delete trailing whitespace
Mark Doliner <markdoliner@pidgin.im>
parents: 22981
diff changeset
565
23830
1436e3de5d6c The great MSN debug message cleanup! Threw in a few whitespace fixes,
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 23783
diff changeset
566 purple_debug_info("msn", "Adding user: %s to group id: %s\n", who, group_id);
9193
6e76f1367896 [gaim-migrate @ 9988]
Felipe Contreras <felipe.contreras@gmail.com>
parents:
diff changeset
567
20564
35675dd4a44d Make buddy and group management actually work, add some SOAP templates, redesign some parts of code and separate some bigger functions into its smaller tasks which are completely unrelated to each other
Carlos Silva <typ0@pidgin.im>
parents: 20560
diff changeset
568 msn_callback_state_set_action(state, MSN_ADD_BUDDY);
35675dd4a44d Make buddy and group management actually work, add some SOAP templates, redesign some parts of code and separate some bigger functions into its smaller tasks which are completely unrelated to each other
Carlos Silva <typ0@pidgin.im>
parents: 20560
diff changeset
569
35675dd4a44d Make buddy and group management actually work, add some SOAP templates, redesign some parts of code and separate some bigger functions into its smaller tasks which are completely unrelated to each other
Carlos Silva <typ0@pidgin.im>
parents: 20560
diff changeset
570 /* Add contact in the Contact server with a SOAP request and if
35675dd4a44d Make buddy and group management actually work, add some SOAP templates, redesign some parts of code and separate some bigger functions into its smaller tasks which are completely unrelated to each other
Carlos Silva <typ0@pidgin.im>
parents: 20560
diff changeset
571 successful, send ADL with MSN_LIST_AL and MSN_LIST_FL and a FQY */
23771
c98f7e879218 killing MsnContact which just wraps MsnSession
Ka-Hing Cheung <khc@pidgin.im>
parents: 21369
diff changeset
572 msn_add_contact_to_group(userlist->session, state, who, group_id);
20564
35675dd4a44d Make buddy and group management actually work, add some SOAP templates, redesign some parts of code and separate some bigger functions into its smaller tasks which are completely unrelated to each other
Carlos Silva <typ0@pidgin.im>
parents: 20560
diff changeset
573 }
9193
6e76f1367896 [gaim-migrate @ 9988]
Felipe Contreras <felipe.contreras@gmail.com>
parents:
diff changeset
574
20564
35675dd4a44d Make buddy and group management actually work, add some SOAP templates, redesign some parts of code and separate some bigger functions into its smaller tasks which are completely unrelated to each other
Carlos Silva <typ0@pidgin.im>
parents: 20560
diff changeset
575 void
23441
fd45c23a3eb2 Delete trailing whitespace
Mark Doliner <markdoliner@pidgin.im>
parents: 22981
diff changeset
576 msn_userlist_add_buddy_to_list(MsnUserList *userlist, const char *who,
20564
35675dd4a44d Make buddy and group management actually work, add some SOAP templates, redesign some parts of code and separate some bigger functions into its smaller tasks which are completely unrelated to each other
Carlos Silva <typ0@pidgin.im>
parents: 20560
diff changeset
577 MsnListId list_id)
35675dd4a44d Make buddy and group management actually work, add some SOAP templates, redesign some parts of code and separate some bigger functions into its smaller tasks which are completely unrelated to each other
Carlos Silva <typ0@pidgin.im>
parents: 20560
diff changeset
578 {
35675dd4a44d Make buddy and group management actually work, add some SOAP templates, redesign some parts of code and separate some bigger functions into its smaller tasks which are completely unrelated to each other
Carlos Silva <typ0@pidgin.im>
parents: 20560
diff changeset
579 MsnUser *user = NULL;
35675dd4a44d Make buddy and group management actually work, add some SOAP templates, redesign some parts of code and separate some bigger functions into its smaller tasks which are completely unrelated to each other
Carlos Silva <typ0@pidgin.im>
parents: 20560
diff changeset
580 const gchar *list;
35675dd4a44d Make buddy and group management actually work, add some SOAP templates, redesign some parts of code and separate some bigger functions into its smaller tasks which are completely unrelated to each other
Carlos Silva <typ0@pidgin.im>
parents: 20560
diff changeset
581 MsnListOp list_op = 1 << list_id;
35675dd4a44d Make buddy and group management actually work, add some SOAP templates, redesign some parts of code and separate some bigger functions into its smaller tasks which are completely unrelated to each other
Carlos Silva <typ0@pidgin.im>
parents: 20560
diff changeset
582
35675dd4a44d Make buddy and group management actually work, add some SOAP templates, redesign some parts of code and separate some bigger functions into its smaller tasks which are completely unrelated to each other
Carlos Silva <typ0@pidgin.im>
parents: 20560
diff changeset
583 g_return_if_fail(userlist != NULL);
23441
fd45c23a3eb2 Delete trailing whitespace
Mark Doliner <markdoliner@pidgin.im>
parents: 22981
diff changeset
584
20522
177cad886d4c A bunch of MSNP14 stuff:
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 20508
diff changeset
585 user = msn_userlist_find_add_user(userlist, who, who);
23441
fd45c23a3eb2 Delete trailing whitespace
Mark Doliner <markdoliner@pidgin.im>
parents: 22981
diff changeset
586
9194
1ff43e1a77e5 [gaim-migrate @ 9989]
Christian Hammond <chipx86@chipx86.com>
parents: 9193
diff changeset
587 /* First we're going to check if it's already there. */
30936
8beec3081849 This are MsnUser functions, move them there.
Jorge Villaseñor <masca@cpw.pidgin.im>
parents: 29306
diff changeset
588 if (msn_user_is_in_list(user, list_id))
9193
6e76f1367896 [gaim-migrate @ 9988]
Felipe Contreras <felipe.contreras@gmail.com>
parents:
diff changeset
589 {
6e76f1367896 [gaim-migrate @ 9988]
Felipe Contreras <felipe.contreras@gmail.com>
parents:
diff changeset
590 list = lists[list_id];
23830
1436e3de5d6c The great MSN debug message cleanup! Threw in a few whitespace fixes,
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 23783
diff changeset
591 purple_debug_info("msn", "User '%s' is already in list: %s\n", who, list);
9193
6e76f1367896 [gaim-migrate @ 9988]
Felipe Contreras <felipe.contreras@gmail.com>
parents:
diff changeset
592 return;
6e76f1367896 [gaim-migrate @ 9988]
Felipe Contreras <felipe.contreras@gmail.com>
parents:
diff changeset
593 }
23441
fd45c23a3eb2 Delete trailing whitespace
Mark Doliner <markdoliner@pidgin.im>
parents: 22981
diff changeset
594
20564
35675dd4a44d Make buddy and group management actually work, add some SOAP templates, redesign some parts of code and separate some bigger functions into its smaller tasks which are completely unrelated to each other
Carlos Silva <typ0@pidgin.im>
parents: 20560
diff changeset
595 /* XXX: see XXX above, this should really be done when we get the response from
35675dd4a44d Make buddy and group management actually work, add some SOAP templates, redesign some parts of code and separate some bigger functions into its smaller tasks which are completely unrelated to each other
Carlos Silva <typ0@pidgin.im>
parents: 20560
diff changeset
596 the server */
23441
fd45c23a3eb2 Delete trailing whitespace
Mark Doliner <markdoliner@pidgin.im>
parents: 22981
diff changeset
597
20564
35675dd4a44d Make buddy and group management actually work, add some SOAP templates, redesign some parts of code and separate some bigger functions into its smaller tasks which are completely unrelated to each other
Carlos Silva <typ0@pidgin.im>
parents: 20560
diff changeset
598 msn_user_set_op(user, list_op);
23441
fd45c23a3eb2 Delete trailing whitespace
Mark Doliner <markdoliner@pidgin.im>
parents: 22981
diff changeset
599
25153
7e8bdb57a11f Make the add/remove buddy from list functions take a MsnUser* instead of the
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 24784
diff changeset
600 msn_notification_add_buddy_to_list(userlist->session->notification, list_id, user);
20564
35675dd4a44d Make buddy and group management actually work, add some SOAP templates, redesign some parts of code and separate some bigger functions into its smaller tasks which are completely unrelated to each other
Carlos Silva <typ0@pidgin.im>
parents: 20560
diff changeset
601 }
35675dd4a44d Make buddy and group management actually work, add some SOAP templates, redesign some parts of code and separate some bigger functions into its smaller tasks which are completely unrelated to each other
Carlos Silva <typ0@pidgin.im>
parents: 20560
diff changeset
602
35675dd4a44d Make buddy and group management actually work, add some SOAP templates, redesign some parts of code and separate some bigger functions into its smaller tasks which are completely unrelated to each other
Carlos Silva <typ0@pidgin.im>
parents: 20560
diff changeset
603 gboolean
35675dd4a44d Make buddy and group management actually work, add some SOAP templates, redesign some parts of code and separate some bigger functions into its smaller tasks which are completely unrelated to each other
Carlos Silva <typ0@pidgin.im>
parents: 20560
diff changeset
604 msn_userlist_add_buddy_to_group(MsnUserList *userlist, const char *who,
35675dd4a44d Make buddy and group management actually work, add some SOAP templates, redesign some parts of code and separate some bigger functions into its smaller tasks which are completely unrelated to each other
Carlos Silva <typ0@pidgin.im>
parents: 20560
diff changeset
605 const char *group_name)
35675dd4a44d Make buddy and group management actually work, add some SOAP templates, redesign some parts of code and separate some bigger functions into its smaller tasks which are completely unrelated to each other
Carlos Silva <typ0@pidgin.im>
parents: 20560
diff changeset
606 {
35675dd4a44d Make buddy and group management actually work, add some SOAP templates, redesign some parts of code and separate some bigger functions into its smaller tasks which are completely unrelated to each other
Carlos Silva <typ0@pidgin.im>
parents: 20560
diff changeset
607 MsnUser *user;
35675dd4a44d Make buddy and group management actually work, add some SOAP templates, redesign some parts of code and separate some bigger functions into its smaller tasks which are completely unrelated to each other
Carlos Silva <typ0@pidgin.im>
parents: 20560
diff changeset
608 gchar * group_id;
23441
fd45c23a3eb2 Delete trailing whitespace
Mark Doliner <markdoliner@pidgin.im>
parents: 22981
diff changeset
609
20564
35675dd4a44d Make buddy and group management actually work, add some SOAP templates, redesign some parts of code and separate some bigger functions into its smaller tasks which are completely unrelated to each other
Carlos Silva <typ0@pidgin.im>
parents: 20560
diff changeset
610 g_return_val_if_fail(userlist != NULL, FALSE);
35675dd4a44d Make buddy and group management actually work, add some SOAP templates, redesign some parts of code and separate some bigger functions into its smaller tasks which are completely unrelated to each other
Carlos Silva <typ0@pidgin.im>
parents: 20560
diff changeset
611 g_return_val_if_fail(group_name != NULL, FALSE);
35675dd4a44d Make buddy and group management actually work, add some SOAP templates, redesign some parts of code and separate some bigger functions into its smaller tasks which are completely unrelated to each other
Carlos Silva <typ0@pidgin.im>
parents: 20560
diff changeset
612 g_return_val_if_fail(who != NULL, FALSE);
35675dd4a44d Make buddy and group management actually work, add some SOAP templates, redesign some parts of code and separate some bigger functions into its smaller tasks which are completely unrelated to each other
Carlos Silva <typ0@pidgin.im>
parents: 20560
diff changeset
613
23830
1436e3de5d6c The great MSN debug message cleanup! Threw in a few whitespace fixes,
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 23783
diff changeset
614 purple_debug_info("msn", "Adding buddy with passport %s to group %s\n", who, group_name);
20564
35675dd4a44d Make buddy and group management actually work, add some SOAP templates, redesign some parts of code and separate some bigger functions into its smaller tasks which are completely unrelated to each other
Carlos Silva <typ0@pidgin.im>
parents: 20560
diff changeset
615
35675dd4a44d Make buddy and group management actually work, add some SOAP templates, redesign some parts of code and separate some bigger functions into its smaller tasks which are completely unrelated to each other
Carlos Silva <typ0@pidgin.im>
parents: 20560
diff changeset
616 if ( (group_id = (gchar *)msn_userlist_find_group_id(userlist, group_name)) == NULL) {
23830
1436e3de5d6c The great MSN debug message cleanup! Threw in a few whitespace fixes,
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 23783
diff changeset
617 purple_debug_error("msn", "Group %s has no guid!\n", group_name);
20564
35675dd4a44d Make buddy and group management actually work, add some SOAP templates, redesign some parts of code and separate some bigger functions into its smaller tasks which are completely unrelated to each other
Carlos Silva <typ0@pidgin.im>
parents: 20560
diff changeset
618 return FALSE;
35675dd4a44d Make buddy and group management actually work, add some SOAP templates, redesign some parts of code and separate some bigger functions into its smaller tasks which are completely unrelated to each other
Carlos Silva <typ0@pidgin.im>
parents: 20560
diff changeset
619 }
9193
6e76f1367896 [gaim-migrate @ 9988]
Felipe Contreras <felipe.contreras@gmail.com>
parents:
diff changeset
620
20564
35675dd4a44d Make buddy and group management actually work, add some SOAP templates, redesign some parts of code and separate some bigger functions into its smaller tasks which are completely unrelated to each other
Carlos Silva <typ0@pidgin.im>
parents: 20560
diff changeset
621 if ( (user = msn_userlist_find_user(userlist, who)) == NULL) {
26474
69f112d09563 Add some missing newlines in debug messages.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 25911
diff changeset
622 purple_debug_error("msn", "User %s not found!\n", who);
20564
35675dd4a44d Make buddy and group management actually work, add some SOAP templates, redesign some parts of code and separate some bigger functions into its smaller tasks which are completely unrelated to each other
Carlos Silva <typ0@pidgin.im>
parents: 20560
diff changeset
623 return FALSE;
35675dd4a44d Make buddy and group management actually work, add some SOAP templates, redesign some parts of code and separate some bigger functions into its smaller tasks which are completely unrelated to each other
Carlos Silva <typ0@pidgin.im>
parents: 20560
diff changeset
624 }
23441
fd45c23a3eb2 Delete trailing whitespace
Mark Doliner <markdoliner@pidgin.im>
parents: 22981
diff changeset
625
20564
35675dd4a44d Make buddy and group management actually work, add some SOAP templates, redesign some parts of code and separate some bigger functions into its smaller tasks which are completely unrelated to each other
Carlos Silva <typ0@pidgin.im>
parents: 20560
diff changeset
626 msn_user_add_group_id(user, group_id);
20560
79e9c94c34db Add the possibility to create an Address Book, useful for newly registered MSN users.
Carlos Silva <typ0@pidgin.im>
parents: 20550
diff changeset
627
20564
35675dd4a44d Make buddy and group management actually work, add some SOAP templates, redesign some parts of code and separate some bigger functions into its smaller tasks which are completely unrelated to each other
Carlos Silva <typ0@pidgin.im>
parents: 20560
diff changeset
628 return TRUE;
35675dd4a44d Make buddy and group management actually work, add some SOAP templates, redesign some parts of code and separate some bigger functions into its smaller tasks which are completely unrelated to each other
Carlos Silva <typ0@pidgin.im>
parents: 20560
diff changeset
629 }
35675dd4a44d Make buddy and group management actually work, add some SOAP templates, redesign some parts of code and separate some bigger functions into its smaller tasks which are completely unrelated to each other
Carlos Silva <typ0@pidgin.im>
parents: 20560
diff changeset
630
35675dd4a44d Make buddy and group management actually work, add some SOAP templates, redesign some parts of code and separate some bigger functions into its smaller tasks which are completely unrelated to each other
Carlos Silva <typ0@pidgin.im>
parents: 20560
diff changeset
631
35675dd4a44d Make buddy and group management actually work, add some SOAP templates, redesign some parts of code and separate some bigger functions into its smaller tasks which are completely unrelated to each other
Carlos Silva <typ0@pidgin.im>
parents: 20560
diff changeset
632 gboolean
35675dd4a44d Make buddy and group management actually work, add some SOAP templates, redesign some parts of code and separate some bigger functions into its smaller tasks which are completely unrelated to each other
Carlos Silva <typ0@pidgin.im>
parents: 20560
diff changeset
633 msn_userlist_rem_buddy_from_group(MsnUserList *userlist, const char *who,
35675dd4a44d Make buddy and group management actually work, add some SOAP templates, redesign some parts of code and separate some bigger functions into its smaller tasks which are completely unrelated to each other
Carlos Silva <typ0@pidgin.im>
parents: 20560
diff changeset
634 const char *group_name)
35675dd4a44d Make buddy and group management actually work, add some SOAP templates, redesign some parts of code and separate some bigger functions into its smaller tasks which are completely unrelated to each other
Carlos Silva <typ0@pidgin.im>
parents: 20560
diff changeset
635 {
35675dd4a44d Make buddy and group management actually work, add some SOAP templates, redesign some parts of code and separate some bigger functions into its smaller tasks which are completely unrelated to each other
Carlos Silva <typ0@pidgin.im>
parents: 20560
diff changeset
636 const gchar * group_id;
35675dd4a44d Make buddy and group management actually work, add some SOAP templates, redesign some parts of code and separate some bigger functions into its smaller tasks which are completely unrelated to each other
Carlos Silva <typ0@pidgin.im>
parents: 20560
diff changeset
637 MsnUser *user;
9193
6e76f1367896 [gaim-migrate @ 9988]
Felipe Contreras <felipe.contreras@gmail.com>
parents:
diff changeset
638
20564
35675dd4a44d Make buddy and group management actually work, add some SOAP templates, redesign some parts of code and separate some bigger functions into its smaller tasks which are completely unrelated to each other
Carlos Silva <typ0@pidgin.im>
parents: 20560
diff changeset
639 g_return_val_if_fail(userlist != NULL, FALSE);
35675dd4a44d Make buddy and group management actually work, add some SOAP templates, redesign some parts of code and separate some bigger functions into its smaller tasks which are completely unrelated to each other
Carlos Silva <typ0@pidgin.im>
parents: 20560
diff changeset
640 g_return_val_if_fail(group_name != NULL, FALSE);
35675dd4a44d Make buddy and group management actually work, add some SOAP templates, redesign some parts of code and separate some bigger functions into its smaller tasks which are completely unrelated to each other
Carlos Silva <typ0@pidgin.im>
parents: 20560
diff changeset
641 g_return_val_if_fail(who != NULL, FALSE);
23441
fd45c23a3eb2 Delete trailing whitespace
Mark Doliner <markdoliner@pidgin.im>
parents: 22981
diff changeset
642
23830
1436e3de5d6c The great MSN debug message cleanup! Threw in a few whitespace fixes,
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 23783
diff changeset
643 purple_debug_info("msn", "Removing buddy with passport %s from group %s\n", who, group_name);
9193
6e76f1367896 [gaim-migrate @ 9988]
Felipe Contreras <felipe.contreras@gmail.com>
parents:
diff changeset
644
20564
35675dd4a44d Make buddy and group management actually work, add some SOAP templates, redesign some parts of code and separate some bigger functions into its smaller tasks which are completely unrelated to each other
Carlos Silva <typ0@pidgin.im>
parents: 20560
diff changeset
645 if ( (group_id = msn_userlist_find_group_id(userlist, group_name)) == NULL) {
23830
1436e3de5d6c The great MSN debug message cleanup! Threw in a few whitespace fixes,
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 23783
diff changeset
646 purple_debug_error("msn", "Group %s has no guid!\n", group_name);
20564
35675dd4a44d Make buddy and group management actually work, add some SOAP templates, redesign some parts of code and separate some bigger functions into its smaller tasks which are completely unrelated to each other
Carlos Silva <typ0@pidgin.im>
parents: 20560
diff changeset
647 return FALSE;
35675dd4a44d Make buddy and group management actually work, add some SOAP templates, redesign some parts of code and separate some bigger functions into its smaller tasks which are completely unrelated to each other
Carlos Silva <typ0@pidgin.im>
parents: 20560
diff changeset
648 }
35675dd4a44d Make buddy and group management actually work, add some SOAP templates, redesign some parts of code and separate some bigger functions into its smaller tasks which are completely unrelated to each other
Carlos Silva <typ0@pidgin.im>
parents: 20560
diff changeset
649
35675dd4a44d Make buddy and group management actually work, add some SOAP templates, redesign some parts of code and separate some bigger functions into its smaller tasks which are completely unrelated to each other
Carlos Silva <typ0@pidgin.im>
parents: 20560
diff changeset
650 if ( (user = msn_userlist_find_user(userlist, who)) == NULL) {
26474
69f112d09563 Add some missing newlines in debug messages.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 25911
diff changeset
651 purple_debug_error("msn", "User %s not found!\n", who);
20564
35675dd4a44d Make buddy and group management actually work, add some SOAP templates, redesign some parts of code and separate some bigger functions into its smaller tasks which are completely unrelated to each other
Carlos Silva <typ0@pidgin.im>
parents: 20560
diff changeset
652 return FALSE;
35675dd4a44d Make buddy and group management actually work, add some SOAP templates, redesign some parts of code and separate some bigger functions into its smaller tasks which are completely unrelated to each other
Carlos Silva <typ0@pidgin.im>
parents: 20560
diff changeset
653 }
35675dd4a44d Make buddy and group management actually work, add some SOAP templates, redesign some parts of code and separate some bigger functions into its smaller tasks which are completely unrelated to each other
Carlos Silva <typ0@pidgin.im>
parents: 20560
diff changeset
654
35675dd4a44d Make buddy and group management actually work, add some SOAP templates, redesign some parts of code and separate some bigger functions into its smaller tasks which are completely unrelated to each other
Carlos Silva <typ0@pidgin.im>
parents: 20560
diff changeset
655 msn_user_remove_group_id(user, group_id);
35675dd4a44d Make buddy and group management actually work, add some SOAP templates, redesign some parts of code and separate some bigger functions into its smaller tasks which are completely unrelated to each other
Carlos Silva <typ0@pidgin.im>
parents: 20560
diff changeset
656
35675dd4a44d Make buddy and group management actually work, add some SOAP templates, redesign some parts of code and separate some bigger functions into its smaller tasks which are completely unrelated to each other
Carlos Silva <typ0@pidgin.im>
parents: 20560
diff changeset
657 return TRUE;
9193
6e76f1367896 [gaim-migrate @ 9988]
Felipe Contreras <felipe.contreras@gmail.com>
parents:
diff changeset
658 }
6e76f1367896 [gaim-migrate @ 9988]
Felipe Contreras <felipe.contreras@gmail.com>
parents:
diff changeset
659
6e76f1367896 [gaim-migrate @ 9988]
Felipe Contreras <felipe.contreras@gmail.com>
parents:
diff changeset
660 void
6e76f1367896 [gaim-migrate @ 9988]
Felipe Contreras <felipe.contreras@gmail.com>
parents:
diff changeset
661 msn_userlist_move_buddy(MsnUserList *userlist, const char *who,
20564
35675dd4a44d Make buddy and group management actually work, add some SOAP templates, redesign some parts of code and separate some bigger functions into its smaller tasks which are completely unrelated to each other
Carlos Silva <typ0@pidgin.im>
parents: 20560
diff changeset
662 const char *old_group_name, const char *new_group_name)
9193
6e76f1367896 [gaim-migrate @ 9988]
Felipe Contreras <felipe.contreras@gmail.com>
parents:
diff changeset
663 {
13856
a6511183749e [gaim-migrate @ 16546]
Ma Yuan <mayuan2006@gmail.com>
parents: 13855
diff changeset
664 const char *new_group_id;
20567
2417aff6ff3b Handle special cases in buddy/group management (wrt MSN_INDIVIDUALS_GROUP and MSN_NON_IM_GROUP).
Carlos Silva <typ0@pidgin.im>
parents: 20566
diff changeset
665 MsnCallbackState *state;
23441
fd45c23a3eb2 Delete trailing whitespace
Mark Doliner <markdoliner@pidgin.im>
parents: 22981
diff changeset
666
20564
35675dd4a44d Make buddy and group management actually work, add some SOAP templates, redesign some parts of code and separate some bigger functions into its smaller tasks which are completely unrelated to each other
Carlos Silva <typ0@pidgin.im>
parents: 20560
diff changeset
667 g_return_if_fail(userlist != NULL);
35675dd4a44d Make buddy and group management actually work, add some SOAP templates, redesign some parts of code and separate some bigger functions into its smaller tasks which are completely unrelated to each other
Carlos Silva <typ0@pidgin.im>
parents: 20560
diff changeset
668 g_return_if_fail(userlist->session != NULL);
20567
2417aff6ff3b Handle special cases in buddy/group management (wrt MSN_INDIVIDUALS_GROUP and MSN_NON_IM_GROUP).
Carlos Silva <typ0@pidgin.im>
parents: 20566
diff changeset
669
21368
d270fe91b138 finish converting the rest of stuff to the new soap api, signing on, getting
Ka-Hing Cheung <khc@pidgin.im>
parents: 20603
diff changeset
670 state = msn_callback_state_new(userlist->session);
20564
35675dd4a44d Make buddy and group management actually work, add some SOAP templates, redesign some parts of code and separate some bigger functions into its smaller tasks which are completely unrelated to each other
Carlos Silva <typ0@pidgin.im>
parents: 20560
diff changeset
671 msn_callback_state_set_who(state, who);
35675dd4a44d Make buddy and group management actually work, add some SOAP templates, redesign some parts of code and separate some bigger functions into its smaller tasks which are completely unrelated to each other
Carlos Silva <typ0@pidgin.im>
parents: 20560
diff changeset
672 msn_callback_state_set_action(state, MSN_MOVE_BUDDY);
35675dd4a44d Make buddy and group management actually work, add some SOAP templates, redesign some parts of code and separate some bigger functions into its smaller tasks which are completely unrelated to each other
Carlos Silva <typ0@pidgin.im>
parents: 20560
diff changeset
673 msn_callback_state_set_old_group_name(state, old_group_name);
35675dd4a44d Make buddy and group management actually work, add some SOAP templates, redesign some parts of code and separate some bigger functions into its smaller tasks which are completely unrelated to each other
Carlos Silva <typ0@pidgin.im>
parents: 20560
diff changeset
674 msn_callback_state_set_new_group_name(state, new_group_name);
9193
6e76f1367896 [gaim-migrate @ 9988]
Felipe Contreras <felipe.contreras@gmail.com>
parents:
diff changeset
675
6e76f1367896 [gaim-migrate @ 9988]
Felipe Contreras <felipe.contreras@gmail.com>
parents:
diff changeset
676 new_group_id = msn_userlist_find_group_id(userlist, new_group_name);
6e76f1367896 [gaim-migrate @ 9988]
Felipe Contreras <felipe.contreras@gmail.com>
parents:
diff changeset
677
20478
46933dc62880 propagate from branch 'im.pidgin.pidgin' (head 88b7040408c88e4516c008f4eac579f98ef53e85)
Richard Laager <rlaager@pidgin.im>
parents: 20475 15884
diff changeset
678 if (new_group_id == NULL)
23441
fd45c23a3eb2 Delete trailing whitespace
Mark Doliner <markdoliner@pidgin.im>
parents: 22981
diff changeset
679 {
20564
35675dd4a44d Make buddy and group management actually work, add some SOAP templates, redesign some parts of code and separate some bigger functions into its smaller tasks which are completely unrelated to each other
Carlos Silva <typ0@pidgin.im>
parents: 20560
diff changeset
680 msn_add_group(userlist->session, state, new_group_name);
9193
6e76f1367896 [gaim-migrate @ 9988]
Felipe Contreras <felipe.contreras@gmail.com>
parents:
diff changeset
681 return;
6e76f1367896 [gaim-migrate @ 9988]
Felipe Contreras <felipe.contreras@gmail.com>
parents:
diff changeset
682 }
23441
fd45c23a3eb2 Delete trailing whitespace
Mark Doliner <markdoliner@pidgin.im>
parents: 22981
diff changeset
683
20564
35675dd4a44d Make buddy and group management actually work, add some SOAP templates, redesign some parts of code and separate some bigger functions into its smaller tasks which are completely unrelated to each other
Carlos Silva <typ0@pidgin.im>
parents: 20560
diff changeset
684 /* add the contact to the new group, and remove it from the old one in
35675dd4a44d Make buddy and group management actually work, add some SOAP templates, redesign some parts of code and separate some bigger functions into its smaller tasks which are completely unrelated to each other
Carlos Silva <typ0@pidgin.im>
parents: 20560
diff changeset
685 * the callback
35675dd4a44d Make buddy and group management actually work, add some SOAP templates, redesign some parts of code and separate some bigger functions into its smaller tasks which are completely unrelated to each other
Carlos Silva <typ0@pidgin.im>
parents: 20560
diff changeset
686 */
23771
c98f7e879218 killing MsnContact which just wraps MsnSession
Ka-Hing Cheung <khc@pidgin.im>
parents: 21369
diff changeset
687 msn_add_contact_to_group(userlist->session, state, who, new_group_id);
9193
6e76f1367896 [gaim-migrate @ 9988]
Felipe Contreras <felipe.contreras@gmail.com>
parents:
diff changeset
688 }
6e76f1367896 [gaim-migrate @ 9988]
Felipe Contreras <felipe.contreras@gmail.com>
parents:
diff changeset
689
31037
457c61e53d50 Move queue logic in requesting user display out of slp code.
Jorge Villaseñor <masca@cpw.pidgin.im>
parents: 30961
diff changeset
690 void
457c61e53d50 Move queue logic in requesting user display out of slp code.
Jorge Villaseñor <masca@cpw.pidgin.im>
parents: 30961
diff changeset
691 msn_release_buddy_icon_request(MsnUserList *userlist)
457c61e53d50 Move queue logic in requesting user display out of slp code.
Jorge Villaseñor <masca@cpw.pidgin.im>
parents: 30961
diff changeset
692 {
457c61e53d50 Move queue logic in requesting user display out of slp code.
Jorge Villaseñor <masca@cpw.pidgin.im>
parents: 30961
diff changeset
693 MsnUser *user;
457c61e53d50 Move queue logic in requesting user display out of slp code.
Jorge Villaseñor <masca@cpw.pidgin.im>
parents: 30961
diff changeset
694
457c61e53d50 Move queue logic in requesting user display out of slp code.
Jorge Villaseñor <masca@cpw.pidgin.im>
parents: 30961
diff changeset
695 g_return_if_fail(userlist != NULL);
457c61e53d50 Move queue logic in requesting user display out of slp code.
Jorge Villaseñor <masca@cpw.pidgin.im>
parents: 30961
diff changeset
696
457c61e53d50 Move queue logic in requesting user display out of slp code.
Jorge Villaseñor <masca@cpw.pidgin.im>
parents: 30961
diff changeset
697 if (purple_debug_is_verbose())
457c61e53d50 Move queue logic in requesting user display out of slp code.
Jorge Villaseñor <masca@cpw.pidgin.im>
parents: 30961
diff changeset
698 purple_debug_info("msn", "Releasing buddy icon request\n");
457c61e53d50 Move queue logic in requesting user display out of slp code.
Jorge Villaseñor <masca@cpw.pidgin.im>
parents: 30961
diff changeset
699
457c61e53d50 Move queue logic in requesting user display out of slp code.
Jorge Villaseñor <masca@cpw.pidgin.im>
parents: 30961
diff changeset
700 if (userlist->buddy_icon_window > 0) {
457c61e53d50 Move queue logic in requesting user display out of slp code.
Jorge Villaseñor <masca@cpw.pidgin.im>
parents: 30961
diff changeset
701 GQueue *queue;
457c61e53d50 Move queue logic in requesting user display out of slp code.
Jorge Villaseñor <masca@cpw.pidgin.im>
parents: 30961
diff changeset
702 PurpleAccount *account;
457c61e53d50 Move queue logic in requesting user display out of slp code.
Jorge Villaseñor <masca@cpw.pidgin.im>
parents: 30961
diff changeset
703 const char *username;
457c61e53d50 Move queue logic in requesting user display out of slp code.
Jorge Villaseñor <masca@cpw.pidgin.im>
parents: 30961
diff changeset
704
457c61e53d50 Move queue logic in requesting user display out of slp code.
Jorge Villaseñor <masca@cpw.pidgin.im>
parents: 30961
diff changeset
705 queue = userlist->buddy_icon_requests;
457c61e53d50 Move queue logic in requesting user display out of slp code.
Jorge Villaseñor <masca@cpw.pidgin.im>
parents: 30961
diff changeset
706
457c61e53d50 Move queue logic in requesting user display out of slp code.
Jorge Villaseñor <masca@cpw.pidgin.im>
parents: 30961
diff changeset
707 if (g_queue_is_empty(userlist->buddy_icon_requests))
457c61e53d50 Move queue logic in requesting user display out of slp code.
Jorge Villaseñor <masca@cpw.pidgin.im>
parents: 30961
diff changeset
708 return;
457c61e53d50 Move queue logic in requesting user display out of slp code.
Jorge Villaseñor <masca@cpw.pidgin.im>
parents: 30961
diff changeset
709
457c61e53d50 Move queue logic in requesting user display out of slp code.
Jorge Villaseñor <masca@cpw.pidgin.im>
parents: 30961
diff changeset
710 user = g_queue_pop_head(queue);
457c61e53d50 Move queue logic in requesting user display out of slp code.
Jorge Villaseñor <masca@cpw.pidgin.im>
parents: 30961
diff changeset
711
457c61e53d50 Move queue logic in requesting user display out of slp code.
Jorge Villaseñor <masca@cpw.pidgin.im>
parents: 30961
diff changeset
712 account = userlist->session->account;
457c61e53d50 Move queue logic in requesting user display out of slp code.
Jorge Villaseñor <masca@cpw.pidgin.im>
parents: 30961
diff changeset
713 username = user->passport;
457c61e53d50 Move queue logic in requesting user display out of slp code.
Jorge Villaseñor <masca@cpw.pidgin.im>
parents: 30961
diff changeset
714
457c61e53d50 Move queue logic in requesting user display out of slp code.
Jorge Villaseñor <masca@cpw.pidgin.im>
parents: 30961
diff changeset
715 userlist->buddy_icon_window--;
457c61e53d50 Move queue logic in requesting user display out of slp code.
Jorge Villaseñor <masca@cpw.pidgin.im>
parents: 30961
diff changeset
716
457c61e53d50 Move queue logic in requesting user display out of slp code.
Jorge Villaseñor <masca@cpw.pidgin.im>
parents: 30961
diff changeset
717 msn_request_user_display(user);
457c61e53d50 Move queue logic in requesting user display out of slp code.
Jorge Villaseñor <masca@cpw.pidgin.im>
parents: 30961
diff changeset
718
457c61e53d50 Move queue logic in requesting user display out of slp code.
Jorge Villaseñor <masca@cpw.pidgin.im>
parents: 30961
diff changeset
719 if (purple_debug_is_verbose())
457c61e53d50 Move queue logic in requesting user display out of slp code.
Jorge Villaseñor <masca@cpw.pidgin.im>
parents: 30961
diff changeset
720 purple_debug_info("msn",
457c61e53d50 Move queue logic in requesting user display out of slp code.
Jorge Villaseñor <masca@cpw.pidgin.im>
parents: 30961
diff changeset
721 "msn_release_buddy_icon_request(): buddy_icon_window-- yields =%d\n",
457c61e53d50 Move queue logic in requesting user display out of slp code.
Jorge Villaseñor <masca@cpw.pidgin.im>
parents: 30961
diff changeset
722 userlist->buddy_icon_window);
457c61e53d50 Move queue logic in requesting user display out of slp code.
Jorge Villaseñor <masca@cpw.pidgin.im>
parents: 30961
diff changeset
723 }
457c61e53d50 Move queue logic in requesting user display out of slp code.
Jorge Villaseñor <masca@cpw.pidgin.im>
parents: 30961
diff changeset
724 }
457c61e53d50 Move queue logic in requesting user display out of slp code.
Jorge Villaseñor <masca@cpw.pidgin.im>
parents: 30961
diff changeset
725
20473
91e1b3a49d10 msn.tgz from SF Patch #1621854 from Ka-Hing Cheung
Ka-Hing Cheung <khc@pidgin.im>
parents: 20472
diff changeset
726 /*load userlist from the Blist file cache*/
91e1b3a49d10 msn.tgz from SF Patch #1621854 from Ka-Hing Cheung
Ka-Hing Cheung <khc@pidgin.im>
parents: 20472
diff changeset
727 void
91e1b3a49d10 msn.tgz from SF Patch #1621854 from Ka-Hing Cheung
Ka-Hing Cheung <khc@pidgin.im>
parents: 20472
diff changeset
728 msn_userlist_load(MsnSession *session)
91e1b3a49d10 msn.tgz from SF Patch #1621854 from Ka-Hing Cheung
Ka-Hing Cheung <khc@pidgin.im>
parents: 20472
diff changeset
729 {
24398
4865c2ee6ea8 Start hiding blist.h internals in prpls.
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents: 23833
diff changeset
730 PurpleAccount *account = session->account;
4865c2ee6ea8 Start hiding blist.h internals in prpls.
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents: 23833
diff changeset
731 PurpleConnection *gc = purple_account_get_connection(account);
20473
91e1b3a49d10 msn.tgz from SF Patch #1621854 from Ka-Hing Cheung
Ka-Hing Cheung <khc@pidgin.im>
parents: 20472
diff changeset
732 GSList *l;
91e1b3a49d10 msn.tgz from SF Patch #1621854 from Ka-Hing Cheung
Ka-Hing Cheung <khc@pidgin.im>
parents: 20472
diff changeset
733 MsnUser * user;
91e1b3a49d10 msn.tgz from SF Patch #1621854 from Ka-Hing Cheung
Ka-Hing Cheung <khc@pidgin.im>
parents: 20472
diff changeset
734
91e1b3a49d10 msn.tgz from SF Patch #1621854 from Ka-Hing Cheung
Ka-Hing Cheung <khc@pidgin.im>
parents: 20472
diff changeset
735 g_return_if_fail(gc != NULL);
91e1b3a49d10 msn.tgz from SF Patch #1621854 from Ka-Hing Cheung
Ka-Hing Cheung <khc@pidgin.im>
parents: 20472
diff changeset
736
27199
ab2af9d15cba Use purple_find_buddies() instead of iterating the buddy list.
Paul Aurich <darkrain42@pidgin.im>
parents: 27101
diff changeset
737 for (l = purple_find_buddies(account, NULL); l != NULL;
ab2af9d15cba Use purple_find_buddies() instead of iterating the buddy list.
Paul Aurich <darkrain42@pidgin.im>
parents: 27101
diff changeset
738 l = g_slist_delete_link(l, l)) {
ab2af9d15cba Use purple_find_buddies() instead of iterating the buddy list.
Paul Aurich <darkrain42@pidgin.im>
parents: 27101
diff changeset
739 PurpleBuddy *buddy = l->data;
ab2af9d15cba Use purple_find_buddies() instead of iterating the buddy list.
Paul Aurich <darkrain42@pidgin.im>
parents: 27101
diff changeset
740
ab2af9d15cba Use purple_find_buddies() instead of iterating the buddy list.
Paul Aurich <darkrain42@pidgin.im>
parents: 27101
diff changeset
741 user = msn_userlist_find_add_user(session->userlist,
ab2af9d15cba Use purple_find_buddies() instead of iterating the buddy list.
Paul Aurich <darkrain42@pidgin.im>
parents: 27101
diff changeset
742 purple_buddy_get_name(buddy), NULL);
ab2af9d15cba Use purple_find_buddies() instead of iterating the buddy list.
Paul Aurich <darkrain42@pidgin.im>
parents: 27101
diff changeset
743 purple_buddy_set_protocol_data(buddy, user);
ab2af9d15cba Use purple_find_buddies() instead of iterating the buddy list.
Paul Aurich <darkrain42@pidgin.im>
parents: 27101
diff changeset
744 msn_user_set_op(user, MSN_LIST_FL_OP);
20473
91e1b3a49d10 msn.tgz from SF Patch #1621854 from Ka-Hing Cheung
Ka-Hing Cheung <khc@pidgin.im>
parents: 20472
diff changeset
745 }
20479
03c44889c50f Revert some whitespace changes.
Richard Laager <rlaager@pidgin.im>
parents: 20473
diff changeset
746 for (l = session->account->permit; l != NULL; l = l->next)
03c44889c50f Revert some whitespace changes.
Richard Laager <rlaager@pidgin.im>
parents: 20473
diff changeset
747 {
20473
91e1b3a49d10 msn.tgz from SF Patch #1621854 from Ka-Hing Cheung
Ka-Hing Cheung <khc@pidgin.im>
parents: 20472
diff changeset
748 user = msn_userlist_find_add_user(session->userlist,
91e1b3a49d10 msn.tgz from SF Patch #1621854 from Ka-Hing Cheung
Ka-Hing Cheung <khc@pidgin.im>
parents: 20472
diff changeset
749 (char *)l->data,NULL);
20475
0b3826f0e687 The first msn-p13-merge-head.diff.gz from SF Patch #1621854 from Ka-Hing Cheung.
Richard Laager <rlaager@pidgin.im>
parents: 20473
diff changeset
750 msn_user_set_op(user, MSN_LIST_AL_OP);
20473
91e1b3a49d10 msn.tgz from SF Patch #1621854 from Ka-Hing Cheung
Ka-Hing Cheung <khc@pidgin.im>
parents: 20472
diff changeset
751 }
20479
03c44889c50f Revert some whitespace changes.
Richard Laager <rlaager@pidgin.im>
parents: 20473
diff changeset
752 for (l = session->account->deny; l != NULL; l = l->next)
03c44889c50f Revert some whitespace changes.
Richard Laager <rlaager@pidgin.im>
parents: 20473
diff changeset
753 {
20473
91e1b3a49d10 msn.tgz from SF Patch #1621854 from Ka-Hing Cheung
Ka-Hing Cheung <khc@pidgin.im>
parents: 20472
diff changeset
754 user = msn_userlist_find_add_user(session->userlist,
91e1b3a49d10 msn.tgz from SF Patch #1621854 from Ka-Hing Cheung
Ka-Hing Cheung <khc@pidgin.im>
parents: 20472
diff changeset
755 (char *)l->data,NULL);
20475
0b3826f0e687 The first msn-p13-merge-head.diff.gz from SF Patch #1621854 from Ka-Hing Cheung.
Richard Laager <rlaager@pidgin.im>
parents: 20473
diff changeset
756 msn_user_set_op(user, MSN_LIST_BL_OP);
20473
91e1b3a49d10 msn.tgz from SF Patch #1621854 from Ka-Hing Cheung
Ka-Hing Cheung <khc@pidgin.im>
parents: 20472
diff changeset
757 }
23441
fd45c23a3eb2 Delete trailing whitespace
Mark Doliner <markdoliner@pidgin.im>
parents: 22981
diff changeset
758
9193
6e76f1367896 [gaim-migrate @ 9988]
Felipe Contreras <felipe.contreras@gmail.com>
parents:
diff changeset
759 }
20473
91e1b3a49d10 msn.tgz from SF Patch #1621854 from Ka-Hing Cheung
Ka-Hing Cheung <khc@pidgin.im>
parents: 20472
diff changeset
760

mercurial