Mercurial > pidgin.yaz
annotate libpurple/protocols/msn/contact.c @ 23597:e069c16db597
Always save the MSN transaction in each command, not just for
synchronous ones. Apparently, "URL" may or may not be async, but we
also send it ourselves, too, and we need the transaction for other
things.
References #5762.
author | Elliott Sales de Andrade <qulogic@pidgin.im> |
---|---|
date | Thu, 17 Jul 2008 03:23:59 +0000 |
parents | 4162ac08c775 |
children | 860e5e210fc9 |
rev | line source |
---|---|
20394
4a099e4d0d09
propagate from branch 'im.pidgin.pidgin' (head 98b6b547b29ea1192b73cc4e1de1e674edef4328)
Richard Laager <rlaager@wiktel.com>
parents:
diff
changeset
|
1 /** |
4a099e4d0d09
propagate from branch 'im.pidgin.pidgin' (head 98b6b547b29ea1192b73cc4e1de1e674edef4328)
Richard Laager <rlaager@wiktel.com>
parents:
diff
changeset
|
2 * @file contact.c |
4a099e4d0d09
propagate from branch 'im.pidgin.pidgin' (head 98b6b547b29ea1192b73cc4e1de1e674edef4328)
Richard Laager <rlaager@wiktel.com>
parents:
diff
changeset
|
3 * get MSN contacts via SOAP request |
4a099e4d0d09
propagate from branch 'im.pidgin.pidgin' (head 98b6b547b29ea1192b73cc4e1de1e674edef4328)
Richard Laager <rlaager@wiktel.com>
parents:
diff
changeset
|
4 * created by MaYuan<mayuan2006@gmail.com> |
4a099e4d0d09
propagate from branch 'im.pidgin.pidgin' (head 98b6b547b29ea1192b73cc4e1de1e674edef4328)
Richard Laager <rlaager@wiktel.com>
parents:
diff
changeset
|
5 * |
20401
4ddc27c18781
Fix up some gaim -> purple issues.
Richard Laager <rlaager@wiktel.com>
parents:
20394
diff
changeset
|
6 * purple |
20394
4a099e4d0d09
propagate from branch 'im.pidgin.pidgin' (head 98b6b547b29ea1192b73cc4e1de1e674edef4328)
Richard Laager <rlaager@wiktel.com>
parents:
diff
changeset
|
7 * |
20401
4ddc27c18781
Fix up some gaim -> purple issues.
Richard Laager <rlaager@wiktel.com>
parents:
20394
diff
changeset
|
8 * Purple is the legal property of its developers, whose names are too numerous |
20394
4a099e4d0d09
propagate from branch 'im.pidgin.pidgin' (head 98b6b547b29ea1192b73cc4e1de1e674edef4328)
Richard Laager <rlaager@wiktel.com>
parents:
diff
changeset
|
9 * to list here. Please refer to the COPYRIGHT file distributed with this |
4a099e4d0d09
propagate from branch 'im.pidgin.pidgin' (head 98b6b547b29ea1192b73cc4e1de1e674edef4328)
Richard Laager <rlaager@wiktel.com>
parents:
diff
changeset
|
10 * source distribution. |
4a099e4d0d09
propagate from branch 'im.pidgin.pidgin' (head 98b6b547b29ea1192b73cc4e1de1e674edef4328)
Richard Laager <rlaager@wiktel.com>
parents:
diff
changeset
|
11 * |
4a099e4d0d09
propagate from branch 'im.pidgin.pidgin' (head 98b6b547b29ea1192b73cc4e1de1e674edef4328)
Richard Laager <rlaager@wiktel.com>
parents:
diff
changeset
|
12 * This program is free software; you can redistribute it and/or modify |
4a099e4d0d09
propagate from branch 'im.pidgin.pidgin' (head 98b6b547b29ea1192b73cc4e1de1e674edef4328)
Richard Laager <rlaager@wiktel.com>
parents:
diff
changeset
|
13 * it under the terms of the GNU General Public License as published by |
4a099e4d0d09
propagate from branch 'im.pidgin.pidgin' (head 98b6b547b29ea1192b73cc4e1de1e674edef4328)
Richard Laager <rlaager@wiktel.com>
parents:
diff
changeset
|
14 * the Free Software Foundation; either version 2 of the License, or |
4a099e4d0d09
propagate from branch 'im.pidgin.pidgin' (head 98b6b547b29ea1192b73cc4e1de1e674edef4328)
Richard Laager <rlaager@wiktel.com>
parents:
diff
changeset
|
15 * (at your option) any later version. |
4a099e4d0d09
propagate from branch 'im.pidgin.pidgin' (head 98b6b547b29ea1192b73cc4e1de1e674edef4328)
Richard Laager <rlaager@wiktel.com>
parents:
diff
changeset
|
16 * |
4a099e4d0d09
propagate from branch 'im.pidgin.pidgin' (head 98b6b547b29ea1192b73cc4e1de1e674edef4328)
Richard Laager <rlaager@wiktel.com>
parents:
diff
changeset
|
17 * This program is distributed in the hope that it will be useful, |
4a099e4d0d09
propagate from branch 'im.pidgin.pidgin' (head 98b6b547b29ea1192b73cc4e1de1e674edef4328)
Richard Laager <rlaager@wiktel.com>
parents:
diff
changeset
|
18 * but WITHOUT ANY WARRANTY; without even the implied warranty of |
4a099e4d0d09
propagate from branch 'im.pidgin.pidgin' (head 98b6b547b29ea1192b73cc4e1de1e674edef4328)
Richard Laager <rlaager@wiktel.com>
parents:
diff
changeset
|
19 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
4a099e4d0d09
propagate from branch 'im.pidgin.pidgin' (head 98b6b547b29ea1192b73cc4e1de1e674edef4328)
Richard Laager <rlaager@wiktel.com>
parents:
diff
changeset
|
20 * GNU General Public License for more details. |
4a099e4d0d09
propagate from branch 'im.pidgin.pidgin' (head 98b6b547b29ea1192b73cc4e1de1e674edef4328)
Richard Laager <rlaager@wiktel.com>
parents:
diff
changeset
|
21 * |
4a099e4d0d09
propagate from branch 'im.pidgin.pidgin' (head 98b6b547b29ea1192b73cc4e1de1e674edef4328)
Richard Laager <rlaager@wiktel.com>
parents:
diff
changeset
|
22 * You should have received a copy of the GNU General Public License |
4a099e4d0d09
propagate from branch 'im.pidgin.pidgin' (head 98b6b547b29ea1192b73cc4e1de1e674edef4328)
Richard Laager <rlaager@wiktel.com>
parents:
diff
changeset
|
23 * along with this program; if not, write to the Free Software |
4a099e4d0d09
propagate from branch 'im.pidgin.pidgin' (head 98b6b547b29ea1192b73cc4e1de1e674edef4328)
Richard Laager <rlaager@wiktel.com>
parents:
diff
changeset
|
24 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA |
4a099e4d0d09
propagate from branch 'im.pidgin.pidgin' (head 98b6b547b29ea1192b73cc4e1de1e674edef4328)
Richard Laager <rlaager@wiktel.com>
parents:
diff
changeset
|
25 */ |
4a099e4d0d09
propagate from branch 'im.pidgin.pidgin' (head 98b6b547b29ea1192b73cc4e1de1e674edef4328)
Richard Laager <rlaager@wiktel.com>
parents:
diff
changeset
|
26 |
4a099e4d0d09
propagate from branch 'im.pidgin.pidgin' (head 98b6b547b29ea1192b73cc4e1de1e674edef4328)
Richard Laager <rlaager@wiktel.com>
parents:
diff
changeset
|
27 #include "msn.h" |
4a099e4d0d09
propagate from branch 'im.pidgin.pidgin' (head 98b6b547b29ea1192b73cc4e1de1e674edef4328)
Richard Laager <rlaager@wiktel.com>
parents:
diff
changeset
|
28 #include "contact.h" |
4a099e4d0d09
propagate from branch 'im.pidgin.pidgin' (head 98b6b547b29ea1192b73cc4e1de1e674edef4328)
Richard Laager <rlaager@wiktel.com>
parents:
diff
changeset
|
29 #include "xmlnode.h" |
4a099e4d0d09
propagate from branch 'im.pidgin.pidgin' (head 98b6b547b29ea1192b73cc4e1de1e674edef4328)
Richard Laager <rlaager@wiktel.com>
parents:
diff
changeset
|
30 #include "group.h" |
23552
711773577380
Clean up some MSN SOAP stuff.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
23523
diff
changeset
|
31 #include "soap.h" |
23490
b70f30dd4753
Patch 3 from Qulogic, this one updates contact list actions to use ticket
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
21833
diff
changeset
|
32 #include "nexus.h" |
20394
4a099e4d0d09
propagate from branch 'im.pidgin.pidgin' (head 98b6b547b29ea1192b73cc4e1de1e674edef4328)
Richard Laager <rlaager@wiktel.com>
parents:
diff
changeset
|
33 |
20484
98613886411a
Handle special cases in buddy/group management (wrt MSN_INDIVIDUALS_GROUP and MSN_NON_IM_GROUP).
Carlos Silva <typ0@pidgin.im>
parents:
20481
diff
changeset
|
34 const char *MsnSoapPartnerScenarioText[] = |
20481
eb93710aec4d
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:
20479
diff
changeset
|
35 { |
20666
0e1bc5c51030
A few leak plugs, some unnecessary allocation prevention, null pointer deref fixes and general robustness fixes. I'm sure there is more to do here, I got tired... Fixes #3308
Daniel Atallah <daniel.atallah@gmail.com>
parents:
20539
diff
changeset
|
36 "Initial", |
0e1bc5c51030
A few leak plugs, some unnecessary allocation prevention, null pointer deref fixes and general robustness fixes. I'm sure there is more to do here, I got tired... Fixes #3308
Daniel Atallah <daniel.atallah@gmail.com>
parents:
20539
diff
changeset
|
37 "ContactSave", |
20486
ff4ae9dde291
Make block/unblock work right, as well as being add by a buddy. Finally fixes #723
Carlos Silva <typ0@pidgin.im>
parents:
20484
diff
changeset
|
38 "MessengerPendingList", |
ff4ae9dde291
Make block/unblock work right, as well as being add by a buddy. Finally fixes #723
Carlos Silva <typ0@pidgin.im>
parents:
20484
diff
changeset
|
39 "ContactMsgrAPI", |
ff4ae9dde291
Make block/unblock work right, as well as being add by a buddy. Finally fixes #723
Carlos Silva <typ0@pidgin.im>
parents:
20484
diff
changeset
|
40 "BlockUnblock" |
20481
eb93710aec4d
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:
20479
diff
changeset
|
41 }; |
eb93710aec4d
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:
20479
diff
changeset
|
42 |
20486
ff4ae9dde291
Make block/unblock work right, as well as being add by a buddy. Finally fixes #723
Carlos Silva <typ0@pidgin.im>
parents:
20484
diff
changeset
|
43 const char *MsnMemberRole[] = |
ff4ae9dde291
Make block/unblock work right, as well as being add by a buddy. Finally fixes #723
Carlos Silva <typ0@pidgin.im>
parents:
20484
diff
changeset
|
44 { |
ff4ae9dde291
Make block/unblock work right, as well as being add by a buddy. Finally fixes #723
Carlos Silva <typ0@pidgin.im>
parents:
20484
diff
changeset
|
45 "Forward", |
ff4ae9dde291
Make block/unblock work right, as well as being add by a buddy. Finally fixes #723
Carlos Silva <typ0@pidgin.im>
parents:
20484
diff
changeset
|
46 "Allow", |
ff4ae9dde291
Make block/unblock work right, as well as being add by a buddy. Finally fixes #723
Carlos Silva <typ0@pidgin.im>
parents:
20484
diff
changeset
|
47 "Block", |
ff4ae9dde291
Make block/unblock work right, as well as being add by a buddy. Finally fixes #723
Carlos Silva <typ0@pidgin.im>
parents:
20484
diff
changeset
|
48 "Reverse", |
ff4ae9dde291
Make block/unblock work right, as well as being add by a buddy. Finally fixes #723
Carlos Silva <typ0@pidgin.im>
parents:
20484
diff
changeset
|
49 "Pending" |
ff4ae9dde291
Make block/unblock work right, as well as being add by a buddy. Finally fixes #723
Carlos Silva <typ0@pidgin.im>
parents:
20484
diff
changeset
|
50 }; |
20481
eb93710aec4d
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:
20479
diff
changeset
|
51 |
20538
90fd0826c6ce
finish converting the rest of stuff to the new soap api, signing on, getting
Ka-Hing Cheung <khc@hxbc.us>
parents:
20501
diff
changeset
|
52 typedef struct { |
23504
69af5301e1a7
killing MsnContact which just wraps MsnSession
Ka-Hing Cheung <khc@hxbc.us>
parents:
23498
diff
changeset
|
53 MsnSession *session; |
20538
90fd0826c6ce
finish converting the rest of stuff to the new soap api, signing on, getting
Ka-Hing Cheung <khc@hxbc.us>
parents:
20501
diff
changeset
|
54 MsnSoapPartnerScenario which; |
90fd0826c6ce
finish converting the rest of stuff to the new soap api, signing on, getting
Ka-Hing Cheung <khc@hxbc.us>
parents:
20501
diff
changeset
|
55 } GetContactListCbData; |
90fd0826c6ce
finish converting the rest of stuff to the new soap api, signing on, getting
Ka-Hing Cheung <khc@hxbc.us>
parents:
20501
diff
changeset
|
56 |
20481
eb93710aec4d
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:
20479
diff
changeset
|
57 MsnCallbackState * |
20538
90fd0826c6ce
finish converting the rest of stuff to the new soap api, signing on, getting
Ka-Hing Cheung <khc@hxbc.us>
parents:
20501
diff
changeset
|
58 msn_callback_state_new(MsnSession *session) |
20481
eb93710aec4d
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:
20479
diff
changeset
|
59 { |
20538
90fd0826c6ce
finish converting the rest of stuff to the new soap api, signing on, getting
Ka-Hing Cheung <khc@hxbc.us>
parents:
20501
diff
changeset
|
60 MsnCallbackState *state = g_new0(MsnCallbackState, 1); |
90fd0826c6ce
finish converting the rest of stuff to the new soap api, signing on, getting
Ka-Hing Cheung <khc@hxbc.us>
parents:
20501
diff
changeset
|
61 |
90fd0826c6ce
finish converting the rest of stuff to the new soap api, signing on, getting
Ka-Hing Cheung <khc@hxbc.us>
parents:
20501
diff
changeset
|
62 state->session = session; |
90fd0826c6ce
finish converting the rest of stuff to the new soap api, signing on, getting
Ka-Hing Cheung <khc@hxbc.us>
parents:
20501
diff
changeset
|
63 |
90fd0826c6ce
finish converting the rest of stuff to the new soap api, signing on, getting
Ka-Hing Cheung <khc@hxbc.us>
parents:
20501
diff
changeset
|
64 return state; |
23300
5cdd93dac7a2
Delete trailing whitespace
Mark Doliner <mark@kingant.net>
parents:
22808
diff
changeset
|
65 } |
20481
eb93710aec4d
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:
20479
diff
changeset
|
66 |
23515
eb8bd060b987
Update MSN Contact tokens when an invalid token error is returned.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
23509
diff
changeset
|
67 MsnCallbackState * |
eb8bd060b987
Update MSN Contact tokens when an invalid token error is returned.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
23509
diff
changeset
|
68 msn_callback_state_dup(MsnCallbackState *state) |
eb8bd060b987
Update MSN Contact tokens when an invalid token error is returned.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
23509
diff
changeset
|
69 { |
eb8bd060b987
Update MSN Contact tokens when an invalid token error is returned.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
23509
diff
changeset
|
70 MsnCallbackState *new_state = g_new0(MsnCallbackState, 1); |
eb8bd060b987
Update MSN Contact tokens when an invalid token error is returned.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
23509
diff
changeset
|
71 |
eb8bd060b987
Update MSN Contact tokens when an invalid token error is returned.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
23509
diff
changeset
|
72 new_state->session = state->session; |
eb8bd060b987
Update MSN Contact tokens when an invalid token error is returned.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
23509
diff
changeset
|
73 new_state->who = g_strdup(state->who); |
eb8bd060b987
Update MSN Contact tokens when an invalid token error is returned.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
23509
diff
changeset
|
74 new_state->uid = g_strdup(state->uid); |
eb8bd060b987
Update MSN Contact tokens when an invalid token error is returned.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
23509
diff
changeset
|
75 new_state->old_group_name = g_strdup(state->old_group_name); |
eb8bd060b987
Update MSN Contact tokens when an invalid token error is returned.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
23509
diff
changeset
|
76 new_state->new_group_name = g_strdup(state->new_group_name); |
eb8bd060b987
Update MSN Contact tokens when an invalid token error is returned.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
23509
diff
changeset
|
77 new_state->guid = g_strdup(state->guid); |
eb8bd060b987
Update MSN Contact tokens when an invalid token error is returned.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
23509
diff
changeset
|
78 /* The rest should be made new */ |
eb8bd060b987
Update MSN Contact tokens when an invalid token error is returned.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
23509
diff
changeset
|
79 |
eb8bd060b987
Update MSN Contact tokens when an invalid token error is returned.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
23509
diff
changeset
|
80 return new_state; |
23552
711773577380
Clean up some MSN SOAP stuff.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
23523
diff
changeset
|
81 } |
23515
eb8bd060b987
Update MSN Contact tokens when an invalid token error is returned.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
23509
diff
changeset
|
82 |
20481
eb93710aec4d
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:
20479
diff
changeset
|
83 void |
eb93710aec4d
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:
20479
diff
changeset
|
84 msn_callback_state_free(MsnCallbackState *state) |
eb93710aec4d
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:
20479
diff
changeset
|
85 { |
20501
f6dff814d95f
cleans up ownership of soap callback data, this soap stuff is perfect
Ka-Hing Cheung <khc@hxbc.us>
parents:
20495
diff
changeset
|
86 if (state == NULL) |
f6dff814d95f
cleans up ownership of soap callback data, this soap stuff is perfect
Ka-Hing Cheung <khc@hxbc.us>
parents:
20495
diff
changeset
|
87 return; |
20539
2c8c6d77f12c
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:
20501
diff
changeset
|
88 |
20666
0e1bc5c51030
A few leak plugs, some unnecessary allocation prevention, null pointer deref fixes and general robustness fixes. I'm sure there is more to do here, I got tired... Fixes #3308
Daniel Atallah <daniel.atallah@gmail.com>
parents:
20539
diff
changeset
|
89 g_free(state->who); |
0e1bc5c51030
A few leak plugs, some unnecessary allocation prevention, null pointer deref fixes and general robustness fixes. I'm sure there is more to do here, I got tired... Fixes #3308
Daniel Atallah <daniel.atallah@gmail.com>
parents:
20539
diff
changeset
|
90 g_free(state->uid); |
0e1bc5c51030
A few leak plugs, some unnecessary allocation prevention, null pointer deref fixes and general robustness fixes. I'm sure there is more to do here, I got tired... Fixes #3308
Daniel Atallah <daniel.atallah@gmail.com>
parents:
20539
diff
changeset
|
91 g_free(state->old_group_name); |
0e1bc5c51030
A few leak plugs, some unnecessary allocation prevention, null pointer deref fixes and general robustness fixes. I'm sure there is more to do here, I got tired... Fixes #3308
Daniel Atallah <daniel.atallah@gmail.com>
parents:
20539
diff
changeset
|
92 g_free(state->new_group_name); |
0e1bc5c51030
A few leak plugs, some unnecessary allocation prevention, null pointer deref fixes and general robustness fixes. I'm sure there is more to do here, I got tired... Fixes #3308
Daniel Atallah <daniel.atallah@gmail.com>
parents:
20539
diff
changeset
|
93 g_free(state->guid); |
23515
eb8bd060b987
Update MSN Contact tokens when an invalid token error is returned.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
23509
diff
changeset
|
94 xmlnode_free(state->body); |
20539
2c8c6d77f12c
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:
20501
diff
changeset
|
95 |
20481
eb93710aec4d
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:
20479
diff
changeset
|
96 g_free(state); |
eb93710aec4d
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:
20479
diff
changeset
|
97 } |
20666
0e1bc5c51030
A few leak plugs, some unnecessary allocation prevention, null pointer deref fixes and general robustness fixes. I'm sure there is more to do here, I got tired... Fixes #3308
Daniel Atallah <daniel.atallah@gmail.com>
parents:
20539
diff
changeset
|
98 |
20481
eb93710aec4d
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:
20479
diff
changeset
|
99 void |
eb93710aec4d
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:
20479
diff
changeset
|
100 msn_callback_state_set_who(MsnCallbackState *state, const gchar *who) |
eb93710aec4d
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:
20479
diff
changeset
|
101 { |
eb93710aec4d
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:
20479
diff
changeset
|
102 g_return_if_fail(state != NULL); |
20489
321d25932f5e
Fix a bug where we were g_strdup'ing a previously freed pointer. Thanks to khc for the debugging.
Carlos Silva <typ0@pidgin.im>
parents:
20486
diff
changeset
|
103 |
20666
0e1bc5c51030
A few leak plugs, some unnecessary allocation prevention, null pointer deref fixes and general robustness fixes. I'm sure there is more to do here, I got tired... Fixes #3308
Daniel Atallah <daniel.atallah@gmail.com>
parents:
20539
diff
changeset
|
104 g_free(state->who); |
22808
f62a4a7fe365
Fix a number of leaks. As far as I can tell, MSNP14 now logs in without
Daniel Atallah <daniel.atallah@gmail.com>
parents:
22805
diff
changeset
|
105 state->who = g_strdup(who); |
20481
eb93710aec4d
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:
20479
diff
changeset
|
106 } |
eb93710aec4d
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:
20479
diff
changeset
|
107 |
eb93710aec4d
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:
20479
diff
changeset
|
108 void |
20539
2c8c6d77f12c
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:
20501
diff
changeset
|
109 msn_callback_state_set_uid(MsnCallbackState *state, const gchar *uid) |
2c8c6d77f12c
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:
20501
diff
changeset
|
110 { |
20666
0e1bc5c51030
A few leak plugs, some unnecessary allocation prevention, null pointer deref fixes and general robustness fixes. I'm sure there is more to do here, I got tired... Fixes #3308
Daniel Atallah <daniel.atallah@gmail.com>
parents:
20539
diff
changeset
|
111 g_return_if_fail(state != NULL); |
20539
2c8c6d77f12c
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:
20501
diff
changeset
|
112 |
20666
0e1bc5c51030
A few leak plugs, some unnecessary allocation prevention, null pointer deref fixes and general robustness fixes. I'm sure there is more to do here, I got tired... Fixes #3308
Daniel Atallah <daniel.atallah@gmail.com>
parents:
20539
diff
changeset
|
113 g_free(state->uid); |
22808
f62a4a7fe365
Fix a number of leaks. As far as I can tell, MSNP14 now logs in without
Daniel Atallah <daniel.atallah@gmail.com>
parents:
22805
diff
changeset
|
114 state->uid = g_strdup(uid); |
20539
2c8c6d77f12c
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:
20501
diff
changeset
|
115 } |
2c8c6d77f12c
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:
20501
diff
changeset
|
116 |
2c8c6d77f12c
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:
20501
diff
changeset
|
117 void |
20481
eb93710aec4d
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:
20479
diff
changeset
|
118 msn_callback_state_set_old_group_name(MsnCallbackState *state, const gchar *old_group_name) |
eb93710aec4d
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:
20479
diff
changeset
|
119 { |
eb93710aec4d
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:
20479
diff
changeset
|
120 g_return_if_fail(state != NULL); |
20489
321d25932f5e
Fix a bug where we were g_strdup'ing a previously freed pointer. Thanks to khc for the debugging.
Carlos Silva <typ0@pidgin.im>
parents:
20486
diff
changeset
|
121 |
20666
0e1bc5c51030
A few leak plugs, some unnecessary allocation prevention, null pointer deref fixes and general robustness fixes. I'm sure there is more to do here, I got tired... Fixes #3308
Daniel Atallah <daniel.atallah@gmail.com>
parents:
20539
diff
changeset
|
122 g_free(state->old_group_name); |
22808
f62a4a7fe365
Fix a number of leaks. As far as I can tell, MSNP14 now logs in without
Daniel Atallah <daniel.atallah@gmail.com>
parents:
22805
diff
changeset
|
123 state->old_group_name = g_strdup(old_group_name); |
20481
eb93710aec4d
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:
20479
diff
changeset
|
124 } |
eb93710aec4d
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:
20479
diff
changeset
|
125 |
eb93710aec4d
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:
20479
diff
changeset
|
126 void |
eb93710aec4d
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:
20479
diff
changeset
|
127 msn_callback_state_set_new_group_name(MsnCallbackState *state, const gchar *new_group_name) |
eb93710aec4d
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:
20479
diff
changeset
|
128 { |
eb93710aec4d
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:
20479
diff
changeset
|
129 g_return_if_fail(state != NULL); |
20489
321d25932f5e
Fix a bug where we were g_strdup'ing a previously freed pointer. Thanks to khc for the debugging.
Carlos Silva <typ0@pidgin.im>
parents:
20486
diff
changeset
|
130 |
20666
0e1bc5c51030
A few leak plugs, some unnecessary allocation prevention, null pointer deref fixes and general robustness fixes. I'm sure there is more to do here, I got tired... Fixes #3308
Daniel Atallah <daniel.atallah@gmail.com>
parents:
20539
diff
changeset
|
131 g_free(state->new_group_name); |
22808
f62a4a7fe365
Fix a number of leaks. As far as I can tell, MSNP14 now logs in without
Daniel Atallah <daniel.atallah@gmail.com>
parents:
22805
diff
changeset
|
132 state->new_group_name = g_strdup(new_group_name); |
20481
eb93710aec4d
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:
20479
diff
changeset
|
133 } |
eb93710aec4d
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:
20479
diff
changeset
|
134 |
eb93710aec4d
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:
20479
diff
changeset
|
135 void |
eb93710aec4d
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:
20479
diff
changeset
|
136 msn_callback_state_set_guid(MsnCallbackState *state, const gchar *guid) |
eb93710aec4d
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:
20479
diff
changeset
|
137 { |
eb93710aec4d
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:
20479
diff
changeset
|
138 g_return_if_fail(state != NULL); |
20489
321d25932f5e
Fix a bug where we were g_strdup'ing a previously freed pointer. Thanks to khc for the debugging.
Carlos Silva <typ0@pidgin.im>
parents:
20486
diff
changeset
|
139 |
20666
0e1bc5c51030
A few leak plugs, some unnecessary allocation prevention, null pointer deref fixes and general robustness fixes. I'm sure there is more to do here, I got tired... Fixes #3308
Daniel Atallah <daniel.atallah@gmail.com>
parents:
20539
diff
changeset
|
140 g_free(state->guid); |
22808
f62a4a7fe365
Fix a number of leaks. As far as I can tell, MSNP14 now logs in without
Daniel Atallah <daniel.atallah@gmail.com>
parents:
22805
diff
changeset
|
141 state->guid = g_strdup(guid); |
20481
eb93710aec4d
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:
20479
diff
changeset
|
142 } |
eb93710aec4d
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:
20479
diff
changeset
|
143 |
eb93710aec4d
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:
20479
diff
changeset
|
144 |
eb93710aec4d
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:
20479
diff
changeset
|
145 void |
eb93710aec4d
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:
20479
diff
changeset
|
146 msn_callback_state_set_list_id(MsnCallbackState *state, MsnListId list_id) |
eb93710aec4d
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:
20479
diff
changeset
|
147 { |
eb93710aec4d
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:
20479
diff
changeset
|
148 g_return_if_fail(state != NULL); |
20666
0e1bc5c51030
A few leak plugs, some unnecessary allocation prevention, null pointer deref fixes and general robustness fixes. I'm sure there is more to do here, I got tired... Fixes #3308
Daniel Atallah <daniel.atallah@gmail.com>
parents:
20539
diff
changeset
|
149 |
20481
eb93710aec4d
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:
20479
diff
changeset
|
150 state->list_id = list_id; |
eb93710aec4d
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:
20479
diff
changeset
|
151 } |
eb93710aec4d
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:
20479
diff
changeset
|
152 |
eb93710aec4d
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:
20479
diff
changeset
|
153 void |
eb93710aec4d
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:
20479
diff
changeset
|
154 msn_callback_state_set_action(MsnCallbackState *state, MsnCallbackAction action) |
eb93710aec4d
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:
20479
diff
changeset
|
155 { |
eb93710aec4d
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:
20479
diff
changeset
|
156 g_return_if_fail(state != NULL); |
20666
0e1bc5c51030
A few leak plugs, some unnecessary allocation prevention, null pointer deref fixes and general robustness fixes. I'm sure there is more to do here, I got tired... Fixes #3308
Daniel Atallah <daniel.atallah@gmail.com>
parents:
20539
diff
changeset
|
157 |
20481
eb93710aec4d
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:
20479
diff
changeset
|
158 state->action |= action; |
eb93710aec4d
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:
20479
diff
changeset
|
159 } |
20394
4a099e4d0d09
propagate from branch 'im.pidgin.pidgin' (head 98b6b547b29ea1192b73cc4e1de1e674edef4328)
Richard Laager <rlaager@wiktel.com>
parents:
diff
changeset
|
160 |
4a099e4d0d09
propagate from branch 'im.pidgin.pidgin' (head 98b6b547b29ea1192b73cc4e1de1e674edef4328)
Richard Laager <rlaager@wiktel.com>
parents:
diff
changeset
|
161 /*get MSN member role utility*/ |
20486
ff4ae9dde291
Make block/unblock work right, as well as being add by a buddy. Finally fixes #723
Carlos Silva <typ0@pidgin.im>
parents:
20484
diff
changeset
|
162 static MsnListId |
20789 | 163 msn_get_memberrole(const char *role) |
20394
4a099e4d0d09
propagate from branch 'im.pidgin.pidgin' (head 98b6b547b29ea1192b73cc4e1de1e674edef4328)
Richard Laager <rlaager@wiktel.com>
parents:
diff
changeset
|
164 { |
20666
0e1bc5c51030
A few leak plugs, some unnecessary allocation prevention, null pointer deref fixes and general robustness fixes. I'm sure there is more to do here, I got tired... Fixes #3308
Daniel Atallah <daniel.atallah@gmail.com>
parents:
20539
diff
changeset
|
165 g_return_val_if_fail(role != NULL, 0); |
0e1bc5c51030
A few leak plugs, some unnecessary allocation prevention, null pointer deref fixes and general robustness fixes. I'm sure there is more to do here, I got tired... Fixes #3308
Daniel Atallah <daniel.atallah@gmail.com>
parents:
20539
diff
changeset
|
166 |
20481
eb93710aec4d
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:
20479
diff
changeset
|
167 if (!strcmp(role,"Allow")) { |
20486
ff4ae9dde291
Make block/unblock work right, as well as being add by a buddy. Finally fixes #723
Carlos Silva <typ0@pidgin.im>
parents:
20484
diff
changeset
|
168 return MSN_LIST_AL; |
20481
eb93710aec4d
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:
20479
diff
changeset
|
169 } else if (!strcmp(role,"Block")) { |
20486
ff4ae9dde291
Make block/unblock work right, as well as being add by a buddy. Finally fixes #723
Carlos Silva <typ0@pidgin.im>
parents:
20484
diff
changeset
|
170 return MSN_LIST_BL; |
20481
eb93710aec4d
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:
20479
diff
changeset
|
171 } else if (!strcmp(role,"Reverse")) { |
20486
ff4ae9dde291
Make block/unblock work right, as well as being add by a buddy. Finally fixes #723
Carlos Silva <typ0@pidgin.im>
parents:
20484
diff
changeset
|
172 return MSN_LIST_RL; |
20481
eb93710aec4d
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:
20479
diff
changeset
|
173 } else if (!strcmp(role,"Pending")) { |
20486
ff4ae9dde291
Make block/unblock work right, as well as being add by a buddy. Finally fixes #723
Carlos Silva <typ0@pidgin.im>
parents:
20484
diff
changeset
|
174 return MSN_LIST_PL; |
20394
4a099e4d0d09
propagate from branch 'im.pidgin.pidgin' (head 98b6b547b29ea1192b73cc4e1de1e674edef4328)
Richard Laager <rlaager@wiktel.com>
parents:
diff
changeset
|
175 } |
4a099e4d0d09
propagate from branch 'im.pidgin.pidgin' (head 98b6b547b29ea1192b73cc4e1de1e674edef4328)
Richard Laager <rlaager@wiktel.com>
parents:
diff
changeset
|
176 return 0; |
4a099e4d0d09
propagate from branch 'im.pidgin.pidgin' (head 98b6b547b29ea1192b73cc4e1de1e674edef4328)
Richard Laager <rlaager@wiktel.com>
parents:
diff
changeset
|
177 } |
4a099e4d0d09
propagate from branch 'im.pidgin.pidgin' (head 98b6b547b29ea1192b73cc4e1de1e674edef4328)
Richard Laager <rlaager@wiktel.com>
parents:
diff
changeset
|
178 |
23523
31b5a1334e7e
Modifications to the MSN code for some stuff I'll be doing in later
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
23517
diff
changeset
|
179 /* get Network */ |
31b5a1334e7e
Modifications to the MSN code for some stuff I'll be doing in later
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
23517
diff
changeset
|
180 /* QuLogic: These names don't really refer to the MsnNetwork, |
31b5a1334e7e
Modifications to the MSN code for some stuff I'll be doing in later
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
23517
diff
changeset
|
181 * but I haven't yet written the code to properly use them. |
31b5a1334e7e
Modifications to the MSN code for some stuff I'll be doing in later
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
23517
diff
changeset
|
182 */ |
31b5a1334e7e
Modifications to the MSN code for some stuff I'll be doing in later
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
23517
diff
changeset
|
183 static MsnNetwork |
31b5a1334e7e
Modifications to the MSN code for some stuff I'll be doing in later
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
23517
diff
changeset
|
184 msn_get_network(char *type) |
20394
4a099e4d0d09
propagate from branch 'im.pidgin.pidgin' (head 98b6b547b29ea1192b73cc4e1de1e674edef4328)
Richard Laager <rlaager@wiktel.com>
parents:
diff
changeset
|
185 { |
20666
0e1bc5c51030
A few leak plugs, some unnecessary allocation prevention, null pointer deref fixes and general robustness fixes. I'm sure there is more to do here, I got tired... Fixes #3308
Daniel Atallah <daniel.atallah@gmail.com>
parents:
20539
diff
changeset
|
186 g_return_val_if_fail(type != NULL, 0); |
0e1bc5c51030
A few leak plugs, some unnecessary allocation prevention, null pointer deref fixes and general robustness fixes. I'm sure there is more to do here, I got tired... Fixes #3308
Daniel Atallah <daniel.atallah@gmail.com>
parents:
20539
diff
changeset
|
187 |
20481
eb93710aec4d
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:
20479
diff
changeset
|
188 if (!strcmp(type,"Regular")) { |
23523
31b5a1334e7e
Modifications to the MSN code for some stuff I'll be doing in later
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
23517
diff
changeset
|
189 return MSN_NETWORK_PASSPORT; |
20394
4a099e4d0d09
propagate from branch 'im.pidgin.pidgin' (head 98b6b547b29ea1192b73cc4e1de1e674edef4328)
Richard Laager <rlaager@wiktel.com>
parents:
diff
changeset
|
190 } |
20481
eb93710aec4d
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:
20479
diff
changeset
|
191 if (!strcmp(type,"Live")) { |
23523
31b5a1334e7e
Modifications to the MSN code for some stuff I'll be doing in later
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
23517
diff
changeset
|
192 return MSN_NETWORK_PASSPORT; |
20394
4a099e4d0d09
propagate from branch 'im.pidgin.pidgin' (head 98b6b547b29ea1192b73cc4e1de1e674edef4328)
Richard Laager <rlaager@wiktel.com>
parents:
diff
changeset
|
193 } |
20481
eb93710aec4d
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:
20479
diff
changeset
|
194 if (!strcmp(type,"LivePending")) { |
23523
31b5a1334e7e
Modifications to the MSN code for some stuff I'll be doing in later
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
23517
diff
changeset
|
195 return MSN_NETWORK_PASSPORT; |
20394
4a099e4d0d09
propagate from branch 'im.pidgin.pidgin' (head 98b6b547b29ea1192b73cc4e1de1e674edef4328)
Richard Laager <rlaager@wiktel.com>
parents:
diff
changeset
|
196 } |
4a099e4d0d09
propagate from branch 'im.pidgin.pidgin' (head 98b6b547b29ea1192b73cc4e1de1e674edef4328)
Richard Laager <rlaager@wiktel.com>
parents:
diff
changeset
|
197 |
23523
31b5a1334e7e
Modifications to the MSN code for some stuff I'll be doing in later
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
23517
diff
changeset
|
198 return MSN_NETWORK_UNKNOWN; |
20394
4a099e4d0d09
propagate from branch 'im.pidgin.pidgin' (head 98b6b547b29ea1192b73cc4e1de1e674edef4328)
Richard Laager <rlaager@wiktel.com>
parents:
diff
changeset
|
199 } |
4a099e4d0d09
propagate from branch 'im.pidgin.pidgin' (head 98b6b547b29ea1192b73cc4e1de1e674edef4328)
Richard Laager <rlaager@wiktel.com>
parents:
diff
changeset
|
200 |
20477
9a2a4a0c0003
Add the possibility to create an Address Book, useful for newly registered MSN users.
Carlos Silva <typ0@pidgin.im>
parents:
20471
diff
changeset
|
201 /* Create the AddressBook in the server, if we don't have one */ |
9a2a4a0c0003
Add the possibility to create an Address Book, useful for newly registered MSN users.
Carlos Silva <typ0@pidgin.im>
parents:
20471
diff
changeset
|
202 static void |
20538
90fd0826c6ce
finish converting the rest of stuff to the new soap api, signing on, getting
Ka-Hing Cheung <khc@hxbc.us>
parents:
20501
diff
changeset
|
203 msn_create_address_cb(MsnSoapMessage *req, MsnSoapMessage *resp, gpointer data) |
20477
9a2a4a0c0003
Add the possibility to create an Address Book, useful for newly registered MSN users.
Carlos Silva <typ0@pidgin.im>
parents:
20471
diff
changeset
|
204 { |
23498
bca58b00afab
References #4382, replaces usage of msn_soap_xml_get with xmlnode_get_child
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
23492
diff
changeset
|
205 if (resp && xmlnode_get_child(resp->xml, "Body/Fault") == NULL) { |
23564
7bceac816e19
The great MSN debug message cleanup! Threw in a few whitespace fixes,
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
23552
diff
changeset
|
206 purple_debug_info("msn", "Address Book successfully created!\n"); |
23504
69af5301e1a7
killing MsnContact which just wraps MsnSession
Ka-Hing Cheung <khc@hxbc.us>
parents:
23498
diff
changeset
|
207 msn_get_address_book((MsnSession *)data, MSN_PS_INITIAL, NULL, NULL); |
20538
90fd0826c6ce
finish converting the rest of stuff to the new soap api, signing on, getting
Ka-Hing Cheung <khc@hxbc.us>
parents:
20501
diff
changeset
|
208 } else { |
23564
7bceac816e19
The great MSN debug message cleanup! Threw in a few whitespace fixes,
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
23552
diff
changeset
|
209 purple_debug_info("msn", "Address Book creation failed!\n"); |
20538
90fd0826c6ce
finish converting the rest of stuff to the new soap api, signing on, getting
Ka-Hing Cheung <khc@hxbc.us>
parents:
20501
diff
changeset
|
210 } |
20477
9a2a4a0c0003
Add the possibility to create an Address Book, useful for newly registered MSN users.
Carlos Silva <typ0@pidgin.im>
parents:
20471
diff
changeset
|
211 } |
9a2a4a0c0003
Add the possibility to create an Address Book, useful for newly registered MSN users.
Carlos Silva <typ0@pidgin.im>
parents:
20471
diff
changeset
|
212 |
9a2a4a0c0003
Add the possibility to create an Address Book, useful for newly registered MSN users.
Carlos Silva <typ0@pidgin.im>
parents:
20471
diff
changeset
|
213 static void |
23504
69af5301e1a7
killing MsnContact which just wraps MsnSession
Ka-Hing Cheung <khc@hxbc.us>
parents:
23498
diff
changeset
|
214 msn_create_address_book(MsnSession *session) |
20477
9a2a4a0c0003
Add the possibility to create an Address Book, useful for newly registered MSN users.
Carlos Silva <typ0@pidgin.im>
parents:
20471
diff
changeset
|
215 { |
9a2a4a0c0003
Add the possibility to create an Address Book, useful for newly registered MSN users.
Carlos Silva <typ0@pidgin.im>
parents:
20471
diff
changeset
|
216 gchar *body; |
9a2a4a0c0003
Add the possibility to create an Address Book, useful for newly registered MSN users.
Carlos Silva <typ0@pidgin.im>
parents:
20471
diff
changeset
|
217 |
23504
69af5301e1a7
killing MsnContact which just wraps MsnSession
Ka-Hing Cheung <khc@hxbc.us>
parents:
23498
diff
changeset
|
218 g_return_if_fail(session != NULL); |
69af5301e1a7
killing MsnContact which just wraps MsnSession
Ka-Hing Cheung <khc@hxbc.us>
parents:
23498
diff
changeset
|
219 g_return_if_fail(session->user != NULL); |
69af5301e1a7
killing MsnContact which just wraps MsnSession
Ka-Hing Cheung <khc@hxbc.us>
parents:
23498
diff
changeset
|
220 g_return_if_fail(session->user->passport != NULL); |
20481
eb93710aec4d
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:
20479
diff
changeset
|
221 |
23564
7bceac816e19
The great MSN debug message cleanup! Threw in a few whitespace fixes,
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
23552
diff
changeset
|
222 purple_debug_info("msn", "Creating an Address Book.\n"); |
20477
9a2a4a0c0003
Add the possibility to create an Address Book, useful for newly registered MSN users.
Carlos Silva <typ0@pidgin.im>
parents:
20471
diff
changeset
|
223 |
23515
eb8bd060b987
Update MSN Contact tokens when an invalid token error is returned.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
23509
diff
changeset
|
224 body = g_markup_printf_escaped(MSN_ADD_ADDRESSBOOK_TEMPLATE, |
23504
69af5301e1a7
killing MsnContact which just wraps MsnSession
Ka-Hing Cheung <khc@hxbc.us>
parents:
23498
diff
changeset
|
225 msn_nexus_get_token_str(session->nexus, MSN_AUTH_CONTACTS), |
69af5301e1a7
killing MsnContact which just wraps MsnSession
Ka-Hing Cheung <khc@hxbc.us>
parents:
23498
diff
changeset
|
226 session->user->passport); |
20477
9a2a4a0c0003
Add the possibility to create an Address Book, useful for newly registered MSN users.
Carlos Silva <typ0@pidgin.im>
parents:
20471
diff
changeset
|
227 |
23504
69af5301e1a7
killing MsnContact which just wraps MsnSession
Ka-Hing Cheung <khc@hxbc.us>
parents:
23498
diff
changeset
|
228 msn_soap_message_send(session, |
20538
90fd0826c6ce
finish converting the rest of stuff to the new soap api, signing on, getting
Ka-Hing Cheung <khc@hxbc.us>
parents:
20501
diff
changeset
|
229 msn_soap_message_new(MSN_ADD_ADDRESSBOOK_SOAP_ACTION, |
90fd0826c6ce
finish converting the rest of stuff to the new soap api, signing on, getting
Ka-Hing Cheung <khc@hxbc.us>
parents:
20501
diff
changeset
|
230 xmlnode_from_str(body, -1)), |
90fd0826c6ce
finish converting the rest of stuff to the new soap api, signing on, getting
Ka-Hing Cheung <khc@hxbc.us>
parents:
20501
diff
changeset
|
231 MSN_CONTACT_SERVER, MSN_ADDRESS_BOOK_POST_URL, msn_create_address_cb, |
23504
69af5301e1a7
killing MsnContact which just wraps MsnSession
Ka-Hing Cheung <khc@hxbc.us>
parents:
23498
diff
changeset
|
232 session); |
20477
9a2a4a0c0003
Add the possibility to create an Address Book, useful for newly registered MSN users.
Carlos Silva <typ0@pidgin.im>
parents:
20471
diff
changeset
|
233 |
9a2a4a0c0003
Add the possibility to create an Address Book, useful for newly registered MSN users.
Carlos Silva <typ0@pidgin.im>
parents:
20471
diff
changeset
|
234 g_free(body); |
20538
90fd0826c6ce
finish converting the rest of stuff to the new soap api, signing on, getting
Ka-Hing Cheung <khc@hxbc.us>
parents:
20501
diff
changeset
|
235 } |
90fd0826c6ce
finish converting the rest of stuff to the new soap api, signing on, getting
Ka-Hing Cheung <khc@hxbc.us>
parents:
20501
diff
changeset
|
236 |
90fd0826c6ce
finish converting the rest of stuff to the new soap api, signing on, getting
Ka-Hing Cheung <khc@hxbc.us>
parents:
20501
diff
changeset
|
237 static void |
90fd0826c6ce
finish converting the rest of stuff to the new soap api, signing on, getting
Ka-Hing Cheung <khc@hxbc.us>
parents:
20501
diff
changeset
|
238 msn_parse_each_member(MsnSession *session, xmlnode *member, const char *node, |
90fd0826c6ce
finish converting the rest of stuff to the new soap api, signing on, getting
Ka-Hing Cheung <khc@hxbc.us>
parents:
20501
diff
changeset
|
239 MsnListId list) |
90fd0826c6ce
finish converting the rest of stuff to the new soap api, signing on, getting
Ka-Hing Cheung <khc@hxbc.us>
parents:
20501
diff
changeset
|
240 { |
90fd0826c6ce
finish converting the rest of stuff to the new soap api, signing on, getting
Ka-Hing Cheung <khc@hxbc.us>
parents:
20501
diff
changeset
|
241 char *passport = xmlnode_get_data(xmlnode_get_child(member, node)); |
21127 | 242 char *type = xmlnode_get_data(xmlnode_get_child(member, "Type")); |
20538
90fd0826c6ce
finish converting the rest of stuff to the new soap api, signing on, getting
Ka-Hing Cheung <khc@hxbc.us>
parents:
20501
diff
changeset
|
243 char *member_id = xmlnode_get_data(xmlnode_get_child(member, "MembershipId")); |
90fd0826c6ce
finish converting the rest of stuff to the new soap api, signing on, getting
Ka-Hing Cheung <khc@hxbc.us>
parents:
20501
diff
changeset
|
244 MsnUser *user = msn_userlist_find_add_user(session->userlist, passport, NULL); |
90fd0826c6ce
finish converting the rest of stuff to the new soap api, signing on, getting
Ka-Hing Cheung <khc@hxbc.us>
parents:
20501
diff
changeset
|
245 |
23564
7bceac816e19
The great MSN debug message cleanup! Threw in a few whitespace fixes,
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
23552
diff
changeset
|
246 purple_debug_info("msn", "CL: %s name: %s, Type: %s, MembershipID: %s\n", |
21127 | 247 node, passport, type, member_id == NULL ? "(null)" : member_id); |
20538
90fd0826c6ce
finish converting the rest of stuff to the new soap api, signing on, getting
Ka-Hing Cheung <khc@hxbc.us>
parents:
20501
diff
changeset
|
248 |
90fd0826c6ce
finish converting the rest of stuff to the new soap api, signing on, getting
Ka-Hing Cheung <khc@hxbc.us>
parents:
20501
diff
changeset
|
249 if (member_id) { |
90fd0826c6ce
finish converting the rest of stuff to the new soap api, signing on, getting
Ka-Hing Cheung <khc@hxbc.us>
parents:
20501
diff
changeset
|
250 user->membership_id[list] = atoi(member_id); |
90fd0826c6ce
finish converting the rest of stuff to the new soap api, signing on, getting
Ka-Hing Cheung <khc@hxbc.us>
parents:
20501
diff
changeset
|
251 } |
90fd0826c6ce
finish converting the rest of stuff to the new soap api, signing on, getting
Ka-Hing Cheung <khc@hxbc.us>
parents:
20501
diff
changeset
|
252 |
23300
5cdd93dac7a2
Delete trailing whitespace
Mark Doliner <mark@kingant.net>
parents:
22808
diff
changeset
|
253 msn_got_lst_user(session, user, 1 << list, NULL); |
20538
90fd0826c6ce
finish converting the rest of stuff to the new soap api, signing on, getting
Ka-Hing Cheung <khc@hxbc.us>
parents:
20501
diff
changeset
|
254 |
90fd0826c6ce
finish converting the rest of stuff to the new soap api, signing on, getting
Ka-Hing Cheung <khc@hxbc.us>
parents:
20501
diff
changeset
|
255 g_free(passport); |
90fd0826c6ce
finish converting the rest of stuff to the new soap api, signing on, getting
Ka-Hing Cheung <khc@hxbc.us>
parents:
20501
diff
changeset
|
256 g_free(type); |
90fd0826c6ce
finish converting the rest of stuff to the new soap api, signing on, getting
Ka-Hing Cheung <khc@hxbc.us>
parents:
20501
diff
changeset
|
257 g_free(member_id); |
90fd0826c6ce
finish converting the rest of stuff to the new soap api, signing on, getting
Ka-Hing Cheung <khc@hxbc.us>
parents:
20501
diff
changeset
|
258 } |
90fd0826c6ce
finish converting the rest of stuff to the new soap api, signing on, getting
Ka-Hing Cheung <khc@hxbc.us>
parents:
20501
diff
changeset
|
259 |
90fd0826c6ce
finish converting the rest of stuff to the new soap api, signing on, getting
Ka-Hing Cheung <khc@hxbc.us>
parents:
20501
diff
changeset
|
260 static void |
90fd0826c6ce
finish converting the rest of stuff to the new soap api, signing on, getting
Ka-Hing Cheung <khc@hxbc.us>
parents:
20501
diff
changeset
|
261 msn_parse_each_service(MsnSession *session, xmlnode *service) |
90fd0826c6ce
finish converting the rest of stuff to the new soap api, signing on, getting
Ka-Hing Cheung <khc@hxbc.us>
parents:
20501
diff
changeset
|
262 { |
90fd0826c6ce
finish converting the rest of stuff to the new soap api, signing on, getting
Ka-Hing Cheung <khc@hxbc.us>
parents:
20501
diff
changeset
|
263 xmlnode *type; |
90fd0826c6ce
finish converting the rest of stuff to the new soap api, signing on, getting
Ka-Hing Cheung <khc@hxbc.us>
parents:
20501
diff
changeset
|
264 |
23498
bca58b00afab
References #4382, replaces usage of msn_soap_xml_get with xmlnode_get_child
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
23492
diff
changeset
|
265 if ((type = xmlnode_get_child(service, "Info/Handle/Type"))) { |
20538
90fd0826c6ce
finish converting the rest of stuff to the new soap api, signing on, getting
Ka-Hing Cheung <khc@hxbc.us>
parents:
20501
diff
changeset
|
266 char *type_str = xmlnode_get_data(type); |
90fd0826c6ce
finish converting the rest of stuff to the new soap api, signing on, getting
Ka-Hing Cheung <khc@hxbc.us>
parents:
20501
diff
changeset
|
267 |
90fd0826c6ce
finish converting the rest of stuff to the new soap api, signing on, getting
Ka-Hing Cheung <khc@hxbc.us>
parents:
20501
diff
changeset
|
268 if (g_str_equal(type_str, "Profile")) { |
90fd0826c6ce
finish converting the rest of stuff to the new soap api, signing on, getting
Ka-Hing Cheung <khc@hxbc.us>
parents:
20501
diff
changeset
|
269 /* Process Windows Live 'Messenger Roaming Identity' */ |
90fd0826c6ce
finish converting the rest of stuff to the new soap api, signing on, getting
Ka-Hing Cheung <khc@hxbc.us>
parents:
20501
diff
changeset
|
270 } else if (g_str_equal(type_str, "Messenger")) { |
90fd0826c6ce
finish converting the rest of stuff to the new soap api, signing on, getting
Ka-Hing Cheung <khc@hxbc.us>
parents:
20501
diff
changeset
|
271 xmlnode *lastchange = xmlnode_get_child(service, "LastChange"); |
90fd0826c6ce
finish converting the rest of stuff to the new soap api, signing on, getting
Ka-Hing Cheung <khc@hxbc.us>
parents:
20501
diff
changeset
|
272 char *lastchange_str = xmlnode_get_data(lastchange); |
90fd0826c6ce
finish converting the rest of stuff to the new soap api, signing on, getting
Ka-Hing Cheung <khc@hxbc.us>
parents:
20501
diff
changeset
|
273 xmlnode *membership; |
90fd0826c6ce
finish converting the rest of stuff to the new soap api, signing on, getting
Ka-Hing Cheung <khc@hxbc.us>
parents:
20501
diff
changeset
|
274 |
23564
7bceac816e19
The great MSN debug message cleanup! Threw in a few whitespace fixes,
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
23552
diff
changeset
|
275 purple_debug_info("msn", "CL last change: %s\n", lastchange_str); |
20538
90fd0826c6ce
finish converting the rest of stuff to the new soap api, signing on, getting
Ka-Hing Cheung <khc@hxbc.us>
parents:
20501
diff
changeset
|
276 purple_account_set_string(session->account, "CLLastChange", |
90fd0826c6ce
finish converting the rest of stuff to the new soap api, signing on, getting
Ka-Hing Cheung <khc@hxbc.us>
parents:
20501
diff
changeset
|
277 lastchange_str); |
90fd0826c6ce
finish converting the rest of stuff to the new soap api, signing on, getting
Ka-Hing Cheung <khc@hxbc.us>
parents:
20501
diff
changeset
|
278 |
23498
bca58b00afab
References #4382, replaces usage of msn_soap_xml_get with xmlnode_get_child
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
23492
diff
changeset
|
279 for (membership = xmlnode_get_child(service, |
20538
90fd0826c6ce
finish converting the rest of stuff to the new soap api, signing on, getting
Ka-Hing Cheung <khc@hxbc.us>
parents:
20501
diff
changeset
|
280 "Memberships/Membership"); |
90fd0826c6ce
finish converting the rest of stuff to the new soap api, signing on, getting
Ka-Hing Cheung <khc@hxbc.us>
parents:
20501
diff
changeset
|
281 membership; membership = xmlnode_get_next_twin(membership)) { |
90fd0826c6ce
finish converting the rest of stuff to the new soap api, signing on, getting
Ka-Hing Cheung <khc@hxbc.us>
parents:
20501
diff
changeset
|
282 |
90fd0826c6ce
finish converting the rest of stuff to the new soap api, signing on, getting
Ka-Hing Cheung <khc@hxbc.us>
parents:
20501
diff
changeset
|
283 xmlnode *role = xmlnode_get_child(membership, "MemberRole"); |
90fd0826c6ce
finish converting the rest of stuff to the new soap api, signing on, getting
Ka-Hing Cheung <khc@hxbc.us>
parents:
20501
diff
changeset
|
284 char *role_str = xmlnode_get_data(role); |
90fd0826c6ce
finish converting the rest of stuff to the new soap api, signing on, getting
Ka-Hing Cheung <khc@hxbc.us>
parents:
20501
diff
changeset
|
285 MsnListId list = msn_get_memberrole(role_str); |
90fd0826c6ce
finish converting the rest of stuff to the new soap api, signing on, getting
Ka-Hing Cheung <khc@hxbc.us>
parents:
20501
diff
changeset
|
286 xmlnode *member; |
90fd0826c6ce
finish converting the rest of stuff to the new soap api, signing on, getting
Ka-Hing Cheung <khc@hxbc.us>
parents:
20501
diff
changeset
|
287 |
23564
7bceac816e19
The great MSN debug message cleanup! Threw in a few whitespace fixes,
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
23552
diff
changeset
|
288 purple_debug_info("msn", "CL MemberRole role: %s, list: %d\n", |
21127 | 289 role_str, list); |
20538
90fd0826c6ce
finish converting the rest of stuff to the new soap api, signing on, getting
Ka-Hing Cheung <khc@hxbc.us>
parents:
20501
diff
changeset
|
290 |
23498
bca58b00afab
References #4382, replaces usage of msn_soap_xml_get with xmlnode_get_child
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
23492
diff
changeset
|
291 for (member = xmlnode_get_child(membership, "Members/Member"); |
20538
90fd0826c6ce
finish converting the rest of stuff to the new soap api, signing on, getting
Ka-Hing Cheung <khc@hxbc.us>
parents:
20501
diff
changeset
|
292 member; member = xmlnode_get_next_twin(member)) { |
90fd0826c6ce
finish converting the rest of stuff to the new soap api, signing on, getting
Ka-Hing Cheung <khc@hxbc.us>
parents:
20501
diff
changeset
|
293 const char *member_type = xmlnode_get_attrib(member, "type"); |
90fd0826c6ce
finish converting the rest of stuff to the new soap api, signing on, getting
Ka-Hing Cheung <khc@hxbc.us>
parents:
20501
diff
changeset
|
294 if (g_str_equal(member_type, "PassportMember")) { |
90fd0826c6ce
finish converting the rest of stuff to the new soap api, signing on, getting
Ka-Hing Cheung <khc@hxbc.us>
parents:
20501
diff
changeset
|
295 msn_parse_each_member(session, member, "PassportName", |
90fd0826c6ce
finish converting the rest of stuff to the new soap api, signing on, getting
Ka-Hing Cheung <khc@hxbc.us>
parents:
20501
diff
changeset
|
296 list); |
90fd0826c6ce
finish converting the rest of stuff to the new soap api, signing on, getting
Ka-Hing Cheung <khc@hxbc.us>
parents:
20501
diff
changeset
|
297 } else if (g_str_equal(member_type, "PhoneMember")) { |
90fd0826c6ce
finish converting the rest of stuff to the new soap api, signing on, getting
Ka-Hing Cheung <khc@hxbc.us>
parents:
20501
diff
changeset
|
298 |
90fd0826c6ce
finish converting the rest of stuff to the new soap api, signing on, getting
Ka-Hing Cheung <khc@hxbc.us>
parents:
20501
diff
changeset
|
299 } else if (g_str_equal(member_type, "EmailMember")) { |
90fd0826c6ce
finish converting the rest of stuff to the new soap api, signing on, getting
Ka-Hing Cheung <khc@hxbc.us>
parents:
20501
diff
changeset
|
300 msn_parse_each_member(session, member, "Email", list); |
90fd0826c6ce
finish converting the rest of stuff to the new soap api, signing on, getting
Ka-Hing Cheung <khc@hxbc.us>
parents:
20501
diff
changeset
|
301 } |
90fd0826c6ce
finish converting the rest of stuff to the new soap api, signing on, getting
Ka-Hing Cheung <khc@hxbc.us>
parents:
20501
diff
changeset
|
302 } |
90fd0826c6ce
finish converting the rest of stuff to the new soap api, signing on, getting
Ka-Hing Cheung <khc@hxbc.us>
parents:
20501
diff
changeset
|
303 |
90fd0826c6ce
finish converting the rest of stuff to the new soap api, signing on, getting
Ka-Hing Cheung <khc@hxbc.us>
parents:
20501
diff
changeset
|
304 g_free(role_str); |
90fd0826c6ce
finish converting the rest of stuff to the new soap api, signing on, getting
Ka-Hing Cheung <khc@hxbc.us>
parents:
20501
diff
changeset
|
305 } |
90fd0826c6ce
finish converting the rest of stuff to the new soap api, signing on, getting
Ka-Hing Cheung <khc@hxbc.us>
parents:
20501
diff
changeset
|
306 |
90fd0826c6ce
finish converting the rest of stuff to the new soap api, signing on, getting
Ka-Hing Cheung <khc@hxbc.us>
parents:
20501
diff
changeset
|
307 g_free(lastchange_str); |
90fd0826c6ce
finish converting the rest of stuff to the new soap api, signing on, getting
Ka-Hing Cheung <khc@hxbc.us>
parents:
20501
diff
changeset
|
308 } |
90fd0826c6ce
finish converting the rest of stuff to the new soap api, signing on, getting
Ka-Hing Cheung <khc@hxbc.us>
parents:
20501
diff
changeset
|
309 |
90fd0826c6ce
finish converting the rest of stuff to the new soap api, signing on, getting
Ka-Hing Cheung <khc@hxbc.us>
parents:
20501
diff
changeset
|
310 g_free(type_str); |
90fd0826c6ce
finish converting the rest of stuff to the new soap api, signing on, getting
Ka-Hing Cheung <khc@hxbc.us>
parents:
20501
diff
changeset
|
311 } |
20477
9a2a4a0c0003
Add the possibility to create an Address Book, useful for newly registered MSN users.
Carlos Silva <typ0@pidgin.im>
parents:
20471
diff
changeset
|
312 } |
9a2a4a0c0003
Add the possibility to create an Address Book, useful for newly registered MSN users.
Carlos Silva <typ0@pidgin.im>
parents:
20471
diff
changeset
|
313 |
20394
4a099e4d0d09
propagate from branch 'im.pidgin.pidgin' (head 98b6b547b29ea1192b73cc4e1de1e674edef4328)
Richard Laager <rlaager@wiktel.com>
parents:
diff
changeset
|
314 /*parse contact list*/ |
4a099e4d0d09
propagate from branch 'im.pidgin.pidgin' (head 98b6b547b29ea1192b73cc4e1de1e674edef4328)
Richard Laager <rlaager@wiktel.com>
parents:
diff
changeset
|
315 static void |
23504
69af5301e1a7
killing MsnContact which just wraps MsnSession
Ka-Hing Cheung <khc@hxbc.us>
parents:
23498
diff
changeset
|
316 msn_parse_contact_list(MsnSession *session, xmlnode *node) |
20394
4a099e4d0d09
propagate from branch 'im.pidgin.pidgin' (head 98b6b547b29ea1192b73cc4e1de1e674edef4328)
Richard Laager <rlaager@wiktel.com>
parents:
diff
changeset
|
317 { |
20538
90fd0826c6ce
finish converting the rest of stuff to the new soap api, signing on, getting
Ka-Hing Cheung <khc@hxbc.us>
parents:
20501
diff
changeset
|
318 xmlnode *fault, *faultnode; |
20467
86da6ab1f612
Correctly process an additional <Service> with type Profile and name 'Messenger Roaming Identity' sent with the contact list using a recently registered WLM account, that was causing the initial ADL command to be sent malformed, and our presence status not being forwarded to our buddies
Carlos Silva <typ0@pidgin.im>
parents:
20466
diff
changeset
|
319 |
20538
90fd0826c6ce
finish converting the rest of stuff to the new soap api, signing on, getting
Ka-Hing Cheung <khc@hxbc.us>
parents:
20501
diff
changeset
|
320 /* we may get a response if our cache data is too old: |
90fd0826c6ce
finish converting the rest of stuff to the new soap api, signing on, getting
Ka-Hing Cheung <khc@hxbc.us>
parents:
20501
diff
changeset
|
321 * |
90fd0826c6ce
finish converting the rest of stuff to the new soap api, signing on, getting
Ka-Hing Cheung <khc@hxbc.us>
parents:
20501
diff
changeset
|
322 * <faultstring>Need to do full sync. Can't sync deltas Client |
90fd0826c6ce
finish converting the rest of stuff to the new soap api, signing on, getting
Ka-Hing Cheung <khc@hxbc.us>
parents:
20501
diff
changeset
|
323 * has too old a copy for us to do a delta sync</faultstring> |
90fd0826c6ce
finish converting the rest of stuff to the new soap api, signing on, getting
Ka-Hing Cheung <khc@hxbc.us>
parents:
20501
diff
changeset
|
324 * |
90fd0826c6ce
finish converting the rest of stuff to the new soap api, signing on, getting
Ka-Hing Cheung <khc@hxbc.us>
parents:
20501
diff
changeset
|
325 * this is not handled yet |
90fd0826c6ce
finish converting the rest of stuff to the new soap api, signing on, getting
Ka-Hing Cheung <khc@hxbc.us>
parents:
20501
diff
changeset
|
326 */ |
23498
bca58b00afab
References #4382, replaces usage of msn_soap_xml_get with xmlnode_get_child
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
23492
diff
changeset
|
327 if ((fault = xmlnode_get_child(node, "Body/Fault"))) { |
20538
90fd0826c6ce
finish converting the rest of stuff to the new soap api, signing on, getting
Ka-Hing Cheung <khc@hxbc.us>
parents:
20501
diff
changeset
|
328 if ((faultnode = xmlnode_get_child(fault, "faultstring"))) { |
90fd0826c6ce
finish converting the rest of stuff to the new soap api, signing on, getting
Ka-Hing Cheung <khc@hxbc.us>
parents:
20501
diff
changeset
|
329 char *faultstring = xmlnode_get_data(faultnode); |
23564
7bceac816e19
The great MSN debug message cleanup! Threw in a few whitespace fixes,
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
23552
diff
changeset
|
330 purple_debug_info("msn", "Retrieving contact list failed: %s\n", |
20538
90fd0826c6ce
finish converting the rest of stuff to the new soap api, signing on, getting
Ka-Hing Cheung <khc@hxbc.us>
parents:
20501
diff
changeset
|
331 faultstring); |
20477
9a2a4a0c0003
Add the possibility to create an Address Book, useful for newly registered MSN users.
Carlos Silva <typ0@pidgin.im>
parents:
20471
diff
changeset
|
332 g_free(faultstring); |
9a2a4a0c0003
Add the possibility to create an Address Book, useful for newly registered MSN users.
Carlos Silva <typ0@pidgin.im>
parents:
20471
diff
changeset
|
333 } |
23498
bca58b00afab
References #4382, replaces usage of msn_soap_xml_get with xmlnode_get_child
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
23492
diff
changeset
|
334 if ((faultnode = xmlnode_get_child(fault, "detail/errorcode"))) { |
20538
90fd0826c6ce
finish converting the rest of stuff to the new soap api, signing on, getting
Ka-Hing Cheung <khc@hxbc.us>
parents:
20501
diff
changeset
|
335 char *errorcode = xmlnode_get_data(faultnode); |
20394
4a099e4d0d09
propagate from branch 'im.pidgin.pidgin' (head 98b6b547b29ea1192b73cc4e1de1e674edef4328)
Richard Laager <rlaager@wiktel.com>
parents:
diff
changeset
|
336 |
20538
90fd0826c6ce
finish converting the rest of stuff to the new soap api, signing on, getting
Ka-Hing Cheung <khc@hxbc.us>
parents:
20501
diff
changeset
|
337 if (g_str_equal(errorcode, "ABDoesNotExist")) { |
23504
69af5301e1a7
killing MsnContact which just wraps MsnSession
Ka-Hing Cheung <khc@hxbc.us>
parents:
23498
diff
changeset
|
338 msn_create_address_book(session); |
20538
90fd0826c6ce
finish converting the rest of stuff to the new soap api, signing on, getting
Ka-Hing Cheung <khc@hxbc.us>
parents:
20501
diff
changeset
|
339 g_free(errorcode); |
90fd0826c6ce
finish converting the rest of stuff to the new soap api, signing on, getting
Ka-Hing Cheung <khc@hxbc.us>
parents:
20501
diff
changeset
|
340 return; |
90fd0826c6ce
finish converting the rest of stuff to the new soap api, signing on, getting
Ka-Hing Cheung <khc@hxbc.us>
parents:
20501
diff
changeset
|
341 } |
20477
9a2a4a0c0003
Add the possibility to create an Address Book, useful for newly registered MSN users.
Carlos Silva <typ0@pidgin.im>
parents:
20471
diff
changeset
|
342 |
20538
90fd0826c6ce
finish converting the rest of stuff to the new soap api, signing on, getting
Ka-Hing Cheung <khc@hxbc.us>
parents:
20501
diff
changeset
|
343 g_free(errorcode); |
20467
86da6ab1f612
Correctly process an additional <Service> with type Profile and name 'Messenger Roaming Identity' sent with the contact list using a recently registered WLM account, that was causing the initial ADL command to be sent malformed, and our presence status not being forwarded to our buddies
Carlos Silva <typ0@pidgin.im>
parents:
20466
diff
changeset
|
344 } |
86da6ab1f612
Correctly process an additional <Service> with type Profile and name 'Messenger Roaming Identity' sent with the contact list using a recently registered WLM account, that was causing the initial ADL command to be sent malformed, and our presence status not being forwarded to our buddies
Carlos Silva <typ0@pidgin.im>
parents:
20466
diff
changeset
|
345 |
23504
69af5301e1a7
killing MsnContact which just wraps MsnSession
Ka-Hing Cheung <khc@hxbc.us>
parents:
23498
diff
changeset
|
346 msn_get_contact_list(session, MSN_PS_INITIAL, NULL); |
20538
90fd0826c6ce
finish converting the rest of stuff to the new soap api, signing on, getting
Ka-Hing Cheung <khc@hxbc.us>
parents:
20501
diff
changeset
|
347 } else { |
90fd0826c6ce
finish converting the rest of stuff to the new soap api, signing on, getting
Ka-Hing Cheung <khc@hxbc.us>
parents:
20501
diff
changeset
|
348 xmlnode *service; |
20486
ff4ae9dde291
Make block/unblock work right, as well as being add by a buddy. Finally fixes #723
Carlos Silva <typ0@pidgin.im>
parents:
20484
diff
changeset
|
349 |
23498
bca58b00afab
References #4382, replaces usage of msn_soap_xml_get with xmlnode_get_child
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
23492
diff
changeset
|
350 for (service = xmlnode_get_child(node, "Body/FindMembershipResponse/" |
20538
90fd0826c6ce
finish converting the rest of stuff to the new soap api, signing on, getting
Ka-Hing Cheung <khc@hxbc.us>
parents:
20501
diff
changeset
|
351 "FindMembershipResult/Services/Service"); |
90fd0826c6ce
finish converting the rest of stuff to the new soap api, signing on, getting
Ka-Hing Cheung <khc@hxbc.us>
parents:
20501
diff
changeset
|
352 service; service = xmlnode_get_next_twin(service)) { |
23504
69af5301e1a7
killing MsnContact which just wraps MsnSession
Ka-Hing Cheung <khc@hxbc.us>
parents:
23498
diff
changeset
|
353 msn_parse_each_service(session, service); |
20394
4a099e4d0d09
propagate from branch 'im.pidgin.pidgin' (head 98b6b547b29ea1192b73cc4e1de1e674edef4328)
Richard Laager <rlaager@wiktel.com>
parents:
diff
changeset
|
354 } |
4a099e4d0d09
propagate from branch 'im.pidgin.pidgin' (head 98b6b547b29ea1192b73cc4e1de1e674edef4328)
Richard Laager <rlaager@wiktel.com>
parents:
diff
changeset
|
355 } |
4a099e4d0d09
propagate from branch 'im.pidgin.pidgin' (head 98b6b547b29ea1192b73cc4e1de1e674edef4328)
Richard Laager <rlaager@wiktel.com>
parents:
diff
changeset
|
356 } |
4a099e4d0d09
propagate from branch 'im.pidgin.pidgin' (head 98b6b547b29ea1192b73cc4e1de1e674edef4328)
Richard Laager <rlaager@wiktel.com>
parents:
diff
changeset
|
357 |
4a099e4d0d09
propagate from branch 'im.pidgin.pidgin' (head 98b6b547b29ea1192b73cc4e1de1e674edef4328)
Richard Laager <rlaager@wiktel.com>
parents:
diff
changeset
|
358 static void |
20538
90fd0826c6ce
finish converting the rest of stuff to the new soap api, signing on, getting
Ka-Hing Cheung <khc@hxbc.us>
parents:
20501
diff
changeset
|
359 msn_get_contact_list_cb(MsnSoapMessage *req, MsnSoapMessage *resp, |
90fd0826c6ce
finish converting the rest of stuff to the new soap api, signing on, getting
Ka-Hing Cheung <khc@hxbc.us>
parents:
20501
diff
changeset
|
360 gpointer data) |
20394
4a099e4d0d09
propagate from branch 'im.pidgin.pidgin' (head 98b6b547b29ea1192b73cc4e1de1e674edef4328)
Richard Laager <rlaager@wiktel.com>
parents:
diff
changeset
|
361 { |
20538
90fd0826c6ce
finish converting the rest of stuff to the new soap api, signing on, getting
Ka-Hing Cheung <khc@hxbc.us>
parents:
20501
diff
changeset
|
362 GetContactListCbData *cb_data = data; |
23504
69af5301e1a7
killing MsnContact which just wraps MsnSession
Ka-Hing Cheung <khc@hxbc.us>
parents:
23498
diff
changeset
|
363 MsnSession *session = cb_data->session; |
20538
90fd0826c6ce
finish converting the rest of stuff to the new soap api, signing on, getting
Ka-Hing Cheung <khc@hxbc.us>
parents:
20501
diff
changeset
|
364 |
90fd0826c6ce
finish converting the rest of stuff to the new soap api, signing on, getting
Ka-Hing Cheung <khc@hxbc.us>
parents:
20501
diff
changeset
|
365 g_return_if_fail(session != NULL); |
90fd0826c6ce
finish converting the rest of stuff to the new soap api, signing on, getting
Ka-Hing Cheung <khc@hxbc.us>
parents:
20501
diff
changeset
|
366 |
90fd0826c6ce
finish converting the rest of stuff to the new soap api, signing on, getting
Ka-Hing Cheung <khc@hxbc.us>
parents:
20501
diff
changeset
|
367 if (resp != NULL) { |
90fd0826c6ce
finish converting the rest of stuff to the new soap api, signing on, getting
Ka-Hing Cheung <khc@hxbc.us>
parents:
20501
diff
changeset
|
368 const char *abLastChange; |
90fd0826c6ce
finish converting the rest of stuff to the new soap api, signing on, getting
Ka-Hing Cheung <khc@hxbc.us>
parents:
20501
diff
changeset
|
369 const char *dynamicItemLastChange; |
90fd0826c6ce
finish converting the rest of stuff to the new soap api, signing on, getting
Ka-Hing Cheung <khc@hxbc.us>
parents:
20501
diff
changeset
|
370 |
23564
7bceac816e19
The great MSN debug message cleanup! Threw in a few whitespace fixes,
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
23552
diff
changeset
|
371 purple_debug_misc("msn", "Got the contact list!\n"); |
20394
4a099e4d0d09
propagate from branch 'im.pidgin.pidgin' (head 98b6b547b29ea1192b73cc4e1de1e674edef4328)
Richard Laager <rlaager@wiktel.com>
parents:
diff
changeset
|
372 |
23504
69af5301e1a7
killing MsnContact which just wraps MsnSession
Ka-Hing Cheung <khc@hxbc.us>
parents:
23498
diff
changeset
|
373 msn_parse_contact_list(session, resp->xml); |
20538
90fd0826c6ce
finish converting the rest of stuff to the new soap api, signing on, getting
Ka-Hing Cheung <khc@hxbc.us>
parents:
20501
diff
changeset
|
374 abLastChange = purple_account_get_string(session->account, |
90fd0826c6ce
finish converting the rest of stuff to the new soap api, signing on, getting
Ka-Hing Cheung <khc@hxbc.us>
parents:
20501
diff
changeset
|
375 "ablastChange", NULL); |
90fd0826c6ce
finish converting the rest of stuff to the new soap api, signing on, getting
Ka-Hing Cheung <khc@hxbc.us>
parents:
20501
diff
changeset
|
376 dynamicItemLastChange = purple_account_get_string(session->account, |
90fd0826c6ce
finish converting the rest of stuff to the new soap api, signing on, getting
Ka-Hing Cheung <khc@hxbc.us>
parents:
20501
diff
changeset
|
377 "dynamicItemLastChange", NULL); |
90fd0826c6ce
finish converting the rest of stuff to the new soap api, signing on, getting
Ka-Hing Cheung <khc@hxbc.us>
parents:
20501
diff
changeset
|
378 |
90fd0826c6ce
finish converting the rest of stuff to the new soap api, signing on, getting
Ka-Hing Cheung <khc@hxbc.us>
parents:
20501
diff
changeset
|
379 if (cb_data->which == MSN_PS_INITIAL) { |
90fd0826c6ce
finish converting the rest of stuff to the new soap api, signing on, getting
Ka-Hing Cheung <khc@hxbc.us>
parents:
20501
diff
changeset
|
380 #ifdef MSN_PARTIAL_LISTS |
90fd0826c6ce
finish converting the rest of stuff to the new soap api, signing on, getting
Ka-Hing Cheung <khc@hxbc.us>
parents:
20501
diff
changeset
|
381 /* XXX: this should be enabled when we can correctly do partial |
90fd0826c6ce
finish converting the rest of stuff to the new soap api, signing on, getting
Ka-Hing Cheung <khc@hxbc.us>
parents:
20501
diff
changeset
|
382 syncs with the server. Currently we need to retrieve the whole |
90fd0826c6ce
finish converting the rest of stuff to the new soap api, signing on, getting
Ka-Hing Cheung <khc@hxbc.us>
parents:
20501
diff
changeset
|
383 list to detect sync issues */ |
23504
69af5301e1a7
killing MsnContact which just wraps MsnSession
Ka-Hing Cheung <khc@hxbc.us>
parents:
23498
diff
changeset
|
384 msn_get_address_book(session, MSN_PS_INITIAL, abLastChange, dynamicItemLastChange); |
20538
90fd0826c6ce
finish converting the rest of stuff to the new soap api, signing on, getting
Ka-Hing Cheung <khc@hxbc.us>
parents:
20501
diff
changeset
|
385 #else |
23504
69af5301e1a7
killing MsnContact which just wraps MsnSession
Ka-Hing Cheung <khc@hxbc.us>
parents:
23498
diff
changeset
|
386 msn_get_address_book(session, MSN_PS_INITIAL, NULL, NULL); |
20538
90fd0826c6ce
finish converting the rest of stuff to the new soap api, signing on, getting
Ka-Hing Cheung <khc@hxbc.us>
parents:
20501
diff
changeset
|
387 #endif |
90fd0826c6ce
finish converting the rest of stuff to the new soap api, signing on, getting
Ka-Hing Cheung <khc@hxbc.us>
parents:
20501
diff
changeset
|
388 } |
90fd0826c6ce
finish converting the rest of stuff to the new soap api, signing on, getting
Ka-Hing Cheung <khc@hxbc.us>
parents:
20501
diff
changeset
|
389 } |
90fd0826c6ce
finish converting the rest of stuff to the new soap api, signing on, getting
Ka-Hing Cheung <khc@hxbc.us>
parents:
20501
diff
changeset
|
390 |
90fd0826c6ce
finish converting the rest of stuff to the new soap api, signing on, getting
Ka-Hing Cheung <khc@hxbc.us>
parents:
20501
diff
changeset
|
391 g_free(cb_data); |
20394
4a099e4d0d09
propagate from branch 'im.pidgin.pidgin' (head 98b6b547b29ea1192b73cc4e1de1e674edef4328)
Richard Laager <rlaager@wiktel.com>
parents:
diff
changeset
|
392 } |
4a099e4d0d09
propagate from branch 'im.pidgin.pidgin' (head 98b6b547b29ea1192b73cc4e1de1e674edef4328)
Richard Laager <rlaager@wiktel.com>
parents:
diff
changeset
|
393 |
4a099e4d0d09
propagate from branch 'im.pidgin.pidgin' (head 98b6b547b29ea1192b73cc4e1de1e674edef4328)
Richard Laager <rlaager@wiktel.com>
parents:
diff
changeset
|
394 /*SOAP get contact list*/ |
4a099e4d0d09
propagate from branch 'im.pidgin.pidgin' (head 98b6b547b29ea1192b73cc4e1de1e674edef4328)
Richard Laager <rlaager@wiktel.com>
parents:
diff
changeset
|
395 void |
23504
69af5301e1a7
killing MsnContact which just wraps MsnSession
Ka-Hing Cheung <khc@hxbc.us>
parents:
23498
diff
changeset
|
396 msn_get_contact_list(MsnSession *session, |
20538
90fd0826c6ce
finish converting the rest of stuff to the new soap api, signing on, getting
Ka-Hing Cheung <khc@hxbc.us>
parents:
20501
diff
changeset
|
397 const MsnSoapPartnerScenario partner_scenario, const char *update_time) |
20394
4a099e4d0d09
propagate from branch 'im.pidgin.pidgin' (head 98b6b547b29ea1192b73cc4e1de1e674edef4328)
Richard Laager <rlaager@wiktel.com>
parents:
diff
changeset
|
398 { |
20486
ff4ae9dde291
Make block/unblock work right, as well as being add by a buddy. Finally fixes #723
Carlos Silva <typ0@pidgin.im>
parents:
20484
diff
changeset
|
399 gchar *body = NULL; |
20671
4dd60add6a7c
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 <daniel.atallah@gmail.com>
parents:
20666
diff
changeset
|
400 gchar *update_str = NULL; |
23504
69af5301e1a7
killing MsnContact which just wraps MsnSession
Ka-Hing Cheung <khc@hxbc.us>
parents:
23498
diff
changeset
|
401 GetContactListCbData cb_data = { session, partner_scenario }; |
20486
ff4ae9dde291
Make block/unblock work right, as well as being add by a buddy. Finally fixes #723
Carlos Silva <typ0@pidgin.im>
parents:
20484
diff
changeset
|
402 const gchar *partner_scenario_str = MsnSoapPartnerScenarioText[partner_scenario]; |
20467
86da6ab1f612
Correctly process an additional <Service> with type Profile and name 'Messenger Roaming Identity' sent with the contact list using a recently registered WLM account, that was causing the initial ADL command to be sent malformed, and our presence status not being forwarded to our buddies
Carlos Silva <typ0@pidgin.im>
parents:
20466
diff
changeset
|
403 |
23564
7bceac816e19
The great MSN debug message cleanup! Threw in a few whitespace fixes,
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
23552
diff
changeset
|
404 purple_debug_misc("msn", "Getting Contact List.\n"); |
20486
ff4ae9dde291
Make block/unblock work right, as well as being add by a buddy. Finally fixes #723
Carlos Silva <typ0@pidgin.im>
parents:
20484
diff
changeset
|
405 |
23564
7bceac816e19
The great MSN debug message cleanup! Threw in a few whitespace fixes,
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
23552
diff
changeset
|
406 if (update_time != NULL) { |
7bceac816e19
The great MSN debug message cleanup! Threw in a few whitespace fixes,
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
23552
diff
changeset
|
407 purple_debug_info("msn", "CL Last update time: %s\n", update_time); |
20394
4a099e4d0d09
propagate from branch 'im.pidgin.pidgin' (head 98b6b547b29ea1192b73cc4e1de1e674edef4328)
Richard Laager <rlaager@wiktel.com>
parents:
diff
changeset
|
408 update_str = g_strdup_printf(MSN_GET_CONTACT_UPDATE_XML,update_time); |
4a099e4d0d09
propagate from branch 'im.pidgin.pidgin' (head 98b6b547b29ea1192b73cc4e1de1e674edef4328)
Richard Laager <rlaager@wiktel.com>
parents:
diff
changeset
|
409 } |
20486
ff4ae9dde291
Make block/unblock work right, as well as being add by a buddy. Finally fixes #723
Carlos Silva <typ0@pidgin.im>
parents:
20484
diff
changeset
|
410 |
23515
eb8bd060b987
Update MSN Contact tokens when an invalid token error is returned.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
23509
diff
changeset
|
411 body = g_markup_printf_escaped(MSN_GET_CONTACT_TEMPLATE, partner_scenario_str, |
23504
69af5301e1a7
killing MsnContact which just wraps MsnSession
Ka-Hing Cheung <khc@hxbc.us>
parents:
23498
diff
changeset
|
412 msn_nexus_get_token_str(session->nexus, MSN_AUTH_CONTACTS), |
23492
72aa2ccad28d
fix sending offline message in p15 by sending the correct token. In msnp14,
Ka-Hing Cheung <khc@hxbc.us>
parents:
23491
diff
changeset
|
413 update_str ? update_str : ""); |
20477
9a2a4a0c0003
Add the possibility to create an Address Book, useful for newly registered MSN users.
Carlos Silva <typ0@pidgin.im>
parents:
20471
diff
changeset
|
414 |
23504
69af5301e1a7
killing MsnContact which just wraps MsnSession
Ka-Hing Cheung <khc@hxbc.us>
parents:
23498
diff
changeset
|
415 msn_soap_message_send(session, |
20538
90fd0826c6ce
finish converting the rest of stuff to the new soap api, signing on, getting
Ka-Hing Cheung <khc@hxbc.us>
parents:
20501
diff
changeset
|
416 msn_soap_message_new(MSN_GET_CONTACT_SOAP_ACTION, |
90fd0826c6ce
finish converting the rest of stuff to the new soap api, signing on, getting
Ka-Hing Cheung <khc@hxbc.us>
parents:
20501
diff
changeset
|
417 xmlnode_from_str(body, -1)), |
90fd0826c6ce
finish converting the rest of stuff to the new soap api, signing on, getting
Ka-Hing Cheung <khc@hxbc.us>
parents:
20501
diff
changeset
|
418 MSN_CONTACT_SERVER, MSN_GET_CONTACT_POST_URL, |
90fd0826c6ce
finish converting the rest of stuff to the new soap api, signing on, getting
Ka-Hing Cheung <khc@hxbc.us>
parents:
20501
diff
changeset
|
419 msn_get_contact_list_cb, g_memdup(&cb_data, sizeof(cb_data))); |
90fd0826c6ce
finish converting the rest of stuff to the new soap api, signing on, getting
Ka-Hing Cheung <khc@hxbc.us>
parents:
20501
diff
changeset
|
420 |
90fd0826c6ce
finish converting the rest of stuff to the new soap api, signing on, getting
Ka-Hing Cheung <khc@hxbc.us>
parents:
20501
diff
changeset
|
421 g_free(update_str); |
20394
4a099e4d0d09
propagate from branch 'im.pidgin.pidgin' (head 98b6b547b29ea1192b73cc4e1de1e674edef4328)
Richard Laager <rlaager@wiktel.com>
parents:
diff
changeset
|
422 g_free(body); |
4a099e4d0d09
propagate from branch 'im.pidgin.pidgin' (head 98b6b547b29ea1192b73cc4e1de1e674edef4328)
Richard Laager <rlaager@wiktel.com>
parents:
diff
changeset
|
423 } |
4a099e4d0d09
propagate from branch 'im.pidgin.pidgin' (head 98b6b547b29ea1192b73cc4e1de1e674edef4328)
Richard Laager <rlaager@wiktel.com>
parents:
diff
changeset
|
424 |
20439
bee467c81570
A bunch of MSNP14 stuff:
Stu Tomlinson <stu@nosnilmot.com>
parents:
20432
diff
changeset
|
425 static void |
23504
69af5301e1a7
killing MsnContact which just wraps MsnSession
Ka-Hing Cheung <khc@hxbc.us>
parents:
23498
diff
changeset
|
426 msn_parse_addressbook_groups(MsnSession *session, xmlnode *node) |
20394
4a099e4d0d09
propagate from branch 'im.pidgin.pidgin' (head 98b6b547b29ea1192b73cc4e1de1e674edef4328)
Richard Laager <rlaager@wiktel.com>
parents:
diff
changeset
|
427 { |
20439
bee467c81570
A bunch of MSNP14 stuff:
Stu Tomlinson <stu@nosnilmot.com>
parents:
20432
diff
changeset
|
428 xmlnode *group; |
20394
4a099e4d0d09
propagate from branch 'im.pidgin.pidgin' (head 98b6b547b29ea1192b73cc4e1de1e674edef4328)
Richard Laager <rlaager@wiktel.com>
parents:
diff
changeset
|
429 |
23564
7bceac816e19
The great MSN debug message cleanup! Threw in a few whitespace fixes,
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
23552
diff
changeset
|
430 purple_debug_info("msn", "msn_parse_addressbook_groups()\n"); |
20467
86da6ab1f612
Correctly process an additional <Service> with type Profile and name 'Messenger Roaming Identity' sent with the contact list using a recently registered WLM account, that was causing the initial ADL command to be sent malformed, and our presence status not being forwarded to our buddies
Carlos Silva <typ0@pidgin.im>
parents:
20466
diff
changeset
|
431 |
20439
bee467c81570
A bunch of MSNP14 stuff:
Stu Tomlinson <stu@nosnilmot.com>
parents:
20432
diff
changeset
|
432 for(group = xmlnode_get_child(node, "Group"); group; |
bee467c81570
A bunch of MSNP14 stuff:
Stu Tomlinson <stu@nosnilmot.com>
parents:
20432
diff
changeset
|
433 group = xmlnode_get_next_twin(group)){ |
bee467c81570
A bunch of MSNP14 stuff:
Stu Tomlinson <stu@nosnilmot.com>
parents:
20432
diff
changeset
|
434 xmlnode *groupId, *groupInfo, *groupname; |
20671
4dd60add6a7c
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 <daniel.atallah@gmail.com>
parents:
20666
diff
changeset
|
435 char *group_id = NULL, *group_name = NULL; |
20394
4a099e4d0d09
propagate from branch 'im.pidgin.pidgin' (head 98b6b547b29ea1192b73cc4e1de1e674edef4328)
Richard Laager <rlaager@wiktel.com>
parents:
diff
changeset
|
436 |
20671
4dd60add6a7c
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 <daniel.atallah@gmail.com>
parents:
20666
diff
changeset
|
437 if ((groupId = xmlnode_get_child(group, "groupId"))) |
4dd60add6a7c
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 <daniel.atallah@gmail.com>
parents:
20666
diff
changeset
|
438 group_id = xmlnode_get_data(groupId); |
4dd60add6a7c
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 <daniel.atallah@gmail.com>
parents:
20666
diff
changeset
|
439 if ((groupInfo = xmlnode_get_child(group, "groupInfo")) && (groupname = xmlnode_get_child(groupInfo, "name"))) |
4dd60add6a7c
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 <daniel.atallah@gmail.com>
parents:
20666
diff
changeset
|
440 group_name = xmlnode_get_data(groupname); |
20394
4a099e4d0d09
propagate from branch 'im.pidgin.pidgin' (head 98b6b547b29ea1192b73cc4e1de1e674edef4328)
Richard Laager <rlaager@wiktel.com>
parents:
diff
changeset
|
441 |
4a099e4d0d09
propagate from branch 'im.pidgin.pidgin' (head 98b6b547b29ea1192b73cc4e1de1e674edef4328)
Richard Laager <rlaager@wiktel.com>
parents:
diff
changeset
|
442 msn_group_new(session->userlist, group_id, group_name); |
4a099e4d0d09
propagate from branch 'im.pidgin.pidgin' (head 98b6b547b29ea1192b73cc4e1de1e674edef4328)
Richard Laager <rlaager@wiktel.com>
parents:
diff
changeset
|
443 |
4a099e4d0d09
propagate from branch 'im.pidgin.pidgin' (head 98b6b547b29ea1192b73cc4e1de1e674edef4328)
Richard Laager <rlaager@wiktel.com>
parents:
diff
changeset
|
444 if (group_id == NULL){ |
4a099e4d0d09
propagate from branch 'im.pidgin.pidgin' (head 98b6b547b29ea1192b73cc4e1de1e674edef4328)
Richard Laager <rlaager@wiktel.com>
parents:
diff
changeset
|
445 /* Group of ungroupped buddies */ |
20477
9a2a4a0c0003
Add the possibility to create an Address Book, useful for newly registered MSN users.
Carlos Silva <typ0@pidgin.im>
parents:
20471
diff
changeset
|
446 g_free(group_name); |
20394
4a099e4d0d09
propagate from branch 'im.pidgin.pidgin' (head 98b6b547b29ea1192b73cc4e1de1e674edef4328)
Richard Laager <rlaager@wiktel.com>
parents:
diff
changeset
|
447 continue; |
4a099e4d0d09
propagate from branch 'im.pidgin.pidgin' (head 98b6b547b29ea1192b73cc4e1de1e674edef4328)
Richard Laager <rlaager@wiktel.com>
parents:
diff
changeset
|
448 } |
4a099e4d0d09
propagate from branch 'im.pidgin.pidgin' (head 98b6b547b29ea1192b73cc4e1de1e674edef4328)
Richard Laager <rlaager@wiktel.com>
parents:
diff
changeset
|
449 |
23564
7bceac816e19
The great MSN debug message cleanup! Threw in a few whitespace fixes,
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
23552
diff
changeset
|
450 purple_debug_info("msn", "AB group_id: %s, name: %s\n", group_id, group_name ? group_name : "(null)"); |
20401
4ddc27c18781
Fix up some gaim -> purple issues.
Richard Laager <rlaager@wiktel.com>
parents:
20394
diff
changeset
|
451 if ((purple_find_group(group_name)) == NULL){ |
4ddc27c18781
Fix up some gaim -> purple issues.
Richard Laager <rlaager@wiktel.com>
parents:
20394
diff
changeset
|
452 PurpleGroup *g = purple_group_new(group_name); |
4ddc27c18781
Fix up some gaim -> purple issues.
Richard Laager <rlaager@wiktel.com>
parents:
20394
diff
changeset
|
453 purple_blist_add_group(g, NULL); |
20394
4a099e4d0d09
propagate from branch 'im.pidgin.pidgin' (head 98b6b547b29ea1192b73cc4e1de1e674edef4328)
Richard Laager <rlaager@wiktel.com>
parents:
diff
changeset
|
454 } |
4a099e4d0d09
propagate from branch 'im.pidgin.pidgin' (head 98b6b547b29ea1192b73cc4e1de1e674edef4328)
Richard Laager <rlaager@wiktel.com>
parents:
diff
changeset
|
455 g_free(group_id); |
4a099e4d0d09
propagate from branch 'im.pidgin.pidgin' (head 98b6b547b29ea1192b73cc4e1de1e674edef4328)
Richard Laager <rlaager@wiktel.com>
parents:
diff
changeset
|
456 g_free(group_name); |
4a099e4d0d09
propagate from branch 'im.pidgin.pidgin' (head 98b6b547b29ea1192b73cc4e1de1e674edef4328)
Richard Laager <rlaager@wiktel.com>
parents:
diff
changeset
|
457 } |
20439
bee467c81570
A bunch of MSNP14 stuff:
Stu Tomlinson <stu@nosnilmot.com>
parents:
20432
diff
changeset
|
458 } |
20394
4a099e4d0d09
propagate from branch 'im.pidgin.pidgin' (head 98b6b547b29ea1192b73cc4e1de1e674edef4328)
Richard Laager <rlaager@wiktel.com>
parents:
diff
changeset
|
459 |
22552
207f51e16b50
another patch from Maiku that "Properly identifies users you have the mobile
Ka-Hing Cheung <khc@hxbc.us>
parents:
21833
diff
changeset
|
460 static gboolean |
207f51e16b50
another patch from Maiku that "Properly identifies users you have the mobile
Ka-Hing Cheung <khc@hxbc.us>
parents:
21833
diff
changeset
|
461 msn_parse_addressbook_mobile(xmlnode *contactInfo, char **inout_mobile_number) |
207f51e16b50
another patch from Maiku that "Properly identifies users you have the mobile
Ka-Hing Cheung <khc@hxbc.us>
parents:
21833
diff
changeset
|
462 { |
207f51e16b50
another patch from Maiku that "Properly identifies users you have the mobile
Ka-Hing Cheung <khc@hxbc.us>
parents:
21833
diff
changeset
|
463 xmlnode *phones; |
207f51e16b50
another patch from Maiku that "Properly identifies users you have the mobile
Ka-Hing Cheung <khc@hxbc.us>
parents:
21833
diff
changeset
|
464 char *mobile_number = NULL; |
207f51e16b50
another patch from Maiku that "Properly identifies users you have the mobile
Ka-Hing Cheung <khc@hxbc.us>
parents:
21833
diff
changeset
|
465 gboolean mobile = FALSE; |
207f51e16b50
another patch from Maiku that "Properly identifies users you have the mobile
Ka-Hing Cheung <khc@hxbc.us>
parents:
21833
diff
changeset
|
466 |
207f51e16b50
another patch from Maiku that "Properly identifies users you have the mobile
Ka-Hing Cheung <khc@hxbc.us>
parents:
21833
diff
changeset
|
467 *inout_mobile_number = NULL; |
207f51e16b50
another patch from Maiku that "Properly identifies users you have the mobile
Ka-Hing Cheung <khc@hxbc.us>
parents:
21833
diff
changeset
|
468 |
207f51e16b50
another patch from Maiku that "Properly identifies users you have the mobile
Ka-Hing Cheung <khc@hxbc.us>
parents:
21833
diff
changeset
|
469 if ((phones = xmlnode_get_child(contactInfo, "phones"))) { |
207f51e16b50
another patch from Maiku that "Properly identifies users you have the mobile
Ka-Hing Cheung <khc@hxbc.us>
parents:
21833
diff
changeset
|
470 xmlnode *contact_phone; |
207f51e16b50
another patch from Maiku that "Properly identifies users you have the mobile
Ka-Hing Cheung <khc@hxbc.us>
parents:
21833
diff
changeset
|
471 char *phone_type = NULL; |
207f51e16b50
another patch from Maiku that "Properly identifies users you have the mobile
Ka-Hing Cheung <khc@hxbc.us>
parents:
21833
diff
changeset
|
472 |
207f51e16b50
another patch from Maiku that "Properly identifies users you have the mobile
Ka-Hing Cheung <khc@hxbc.us>
parents:
21833
diff
changeset
|
473 for (contact_phone = xmlnode_get_child(phones, "ContactPhone"); |
207f51e16b50
another patch from Maiku that "Properly identifies users you have the mobile
Ka-Hing Cheung <khc@hxbc.us>
parents:
21833
diff
changeset
|
474 contact_phone; |
207f51e16b50
another patch from Maiku that "Properly identifies users you have the mobile
Ka-Hing Cheung <khc@hxbc.us>
parents:
21833
diff
changeset
|
475 contact_phone = xmlnode_get_next_twin(contact_phone)) { |
207f51e16b50
another patch from Maiku that "Properly identifies users you have the mobile
Ka-Hing Cheung <khc@hxbc.us>
parents:
21833
diff
changeset
|
476 xmlnode *contact_phone_type; |
207f51e16b50
another patch from Maiku that "Properly identifies users you have the mobile
Ka-Hing Cheung <khc@hxbc.us>
parents:
21833
diff
changeset
|
477 |
207f51e16b50
another patch from Maiku that "Properly identifies users you have the mobile
Ka-Hing Cheung <khc@hxbc.us>
parents:
21833
diff
changeset
|
478 if (!(contact_phone_type = |
207f51e16b50
another patch from Maiku that "Properly identifies users you have the mobile
Ka-Hing Cheung <khc@hxbc.us>
parents:
21833
diff
changeset
|
479 xmlnode_get_child(contact_phone, "contactPhoneType"))) |
207f51e16b50
another patch from Maiku that "Properly identifies users you have the mobile
Ka-Hing Cheung <khc@hxbc.us>
parents:
21833
diff
changeset
|
480 continue; |
207f51e16b50
another patch from Maiku that "Properly identifies users you have the mobile
Ka-Hing Cheung <khc@hxbc.us>
parents:
21833
diff
changeset
|
481 |
207f51e16b50
another patch from Maiku that "Properly identifies users you have the mobile
Ka-Hing Cheung <khc@hxbc.us>
parents:
21833
diff
changeset
|
482 phone_type = xmlnode_get_data(contact_phone_type); |
207f51e16b50
another patch from Maiku that "Properly identifies users you have the mobile
Ka-Hing Cheung <khc@hxbc.us>
parents:
21833
diff
changeset
|
483 |
207f51e16b50
another patch from Maiku that "Properly identifies users you have the mobile
Ka-Hing Cheung <khc@hxbc.us>
parents:
21833
diff
changeset
|
484 if (phone_type && !strcmp(phone_type, "ContactPhoneMobile")) { |
207f51e16b50
another patch from Maiku that "Properly identifies users you have the mobile
Ka-Hing Cheung <khc@hxbc.us>
parents:
21833
diff
changeset
|
485 xmlnode *number; |
23300
5cdd93dac7a2
Delete trailing whitespace
Mark Doliner <mark@kingant.net>
parents:
22808
diff
changeset
|
486 |
22552
207f51e16b50
another patch from Maiku that "Properly identifies users you have the mobile
Ka-Hing Cheung <khc@hxbc.us>
parents:
21833
diff
changeset
|
487 if ((number = xmlnode_get_child(contact_phone, "number"))) { |
207f51e16b50
another patch from Maiku that "Properly identifies users you have the mobile
Ka-Hing Cheung <khc@hxbc.us>
parents:
21833
diff
changeset
|
488 xmlnode *messenger_enabled; |
207f51e16b50
another patch from Maiku that "Properly identifies users you have the mobile
Ka-Hing Cheung <khc@hxbc.us>
parents:
21833
diff
changeset
|
489 char *is_messenger_enabled = NULL; |
207f51e16b50
another patch from Maiku that "Properly identifies users you have the mobile
Ka-Hing Cheung <khc@hxbc.us>
parents:
21833
diff
changeset
|
490 |
22805
3c98c25b076b
Fix incorrect freeing in my previous commit.
Daniel Atallah <daniel.atallah@gmail.com>
parents:
22804
diff
changeset
|
491 g_free(mobile_number); |
22552
207f51e16b50
another patch from Maiku that "Properly identifies users you have the mobile
Ka-Hing Cheung <khc@hxbc.us>
parents:
21833
diff
changeset
|
492 mobile_number = xmlnode_get_data(number); |
207f51e16b50
another patch from Maiku that "Properly identifies users you have the mobile
Ka-Hing Cheung <khc@hxbc.us>
parents:
21833
diff
changeset
|
493 |
207f51e16b50
another patch from Maiku that "Properly identifies users you have the mobile
Ka-Hing Cheung <khc@hxbc.us>
parents:
21833
diff
changeset
|
494 if (mobile_number && |
23300
5cdd93dac7a2
Delete trailing whitespace
Mark Doliner <mark@kingant.net>
parents:
22808
diff
changeset
|
495 (messenger_enabled = xmlnode_get_child(contact_phone, "isMessengerEnabled")) |
5cdd93dac7a2
Delete trailing whitespace
Mark Doliner <mark@kingant.net>
parents:
22808
diff
changeset
|
496 && (is_messenger_enabled = xmlnode_get_data(messenger_enabled)) |
22804
7d3b2c023ad8
This is the way we plug the leaks, plug the leaks, plug the leaks...
Daniel Atallah <daniel.atallah@gmail.com>
parents:
22554
diff
changeset
|
497 && !strcmp(is_messenger_enabled, "true")) |
22552
207f51e16b50
another patch from Maiku that "Properly identifies users you have the mobile
Ka-Hing Cheung <khc@hxbc.us>
parents:
21833
diff
changeset
|
498 mobile = TRUE; |
207f51e16b50
another patch from Maiku that "Properly identifies users you have the mobile
Ka-Hing Cheung <khc@hxbc.us>
parents:
21833
diff
changeset
|
499 |
207f51e16b50
another patch from Maiku that "Properly identifies users you have the mobile
Ka-Hing Cheung <khc@hxbc.us>
parents:
21833
diff
changeset
|
500 g_free(is_messenger_enabled); |
207f51e16b50
another patch from Maiku that "Properly identifies users you have the mobile
Ka-Hing Cheung <khc@hxbc.us>
parents:
21833
diff
changeset
|
501 } |
207f51e16b50
another patch from Maiku that "Properly identifies users you have the mobile
Ka-Hing Cheung <khc@hxbc.us>
parents:
21833
diff
changeset
|
502 } |
207f51e16b50
another patch from Maiku that "Properly identifies users you have the mobile
Ka-Hing Cheung <khc@hxbc.us>
parents:
21833
diff
changeset
|
503 |
207f51e16b50
another patch from Maiku that "Properly identifies users you have the mobile
Ka-Hing Cheung <khc@hxbc.us>
parents:
21833
diff
changeset
|
504 g_free(phone_type); |
207f51e16b50
another patch from Maiku that "Properly identifies users you have the mobile
Ka-Hing Cheung <khc@hxbc.us>
parents:
21833
diff
changeset
|
505 } |
207f51e16b50
another patch from Maiku that "Properly identifies users you have the mobile
Ka-Hing Cheung <khc@hxbc.us>
parents:
21833
diff
changeset
|
506 } |
207f51e16b50
another patch from Maiku that "Properly identifies users you have the mobile
Ka-Hing Cheung <khc@hxbc.us>
parents:
21833
diff
changeset
|
507 |
207f51e16b50
another patch from Maiku that "Properly identifies users you have the mobile
Ka-Hing Cheung <khc@hxbc.us>
parents:
21833
diff
changeset
|
508 *inout_mobile_number = mobile_number; |
207f51e16b50
another patch from Maiku that "Properly identifies users you have the mobile
Ka-Hing Cheung <khc@hxbc.us>
parents:
21833
diff
changeset
|
509 return mobile; |
207f51e16b50
another patch from Maiku that "Properly identifies users you have the mobile
Ka-Hing Cheung <khc@hxbc.us>
parents:
21833
diff
changeset
|
510 } |
207f51e16b50
another patch from Maiku that "Properly identifies users you have the mobile
Ka-Hing Cheung <khc@hxbc.us>
parents:
21833
diff
changeset
|
511 |
20439
bee467c81570
A bunch of MSNP14 stuff:
Stu Tomlinson <stu@nosnilmot.com>
parents:
20432
diff
changeset
|
512 static void |
23504
69af5301e1a7
killing MsnContact which just wraps MsnSession
Ka-Hing Cheung <khc@hxbc.us>
parents:
23498
diff
changeset
|
513 msn_parse_addressbook_contacts(MsnSession *session, xmlnode *node) |
20439
bee467c81570
A bunch of MSNP14 stuff:
Stu Tomlinson <stu@nosnilmot.com>
parents:
20432
diff
changeset
|
514 { |
bee467c81570
A bunch of MSNP14 stuff:
Stu Tomlinson <stu@nosnilmot.com>
parents:
20432
diff
changeset
|
515 xmlnode *contactNode; |
23517
70de4e2246ec
Add real server-side aliasing to MSN.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
23515
diff
changeset
|
516 char *passport = NULL, *Name = NULL, *uid = NULL, *type = NULL, *mobile_number = NULL, *alias = NULL; |
22552
207f51e16b50
another patch from Maiku that "Properly identifies users you have the mobile
Ka-Hing Cheung <khc@hxbc.us>
parents:
21833
diff
changeset
|
517 gboolean mobile = FALSE; |
23517
70de4e2246ec
Add real server-side aliasing to MSN.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
23515
diff
changeset
|
518 PurpleConnection *pc = purple_account_get_connection(session->account); |
20394
4a099e4d0d09
propagate from branch 'im.pidgin.pidgin' (head 98b6b547b29ea1192b73cc4e1de1e674edef4328)
Richard Laager <rlaager@wiktel.com>
parents:
diff
changeset
|
519 |
20439
bee467c81570
A bunch of MSNP14 stuff:
Stu Tomlinson <stu@nosnilmot.com>
parents:
20432
diff
changeset
|
520 for(contactNode = xmlnode_get_child(node, "Contact"); contactNode; |
20666
0e1bc5c51030
A few leak plugs, some unnecessary allocation prevention, null pointer deref fixes and general robustness fixes. I'm sure there is more to do here, I got tired... Fixes #3308
Daniel Atallah <daniel.atallah@gmail.com>
parents:
20539
diff
changeset
|
521 contactNode = xmlnode_get_next_twin(contactNode)) { |
22554
8041c74e36d7
patch from Maiku to ignore non-messenger contacts, fixes #3305
Ka-Hing Cheung <khc@hxbc.us>
parents:
22552
diff
changeset
|
522 xmlnode *contactId, *contactInfo, *contactType, *passportName, *displayName, *guid, *groupIds, *messenger_user; |
23517
70de4e2246ec
Add real server-side aliasing to MSN.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
23515
diff
changeset
|
523 xmlnode *annotation; |
20394
4a099e4d0d09
propagate from branch 'im.pidgin.pidgin' (head 98b6b547b29ea1192b73cc4e1de1e674edef4328)
Richard Laager <rlaager@wiktel.com>
parents:
diff
changeset
|
524 MsnUser *user; |
23523
31b5a1334e7e
Modifications to the MSN code for some stuff I'll be doing in later
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
23517
diff
changeset
|
525 MsnNetwork networkId; |
20666
0e1bc5c51030
A few leak plugs, some unnecessary allocation prevention, null pointer deref fixes and general robustness fixes. I'm sure there is more to do here, I got tired... Fixes #3308
Daniel Atallah <daniel.atallah@gmail.com>
parents:
20539
diff
changeset
|
526 |
0e1bc5c51030
A few leak plugs, some unnecessary allocation prevention, null pointer deref fixes and general robustness fixes. I'm sure there is more to do here, I got tired... Fixes #3308
Daniel Atallah <daniel.atallah@gmail.com>
parents:
20539
diff
changeset
|
527 if (!(contactId = xmlnode_get_child(contactNode,"contactId")) |
0e1bc5c51030
A few leak plugs, some unnecessary allocation prevention, null pointer deref fixes and general robustness fixes. I'm sure there is more to do here, I got tired... Fixes #3308
Daniel Atallah <daniel.atallah@gmail.com>
parents:
20539
diff
changeset
|
528 || !(contactInfo = xmlnode_get_child(contactNode, "contactInfo")) |
0e1bc5c51030
A few leak plugs, some unnecessary allocation prevention, null pointer deref fixes and general robustness fixes. I'm sure there is more to do here, I got tired... Fixes #3308
Daniel Atallah <daniel.atallah@gmail.com>
parents:
20539
diff
changeset
|
529 || !(contactType = xmlnode_get_child(contactInfo, "contactType"))) |
0e1bc5c51030
A few leak plugs, some unnecessary allocation prevention, null pointer deref fixes and general robustness fixes. I'm sure there is more to do here, I got tired... Fixes #3308
Daniel Atallah <daniel.atallah@gmail.com>
parents:
20539
diff
changeset
|
530 continue; |
20394
4a099e4d0d09
propagate from branch 'im.pidgin.pidgin' (head 98b6b547b29ea1192b73cc4e1de1e674edef4328)
Richard Laager <rlaager@wiktel.com>
parents:
diff
changeset
|
531 |
20666
0e1bc5c51030
A few leak plugs, some unnecessary allocation prevention, null pointer deref fixes and general robustness fixes. I'm sure there is more to do here, I got tired... Fixes #3308
Daniel Atallah <daniel.atallah@gmail.com>
parents:
20539
diff
changeset
|
532 g_free(passport); |
0e1bc5c51030
A few leak plugs, some unnecessary allocation prevention, null pointer deref fixes and general robustness fixes. I'm sure there is more to do here, I got tired... Fixes #3308
Daniel Atallah <daniel.atallah@gmail.com>
parents:
20539
diff
changeset
|
533 g_free(Name); |
23517
70de4e2246ec
Add real server-side aliasing to MSN.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
23515
diff
changeset
|
534 g_free(alias); |
20666
0e1bc5c51030
A few leak plugs, some unnecessary allocation prevention, null pointer deref fixes and general robustness fixes. I'm sure there is more to do here, I got tired... Fixes #3308
Daniel Atallah <daniel.atallah@gmail.com>
parents:
20539
diff
changeset
|
535 g_free(uid); |
0e1bc5c51030
A few leak plugs, some unnecessary allocation prevention, null pointer deref fixes and general robustness fixes. I'm sure there is more to do here, I got tired... Fixes #3308
Daniel Atallah <daniel.atallah@gmail.com>
parents:
20539
diff
changeset
|
536 g_free(type); |
22808
f62a4a7fe365
Fix a number of leaks. As far as I can tell, MSNP14 now logs in without
Daniel Atallah <daniel.atallah@gmail.com>
parents:
22805
diff
changeset
|
537 g_free(mobile_number); |
23517
70de4e2246ec
Add real server-side aliasing to MSN.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
23515
diff
changeset
|
538 passport = Name = uid = type = mobile_number = alias = NULL; |
22552
207f51e16b50
another patch from Maiku that "Properly identifies users you have the mobile
Ka-Hing Cheung <khc@hxbc.us>
parents:
21833
diff
changeset
|
539 mobile = FALSE; |
20666
0e1bc5c51030
A few leak plugs, some unnecessary allocation prevention, null pointer deref fixes and general robustness fixes. I'm sure there is more to do here, I got tired... Fixes #3308
Daniel Atallah <daniel.atallah@gmail.com>
parents:
20539
diff
changeset
|
540 |
20394
4a099e4d0d09
propagate from branch 'im.pidgin.pidgin' (head 98b6b547b29ea1192b73cc4e1de1e674edef4328)
Richard Laager <rlaager@wiktel.com>
parents:
diff
changeset
|
541 uid = xmlnode_get_data(contactId); |
4a099e4d0d09
propagate from branch 'im.pidgin.pidgin' (head 98b6b547b29ea1192b73cc4e1de1e674edef4328)
Richard Laager <rlaager@wiktel.com>
parents:
diff
changeset
|
542 type = xmlnode_get_data(contactType); |
4a099e4d0d09
propagate from branch 'im.pidgin.pidgin' (head 98b6b547b29ea1192b73cc4e1de1e674edef4328)
Richard Laager <rlaager@wiktel.com>
parents:
diff
changeset
|
543 |
4a099e4d0d09
propagate from branch 'im.pidgin.pidgin' (head 98b6b547b29ea1192b73cc4e1de1e674edef4328)
Richard Laager <rlaager@wiktel.com>
parents:
diff
changeset
|
544 /*setup the Display Name*/ |
20666
0e1bc5c51030
A few leak plugs, some unnecessary allocation prevention, null pointer deref fixes and general robustness fixes. I'm sure there is more to do here, I got tired... Fixes #3308
Daniel Atallah <daniel.atallah@gmail.com>
parents:
20539
diff
changeset
|
545 if (type && !strcmp(type, "Me")){ |
0e1bc5c51030
A few leak plugs, some unnecessary allocation prevention, null pointer deref fixes and general robustness fixes. I'm sure there is more to do here, I got tired... Fixes #3308
Daniel Atallah <daniel.atallah@gmail.com>
parents:
20539
diff
changeset
|
546 char *friendly = NULL; |
0e1bc5c51030
A few leak plugs, some unnecessary allocation prevention, null pointer deref fixes and general robustness fixes. I'm sure there is more to do here, I got tired... Fixes #3308
Daniel Atallah <daniel.atallah@gmail.com>
parents:
20539
diff
changeset
|
547 if ((displayName = xmlnode_get_child(contactInfo, "displayName"))) |
0e1bc5c51030
A few leak plugs, some unnecessary allocation prevention, null pointer deref fixes and general robustness fixes. I'm sure there is more to do here, I got tired... Fixes #3308
Daniel Atallah <daniel.atallah@gmail.com>
parents:
20539
diff
changeset
|
548 friendly = xmlnode_get_data(displayName); |
0e1bc5c51030
A few leak plugs, some unnecessary allocation prevention, null pointer deref fixes and general robustness fixes. I'm sure there is more to do here, I got tired... Fixes #3308
Daniel Atallah <daniel.atallah@gmail.com>
parents:
20539
diff
changeset
|
549 purple_connection_set_display_name(session->account->gc, friendly ? purple_url_decode(friendly) : NULL); |
20394
4a099e4d0d09
propagate from branch 'im.pidgin.pidgin' (head 98b6b547b29ea1192b73cc4e1de1e674edef4328)
Richard Laager <rlaager@wiktel.com>
parents:
diff
changeset
|
550 g_free(friendly); |
20403
599b5a4aebab
The last of the merge fix-ups.
Richard Laager <rlaager@wiktel.com>
parents:
20401
diff
changeset
|
551 continue; /* Not adding own account as buddy to buddylist */ |
20394
4a099e4d0d09
propagate from branch 'im.pidgin.pidgin' (head 98b6b547b29ea1192b73cc4e1de1e674edef4328)
Richard Laager <rlaager@wiktel.com>
parents:
diff
changeset
|
552 } |
20666
0e1bc5c51030
A few leak plugs, some unnecessary allocation prevention, null pointer deref fixes and general robustness fixes. I'm sure there is more to do here, I got tired... Fixes #3308
Daniel Atallah <daniel.atallah@gmail.com>
parents:
20539
diff
changeset
|
553 |
22554
8041c74e36d7
patch from Maiku to ignore non-messenger contacts, fixes #3305
Ka-Hing Cheung <khc@hxbc.us>
parents:
22552
diff
changeset
|
554 /* ignore non-messenger contacts */ |
23564
7bceac816e19
The great MSN debug message cleanup! Threw in a few whitespace fixes,
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
23552
diff
changeset
|
555 if ((messenger_user = xmlnode_get_child(contactInfo, "isMessengerUser"))) { |
22554
8041c74e36d7
patch from Maiku to ignore non-messenger contacts, fixes #3305
Ka-Hing Cheung <khc@hxbc.us>
parents:
22552
diff
changeset
|
556 char *is_messenger_user = xmlnode_get_data(messenger_user); |
8041c74e36d7
patch from Maiku to ignore non-messenger contacts, fixes #3305
Ka-Hing Cheung <khc@hxbc.us>
parents:
22552
diff
changeset
|
557 |
8041c74e36d7
patch from Maiku to ignore non-messenger contacts, fixes #3305
Ka-Hing Cheung <khc@hxbc.us>
parents:
22552
diff
changeset
|
558 if(is_messenger_user && !strcmp(is_messenger_user, "false")) { |
8041c74e36d7
patch from Maiku to ignore non-messenger contacts, fixes #3305
Ka-Hing Cheung <khc@hxbc.us>
parents:
22552
diff
changeset
|
559 g_free(is_messenger_user); |
8041c74e36d7
patch from Maiku to ignore non-messenger contacts, fixes #3305
Ka-Hing Cheung <khc@hxbc.us>
parents:
22552
diff
changeset
|
560 continue; |
8041c74e36d7
patch from Maiku to ignore non-messenger contacts, fixes #3305
Ka-Hing Cheung <khc@hxbc.us>
parents:
22552
diff
changeset
|
561 } |
8041c74e36d7
patch from Maiku to ignore non-messenger contacts, fixes #3305
Ka-Hing Cheung <khc@hxbc.us>
parents:
22552
diff
changeset
|
562 |
8041c74e36d7
patch from Maiku to ignore non-messenger contacts, fixes #3305
Ka-Hing Cheung <khc@hxbc.us>
parents:
22552
diff
changeset
|
563 g_free(is_messenger_user); |
8041c74e36d7
patch from Maiku to ignore non-messenger contacts, fixes #3305
Ka-Hing Cheung <khc@hxbc.us>
parents:
22552
diff
changeset
|
564 } |
8041c74e36d7
patch from Maiku to ignore non-messenger contacts, fixes #3305
Ka-Hing Cheung <khc@hxbc.us>
parents:
22552
diff
changeset
|
565 |
23523
31b5a1334e7e
Modifications to the MSN code for some stuff I'll be doing in later
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
23517
diff
changeset
|
566 networkId = msn_get_network(type); |
20666
0e1bc5c51030
A few leak plugs, some unnecessary allocation prevention, null pointer deref fixes and general robustness fixes. I'm sure there is more to do here, I got tired... Fixes #3308
Daniel Atallah <daniel.atallah@gmail.com>
parents:
20539
diff
changeset
|
567 passportName = xmlnode_get_child(contactInfo, "passportName"); |
20477
9a2a4a0c0003
Add the possibility to create an Address Book, useful for newly registered MSN users.
Carlos Silva <typ0@pidgin.im>
parents:
20471
diff
changeset
|
568 if (passportName == NULL) { |
20394
4a099e4d0d09
propagate from branch 'im.pidgin.pidgin' (head 98b6b547b29ea1192b73cc4e1de1e674edef4328)
Richard Laager <rlaager@wiktel.com>
parents:
diff
changeset
|
569 xmlnode *emailsNode, *contactEmailNode, *emailNode; |
4a099e4d0d09
propagate from branch 'im.pidgin.pidgin' (head 98b6b547b29ea1192b73cc4e1de1e674edef4328)
Richard Laager <rlaager@wiktel.com>
parents:
diff
changeset
|
570 xmlnode *messengerEnabledNode; |
4a099e4d0d09
propagate from branch 'im.pidgin.pidgin' (head 98b6b547b29ea1192b73cc4e1de1e674edef4328)
Richard Laager <rlaager@wiktel.com>
parents:
diff
changeset
|
571 char *msnEnabled; |
4a099e4d0d09
propagate from branch 'im.pidgin.pidgin' (head 98b6b547b29ea1192b73cc4e1de1e674edef4328)
Richard Laager <rlaager@wiktel.com>
parents:
diff
changeset
|
572 |
4a099e4d0d09
propagate from branch 'im.pidgin.pidgin' (head 98b6b547b29ea1192b73cc4e1de1e674edef4328)
Richard Laager <rlaager@wiktel.com>
parents:
diff
changeset
|
573 /*TODO: add it to the none-instant Messenger group and recognize as email Membership*/ |
4a099e4d0d09
propagate from branch 'im.pidgin.pidgin' (head 98b6b547b29ea1192b73cc4e1de1e674edef4328)
Richard Laager <rlaager@wiktel.com>
parents:
diff
changeset
|
574 /*Yahoo User?*/ |
20666
0e1bc5c51030
A few leak plugs, some unnecessary allocation prevention, null pointer deref fixes and general robustness fixes. I'm sure there is more to do here, I got tired... Fixes #3308
Daniel Atallah <daniel.atallah@gmail.com>
parents:
20539
diff
changeset
|
575 emailsNode = xmlnode_get_child(contactInfo, "emails"); |
20477
9a2a4a0c0003
Add the possibility to create an Address Book, useful for newly registered MSN users.
Carlos Silva <typ0@pidgin.im>
parents:
20471
diff
changeset
|
576 if (emailsNode == NULL) { |
20394
4a099e4d0d09
propagate from branch 'im.pidgin.pidgin' (head 98b6b547b29ea1192b73cc4e1de1e674edef4328)
Richard Laager <rlaager@wiktel.com>
parents:
diff
changeset
|
577 /*TODO: need to support the Mobile type*/ |
4a099e4d0d09
propagate from branch 'im.pidgin.pidgin' (head 98b6b547b29ea1192b73cc4e1de1e674edef4328)
Richard Laager <rlaager@wiktel.com>
parents:
diff
changeset
|
578 continue; |
4a099e4d0d09
propagate from branch 'im.pidgin.pidgin' (head 98b6b547b29ea1192b73cc4e1de1e674edef4328)
Richard Laager <rlaager@wiktel.com>
parents:
diff
changeset
|
579 } |
23564
7bceac816e19
The great MSN debug message cleanup! Threw in a few whitespace fixes,
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
23552
diff
changeset
|
580 for (contactEmailNode = xmlnode_get_child(emailsNode, "ContactEmail"); contactEmailNode; |
20394
4a099e4d0d09
propagate from branch 'im.pidgin.pidgin' (head 98b6b547b29ea1192b73cc4e1de1e674edef4328)
Richard Laager <rlaager@wiktel.com>
parents:
diff
changeset
|
581 contactEmailNode = xmlnode_get_next_twin(contactEmailNode) ){ |
20666
0e1bc5c51030
A few leak plugs, some unnecessary allocation prevention, null pointer deref fixes and general robustness fixes. I'm sure there is more to do here, I got tired... Fixes #3308
Daniel Atallah <daniel.atallah@gmail.com>
parents:
20539
diff
changeset
|
582 if (!(messengerEnabledNode = xmlnode_get_child(contactEmailNode, "isMessengerEnabled"))) { |
0e1bc5c51030
A few leak plugs, some unnecessary allocation prevention, null pointer deref fixes and general robustness fixes. I'm sure there is more to do here, I got tired... Fixes #3308
Daniel Atallah <daniel.atallah@gmail.com>
parents:
20539
diff
changeset
|
583 /* XXX: Should this be a continue instead of a break? It seems like it'd cause unpredictable results otherwise. */ |
20394
4a099e4d0d09
propagate from branch 'im.pidgin.pidgin' (head 98b6b547b29ea1192b73cc4e1de1e674edef4328)
Richard Laager <rlaager@wiktel.com>
parents:
diff
changeset
|
584 break; |
4a099e4d0d09
propagate from branch 'im.pidgin.pidgin' (head 98b6b547b29ea1192b73cc4e1de1e674edef4328)
Richard Laager <rlaager@wiktel.com>
parents:
diff
changeset
|
585 } |
20666
0e1bc5c51030
A few leak plugs, some unnecessary allocation prevention, null pointer deref fixes and general robustness fixes. I'm sure there is more to do here, I got tired... Fixes #3308
Daniel Atallah <daniel.atallah@gmail.com>
parents:
20539
diff
changeset
|
586 |
20394
4a099e4d0d09
propagate from branch 'im.pidgin.pidgin' (head 98b6b547b29ea1192b73cc4e1de1e674edef4328)
Richard Laager <rlaager@wiktel.com>
parents:
diff
changeset
|
587 msnEnabled = xmlnode_get_data(messengerEnabledNode); |
20666
0e1bc5c51030
A few leak plugs, some unnecessary allocation prevention, null pointer deref fixes and general robustness fixes. I'm sure there is more to do here, I got tired... Fixes #3308
Daniel Atallah <daniel.atallah@gmail.com>
parents:
20539
diff
changeset
|
588 |
0e1bc5c51030
A few leak plugs, some unnecessary allocation prevention, null pointer deref fixes and general robustness fixes. I'm sure there is more to do here, I got tired... Fixes #3308
Daniel Atallah <daniel.atallah@gmail.com>
parents:
20539
diff
changeset
|
589 if ((emailNode = xmlnode_get_child(contactEmailNode, "email"))) { |
0e1bc5c51030
A few leak plugs, some unnecessary allocation prevention, null pointer deref fixes and general robustness fixes. I'm sure there is more to do here, I got tired... Fixes #3308
Daniel Atallah <daniel.atallah@gmail.com>
parents:
20539
diff
changeset
|
590 g_free(passport); |
20394
4a099e4d0d09
propagate from branch 'im.pidgin.pidgin' (head 98b6b547b29ea1192b73cc4e1de1e674edef4328)
Richard Laager <rlaager@wiktel.com>
parents:
diff
changeset
|
591 passport = xmlnode_get_data(emailNode); |
20666
0e1bc5c51030
A few leak plugs, some unnecessary allocation prevention, null pointer deref fixes and general robustness fixes. I'm sure there is more to do here, I got tired... Fixes #3308
Daniel Atallah <daniel.atallah@gmail.com>
parents:
20539
diff
changeset
|
592 } |
0e1bc5c51030
A few leak plugs, some unnecessary allocation prevention, null pointer deref fixes and general robustness fixes. I'm sure there is more to do here, I got tired... Fixes #3308
Daniel Atallah <daniel.atallah@gmail.com>
parents:
20539
diff
changeset
|
593 |
23564
7bceac816e19
The great MSN debug message cleanup! Threw in a few whitespace fixes,
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
23552
diff
changeset
|
594 if (msnEnabled && !strcmp(msnEnabled, "true")) { |
20666
0e1bc5c51030
A few leak plugs, some unnecessary allocation prevention, null pointer deref fixes and general robustness fixes. I'm sure there is more to do here, I got tired... Fixes #3308
Daniel Atallah <daniel.atallah@gmail.com>
parents:
20539
diff
changeset
|
595 /*Messenger enabled, Get the Passport*/ |
23564
7bceac816e19
The great MSN debug message cleanup! Threw in a few whitespace fixes,
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
23552
diff
changeset
|
596 purple_debug_info("msn", "AB Yahoo User %s\n", passport ? passport : "(null)"); |
23523
31b5a1334e7e
Modifications to the MSN code for some stuff I'll be doing in later
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
23517
diff
changeset
|
597 networkId = MSN_NETWORK_YAHOO; |
20495
7f5564ebde7f
Fix some memory leaks. Free xmlnodes properly using xmlnode_free instead of
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
20494
diff
changeset
|
598 g_free(msnEnabled); |
20394
4a099e4d0d09
propagate from branch 'im.pidgin.pidgin' (head 98b6b547b29ea1192b73cc4e1de1e674edef4328)
Richard Laager <rlaager@wiktel.com>
parents:
diff
changeset
|
599 break; |
20666
0e1bc5c51030
A few leak plugs, some unnecessary allocation prevention, null pointer deref fixes and general robustness fixes. I'm sure there is more to do here, I got tired... Fixes #3308
Daniel Atallah <daniel.atallah@gmail.com>
parents:
20539
diff
changeset
|
600 } else { |
20401
4ddc27c18781
Fix up some gaim -> purple issues.
Richard Laager <rlaager@wiktel.com>
parents:
20394
diff
changeset
|
601 /*TODO maybe we can just ignore it in Purple?*/ |
23564
7bceac816e19
The great MSN debug message cleanup! Threw in a few whitespace fixes,
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
23552
diff
changeset
|
602 purple_debug_info("msn", "AB Other type user\n"); |
20394
4a099e4d0d09
propagate from branch 'im.pidgin.pidgin' (head 98b6b547b29ea1192b73cc4e1de1e674edef4328)
Richard Laager <rlaager@wiktel.com>
parents:
diff
changeset
|
603 } |
20666
0e1bc5c51030
A few leak plugs, some unnecessary allocation prevention, null pointer deref fixes and general robustness fixes. I'm sure there is more to do here, I got tired... Fixes #3308
Daniel Atallah <daniel.atallah@gmail.com>
parents:
20539
diff
changeset
|
604 |
20394
4a099e4d0d09
propagate from branch 'im.pidgin.pidgin' (head 98b6b547b29ea1192b73cc4e1de1e674edef4328)
Richard Laager <rlaager@wiktel.com>
parents:
diff
changeset
|
605 g_free(msnEnabled); |
4a099e4d0d09
propagate from branch 'im.pidgin.pidgin' (head 98b6b547b29ea1192b73cc4e1de1e674edef4328)
Richard Laager <rlaager@wiktel.com>
parents:
diff
changeset
|
606 } |
20477
9a2a4a0c0003
Add the possibility to create an Address Book, useful for newly registered MSN users.
Carlos Silva <typ0@pidgin.im>
parents:
20471
diff
changeset
|
607 } else { |
20394
4a099e4d0d09
propagate from branch 'im.pidgin.pidgin' (head 98b6b547b29ea1192b73cc4e1de1e674edef4328)
Richard Laager <rlaager@wiktel.com>
parents:
diff
changeset
|
608 passport = xmlnode_get_data(passportName); |
4a099e4d0d09
propagate from branch 'im.pidgin.pidgin' (head 98b6b547b29ea1192b73cc4e1de1e674edef4328)
Richard Laager <rlaager@wiktel.com>
parents:
diff
changeset
|
609 } |
4a099e4d0d09
propagate from branch 'im.pidgin.pidgin' (head 98b6b547b29ea1192b73cc4e1de1e674edef4328)
Richard Laager <rlaager@wiktel.com>
parents:
diff
changeset
|
610 |
20666
0e1bc5c51030
A few leak plugs, some unnecessary allocation prevention, null pointer deref fixes and general robustness fixes. I'm sure there is more to do here, I got tired... Fixes #3308
Daniel Atallah <daniel.atallah@gmail.com>
parents:
20539
diff
changeset
|
611 if (passport == NULL) |
20394
4a099e4d0d09
propagate from branch 'im.pidgin.pidgin' (head 98b6b547b29ea1192b73cc4e1de1e674edef4328)
Richard Laager <rlaager@wiktel.com>
parents:
diff
changeset
|
612 continue; |
4a099e4d0d09
propagate from branch 'im.pidgin.pidgin' (head 98b6b547b29ea1192b73cc4e1de1e674edef4328)
Richard Laager <rlaager@wiktel.com>
parents:
diff
changeset
|
613 |
20666
0e1bc5c51030
A few leak plugs, some unnecessary allocation prevention, null pointer deref fixes and general robustness fixes. I'm sure there is more to do here, I got tired... Fixes #3308
Daniel Atallah <daniel.atallah@gmail.com>
parents:
20539
diff
changeset
|
614 if ((displayName = xmlnode_get_child(contactInfo, "displayName"))) |
0e1bc5c51030
A few leak plugs, some unnecessary allocation prevention, null pointer deref fixes and general robustness fixes. I'm sure there is more to do here, I got tired... Fixes #3308
Daniel Atallah <daniel.atallah@gmail.com>
parents:
20539
diff
changeset
|
615 Name = xmlnode_get_data(displayName); |
0e1bc5c51030
A few leak plugs, some unnecessary allocation prevention, null pointer deref fixes and general robustness fixes. I'm sure there is more to do here, I got tired... Fixes #3308
Daniel Atallah <daniel.atallah@gmail.com>
parents:
20539
diff
changeset
|
616 else |
20394
4a099e4d0d09
propagate from branch 'im.pidgin.pidgin' (head 98b6b547b29ea1192b73cc4e1de1e674edef4328)
Richard Laager <rlaager@wiktel.com>
parents:
diff
changeset
|
617 Name = g_strdup(passport); |
4a099e4d0d09
propagate from branch 'im.pidgin.pidgin' (head 98b6b547b29ea1192b73cc4e1de1e674edef4328)
Richard Laager <rlaager@wiktel.com>
parents:
diff
changeset
|
618 |
23517
70de4e2246ec
Add real server-side aliasing to MSN.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
23515
diff
changeset
|
619 for (annotation = xmlnode_get_child(contactInfo, "annotations/Annotation"); |
70de4e2246ec
Add real server-side aliasing to MSN.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
23515
diff
changeset
|
620 annotation; annotation = xmlnode_get_next_twin(annotation)) { |
70de4e2246ec
Add real server-side aliasing to MSN.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
23515
diff
changeset
|
621 char *name; |
70de4e2246ec
Add real server-side aliasing to MSN.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
23515
diff
changeset
|
622 name = xmlnode_get_data(xmlnode_get_child(annotation, "Name")); |
70de4e2246ec
Add real server-side aliasing to MSN.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
23515
diff
changeset
|
623 if (!strcmp(name, "AB.NickName")) |
70de4e2246ec
Add real server-side aliasing to MSN.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
23515
diff
changeset
|
624 alias = xmlnode_get_data(xmlnode_get_child(annotation, "Value")); |
70de4e2246ec
Add real server-side aliasing to MSN.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
23515
diff
changeset
|
625 g_free(name); |
70de4e2246ec
Add real server-side aliasing to MSN.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
23515
diff
changeset
|
626 } |
70de4e2246ec
Add real server-side aliasing to MSN.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
23515
diff
changeset
|
627 |
22552
207f51e16b50
another patch from Maiku that "Properly identifies users you have the mobile
Ka-Hing Cheung <khc@hxbc.us>
parents:
21833
diff
changeset
|
628 mobile = msn_parse_addressbook_mobile(contactInfo, &mobile_number); |
207f51e16b50
another patch from Maiku that "Properly identifies users you have the mobile
Ka-Hing Cheung <khc@hxbc.us>
parents:
21833
diff
changeset
|
629 |
23564
7bceac816e19
The great MSN debug message cleanup! Threw in a few whitespace fixes,
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
23552
diff
changeset
|
630 purple_debug_misc("msn", "AB passport:{%s} uid:{%s} display:{%s} alias: {%s} mobile:{%s} mobile number:{%s}\n", |
23517
70de4e2246ec
Add real server-side aliasing to MSN.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
23515
diff
changeset
|
631 passport, uid ? uid : "(null)", Name ? Name : "(null)", alias ? alias : "(null)", |
22552
207f51e16b50
another patch from Maiku that "Properly identifies users you have the mobile
Ka-Hing Cheung <khc@hxbc.us>
parents:
21833
diff
changeset
|
632 mobile ? "true" : "false", mobile_number ? mobile_number : "(null)"); |
20394
4a099e4d0d09
propagate from branch 'im.pidgin.pidgin' (head 98b6b547b29ea1192b73cc4e1de1e674edef4328)
Richard Laager <rlaager@wiktel.com>
parents:
diff
changeset
|
633 |
20666
0e1bc5c51030
A few leak plugs, some unnecessary allocation prevention, null pointer deref fixes and general robustness fixes. I'm sure there is more to do here, I got tired... Fixes #3308
Daniel Atallah <daniel.atallah@gmail.com>
parents:
20539
diff
changeset
|
634 user = msn_userlist_find_add_user(session->userlist, passport, Name); |
0e1bc5c51030
A few leak plugs, some unnecessary allocation prevention, null pointer deref fixes and general robustness fixes. I'm sure there is more to do here, I got tired... Fixes #3308
Daniel Atallah <daniel.atallah@gmail.com>
parents:
20539
diff
changeset
|
635 msn_user_set_uid(user, uid); |
23523
31b5a1334e7e
Modifications to the MSN code for some stuff I'll be doing in later
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
23517
diff
changeset
|
636 msn_user_set_network(user, networkId); |
22552
207f51e16b50
another patch from Maiku that "Properly identifies users you have the mobile
Ka-Hing Cheung <khc@hxbc.us>
parents:
21833
diff
changeset
|
637 msn_user_set_mobile_phone(user, mobile_number); |
20394
4a099e4d0d09
propagate from branch 'im.pidgin.pidgin' (head 98b6b547b29ea1192b73cc4e1de1e674edef4328)
Richard Laager <rlaager@wiktel.com>
parents:
diff
changeset
|
638 |
20666
0e1bc5c51030
A few leak plugs, some unnecessary allocation prevention, null pointer deref fixes and general robustness fixes. I'm sure there is more to do here, I got tired... Fixes #3308
Daniel Atallah <daniel.atallah@gmail.com>
parents:
20539
diff
changeset
|
639 groupIds = xmlnode_get_child(contactInfo, "groupIds"); |
20477
9a2a4a0c0003
Add the possibility to create an Address Book, useful for newly registered MSN users.
Carlos Silva <typ0@pidgin.im>
parents:
20471
diff
changeset
|
640 if (groupIds) { |
20666
0e1bc5c51030
A few leak plugs, some unnecessary allocation prevention, null pointer deref fixes and general robustness fixes. I'm sure there is more to do here, I got tired... Fixes #3308
Daniel Atallah <daniel.atallah@gmail.com>
parents:
20539
diff
changeset
|
641 for (guid = xmlnode_get_child(groupIds, "guid"); guid; |
23564
7bceac816e19
The great MSN debug message cleanup! Threw in a few whitespace fixes,
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
23552
diff
changeset
|
642 guid = xmlnode_get_next_twin(guid)) { |
20666
0e1bc5c51030
A few leak plugs, some unnecessary allocation prevention, null pointer deref fixes and general robustness fixes. I'm sure there is more to do here, I got tired... Fixes #3308
Daniel Atallah <daniel.atallah@gmail.com>
parents:
20539
diff
changeset
|
643 char *group_id = xmlnode_get_data(guid); |
0e1bc5c51030
A few leak plugs, some unnecessary allocation prevention, null pointer deref fixes and general robustness fixes. I'm sure there is more to do here, I got tired... Fixes #3308
Daniel Atallah <daniel.atallah@gmail.com>
parents:
20539
diff
changeset
|
644 msn_user_add_group_id(user, group_id); |
23564
7bceac816e19
The great MSN debug message cleanup! Threw in a few whitespace fixes,
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
23552
diff
changeset
|
645 purple_debug_misc("msn", "AB guid:%s\n", group_id ? group_id : "(null)"); |
20394
4a099e4d0d09
propagate from branch 'im.pidgin.pidgin' (head 98b6b547b29ea1192b73cc4e1de1e674edef4328)
Richard Laager <rlaager@wiktel.com>
parents:
diff
changeset
|
646 g_free(group_id); |
4a099e4d0d09
propagate from branch 'im.pidgin.pidgin' (head 98b6b547b29ea1192b73cc4e1de1e674edef4328)
Richard Laager <rlaager@wiktel.com>
parents:
diff
changeset
|
647 } |
20477
9a2a4a0c0003
Add the possibility to create an Address Book, useful for newly registered MSN users.
Carlos Silva <typ0@pidgin.im>
parents:
20471
diff
changeset
|
648 } else { |
20671
4dd60add6a7c
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 <daniel.atallah@gmail.com>
parents:
20666
diff
changeset
|
649 purple_debug_info("msn", "User not in any groups, adding to default group.\n"); |
20394
4a099e4d0d09
propagate from branch 'im.pidgin.pidgin' (head 98b6b547b29ea1192b73cc4e1de1e674edef4328)
Richard Laager <rlaager@wiktel.com>
parents:
diff
changeset
|
650 /*not in any group,Then set default group*/ |
20439
bee467c81570
A bunch of MSNP14 stuff:
Stu Tomlinson <stu@nosnilmot.com>
parents:
20432
diff
changeset
|
651 msn_user_add_group_id(user, MSN_INDIVIDUALS_GROUP_ID); |
20394
4a099e4d0d09
propagate from branch 'im.pidgin.pidgin' (head 98b6b547b29ea1192b73cc4e1de1e674edef4328)
Richard Laager <rlaager@wiktel.com>
parents:
diff
changeset
|
652 } |
20439
bee467c81570
A bunch of MSNP14 stuff:
Stu Tomlinson <stu@nosnilmot.com>
parents:
20432
diff
changeset
|
653 |
bee467c81570
A bunch of MSNP14 stuff:
Stu Tomlinson <stu@nosnilmot.com>
parents:
20432
diff
changeset
|
654 msn_got_lst_user(session, user, MSN_LIST_FL_OP, NULL); |
22552
207f51e16b50
another patch from Maiku that "Properly identifies users you have the mobile
Ka-Hing Cheung <khc@hxbc.us>
parents:
21833
diff
changeset
|
655 |
23564
7bceac816e19
The great MSN debug message cleanup! Threw in a few whitespace fixes,
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
23552
diff
changeset
|
656 if (mobile && user) |
22552
207f51e16b50
another patch from Maiku that "Properly identifies users you have the mobile
Ka-Hing Cheung <khc@hxbc.us>
parents:
21833
diff
changeset
|
657 { |
207f51e16b50
another patch from Maiku that "Properly identifies users you have the mobile
Ka-Hing Cheung <khc@hxbc.us>
parents:
21833
diff
changeset
|
658 user->mobile = TRUE; |
207f51e16b50
another patch from Maiku that "Properly identifies users you have the mobile
Ka-Hing Cheung <khc@hxbc.us>
parents:
21833
diff
changeset
|
659 purple_prpl_got_user_status(session->account, user->passport, "mobile", NULL); |
207f51e16b50
another patch from Maiku that "Properly identifies users you have the mobile
Ka-Hing Cheung <khc@hxbc.us>
parents:
21833
diff
changeset
|
660 purple_prpl_got_user_status(session->account, user->passport, "available", NULL); |
207f51e16b50
another patch from Maiku that "Properly identifies users you have the mobile
Ka-Hing Cheung <khc@hxbc.us>
parents:
21833
diff
changeset
|
661 } |
23517
70de4e2246ec
Add real server-side aliasing to MSN.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
23515
diff
changeset
|
662 if (alias) |
70de4e2246ec
Add real server-side aliasing to MSN.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
23515
diff
changeset
|
663 purple_serv_got_private_alias(pc, passport, alias); |
20439
bee467c81570
A bunch of MSNP14 stuff:
Stu Tomlinson <stu@nosnilmot.com>
parents:
20432
diff
changeset
|
664 } |
20666
0e1bc5c51030
A few leak plugs, some unnecessary allocation prevention, null pointer deref fixes and general robustness fixes. I'm sure there is more to do here, I got tired... Fixes #3308
Daniel Atallah <daniel.atallah@gmail.com>
parents:
20539
diff
changeset
|
665 |
0e1bc5c51030
A few leak plugs, some unnecessary allocation prevention, null pointer deref fixes and general robustness fixes. I'm sure there is more to do here, I got tired... Fixes #3308
Daniel Atallah <daniel.atallah@gmail.com>
parents:
20539
diff
changeset
|
666 g_free(passport); |
0e1bc5c51030
A few leak plugs, some unnecessary allocation prevention, null pointer deref fixes and general robustness fixes. I'm sure there is more to do here, I got tired... Fixes #3308
Daniel Atallah <daniel.atallah@gmail.com>
parents:
20539
diff
changeset
|
667 g_free(Name); |
0e1bc5c51030
A few leak plugs, some unnecessary allocation prevention, null pointer deref fixes and general robustness fixes. I'm sure there is more to do here, I got tired... Fixes #3308
Daniel Atallah <daniel.atallah@gmail.com>
parents:
20539
diff
changeset
|
668 g_free(uid); |
0e1bc5c51030
A few leak plugs, some unnecessary allocation prevention, null pointer deref fixes and general robustness fixes. I'm sure there is more to do here, I got tired... Fixes #3308
Daniel Atallah <daniel.atallah@gmail.com>
parents:
20539
diff
changeset
|
669 g_free(type); |
22808
f62a4a7fe365
Fix a number of leaks. As far as I can tell, MSNP14 now logs in without
Daniel Atallah <daniel.atallah@gmail.com>
parents:
22805
diff
changeset
|
670 g_free(mobile_number); |
20439
bee467c81570
A bunch of MSNP14 stuff:
Stu Tomlinson <stu@nosnilmot.com>
parents:
20432
diff
changeset
|
671 } |
bee467c81570
A bunch of MSNP14 stuff:
Stu Tomlinson <stu@nosnilmot.com>
parents:
20432
diff
changeset
|
672 |
bee467c81570
A bunch of MSNP14 stuff:
Stu Tomlinson <stu@nosnilmot.com>
parents:
20432
diff
changeset
|
673 static gboolean |
23504
69af5301e1a7
killing MsnContact which just wraps MsnSession
Ka-Hing Cheung <khc@hxbc.us>
parents:
23498
diff
changeset
|
674 msn_parse_addressbook(MsnSession *session, xmlnode *node) |
20439
bee467c81570
A bunch of MSNP14 stuff:
Stu Tomlinson <stu@nosnilmot.com>
parents:
20432
diff
changeset
|
675 { |
20538
90fd0826c6ce
finish converting the rest of stuff to the new soap api, signing on, getting
Ka-Hing Cheung <khc@hxbc.us>
parents:
20501
diff
changeset
|
676 xmlnode *result; |
20439
bee467c81570
A bunch of MSNP14 stuff:
Stu Tomlinson <stu@nosnilmot.com>
parents:
20432
diff
changeset
|
677 xmlnode *groups; |
20671
4dd60add6a7c
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 <daniel.atallah@gmail.com>
parents:
20666
diff
changeset
|
678 xmlnode *contacts; |
20439
bee467c81570
A bunch of MSNP14 stuff:
Stu Tomlinson <stu@nosnilmot.com>
parents:
20432
diff
changeset
|
679 xmlnode *abNode; |
20538
90fd0826c6ce
finish converting the rest of stuff to the new soap api, signing on, getting
Ka-Hing Cheung <khc@hxbc.us>
parents:
20501
diff
changeset
|
680 xmlnode *fault; |
20439
bee467c81570
A bunch of MSNP14 stuff:
Stu Tomlinson <stu@nosnilmot.com>
parents:
20432
diff
changeset
|
681 |
23498
bca58b00afab
References #4382, replaces usage of msn_soap_xml_get with xmlnode_get_child
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
23492
diff
changeset
|
682 if ((fault = xmlnode_get_child(node, "Body/Fault"))) { |
20538
90fd0826c6ce
finish converting the rest of stuff to the new soap api, signing on, getting
Ka-Hing Cheung <khc@hxbc.us>
parents:
20501
diff
changeset
|
683 xmlnode *faultnode; |
90fd0826c6ce
finish converting the rest of stuff to the new soap api, signing on, getting
Ka-Hing Cheung <khc@hxbc.us>
parents:
20501
diff
changeset
|
684 |
90fd0826c6ce
finish converting the rest of stuff to the new soap api, signing on, getting
Ka-Hing Cheung <khc@hxbc.us>
parents:
20501
diff
changeset
|
685 if ((faultnode = xmlnode_get_child(fault, "faultstring"))) { |
90fd0826c6ce
finish converting the rest of stuff to the new soap api, signing on, getting
Ka-Hing Cheung <khc@hxbc.us>
parents:
20501
diff
changeset
|
686 gchar *faultstring = xmlnode_get_data(faultnode); |
23564
7bceac816e19
The great MSN debug message cleanup! Threw in a few whitespace fixes,
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
23552
diff
changeset
|
687 purple_debug_info("msn", "AB Faultstring: %s\n", faultstring); |
20538
90fd0826c6ce
finish converting the rest of stuff to the new soap api, signing on, getting
Ka-Hing Cheung <khc@hxbc.us>
parents:
20501
diff
changeset
|
688 g_free(faultstring); |
90fd0826c6ce
finish converting the rest of stuff to the new soap api, signing on, getting
Ka-Hing Cheung <khc@hxbc.us>
parents:
20501
diff
changeset
|
689 } |
20477
9a2a4a0c0003
Add the possibility to create an Address Book, useful for newly registered MSN users.
Carlos Silva <typ0@pidgin.im>
parents:
20471
diff
changeset
|
690 |
23498
bca58b00afab
References #4382, replaces usage of msn_soap_xml_get with xmlnode_get_child
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
23492
diff
changeset
|
691 if ((faultnode = xmlnode_get_child(fault, "detail/errorcode"))) { |
20538
90fd0826c6ce
finish converting the rest of stuff to the new soap api, signing on, getting
Ka-Hing Cheung <khc@hxbc.us>
parents:
20501
diff
changeset
|
692 gchar *errorcode = xmlnode_get_data(faultnode); |
90fd0826c6ce
finish converting the rest of stuff to the new soap api, signing on, getting
Ka-Hing Cheung <khc@hxbc.us>
parents:
20501
diff
changeset
|
693 |
23564
7bceac816e19
The great MSN debug message cleanup! Threw in a few whitespace fixes,
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
23552
diff
changeset
|
694 purple_debug_info("msn", "AB Error Code: %s\n", errorcode); |
23300
5cdd93dac7a2
Delete trailing whitespace
Mark Doliner <mark@kingant.net>
parents:
22808
diff
changeset
|
695 |
20538
90fd0826c6ce
finish converting the rest of stuff to the new soap api, signing on, getting
Ka-Hing Cheung <khc@hxbc.us>
parents:
20501
diff
changeset
|
696 if (g_str_equal(errorcode, "ABDoesNotExist")) { |
90fd0826c6ce
finish converting the rest of stuff to the new soap api, signing on, getting
Ka-Hing Cheung <khc@hxbc.us>
parents:
20501
diff
changeset
|
697 g_free(errorcode); |
90fd0826c6ce
finish converting the rest of stuff to the new soap api, signing on, getting
Ka-Hing Cheung <khc@hxbc.us>
parents:
20501
diff
changeset
|
698 return TRUE; |
90fd0826c6ce
finish converting the rest of stuff to the new soap api, signing on, getting
Ka-Hing Cheung <khc@hxbc.us>
parents:
20501
diff
changeset
|
699 } |
22804
7d3b2c023ad8
This is the way we plug the leaks, plug the leaks, plug the leaks...
Daniel Atallah <daniel.atallah@gmail.com>
parents:
22554
diff
changeset
|
700 g_free(errorcode); |
20538
90fd0826c6ce
finish converting the rest of stuff to the new soap api, signing on, getting
Ka-Hing Cheung <khc@hxbc.us>
parents:
20501
diff
changeset
|
701 } |
90fd0826c6ce
finish converting the rest of stuff to the new soap api, signing on, getting
Ka-Hing Cheung <khc@hxbc.us>
parents:
20501
diff
changeset
|
702 |
20439
bee467c81570
A bunch of MSNP14 stuff:
Stu Tomlinson <stu@nosnilmot.com>
parents:
20432
diff
changeset
|
703 return FALSE; |
bee467c81570
A bunch of MSNP14 stuff:
Stu Tomlinson <stu@nosnilmot.com>
parents:
20432
diff
changeset
|
704 } |
20471
530a92d50c5e
Misc cleanups, better error handling, and print the Address Book received from the server in a human readable way.
Carlos Silva <typ0@pidgin.im>
parents:
20467
diff
changeset
|
705 |
23498
bca58b00afab
References #4382, replaces usage of msn_soap_xml_get with xmlnode_get_child
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
23492
diff
changeset
|
706 result = xmlnode_get_child(node, "Body/ABFindAllResponse/ABFindAllResult"); |
23564
7bceac816e19
The great MSN debug message cleanup! Threw in a few whitespace fixes,
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
23552
diff
changeset
|
707 if (result == NULL) { |
7bceac816e19
The great MSN debug message cleanup! Threw in a few whitespace fixes,
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
23552
diff
changeset
|
708 purple_debug_misc("msn", "Received no address book update\n"); |
20538
90fd0826c6ce
finish converting the rest of stuff to the new soap api, signing on, getting
Ka-Hing Cheung <khc@hxbc.us>
parents:
20501
diff
changeset
|
709 return TRUE; |
20477
9a2a4a0c0003
Add the possibility to create an Address Book, useful for newly registered MSN users.
Carlos Silva <typ0@pidgin.im>
parents:
20471
diff
changeset
|
710 } |
9a2a4a0c0003
Add the possibility to create an Address Book, useful for newly registered MSN users.
Carlos Silva <typ0@pidgin.im>
parents:
20471
diff
changeset
|
711 |
20538
90fd0826c6ce
finish converting the rest of stuff to the new soap api, signing on, getting
Ka-Hing Cheung <khc@hxbc.us>
parents:
20501
diff
changeset
|
712 /* I don't see this "groups" tag documented on msnpiki, need to find out |
90fd0826c6ce
finish converting the rest of stuff to the new soap api, signing on, getting
Ka-Hing Cheung <khc@hxbc.us>
parents:
20501
diff
changeset
|
713 if they are really there, and update msnpiki */ |
20439
bee467c81570
A bunch of MSNP14 stuff:
Stu Tomlinson <stu@nosnilmot.com>
parents:
20432
diff
changeset
|
714 /*Process Group List*/ |
23564
7bceac816e19
The great MSN debug message cleanup! Threw in a few whitespace fixes,
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
23552
diff
changeset
|
715 groups = xmlnode_get_child(result, "groups"); |
20439
bee467c81570
A bunch of MSNP14 stuff:
Stu Tomlinson <stu@nosnilmot.com>
parents:
20432
diff
changeset
|
716 if (groups != NULL) { |
23504
69af5301e1a7
killing MsnContact which just wraps MsnSession
Ka-Hing Cheung <khc@hxbc.us>
parents:
23498
diff
changeset
|
717 msn_parse_addressbook_groups(session, groups); |
20439
bee467c81570
A bunch of MSNP14 stuff:
Stu Tomlinson <stu@nosnilmot.com>
parents:
20432
diff
changeset
|
718 } |
bee467c81570
A bunch of MSNP14 stuff:
Stu Tomlinson <stu@nosnilmot.com>
parents:
20432
diff
changeset
|
719 |
bee467c81570
A bunch of MSNP14 stuff:
Stu Tomlinson <stu@nosnilmot.com>
parents:
20432
diff
changeset
|
720 /*add a default No group to set up the no group Membership*/ |
bee467c81570
A bunch of MSNP14 stuff:
Stu Tomlinson <stu@nosnilmot.com>
parents:
20432
diff
changeset
|
721 msn_group_new(session->userlist, MSN_INDIVIDUALS_GROUP_ID, |
bee467c81570
A bunch of MSNP14 stuff:
Stu Tomlinson <stu@nosnilmot.com>
parents:
20432
diff
changeset
|
722 MSN_INDIVIDUALS_GROUP_NAME); |
23564
7bceac816e19
The great MSN debug message cleanup! Threw in a few whitespace fixes,
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
23552
diff
changeset
|
723 purple_debug_misc("msn", "AB group_id:%s name:%s\n", |
20439
bee467c81570
A bunch of MSNP14 stuff:
Stu Tomlinson <stu@nosnilmot.com>
parents:
20432
diff
changeset
|
724 MSN_INDIVIDUALS_GROUP_ID, MSN_INDIVIDUALS_GROUP_NAME); |
bee467c81570
A bunch of MSNP14 stuff:
Stu Tomlinson <stu@nosnilmot.com>
parents:
20432
diff
changeset
|
725 if ((purple_find_group(MSN_INDIVIDUALS_GROUP_NAME)) == NULL){ |
bee467c81570
A bunch of MSNP14 stuff:
Stu Tomlinson <stu@nosnilmot.com>
parents:
20432
diff
changeset
|
726 PurpleGroup *g = purple_group_new(MSN_INDIVIDUALS_GROUP_NAME); |
bee467c81570
A bunch of MSNP14 stuff:
Stu Tomlinson <stu@nosnilmot.com>
parents:
20432
diff
changeset
|
727 purple_blist_add_group(g, NULL); |
bee467c81570
A bunch of MSNP14 stuff:
Stu Tomlinson <stu@nosnilmot.com>
parents:
20432
diff
changeset
|
728 } |
bee467c81570
A bunch of MSNP14 stuff:
Stu Tomlinson <stu@nosnilmot.com>
parents:
20432
diff
changeset
|
729 |
bee467c81570
A bunch of MSNP14 stuff:
Stu Tomlinson <stu@nosnilmot.com>
parents:
20432
diff
changeset
|
730 /*add a default No group to set up the no group Membership*/ |
bee467c81570
A bunch of MSNP14 stuff:
Stu Tomlinson <stu@nosnilmot.com>
parents:
20432
diff
changeset
|
731 msn_group_new(session->userlist, MSN_NON_IM_GROUP_ID, MSN_NON_IM_GROUP_NAME); |
23564
7bceac816e19
The great MSN debug message cleanup! Threw in a few whitespace fixes,
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
23552
diff
changeset
|
732 purple_debug_misc("msn", "AB group_id:%s name:%s\n", MSN_NON_IM_GROUP_ID, MSN_NON_IM_GROUP_NAME); |
7bceac816e19
The great MSN debug message cleanup! Threw in a few whitespace fixes,
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
23552
diff
changeset
|
733 if ((purple_find_group(MSN_NON_IM_GROUP_NAME)) == NULL) { |
20439
bee467c81570
A bunch of MSNP14 stuff:
Stu Tomlinson <stu@nosnilmot.com>
parents:
20432
diff
changeset
|
734 PurpleGroup *g = purple_group_new(MSN_NON_IM_GROUP_NAME); |
bee467c81570
A bunch of MSNP14 stuff:
Stu Tomlinson <stu@nosnilmot.com>
parents:
20432
diff
changeset
|
735 purple_blist_add_group(g, NULL); |
bee467c81570
A bunch of MSNP14 stuff:
Stu Tomlinson <stu@nosnilmot.com>
parents:
20432
diff
changeset
|
736 } |
bee467c81570
A bunch of MSNP14 stuff:
Stu Tomlinson <stu@nosnilmot.com>
parents:
20432
diff
changeset
|
737 |
bee467c81570
A bunch of MSNP14 stuff:
Stu Tomlinson <stu@nosnilmot.com>
parents:
20432
diff
changeset
|
738 /*Process contact List*/ |
23564
7bceac816e19
The great MSN debug message cleanup! Threw in a few whitespace fixes,
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
23552
diff
changeset
|
739 purple_debug_info("msn", "Process contact list...\n"); |
7bceac816e19
The great MSN debug message cleanup! Threw in a few whitespace fixes,
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
23552
diff
changeset
|
740 contacts = xmlnode_get_child(result, "contacts"); |
20439
bee467c81570
A bunch of MSNP14 stuff:
Stu Tomlinson <stu@nosnilmot.com>
parents:
20432
diff
changeset
|
741 if (contacts != NULL) { |
23504
69af5301e1a7
killing MsnContact which just wraps MsnSession
Ka-Hing Cheung <khc@hxbc.us>
parents:
23498
diff
changeset
|
742 msn_parse_addressbook_contacts(session, contacts); |
20394
4a099e4d0d09
propagate from branch 'im.pidgin.pidgin' (head 98b6b547b29ea1192b73cc4e1de1e674edef4328)
Richard Laager <rlaager@wiktel.com>
parents:
diff
changeset
|
743 } |
4a099e4d0d09
propagate from branch 'im.pidgin.pidgin' (head 98b6b547b29ea1192b73cc4e1de1e674edef4328)
Richard Laager <rlaager@wiktel.com>
parents:
diff
changeset
|
744 |
23564
7bceac816e19
The great MSN debug message cleanup! Threw in a few whitespace fixes,
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
23552
diff
changeset
|
745 abNode = xmlnode_get_child(result, "ab"); |
7bceac816e19
The great MSN debug message cleanup! Threw in a few whitespace fixes,
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
23552
diff
changeset
|
746 if (abNode != NULL) { |
20666
0e1bc5c51030
A few leak plugs, some unnecessary allocation prevention, null pointer deref fixes and general robustness fixes. I'm sure there is more to do here, I got tired... Fixes #3308
Daniel Atallah <daniel.atallah@gmail.com>
parents:
20539
diff
changeset
|
747 xmlnode *node2; |
0e1bc5c51030
A few leak plugs, some unnecessary allocation prevention, null pointer deref fixes and general robustness fixes. I'm sure there is more to do here, I got tired... Fixes #3308
Daniel Atallah <daniel.atallah@gmail.com>
parents:
20539
diff
changeset
|
748 char *tmp = NULL; |
20394
4a099e4d0d09
propagate from branch 'im.pidgin.pidgin' (head 98b6b547b29ea1192b73cc4e1de1e674edef4328)
Richard Laager <rlaager@wiktel.com>
parents:
diff
changeset
|
749 |
20666
0e1bc5c51030
A few leak plugs, some unnecessary allocation prevention, null pointer deref fixes and general robustness fixes. I'm sure there is more to do here, I got tired... Fixes #3308
Daniel Atallah <daniel.atallah@gmail.com>
parents:
20539
diff
changeset
|
750 if ((node2 = xmlnode_get_child(abNode, "lastChange"))) |
0e1bc5c51030
A few leak plugs, some unnecessary allocation prevention, null pointer deref fixes and general robustness fixes. I'm sure there is more to do here, I got tired... Fixes #3308
Daniel Atallah <daniel.atallah@gmail.com>
parents:
20539
diff
changeset
|
751 tmp = xmlnode_get_data(node2); |
23564
7bceac816e19
The great MSN debug message cleanup! Threw in a few whitespace fixes,
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
23552
diff
changeset
|
752 purple_debug_info("msn", "AB lastchanged Time:{%s}\n", tmp ? tmp : "(null)"); |
20666
0e1bc5c51030
A few leak plugs, some unnecessary allocation prevention, null pointer deref fixes and general robustness fixes. I'm sure there is more to do here, I got tired... Fixes #3308
Daniel Atallah <daniel.atallah@gmail.com>
parents:
20539
diff
changeset
|
753 purple_account_set_string(session->account, "ablastChange", tmp); |
20432
703fc3437ab5
Store account specific settings in the account, not in some random blist
Stu Tomlinson <stu@nosnilmot.com>
parents:
20427
diff
changeset
|
754 |
20666
0e1bc5c51030
A few leak plugs, some unnecessary allocation prevention, null pointer deref fixes and general robustness fixes. I'm sure there is more to do here, I got tired... Fixes #3308
Daniel Atallah <daniel.atallah@gmail.com>
parents:
20539
diff
changeset
|
755 g_free(tmp); tmp = NULL; |
0e1bc5c51030
A few leak plugs, some unnecessary allocation prevention, null pointer deref fixes and general robustness fixes. I'm sure there is more to do here, I got tired... Fixes #3308
Daniel Atallah <daniel.atallah@gmail.com>
parents:
20539
diff
changeset
|
756 if ((node2 = xmlnode_get_child(abNode, "DynamicItemLastChanged"))) |
0e1bc5c51030
A few leak plugs, some unnecessary allocation prevention, null pointer deref fixes and general robustness fixes. I'm sure there is more to do here, I got tired... Fixes #3308
Daniel Atallah <daniel.atallah@gmail.com>
parents:
20539
diff
changeset
|
757 tmp = xmlnode_get_data(node2); |
23564
7bceac816e19
The great MSN debug message cleanup! Threw in a few whitespace fixes,
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
23552
diff
changeset
|
758 purple_debug_info("msn", "AB DynamicItemLastChanged :{%s}\n", tmp ? tmp : "(null)"); |
20666
0e1bc5c51030
A few leak plugs, some unnecessary allocation prevention, null pointer deref fixes and general robustness fixes. I'm sure there is more to do here, I got tired... Fixes #3308
Daniel Atallah <daniel.atallah@gmail.com>
parents:
20539
diff
changeset
|
759 purple_account_set_string(session->account, "DynamicItemLastChanged", tmp); |
0e1bc5c51030
A few leak plugs, some unnecessary allocation prevention, null pointer deref fixes and general robustness fixes. I'm sure there is more to do here, I got tired... Fixes #3308
Daniel Atallah <daniel.atallah@gmail.com>
parents:
20539
diff
changeset
|
760 g_free(tmp); |
20394
4a099e4d0d09
propagate from branch 'im.pidgin.pidgin' (head 98b6b547b29ea1192b73cc4e1de1e674edef4328)
Richard Laager <rlaager@wiktel.com>
parents:
diff
changeset
|
761 } |
4a099e4d0d09
propagate from branch 'im.pidgin.pidgin' (head 98b6b547b29ea1192b73cc4e1de1e674edef4328)
Richard Laager <rlaager@wiktel.com>
parents:
diff
changeset
|
762 |
4a099e4d0d09
propagate from branch 'im.pidgin.pidgin' (head 98b6b547b29ea1192b73cc4e1de1e674edef4328)
Richard Laager <rlaager@wiktel.com>
parents:
diff
changeset
|
763 return TRUE; |
4a099e4d0d09
propagate from branch 'im.pidgin.pidgin' (head 98b6b547b29ea1192b73cc4e1de1e674edef4328)
Richard Laager <rlaager@wiktel.com>
parents:
diff
changeset
|
764 } |
4a099e4d0d09
propagate from branch 'im.pidgin.pidgin' (head 98b6b547b29ea1192b73cc4e1de1e674edef4328)
Richard Laager <rlaager@wiktel.com>
parents:
diff
changeset
|
765 |
4a099e4d0d09
propagate from branch 'im.pidgin.pidgin' (head 98b6b547b29ea1192b73cc4e1de1e674edef4328)
Richard Laager <rlaager@wiktel.com>
parents:
diff
changeset
|
766 static void |
20538
90fd0826c6ce
finish converting the rest of stuff to the new soap api, signing on, getting
Ka-Hing Cheung <khc@hxbc.us>
parents:
20501
diff
changeset
|
767 msn_get_address_cb(MsnSoapMessage *req, MsnSoapMessage *resp, gpointer data) |
20394
4a099e4d0d09
propagate from branch 'im.pidgin.pidgin' (head 98b6b547b29ea1192b73cc4e1de1e674edef4328)
Richard Laager <rlaager@wiktel.com>
parents:
diff
changeset
|
768 { |
23504
69af5301e1a7
killing MsnContact which just wraps MsnSession
Ka-Hing Cheung <khc@hxbc.us>
parents:
23498
diff
changeset
|
769 MsnSession *session = data; |
20394
4a099e4d0d09
propagate from branch 'im.pidgin.pidgin' (head 98b6b547b29ea1192b73cc4e1de1e674edef4328)
Richard Laager <rlaager@wiktel.com>
parents:
diff
changeset
|
770 |
20538
90fd0826c6ce
finish converting the rest of stuff to the new soap api, signing on, getting
Ka-Hing Cheung <khc@hxbc.us>
parents:
20501
diff
changeset
|
771 if (resp == NULL) |
20501
f6dff814d95f
cleans up ownership of soap callback data, this soap stuff is perfect
Ka-Hing Cheung <khc@hxbc.us>
parents:
20495
diff
changeset
|
772 return; |
f6dff814d95f
cleans up ownership of soap callback data, this soap stuff is perfect
Ka-Hing Cheung <khc@hxbc.us>
parents:
20495
diff
changeset
|
773 |
20394
4a099e4d0d09
propagate from branch 'im.pidgin.pidgin' (head 98b6b547b29ea1192b73cc4e1de1e674edef4328)
Richard Laager <rlaager@wiktel.com>
parents:
diff
changeset
|
774 g_return_if_fail(session != NULL); |
4a099e4d0d09
propagate from branch 'im.pidgin.pidgin' (head 98b6b547b29ea1192b73cc4e1de1e674edef4328)
Richard Laager <rlaager@wiktel.com>
parents:
diff
changeset
|
775 |
23564
7bceac816e19
The great MSN debug message cleanup! Threw in a few whitespace fixes,
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
23552
diff
changeset
|
776 purple_debug_misc("msn", "Got the Address Book!\n"); |
20479
6a8463be5b23
Improve MSN_SOAP_DEBUG and workaround a Win32 bug which would case Pidgin to consume insane amounts of memory when printing a large string to the Debug Window.
Carlos Silva <typ0@pidgin.im>
parents:
20477
diff
changeset
|
777 |
23504
69af5301e1a7
killing MsnContact which just wraps MsnSession
Ka-Hing Cheung <khc@hxbc.us>
parents:
23498
diff
changeset
|
778 if (msn_parse_addressbook(session, resp->xml)) { |
23574
4162ac08c775
On MSN, always send the privacy settings and contact list after parsing
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
23566
diff
changeset
|
779 msn_send_privacy(session->account->gc); |
4162ac08c775
On MSN, always send the privacy settings and contact list after parsing
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
23566
diff
changeset
|
780 msn_notification_dump_contact(session); |
20394
4a099e4d0d09
propagate from branch 'im.pidgin.pidgin' (head 98b6b547b29ea1192b73cc4e1de1e674edef4328)
Richard Laager <rlaager@wiktel.com>
parents:
diff
changeset
|
781 } else { |
20538
90fd0826c6ce
finish converting the rest of stuff to the new soap api, signing on, getting
Ka-Hing Cheung <khc@hxbc.us>
parents:
20501
diff
changeset
|
782 /* This is making us loop infinitely when we fail to parse the |
90fd0826c6ce
finish converting the rest of stuff to the new soap api, signing on, getting
Ka-Hing Cheung <khc@hxbc.us>
parents:
20501
diff
changeset
|
783 address book, disable for now (we should re-enable when we |
90fd0826c6ce
finish converting the rest of stuff to the new soap api, signing on, getting
Ka-Hing Cheung <khc@hxbc.us>
parents:
20501
diff
changeset
|
784 send timestamps) |
20477
9a2a4a0c0003
Add the possibility to create an Address Book, useful for newly registered MSN users.
Carlos Silva <typ0@pidgin.im>
parents:
20471
diff
changeset
|
785 */ |
9a2a4a0c0003
Add the possibility to create an Address Book, useful for newly registered MSN users.
Carlos Silva <typ0@pidgin.im>
parents:
20471
diff
changeset
|
786 /* |
23504
69af5301e1a7
killing MsnContact which just wraps MsnSession
Ka-Hing Cheung <khc@hxbc.us>
parents:
23498
diff
changeset
|
787 msn_get_address_book(session, NULL, NULL); |
20477
9a2a4a0c0003
Add the possibility to create an Address Book, useful for newly registered MSN users.
Carlos Silva <typ0@pidgin.im>
parents:
20471
diff
changeset
|
788 */ |
9a2a4a0c0003
Add the possibility to create an Address Book, useful for newly registered MSN users.
Carlos Silva <typ0@pidgin.im>
parents:
20471
diff
changeset
|
789 msn_session_disconnect(session); |
21358 | 790 purple_connection_error_reason(session->account->gc, PURPLE_CONNECTION_ERROR_NETWORK_ERROR, _("Unable to retrieve MSN Address Book")); |
20394
4a099e4d0d09
propagate from branch 'im.pidgin.pidgin' (head 98b6b547b29ea1192b73cc4e1de1e674edef4328)
Richard Laager <rlaager@wiktel.com>
parents:
diff
changeset
|
791 } |
4a099e4d0d09
propagate from branch 'im.pidgin.pidgin' (head 98b6b547b29ea1192b73cc4e1de1e674edef4328)
Richard Laager <rlaager@wiktel.com>
parents:
diff
changeset
|
792 } |
4a099e4d0d09
propagate from branch 'im.pidgin.pidgin' (head 98b6b547b29ea1192b73cc4e1de1e674edef4328)
Richard Laager <rlaager@wiktel.com>
parents:
diff
changeset
|
793 |
4a099e4d0d09
propagate from branch 'im.pidgin.pidgin' (head 98b6b547b29ea1192b73cc4e1de1e674edef4328)
Richard Laager <rlaager@wiktel.com>
parents:
diff
changeset
|
794 /*get the address book*/ |
4a099e4d0d09
propagate from branch 'im.pidgin.pidgin' (head 98b6b547b29ea1192b73cc4e1de1e674edef4328)
Richard Laager <rlaager@wiktel.com>
parents:
diff
changeset
|
795 void |
23504
69af5301e1a7
killing MsnContact which just wraps MsnSession
Ka-Hing Cheung <khc@hxbc.us>
parents:
23498
diff
changeset
|
796 msn_get_address_book(MsnSession *session, |
20538
90fd0826c6ce
finish converting the rest of stuff to the new soap api, signing on, getting
Ka-Hing Cheung <khc@hxbc.us>
parents:
20501
diff
changeset
|
797 MsnSoapPartnerScenario partner_scenario, const char *LastChanged, |
90fd0826c6ce
finish converting the rest of stuff to the new soap api, signing on, getting
Ka-Hing Cheung <khc@hxbc.us>
parents:
20501
diff
changeset
|
798 const char *dynamicItemLastChange) |
20394
4a099e4d0d09
propagate from branch 'im.pidgin.pidgin' (head 98b6b547b29ea1192b73cc4e1de1e674edef4328)
Richard Laager <rlaager@wiktel.com>
parents:
diff
changeset
|
799 { |
21109
e64e6fbd1351
merge_into_workspace of c0e79d15a4fe4c5b0129fcae5060754b25f72a56 and
Ka-Hing Cheung <khc@hxbc.us>
diff
changeset
|
800 char *body, *update_str = NULL; |
20394
4a099e4d0d09
propagate from branch 'im.pidgin.pidgin' (head 98b6b547b29ea1192b73cc4e1de1e674edef4328)
Richard Laager <rlaager@wiktel.com>
parents:
diff
changeset
|
801 |
23564
7bceac816e19
The great MSN debug message cleanup! Threw in a few whitespace fixes,
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
23552
diff
changeset
|
802 purple_debug_misc("msn", "Getting Address Book\n"); |
20477
9a2a4a0c0003
Add the possibility to create an Address Book, useful for newly registered MSN users.
Carlos Silva <typ0@pidgin.im>
parents:
20471
diff
changeset
|
803 |
20394
4a099e4d0d09
propagate from branch 'im.pidgin.pidgin' (head 98b6b547b29ea1192b73cc4e1de1e674edef4328)
Richard Laager <rlaager@wiktel.com>
parents:
diff
changeset
|
804 /*build SOAP and POST it*/ |
20666
0e1bc5c51030
A few leak plugs, some unnecessary allocation prevention, null pointer deref fixes and general robustness fixes. I'm sure there is more to do here, I got tired... Fixes #3308
Daniel Atallah <daniel.atallah@gmail.com>
parents:
20539
diff
changeset
|
805 if (dynamicItemLastChange != NULL) |
0e1bc5c51030
A few leak plugs, some unnecessary allocation prevention, null pointer deref fixes and general robustness fixes. I'm sure there is more to do here, I got tired... Fixes #3308
Daniel Atallah <daniel.atallah@gmail.com>
parents:
20539
diff
changeset
|
806 update_str = g_strdup_printf(MSN_GET_ADDRESS_UPDATE_XML, dynamicItemLastChange); |
0e1bc5c51030
A few leak plugs, some unnecessary allocation prevention, null pointer deref fixes and general robustness fixes. I'm sure there is more to do here, I got tired... Fixes #3308
Daniel Atallah <daniel.atallah@gmail.com>
parents:
20539
diff
changeset
|
807 else if (LastChanged != NULL) |
0e1bc5c51030
A few leak plugs, some unnecessary allocation prevention, null pointer deref fixes and general robustness fixes. I'm sure there is more to do here, I got tired... Fixes #3308
Daniel Atallah <daniel.atallah@gmail.com>
parents:
20539
diff
changeset
|
808 update_str = g_strdup_printf(MSN_GET_ADDRESS_UPDATE_XML, LastChanged); |
20481
eb93710aec4d
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:
20479
diff
changeset
|
809 |
23515
eb8bd060b987
Update MSN Contact tokens when an invalid token error is returned.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
23509
diff
changeset
|
810 body = g_markup_printf_escaped(MSN_GET_ADDRESS_TEMPLATE, |
23492
72aa2ccad28d
fix sending offline message in p15 by sending the correct token. In msnp14,
Ka-Hing Cheung <khc@hxbc.us>
parents:
23491
diff
changeset
|
811 MsnSoapPartnerScenarioText[partner_scenario], |
23504
69af5301e1a7
killing MsnContact which just wraps MsnSession
Ka-Hing Cheung <khc@hxbc.us>
parents:
23498
diff
changeset
|
812 msn_nexus_get_token_str(session->nexus, MSN_AUTH_CONTACTS), |
23492
72aa2ccad28d
fix sending offline message in p15 by sending the correct token. In msnp14,
Ka-Hing Cheung <khc@hxbc.us>
parents:
23491
diff
changeset
|
813 update_str ? update_str : ""); |
20477
9a2a4a0c0003
Add the possibility to create an Address Book, useful for newly registered MSN users.
Carlos Silva <typ0@pidgin.im>
parents:
20471
diff
changeset
|
814 |
23504
69af5301e1a7
killing MsnContact which just wraps MsnSession
Ka-Hing Cheung <khc@hxbc.us>
parents:
23498
diff
changeset
|
815 msn_soap_message_send(session, |
20538
90fd0826c6ce
finish converting the rest of stuff to the new soap api, signing on, getting
Ka-Hing Cheung <khc@hxbc.us>
parents:
20501
diff
changeset
|
816 msn_soap_message_new(MSN_GET_ADDRESS_SOAP_ACTION, |
90fd0826c6ce
finish converting the rest of stuff to the new soap api, signing on, getting
Ka-Hing Cheung <khc@hxbc.us>
parents:
20501
diff
changeset
|
817 xmlnode_from_str(body, -1)), |
90fd0826c6ce
finish converting the rest of stuff to the new soap api, signing on, getting
Ka-Hing Cheung <khc@hxbc.us>
parents:
20501
diff
changeset
|
818 MSN_CONTACT_SERVER, MSN_ADDRESS_BOOK_POST_URL, msn_get_address_cb, |
23504
69af5301e1a7
killing MsnContact which just wraps MsnSession
Ka-Hing Cheung <khc@hxbc.us>
parents:
23498
diff
changeset
|
819 session); |
20538
90fd0826c6ce
finish converting the rest of stuff to the new soap api, signing on, getting
Ka-Hing Cheung <khc@hxbc.us>
parents:
20501
diff
changeset
|
820 |
21109
e64e6fbd1351
merge_into_workspace of c0e79d15a4fe4c5b0129fcae5060754b25f72a56 and
Ka-Hing Cheung <khc@hxbc.us>
diff
changeset
|
821 g_free(update_str); |
20394
4a099e4d0d09
propagate from branch 'im.pidgin.pidgin' (head 98b6b547b29ea1192b73cc4e1de1e674edef4328)
Richard Laager <rlaager@wiktel.com>
parents:
diff
changeset
|
822 g_free(body); |
4a099e4d0d09
propagate from branch 'im.pidgin.pidgin' (head 98b6b547b29ea1192b73cc4e1de1e674edef4328)
Richard Laager <rlaager@wiktel.com>
parents:
diff
changeset
|
823 } |
4a099e4d0d09
propagate from branch 'im.pidgin.pidgin' (head 98b6b547b29ea1192b73cc4e1de1e674edef4328)
Richard Laager <rlaager@wiktel.com>
parents:
diff
changeset
|
824 |
23515
eb8bd060b987
Update MSN Contact tokens when an invalid token error is returned.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
23509
diff
changeset
|
825 /*************************************************************** |
eb8bd060b987
Update MSN Contact tokens when an invalid token error is returned.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
23509
diff
changeset
|
826 * Contact Operations |
eb8bd060b987
Update MSN Contact tokens when an invalid token error is returned.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
23509
diff
changeset
|
827 ***************************************************************/ |
eb8bd060b987
Update MSN Contact tokens when an invalid token error is returned.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
23509
diff
changeset
|
828 |
eb8bd060b987
Update MSN Contact tokens when an invalid token error is returned.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
23509
diff
changeset
|
829 static const char * |
eb8bd060b987
Update MSN Contact tokens when an invalid token error is returned.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
23509
diff
changeset
|
830 msn_contact_operation_str(MsnCallbackAction action) |
eb8bd060b987
Update MSN Contact tokens when an invalid token error is returned.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
23509
diff
changeset
|
831 { |
eb8bd060b987
Update MSN Contact tokens when an invalid token error is returned.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
23509
diff
changeset
|
832 /* Make sure this is large enough when adding more */ |
eb8bd060b987
Update MSN Contact tokens when an invalid token error is returned.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
23509
diff
changeset
|
833 static char buf[BUF_LEN]; |
eb8bd060b987
Update MSN Contact tokens when an invalid token error is returned.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
23509
diff
changeset
|
834 buf[0] = '\0'; |
eb8bd060b987
Update MSN Contact tokens when an invalid token error is returned.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
23509
diff
changeset
|
835 |
eb8bd060b987
Update MSN Contact tokens when an invalid token error is returned.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
23509
diff
changeset
|
836 if (action & MSN_ADD_BUDDY) |
eb8bd060b987
Update MSN Contact tokens when an invalid token error is returned.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
23509
diff
changeset
|
837 strcat(buf, "Adding Buddy,"); |
eb8bd060b987
Update MSN Contact tokens when an invalid token error is returned.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
23509
diff
changeset
|
838 if (action & MSN_MOVE_BUDDY) |
eb8bd060b987
Update MSN Contact tokens when an invalid token error is returned.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
23509
diff
changeset
|
839 strcat(buf, "Moving Buddy,"); |
eb8bd060b987
Update MSN Contact tokens when an invalid token error is returned.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
23509
diff
changeset
|
840 if (action & MSN_ACCEPTED_BUDDY) |
eb8bd060b987
Update MSN Contact tokens when an invalid token error is returned.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
23509
diff
changeset
|
841 strcat(buf, "Accepted Buddy,"); |
eb8bd060b987
Update MSN Contact tokens when an invalid token error is returned.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
23509
diff
changeset
|
842 if (action & MSN_DENIED_BUDDY) |
eb8bd060b987
Update MSN Contact tokens when an invalid token error is returned.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
23509
diff
changeset
|
843 strcat(buf, "Denied Buddy,"); |
eb8bd060b987
Update MSN Contact tokens when an invalid token error is returned.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
23509
diff
changeset
|
844 if (action & MSN_ADD_GROUP) |
eb8bd060b987
Update MSN Contact tokens when an invalid token error is returned.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
23509
diff
changeset
|
845 strcat(buf, "Adding Group,"); |
eb8bd060b987
Update MSN Contact tokens when an invalid token error is returned.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
23509
diff
changeset
|
846 if (action & MSN_DEL_GROUP) |
eb8bd060b987
Update MSN Contact tokens when an invalid token error is returned.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
23509
diff
changeset
|
847 strcat(buf, "Deleting Group,"); |
eb8bd060b987
Update MSN Contact tokens when an invalid token error is returned.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
23509
diff
changeset
|
848 if (action & MSN_RENAME_GROUP) |
eb8bd060b987
Update MSN Contact tokens when an invalid token error is returned.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
23509
diff
changeset
|
849 strcat(buf, "Renaming Group,"); |
eb8bd060b987
Update MSN Contact tokens when an invalid token error is returned.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
23509
diff
changeset
|
850 if (action & MSN_UPDATE_INFO) |
eb8bd060b987
Update MSN Contact tokens when an invalid token error is returned.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
23509
diff
changeset
|
851 strcat(buf, "Updating Contact Info,"); |
eb8bd060b987
Update MSN Contact tokens when an invalid token error is returned.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
23509
diff
changeset
|
852 |
eb8bd060b987
Update MSN Contact tokens when an invalid token error is returned.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
23509
diff
changeset
|
853 return buf; |
eb8bd060b987
Update MSN Contact tokens when an invalid token error is returned.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
23509
diff
changeset
|
854 } |
eb8bd060b987
Update MSN Contact tokens when an invalid token error is returned.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
23509
diff
changeset
|
855 |
eb8bd060b987
Update MSN Contact tokens when an invalid token error is returned.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
23509
diff
changeset
|
856 static gboolean msn_contact_request(MsnCallbackState *state); |
eb8bd060b987
Update MSN Contact tokens when an invalid token error is returned.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
23509
diff
changeset
|
857 |
eb8bd060b987
Update MSN Contact tokens when an invalid token error is returned.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
23509
diff
changeset
|
858 static void |
eb8bd060b987
Update MSN Contact tokens when an invalid token error is returned.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
23509
diff
changeset
|
859 msn_contact_request_cb(MsnSoapMessage *req, MsnSoapMessage *resp, |
eb8bd060b987
Update MSN Contact tokens when an invalid token error is returned.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
23509
diff
changeset
|
860 gpointer data) |
eb8bd060b987
Update MSN Contact tokens when an invalid token error is returned.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
23509
diff
changeset
|
861 { |
eb8bd060b987
Update MSN Contact tokens when an invalid token error is returned.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
23509
diff
changeset
|
862 MsnCallbackState *state = data; |
eb8bd060b987
Update MSN Contact tokens when an invalid token error is returned.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
23509
diff
changeset
|
863 xmlnode *faultcode; |
eb8bd060b987
Update MSN Contact tokens when an invalid token error is returned.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
23509
diff
changeset
|
864 char *faultcode_str; |
eb8bd060b987
Update MSN Contact tokens when an invalid token error is returned.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
23509
diff
changeset
|
865 |
eb8bd060b987
Update MSN Contact tokens when an invalid token error is returned.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
23509
diff
changeset
|
866 if (resp == NULL) { |
23564
7bceac816e19
The great MSN debug message cleanup! Threw in a few whitespace fixes,
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
23552
diff
changeset
|
867 purple_debug_error("msn", |
23515
eb8bd060b987
Update MSN Contact tokens when an invalid token error is returned.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
23509
diff
changeset
|
868 "Operation {%s} failed. No response received from server.\n", |
eb8bd060b987
Update MSN Contact tokens when an invalid token error is returned.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
23509
diff
changeset
|
869 msn_contact_operation_str(state->action)); |
eb8bd060b987
Update MSN Contact tokens when an invalid token error is returned.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
23509
diff
changeset
|
870 return; |
eb8bd060b987
Update MSN Contact tokens when an invalid token error is returned.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
23509
diff
changeset
|
871 } |
eb8bd060b987
Update MSN Contact tokens when an invalid token error is returned.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
23509
diff
changeset
|
872 |
eb8bd060b987
Update MSN Contact tokens when an invalid token error is returned.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
23509
diff
changeset
|
873 faultcode = xmlnode_get_child(resp->xml, "Body/Fault/faultcode"); |
eb8bd060b987
Update MSN Contact tokens when an invalid token error is returned.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
23509
diff
changeset
|
874 |
eb8bd060b987
Update MSN Contact tokens when an invalid token error is returned.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
23509
diff
changeset
|
875 if (faultcode == NULL) { |
eb8bd060b987
Update MSN Contact tokens when an invalid token error is returned.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
23509
diff
changeset
|
876 /* No errors */ |
eb8bd060b987
Update MSN Contact tokens when an invalid token error is returned.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
23509
diff
changeset
|
877 if (state->cb) |
eb8bd060b987
Update MSN Contact tokens when an invalid token error is returned.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
23509
diff
changeset
|
878 ((MsnSoapCallback)state->cb)(req, resp, data); |
eb8bd060b987
Update MSN Contact tokens when an invalid token error is returned.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
23509
diff
changeset
|
879 msn_callback_state_free(state); |
eb8bd060b987
Update MSN Contact tokens when an invalid token error is returned.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
23509
diff
changeset
|
880 return; |
eb8bd060b987
Update MSN Contact tokens when an invalid token error is returned.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
23509
diff
changeset
|
881 } |
eb8bd060b987
Update MSN Contact tokens when an invalid token error is returned.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
23509
diff
changeset
|
882 |
eb8bd060b987
Update MSN Contact tokens when an invalid token error is returned.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
23509
diff
changeset
|
883 faultcode_str = xmlnode_get_data(faultcode); |
eb8bd060b987
Update MSN Contact tokens when an invalid token error is returned.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
23509
diff
changeset
|
884 |
eb8bd060b987
Update MSN Contact tokens when an invalid token error is returned.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
23509
diff
changeset
|
885 if (faultcode_str && g_str_equal(faultcode_str, "q0:BadContextToken")) { |
23564
7bceac816e19
The great MSN debug message cleanup! Threw in a few whitespace fixes,
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
23552
diff
changeset
|
886 purple_debug_info("msn", |
23515
eb8bd060b987
Update MSN Contact tokens when an invalid token error is returned.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
23509
diff
changeset
|
887 "Contact Operation {%s} failed because of bad token." |
eb8bd060b987
Update MSN Contact tokens when an invalid token error is returned.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
23509
diff
changeset
|
888 " Updating token now and retrying operation.\n", |
eb8bd060b987
Update MSN Contact tokens when an invalid token error is returned.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
23509
diff
changeset
|
889 msn_contact_operation_str(state->action)); |
eb8bd060b987
Update MSN Contact tokens when an invalid token error is returned.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
23509
diff
changeset
|
890 /* Token has expired, so renew it, and try again later */ |
eb8bd060b987
Update MSN Contact tokens when an invalid token error is returned.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
23509
diff
changeset
|
891 msn_nexus_update_token(state->session->nexus, MSN_AUTH_CONTACTS, |
eb8bd060b987
Update MSN Contact tokens when an invalid token error is returned.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
23509
diff
changeset
|
892 (GSourceFunc)msn_contact_request, data); |
eb8bd060b987
Update MSN Contact tokens when an invalid token error is returned.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
23509
diff
changeset
|
893 } |
eb8bd060b987
Update MSN Contact tokens when an invalid token error is returned.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
23509
diff
changeset
|
894 else |
eb8bd060b987
Update MSN Contact tokens when an invalid token error is returned.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
23509
diff
changeset
|
895 { |
eb8bd060b987
Update MSN Contact tokens when an invalid token error is returned.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
23509
diff
changeset
|
896 /* We don't know how to respond to this faultcode, so just log it */ |
eb8bd060b987
Update MSN Contact tokens when an invalid token error is returned.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
23509
diff
changeset
|
897 /* XXX: Probably should notify the user or undo the change or something? */ |
eb8bd060b987
Update MSN Contact tokens when an invalid token error is returned.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
23509
diff
changeset
|
898 char *str = xmlnode_to_str(xmlnode_get_child(resp->xml, "Body/Fault"), NULL); |
23564
7bceac816e19
The great MSN debug message cleanup! Threw in a few whitespace fixes,
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
23552
diff
changeset
|
899 purple_debug_error("msn", "Operation {%s} Failed, SOAP Fault was: %s\n", |
23515
eb8bd060b987
Update MSN Contact tokens when an invalid token error is returned.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
23509
diff
changeset
|
900 msn_contact_operation_str(state->action), str); |
eb8bd060b987
Update MSN Contact tokens when an invalid token error is returned.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
23509
diff
changeset
|
901 g_free(str); |
eb8bd060b987
Update MSN Contact tokens when an invalid token error is returned.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
23509
diff
changeset
|
902 msn_callback_state_free(state); |
eb8bd060b987
Update MSN Contact tokens when an invalid token error is returned.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
23509
diff
changeset
|
903 } |
eb8bd060b987
Update MSN Contact tokens when an invalid token error is returned.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
23509
diff
changeset
|
904 |
eb8bd060b987
Update MSN Contact tokens when an invalid token error is returned.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
23509
diff
changeset
|
905 g_free(faultcode_str); |
eb8bd060b987
Update MSN Contact tokens when an invalid token error is returned.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
23509
diff
changeset
|
906 } |
eb8bd060b987
Update MSN Contact tokens when an invalid token error is returned.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
23509
diff
changeset
|
907 |
eb8bd060b987
Update MSN Contact tokens when an invalid token error is returned.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
23509
diff
changeset
|
908 static gboolean |
eb8bd060b987
Update MSN Contact tokens when an invalid token error is returned.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
23509
diff
changeset
|
909 msn_contact_request(MsnCallbackState *state) |
eb8bd060b987
Update MSN Contact tokens when an invalid token error is returned.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
23509
diff
changeset
|
910 { |
eb8bd060b987
Update MSN Contact tokens when an invalid token error is returned.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
23509
diff
changeset
|
911 if (state->token == NULL) |
eb8bd060b987
Update MSN Contact tokens when an invalid token error is returned.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
23509
diff
changeset
|
912 state->token = xmlnode_get_child(state->body, |
eb8bd060b987
Update MSN Contact tokens when an invalid token error is returned.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
23509
diff
changeset
|
913 "Header/ABAuthHeader/TicketToken"); |
eb8bd060b987
Update MSN Contact tokens when an invalid token error is returned.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
23509
diff
changeset
|
914 /* delete old & replace with new token */ |
eb8bd060b987
Update MSN Contact tokens when an invalid token error is returned.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
23509
diff
changeset
|
915 xmlnode_free(state->token->child); |
eb8bd060b987
Update MSN Contact tokens when an invalid token error is returned.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
23509
diff
changeset
|
916 xmlnode_insert_data(state->token, |
eb8bd060b987
Update MSN Contact tokens when an invalid token error is returned.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
23509
diff
changeset
|
917 msn_nexus_get_token_str(state->session->nexus, MSN_AUTH_CONTACTS), -1); |
eb8bd060b987
Update MSN Contact tokens when an invalid token error is returned.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
23509
diff
changeset
|
918 msn_soap_message_send(state->session, |
eb8bd060b987
Update MSN Contact tokens when an invalid token error is returned.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
23509
diff
changeset
|
919 msn_soap_message_new(state->post_action, xmlnode_copy(state->body)), |
eb8bd060b987
Update MSN Contact tokens when an invalid token error is returned.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
23509
diff
changeset
|
920 MSN_CONTACT_SERVER, state->post_url, msn_contact_request_cb, state); |
eb8bd060b987
Update MSN Contact tokens when an invalid token error is returned.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
23509
diff
changeset
|
921 return FALSE; |
eb8bd060b987
Update MSN Contact tokens when an invalid token error is returned.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
23509
diff
changeset
|
922 } |
eb8bd060b987
Update MSN Contact tokens when an invalid token error is returned.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
23509
diff
changeset
|
923 |
20394
4a099e4d0d09
propagate from branch 'im.pidgin.pidgin' (head 98b6b547b29ea1192b73cc4e1de1e674edef4328)
Richard Laager <rlaager@wiktel.com>
parents:
diff
changeset
|
924 static void |
20538
90fd0826c6ce
finish converting the rest of stuff to the new soap api, signing on, getting
Ka-Hing Cheung <khc@hxbc.us>
parents:
20501
diff
changeset
|
925 msn_add_contact_read_cb(MsnSoapMessage *req, MsnSoapMessage *resp, |
90fd0826c6ce
finish converting the rest of stuff to the new soap api, signing on, getting
Ka-Hing Cheung <khc@hxbc.us>
parents:
20501
diff
changeset
|
926 gpointer data) |
20394
4a099e4d0d09
propagate from branch 'im.pidgin.pidgin' (head 98b6b547b29ea1192b73cc4e1de1e674edef4328)
Richard Laager <rlaager@wiktel.com>
parents:
diff
changeset
|
927 { |
20538
90fd0826c6ce
finish converting the rest of stuff to the new soap api, signing on, getting
Ka-Hing Cheung <khc@hxbc.us>
parents:
20501
diff
changeset
|
928 MsnCallbackState *state = data; |
90fd0826c6ce
finish converting the rest of stuff to the new soap api, signing on, getting
Ka-Hing Cheung <khc@hxbc.us>
parents:
20501
diff
changeset
|
929 MsnSession *session = state->session; |
20501
f6dff814d95f
cleans up ownership of soap callback data, this soap stuff is perfect
Ka-Hing Cheung <khc@hxbc.us>
parents:
20495
diff
changeset
|
930 |
23515
eb8bd060b987
Update MSN Contact tokens when an invalid token error is returned.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
23509
diff
changeset
|
931 MsnUserList *userlist; |
eb8bd060b987
Update MSN Contact tokens when an invalid token error is returned.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
23509
diff
changeset
|
932 MsnUser *user; |
eb8bd060b987
Update MSN Contact tokens when an invalid token error is returned.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
23509
diff
changeset
|
933 |
20538
90fd0826c6ce
finish converting the rest of stuff to the new soap api, signing on, getting
Ka-Hing Cheung <khc@hxbc.us>
parents:
20501
diff
changeset
|
934 g_return_if_fail(session != NULL); |
20501
f6dff814d95f
cleans up ownership of soap callback data, this soap stuff is perfect
Ka-Hing Cheung <khc@hxbc.us>
parents:
20495
diff
changeset
|
935 |
23515
eb8bd060b987
Update MSN Contact tokens when an invalid token error is returned.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
23509
diff
changeset
|
936 userlist = session->userlist; |
23300
5cdd93dac7a2
Delete trailing whitespace
Mark Doliner <mark@kingant.net>
parents:
22808
diff
changeset
|
937 |
23564
7bceac816e19
The great MSN debug message cleanup! Threw in a few whitespace fixes,
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
23552
diff
changeset
|
938 purple_debug_info("msn", "Contact added successfully\n"); |
20481
eb93710aec4d
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:
20479
diff
changeset
|
939 |
23566
a0e957b7b923
Take care of more cleanup in the MSN code.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
23564
diff
changeset
|
940 /* the code this block is replacing didn't send ADL for yahoo contacts, |
a0e957b7b923
Take care of more cleanup in the MSN code.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
23564
diff
changeset
|
941 * but i haven't confirmed this is WLM's behaviour wrt yahoo contacts |
a0e957b7b923
Take care of more cleanup in the MSN code.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
23564
diff
changeset
|
942 */ |
23515
eb8bd060b987
Update MSN Contact tokens when an invalid token error is returned.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
23509
diff
changeset
|
943 if ( !msn_user_is_yahoo(session->account, state->who) ) { |
eb8bd060b987
Update MSN Contact tokens when an invalid token error is returned.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
23509
diff
changeset
|
944 msn_userlist_add_buddy_to_list(userlist, state->who, MSN_LIST_AL); |
eb8bd060b987
Update MSN Contact tokens when an invalid token error is returned.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
23509
diff
changeset
|
945 msn_userlist_add_buddy_to_list(userlist, state->who, MSN_LIST_FL); |
21109
e64e6fbd1351
merge_into_workspace of c0e79d15a4fe4c5b0129fcae5060754b25f72a56 and
Ka-Hing Cheung <khc@hxbc.us>
diff
changeset
|
946 } |
20481
eb93710aec4d
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:
20479
diff
changeset
|
947 |
23515
eb8bd060b987
Update MSN Contact tokens when an invalid token error is returned.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
23509
diff
changeset
|
948 msn_notification_send_fqy(session, state->who); |
eb8bd060b987
Update MSN Contact tokens when an invalid token error is returned.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
23509
diff
changeset
|
949 |
eb8bd060b987
Update MSN Contact tokens when an invalid token error is returned.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
23509
diff
changeset
|
950 user = msn_userlist_find_add_user(userlist, state->who, state->who); |
eb8bd060b987
Update MSN Contact tokens when an invalid token error is returned.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
23509
diff
changeset
|
951 msn_user_add_group_id(user, state->guid); |
20394
4a099e4d0d09
propagate from branch 'im.pidgin.pidgin' (head 98b6b547b29ea1192b73cc4e1de1e674edef4328)
Richard Laager <rlaager@wiktel.com>
parents:
diff
changeset
|
952 } |
4a099e4d0d09
propagate from branch 'im.pidgin.pidgin' (head 98b6b547b29ea1192b73cc4e1de1e674edef4328)
Richard Laager <rlaager@wiktel.com>
parents:
diff
changeset
|
953 |
20484
98613886411a
Handle special cases in buddy/group management (wrt MSN_INDIVIDUALS_GROUP and MSN_NON_IM_GROUP).
Carlos Silva <typ0@pidgin.im>
parents:
20481
diff
changeset
|
954 /* add a Contact in MSN_INDIVIDUALS_GROUP */ |
20394
4a099e4d0d09
propagate from branch 'im.pidgin.pidgin' (head 98b6b547b29ea1192b73cc4e1de1e674edef4328)
Richard Laager <rlaager@wiktel.com>
parents:
diff
changeset
|
955 void |
23504
69af5301e1a7
killing MsnContact which just wraps MsnSession
Ka-Hing Cheung <khc@hxbc.us>
parents:
23498
diff
changeset
|
956 msn_add_contact(MsnSession *session, MsnCallbackState *state, const char *passport) |
20394
4a099e4d0d09
propagate from branch 'im.pidgin.pidgin' (head 98b6b547b29ea1192b73cc4e1de1e674edef4328)
Richard Laager <rlaager@wiktel.com>
parents:
diff
changeset
|
957 { |
20481
eb93710aec4d
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:
20479
diff
changeset
|
958 gchar *body = NULL; |
eb93710aec4d
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:
20479
diff
changeset
|
959 gchar *contact_xml = NULL; |
20538
90fd0826c6ce
finish converting the rest of stuff to the new soap api, signing on, getting
Ka-Hing Cheung <khc@hxbc.us>
parents:
20501
diff
changeset
|
960 |
90fd0826c6ce
finish converting the rest of stuff to the new soap api, signing on, getting
Ka-Hing Cheung <khc@hxbc.us>
parents:
20501
diff
changeset
|
961 #if 0 |
90fd0826c6ce
finish converting the rest of stuff to the new soap api, signing on, getting
Ka-Hing Cheung <khc@hxbc.us>
parents:
20501
diff
changeset
|
962 gchar *escaped_displayname; |
20484
98613886411a
Handle special cases in buddy/group management (wrt MSN_INDIVIDUALS_GROUP and MSN_NON_IM_GROUP).
Carlos Silva <typ0@pidgin.im>
parents:
20481
diff
changeset
|
963 |
20481
eb93710aec4d
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:
20479
diff
changeset
|
964 |
20484
98613886411a
Handle special cases in buddy/group management (wrt MSN_INDIVIDUALS_GROUP and MSN_NON_IM_GROUP).
Carlos Silva <typ0@pidgin.im>
parents:
20481
diff
changeset
|
965 if (displayname != NULL) { |
98613886411a
Handle special cases in buddy/group management (wrt MSN_INDIVIDUALS_GROUP and MSN_NON_IM_GROUP).
Carlos Silva <typ0@pidgin.im>
parents:
20481
diff
changeset
|
966 escaped_displayname = g_markup_decode_text(displayname, -1); |
98613886411a
Handle special cases in buddy/group management (wrt MSN_INDIVIDUALS_GROUP and MSN_NON_IM_GROUP).
Carlos Silva <typ0@pidgin.im>
parents:
20481
diff
changeset
|
967 } else { |
98613886411a
Handle special cases in buddy/group management (wrt MSN_INDIVIDUALS_GROUP and MSN_NON_IM_GROUP).
Carlos Silva <typ0@pidgin.im>
parents:
20481
diff
changeset
|
968 escaped_displayname = passport; |
98613886411a
Handle special cases in buddy/group management (wrt MSN_INDIVIDUALS_GROUP and MSN_NON_IM_GROUP).
Carlos Silva <typ0@pidgin.im>
parents:
20481
diff
changeset
|
969 } |
98613886411a
Handle special cases in buddy/group management (wrt MSN_INDIVIDUALS_GROUP and MSN_NON_IM_GROUP).
Carlos Silva <typ0@pidgin.im>
parents:
20481
diff
changeset
|
970 contact_xml = g_strdup_printf(MSN_XML_ADD_CONTACT, escaped_displayname, passport); |
20538
90fd0826c6ce
finish converting the rest of stuff to the new soap api, signing on, getting
Ka-Hing Cheung <khc@hxbc.us>
parents:
20501
diff
changeset
|
971 #endif |
90fd0826c6ce
finish converting the rest of stuff to the new soap api, signing on, getting
Ka-Hing Cheung <khc@hxbc.us>
parents:
20501
diff
changeset
|
972 |
23564
7bceac816e19
The great MSN debug message cleanup! Threw in a few whitespace fixes,
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
23552
diff
changeset
|
973 purple_debug_info("msn", "Adding contact %s to contact list\n", passport); |
20394
4a099e4d0d09
propagate from branch 'im.pidgin.pidgin' (head 98b6b547b29ea1192b73cc4e1de1e674edef4328)
Richard Laager <rlaager@wiktel.com>
parents:
diff
changeset
|
974 |
20538
90fd0826c6ce
finish converting the rest of stuff to the new soap api, signing on, getting
Ka-Hing Cheung <khc@hxbc.us>
parents:
20501
diff
changeset
|
975 contact_xml = g_strdup_printf(MSN_CONTACT_XML, passport); |
23515
eb8bd060b987
Update MSN Contact tokens when an invalid token error is returned.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
23509
diff
changeset
|
976 body = g_strdup_printf(MSN_ADD_CONTACT_TEMPLATE, contact_xml); |
20481
eb93710aec4d
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:
20479
diff
changeset
|
977 |
23515
eb8bd060b987
Update MSN Contact tokens when an invalid token error is returned.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
23509
diff
changeset
|
978 state->body = xmlnode_from_str(body, -1); |
eb8bd060b987
Update MSN Contact tokens when an invalid token error is returned.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
23509
diff
changeset
|
979 state->post_action = MSN_CONTACT_ADD_SOAP_ACTION; |
eb8bd060b987
Update MSN Contact tokens when an invalid token error is returned.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
23509
diff
changeset
|
980 state->post_url = MSN_ADDRESS_BOOK_POST_URL; |
eb8bd060b987
Update MSN Contact tokens when an invalid token error is returned.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
23509
diff
changeset
|
981 state->cb = msn_add_contact_read_cb; |
eb8bd060b987
Update MSN Contact tokens when an invalid token error is returned.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
23509
diff
changeset
|
982 msn_contact_request(state); |
20538
90fd0826c6ce
finish converting the rest of stuff to the new soap api, signing on, getting
Ka-Hing Cheung <khc@hxbc.us>
parents:
20501
diff
changeset
|
983 |
20481
eb93710aec4d
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:
20479
diff
changeset
|
984 g_free(contact_xml); |
20394
4a099e4d0d09
propagate from branch 'im.pidgin.pidgin' (head 98b6b547b29ea1192b73cc4e1de1e674edef4328)
Richard Laager <rlaager@wiktel.com>
parents:
diff
changeset
|
985 g_free(body); |
4a099e4d0d09
propagate from branch 'im.pidgin.pidgin' (head 98b6b547b29ea1192b73cc4e1de1e674edef4328)
Richard Laager <rlaager@wiktel.com>
parents:
diff
changeset
|
986 } |
20481
eb93710aec4d
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:
20479
diff
changeset
|
987 |
eb93710aec4d
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:
20479
diff
changeset
|
988 static void |
20538
90fd0826c6ce
finish converting the rest of stuff to the new soap api, signing on, getting
Ka-Hing Cheung <khc@hxbc.us>
parents:
20501
diff
changeset
|
989 msn_add_contact_to_group_read_cb(MsnSoapMessage *req, MsnSoapMessage *resp, |
90fd0826c6ce
finish converting the rest of stuff to the new soap api, signing on, getting
Ka-Hing Cheung <khc@hxbc.us>
parents:
20501
diff
changeset
|
990 gpointer data) |
20481
eb93710aec4d
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:
20479
diff
changeset
|
991 { |
20538
90fd0826c6ce
finish converting the rest of stuff to the new soap api, signing on, getting
Ka-Hing Cheung <khc@hxbc.us>
parents:
20501
diff
changeset
|
992 MsnCallbackState *state = data; |
20481
eb93710aec4d
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:
20479
diff
changeset
|
993 MsnUserList *userlist; |
eb93710aec4d
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:
20479
diff
changeset
|
994 |
20538
90fd0826c6ce
finish converting the rest of stuff to the new soap api, signing on, getting
Ka-Hing Cheung <khc@hxbc.us>
parents:
20501
diff
changeset
|
995 g_return_if_fail(data != NULL); |
90fd0826c6ce
finish converting the rest of stuff to the new soap api, signing on, getting
Ka-Hing Cheung <khc@hxbc.us>
parents:
20501
diff
changeset
|
996 |
90fd0826c6ce
finish converting the rest of stuff to the new soap api, signing on, getting
Ka-Hing Cheung <khc@hxbc.us>
parents:
20501
diff
changeset
|
997 userlist = state->session->userlist; |
20481
eb93710aec4d
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:
20479
diff
changeset
|
998 |
23515
eb8bd060b987
Update MSN Contact tokens when an invalid token error is returned.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
23509
diff
changeset
|
999 if (msn_userlist_add_buddy_to_group(userlist, state->who, |
eb8bd060b987
Update MSN Contact tokens when an invalid token error is returned.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
23509
diff
changeset
|
1000 state->new_group_name)) { |
23564
7bceac816e19
The great MSN debug message cleanup! Threw in a few whitespace fixes,
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
23552
diff
changeset
|
1001 purple_debug_info("msn", "Contact %s added to group %s successfully!\n", state->who, state->new_group_name); |
23515
eb8bd060b987
Update MSN Contact tokens when an invalid token error is returned.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
23509
diff
changeset
|
1002 } else { |
23564
7bceac816e19
The great MSN debug message cleanup! Threw in a few whitespace fixes,
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
23552
diff
changeset
|
1003 purple_debug_info("msn", "Contact %s added to group %s successfully on server, but failed in the local list\n", state->who, state->new_group_name); |
23515
eb8bd060b987
Update MSN Contact tokens when an invalid token error is returned.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
23509
diff
changeset
|
1004 } |
20481
eb93710aec4d
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:
20479
diff
changeset
|
1005 |
23515
eb8bd060b987
Update MSN Contact tokens when an invalid token error is returned.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
23509
diff
changeset
|
1006 if (state->action & MSN_ADD_BUDDY) { |
eb8bd060b987
Update MSN Contact tokens when an invalid token error is returned.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
23509
diff
changeset
|
1007 MsnUser *user = msn_userlist_find_user(userlist, state->who); |
20538
90fd0826c6ce
finish converting the rest of stuff to the new soap api, signing on, getting
Ka-Hing Cheung <khc@hxbc.us>
parents:
20501
diff
changeset
|
1008 |
23515
eb8bd060b987
Update MSN Contact tokens when an invalid token error is returned.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
23509
diff
changeset
|
1009 if ( !msn_user_is_yahoo(state->session->account, state->who) ) { |
eb8bd060b987
Update MSN Contact tokens when an invalid token error is returned.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
23509
diff
changeset
|
1010 msn_userlist_add_buddy_to_list(userlist, state->who, MSN_LIST_AL); |
eb8bd060b987
Update MSN Contact tokens when an invalid token error is returned.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
23509
diff
changeset
|
1011 msn_userlist_add_buddy_to_list(userlist, state->who, MSN_LIST_FL); |
eb8bd060b987
Update MSN Contact tokens when an invalid token error is returned.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
23509
diff
changeset
|
1012 } |
eb8bd060b987
Update MSN Contact tokens when an invalid token error is returned.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
23509
diff
changeset
|
1013 msn_notification_send_fqy(state->session, state->who); |
20481
eb93710aec4d
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:
20479
diff
changeset
|
1014 |
23515
eb8bd060b987
Update MSN Contact tokens when an invalid token error is returned.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
23509
diff
changeset
|
1015 if (msn_userlist_user_is_in_list(user, MSN_LIST_PL)) { |
eb8bd060b987
Update MSN Contact tokens when an invalid token error is returned.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
23509
diff
changeset
|
1016 msn_del_contact_from_list(state->session, NULL, state->who, MSN_LIST_PL); |
eb8bd060b987
Update MSN Contact tokens when an invalid token error is returned.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
23509
diff
changeset
|
1017 return; |
20486
ff4ae9dde291
Make block/unblock work right, as well as being add by a buddy. Finally fixes #723
Carlos Silva <typ0@pidgin.im>
parents:
20484
diff
changeset
|
1018 } |
20481
eb93710aec4d
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:
20479
diff
changeset
|
1019 } |
eb93710aec4d
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:
20479
diff
changeset
|
1020 |
23515
eb8bd060b987
Update MSN Contact tokens when an invalid token error is returned.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
23509
diff
changeset
|
1021 if (state->action & MSN_MOVE_BUDDY) { |
eb8bd060b987
Update MSN Contact tokens when an invalid token error is returned.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
23509
diff
changeset
|
1022 msn_del_contact_from_group(state->session, state->who, state->old_group_name); |
eb8bd060b987
Update MSN Contact tokens when an invalid token error is returned.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
23509
diff
changeset
|
1023 } |
20481
eb93710aec4d
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:
20479
diff
changeset
|
1024 } |
eb93710aec4d
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:
20479
diff
changeset
|
1025 |
eb93710aec4d
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:
20479
diff
changeset
|
1026 void |
23509
1ac5faa72c8d
explicit merge of '9d90ebdb7e38fdd77bb504bc3302a083616360d9'
Elliott Sales de Andrade <qulogic@pidgin.im>
diff
changeset
|
1027 msn_add_contact_to_group(MsnSession *session, MsnCallbackState *state, |
20481
eb93710aec4d
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:
20479
diff
changeset
|
1028 const char *passport, const char *groupId) |
eb93710aec4d
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:
20479
diff
changeset
|
1029 { |
eb93710aec4d
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:
20479
diff
changeset
|
1030 MsnUserList *userlist; |
eb93710aec4d
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:
20479
diff
changeset
|
1031 MsnUser *user; |
20538
90fd0826c6ce
finish converting the rest of stuff to the new soap api, signing on, getting
Ka-Hing Cheung <khc@hxbc.us>
parents:
20501
diff
changeset
|
1032 gchar *body = NULL, *contact_xml; |
20481
eb93710aec4d
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:
20479
diff
changeset
|
1033 |
eb93710aec4d
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:
20479
diff
changeset
|
1034 g_return_if_fail(passport != NULL); |
eb93710aec4d
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:
20479
diff
changeset
|
1035 g_return_if_fail(groupId != NULL); |
eb93710aec4d
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:
20479
diff
changeset
|
1036 |
23504
69af5301e1a7
killing MsnContact which just wraps MsnSession
Ka-Hing Cheung <khc@hxbc.us>
parents:
23498
diff
changeset
|
1037 g_return_if_fail(session != NULL); |
23300
5cdd93dac7a2
Delete trailing whitespace
Mark Doliner <mark@kingant.net>
parents:
22808
diff
changeset
|
1038 |
23504
69af5301e1a7
killing MsnContact which just wraps MsnSession
Ka-Hing Cheung <khc@hxbc.us>
parents:
23498
diff
changeset
|
1039 userlist = session->userlist; |
20484
98613886411a
Handle special cases in buddy/group management (wrt MSN_INDIVIDUALS_GROUP and MSN_NON_IM_GROUP).
Carlos Silva <typ0@pidgin.im>
parents:
20481
diff
changeset
|
1040 |
98613886411a
Handle special cases in buddy/group management (wrt MSN_INDIVIDUALS_GROUP and MSN_NON_IM_GROUP).
Carlos Silva <typ0@pidgin.im>
parents:
20481
diff
changeset
|
1041 if (!strcmp(groupId, MSN_INDIVIDUALS_GROUP_ID) || !strcmp(groupId, MSN_NON_IM_GROUP_ID)) { |
23300
5cdd93dac7a2
Delete trailing whitespace
Mark Doliner <mark@kingant.net>
parents:
22808
diff
changeset
|
1042 |
20484
98613886411a
Handle special cases in buddy/group management (wrt MSN_INDIVIDUALS_GROUP and MSN_NON_IM_GROUP).
Carlos Silva <typ0@pidgin.im>
parents:
20481
diff
changeset
|
1043 user = msn_userlist_find_add_user(userlist, passport, passport); |
98613886411a
Handle special cases in buddy/group management (wrt MSN_INDIVIDUALS_GROUP and MSN_NON_IM_GROUP).
Carlos Silva <typ0@pidgin.im>
parents:
20481
diff
changeset
|
1044 |
98613886411a
Handle special cases in buddy/group management (wrt MSN_INDIVIDUALS_GROUP and MSN_NON_IM_GROUP).
Carlos Silva <typ0@pidgin.im>
parents:
20481
diff
changeset
|
1045 if (state->action & MSN_ADD_BUDDY) { |
23504
69af5301e1a7
killing MsnContact which just wraps MsnSession
Ka-Hing Cheung <khc@hxbc.us>
parents:
23498
diff
changeset
|
1046 msn_add_contact(session, state, passport); |
20484
98613886411a
Handle special cases in buddy/group management (wrt MSN_INDIVIDUALS_GROUP and MSN_NON_IM_GROUP).
Carlos Silva <typ0@pidgin.im>
parents:
20481
diff
changeset
|
1047 return; |
98613886411a
Handle special cases in buddy/group management (wrt MSN_INDIVIDUALS_GROUP and MSN_NON_IM_GROUP).
Carlos Silva <typ0@pidgin.im>
parents:
20481
diff
changeset
|
1048 } |
98613886411a
Handle special cases in buddy/group management (wrt MSN_INDIVIDUALS_GROUP and MSN_NON_IM_GROUP).
Carlos Silva <typ0@pidgin.im>
parents:
20481
diff
changeset
|
1049 |
98613886411a
Handle special cases in buddy/group management (wrt MSN_INDIVIDUALS_GROUP and MSN_NON_IM_GROUP).
Carlos Silva <typ0@pidgin.im>
parents:
20481
diff
changeset
|
1050 if (state->action & MSN_MOVE_BUDDY) { |
98613886411a
Handle special cases in buddy/group management (wrt MSN_INDIVIDUALS_GROUP and MSN_NON_IM_GROUP).
Carlos Silva <typ0@pidgin.im>
parents:
20481
diff
changeset
|
1051 msn_user_add_group_id(user, groupId); |
23504
69af5301e1a7
killing MsnContact which just wraps MsnSession
Ka-Hing Cheung <khc@hxbc.us>
parents:
23498
diff
changeset
|
1052 msn_del_contact_from_group(session, passport, state->old_group_name); |
20484
98613886411a
Handle special cases in buddy/group management (wrt MSN_INDIVIDUALS_GROUP and MSN_NON_IM_GROUP).
Carlos Silva <typ0@pidgin.im>
parents:
20481
diff
changeset
|
1053 } |
98613886411a
Handle special cases in buddy/group management (wrt MSN_INDIVIDUALS_GROUP and MSN_NON_IM_GROUP).
Carlos Silva <typ0@pidgin.im>
parents:
20481
diff
changeset
|
1054 |
98613886411a
Handle special cases in buddy/group management (wrt MSN_INDIVIDUALS_GROUP and MSN_NON_IM_GROUP).
Carlos Silva <typ0@pidgin.im>
parents:
20481
diff
changeset
|
1055 return; |
98613886411a
Handle special cases in buddy/group management (wrt MSN_INDIVIDUALS_GROUP and MSN_NON_IM_GROUP).
Carlos Silva <typ0@pidgin.im>
parents:
20481
diff
changeset
|
1056 } |
98613886411a
Handle special cases in buddy/group management (wrt MSN_INDIVIDUALS_GROUP and MSN_NON_IM_GROUP).
Carlos Silva <typ0@pidgin.im>
parents:
20481
diff
changeset
|
1057 |
23564
7bceac816e19
The great MSN debug message cleanup! Threw in a few whitespace fixes,
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
23552
diff
changeset
|
1058 purple_debug_info("msn", "Adding user %s to group %s\n", passport, |
20481
eb93710aec4d
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:
20479
diff
changeset
|
1059 msn_userlist_find_group_name(userlist, groupId)); |
eb93710aec4d
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:
20479
diff
changeset
|
1060 |
eb93710aec4d
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:
20479
diff
changeset
|
1061 user = msn_userlist_find_user(userlist, passport); |
eb93710aec4d
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:
20479
diff
changeset
|
1062 if (user == NULL) { |
23564
7bceac816e19
The great MSN debug message cleanup! Threw in a few whitespace fixes,
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
23552
diff
changeset
|
1063 purple_debug_warning("msn", "Unable to retrieve user %s from the userlist!\n", passport); |
23300
5cdd93dac7a2
Delete trailing whitespace
Mark Doliner <mark@kingant.net>
parents:
22808
diff
changeset
|
1064 msn_callback_state_free(state); |
20538
90fd0826c6ce
finish converting the rest of stuff to the new soap api, signing on, getting
Ka-Hing Cheung <khc@hxbc.us>
parents:
20501
diff
changeset
|
1065 return; /* guess this never happened! */ |
20481
eb93710aec4d
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:
20479
diff
changeset
|
1066 } |
eb93710aec4d
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:
20479
diff
changeset
|
1067 |
20855
cfaf74ec93dc
Prevent null pointer deref to fix CID 322.
Daniel Atallah <daniel.atallah@gmail.com>
parents:
20789
diff
changeset
|
1068 if (user != NULL && user->uid != NULL) { |
20481
eb93710aec4d
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:
20479
diff
changeset
|
1069 contact_xml = g_strdup_printf(MSN_CONTACT_ID_XML, user->uid); |
eb93710aec4d
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:
20479
diff
changeset
|
1070 } else { |
eb93710aec4d
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:
20479
diff
changeset
|
1071 contact_xml = g_strdup_printf(MSN_CONTACT_XML, passport); |
eb93710aec4d
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:
20479
diff
changeset
|
1072 } |
eb93710aec4d
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:
20479
diff
changeset
|
1073 |
23515
eb8bd060b987
Update MSN Contact tokens when an invalid token error is returned.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
23509
diff
changeset
|
1074 body = g_strdup_printf(MSN_ADD_CONTACT_GROUP_TEMPLATE, groupId, contact_xml); |
20481
eb93710aec4d
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:
20479
diff
changeset
|
1075 |
23515
eb8bd060b987
Update MSN Contact tokens when an invalid token error is returned.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
23509
diff
changeset
|
1076 state->body = xmlnode_from_str(body, -1); |
eb8bd060b987
Update MSN Contact tokens when an invalid token error is returned.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
23509
diff
changeset
|
1077 state->post_action = MSN_ADD_CONTACT_GROUP_SOAP_ACTION; |
eb8bd060b987
Update MSN Contact tokens when an invalid token error is returned.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
23509
diff
changeset
|
1078 state->post_url = MSN_ADDRESS_BOOK_POST_URL; |
eb8bd060b987
Update MSN Contact tokens when an invalid token error is returned.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
23509
diff
changeset
|
1079 state->cb = msn_add_contact_to_group_read_cb; |
eb8bd060b987
Update MSN Contact tokens when an invalid token error is returned.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
23509
diff
changeset
|
1080 msn_contact_request(state); |
20481
eb93710aec4d
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:
20479
diff
changeset
|
1081 |
20538
90fd0826c6ce
finish converting the rest of stuff to the new soap api, signing on, getting
Ka-Hing Cheung <khc@hxbc.us>
parents:
20501
diff
changeset
|
1082 g_free(contact_xml); |
20481
eb93710aec4d
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:
20479
diff
changeset
|
1083 g_free(body); |
eb93710aec4d
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:
20479
diff
changeset
|
1084 } |
eb93710aec4d
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:
20479
diff
changeset
|
1085 |
20394
4a099e4d0d09
propagate from branch 'im.pidgin.pidgin' (head 98b6b547b29ea1192b73cc4e1de1e674edef4328)
Richard Laager <rlaager@wiktel.com>
parents:
diff
changeset
|
1086 static void |
20538
90fd0826c6ce
finish converting the rest of stuff to the new soap api, signing on, getting
Ka-Hing Cheung <khc@hxbc.us>
parents:
20501
diff
changeset
|
1087 msn_delete_contact_read_cb(MsnSoapMessage *req, MsnSoapMessage *resp, |
90fd0826c6ce
finish converting the rest of stuff to the new soap api, signing on, getting
Ka-Hing Cheung <khc@hxbc.us>
parents:
20501
diff
changeset
|
1088 gpointer data) |
20394
4a099e4d0d09
propagate from branch 'im.pidgin.pidgin' (head 98b6b547b29ea1192b73cc4e1de1e674edef4328)
Richard Laager <rlaager@wiktel.com>
parents:
diff
changeset
|
1089 { |
21109
e64e6fbd1351
merge_into_workspace of c0e79d15a4fe4c5b0129fcae5060754b25f72a56 and
Ka-Hing Cheung <khc@hxbc.us>
diff
changeset
|
1090 MsnCallbackState *state = data; |
23515
eb8bd060b987
Update MSN Contact tokens when an invalid token error is returned.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
23509
diff
changeset
|
1091 MsnUserList *userlist = state->session->userlist; |
eb8bd060b987
Update MSN Contact tokens when an invalid token error is returned.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
23509
diff
changeset
|
1092 MsnUser *user = msn_userlist_find_user_with_id(userlist, state->uid); |
20539
2c8c6d77f12c
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:
20501
diff
changeset
|
1093 |
23564
7bceac816e19
The great MSN debug message cleanup! Threw in a few whitespace fixes,
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
23552
diff
changeset
|
1094 purple_debug_info("msn", "Delete contact successful\n"); |
23515
eb8bd060b987
Update MSN Contact tokens when an invalid token error is returned.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
23509
diff
changeset
|
1095 |
eb8bd060b987
Update MSN Contact tokens when an invalid token error is returned.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
23509
diff
changeset
|
1096 if (user != NULL) { |
eb8bd060b987
Update MSN Contact tokens when an invalid token error is returned.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
23509
diff
changeset
|
1097 msn_userlist_remove_user(userlist, user); |
20539
2c8c6d77f12c
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:
20501
diff
changeset
|
1098 } |
20394
4a099e4d0d09
propagate from branch 'im.pidgin.pidgin' (head 98b6b547b29ea1192b73cc4e1de1e674edef4328)
Richard Laager <rlaager@wiktel.com>
parents:
diff
changeset
|
1099 } |
4a099e4d0d09
propagate from branch 'im.pidgin.pidgin' (head 98b6b547b29ea1192b73cc4e1de1e674edef4328)
Richard Laager <rlaager@wiktel.com>
parents:
diff
changeset
|
1100 |
4a099e4d0d09
propagate from branch 'im.pidgin.pidgin' (head 98b6b547b29ea1192b73cc4e1de1e674edef4328)
Richard Laager <rlaager@wiktel.com>
parents:
diff
changeset
|
1101 /*delete a Contact*/ |
4a099e4d0d09
propagate from branch 'im.pidgin.pidgin' (head 98b6b547b29ea1192b73cc4e1de1e674edef4328)
Richard Laager <rlaager@wiktel.com>
parents:
diff
changeset
|
1102 void |
23504
69af5301e1a7
killing MsnContact which just wraps MsnSession
Ka-Hing Cheung <khc@hxbc.us>
parents:
23498
diff
changeset
|
1103 msn_delete_contact(MsnSession *session, const char *contactId) |
23300
5cdd93dac7a2
Delete trailing whitespace
Mark Doliner <mark@kingant.net>
parents:
22808
diff
changeset
|
1104 { |
20481
eb93710aec4d
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:
20479
diff
changeset
|
1105 gchar *body = NULL; |
eb93710aec4d
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:
20479
diff
changeset
|
1106 gchar *contact_id_xml = NULL ; |
20539
2c8c6d77f12c
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:
20501
diff
changeset
|
1107 MsnCallbackState *state; |
20394
4a099e4d0d09
propagate from branch 'im.pidgin.pidgin' (head 98b6b547b29ea1192b73cc4e1de1e674edef4328)
Richard Laager <rlaager@wiktel.com>
parents:
diff
changeset
|
1108 |
4a099e4d0d09
propagate from branch 'im.pidgin.pidgin' (head 98b6b547b29ea1192b73cc4e1de1e674edef4328)
Richard Laager <rlaager@wiktel.com>
parents:
diff
changeset
|
1109 g_return_if_fail(contactId != NULL); |
20481
eb93710aec4d
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:
20479
diff
changeset
|
1110 contact_id_xml = g_strdup_printf(MSN_CONTACT_ID_XML, contactId); |
eb93710aec4d
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:
20479
diff
changeset
|
1111 |
23504
69af5301e1a7
killing MsnContact which just wraps MsnSession
Ka-Hing Cheung <khc@hxbc.us>
parents:
23498
diff
changeset
|
1112 state = msn_callback_state_new(session); |
20539
2c8c6d77f12c
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:
20501
diff
changeset
|
1113 msn_callback_state_set_uid(state, contactId); |
2c8c6d77f12c
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:
20501
diff
changeset
|
1114 |
20481
eb93710aec4d
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:
20479
diff
changeset
|
1115 /* build SOAP request */ |
23564
7bceac816e19
The great MSN debug message cleanup! Threw in a few whitespace fixes,
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
23552
diff
changeset
|
1116 purple_debug_info("msn", "Deleting contact with contactId: %s\n", contactId); |
23515
eb8bd060b987
Update MSN Contact tokens when an invalid token error is returned.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
23509
diff
changeset
|
1117 body = g_strdup_printf(MSN_DEL_CONTACT_TEMPLATE, contact_id_xml); |
23492
72aa2ccad28d
fix sending offline message in p15 by sending the correct token. In msnp14,
Ka-Hing Cheung <khc@hxbc.us>
parents:
23491
diff
changeset
|
1118 |
23515
eb8bd060b987
Update MSN Contact tokens when an invalid token error is returned.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
23509
diff
changeset
|
1119 state->body = xmlnode_from_str(body, -1); |
eb8bd060b987
Update MSN Contact tokens when an invalid token error is returned.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
23509
diff
changeset
|
1120 state->post_action = MSN_CONTACT_DEL_SOAP_ACTION; |
eb8bd060b987
Update MSN Contact tokens when an invalid token error is returned.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
23509
diff
changeset
|
1121 state->post_url = MSN_ADDRESS_BOOK_POST_URL; |
eb8bd060b987
Update MSN Contact tokens when an invalid token error is returned.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
23509
diff
changeset
|
1122 state->cb = msn_delete_contact_read_cb; |
eb8bd060b987
Update MSN Contact tokens when an invalid token error is returned.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
23509
diff
changeset
|
1123 msn_contact_request(state); |
20481
eb93710aec4d
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:
20479
diff
changeset
|
1124 |
eb93710aec4d
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:
20479
diff
changeset
|
1125 g_free(contact_id_xml); |
20394
4a099e4d0d09
propagate from branch 'im.pidgin.pidgin' (head 98b6b547b29ea1192b73cc4e1de1e674edef4328)
Richard Laager <rlaager@wiktel.com>
parents:
diff
changeset
|
1126 g_free(body); |
4a099e4d0d09
propagate from branch 'im.pidgin.pidgin' (head 98b6b547b29ea1192b73cc4e1de1e674edef4328)
Richard Laager <rlaager@wiktel.com>
parents:
diff
changeset
|
1127 } |
4a099e4d0d09
propagate from branch 'im.pidgin.pidgin' (head 98b6b547b29ea1192b73cc4e1de1e674edef4328)
Richard Laager <rlaager@wiktel.com>
parents:
diff
changeset
|
1128 |
20481
eb93710aec4d
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:
20479
diff
changeset
|
1129 static void |
20538
90fd0826c6ce
finish converting the rest of stuff to the new soap api, signing on, getting
Ka-Hing Cheung <khc@hxbc.us>
parents:
20501
diff
changeset
|
1130 msn_del_contact_from_group_read_cb(MsnSoapMessage *req, MsnSoapMessage *resp, |
90fd0826c6ce
finish converting the rest of stuff to the new soap api, signing on, getting
Ka-Hing Cheung <khc@hxbc.us>
parents:
20501
diff
changeset
|
1131 gpointer data) |
20481
eb93710aec4d
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:
20479
diff
changeset
|
1132 { |
20538
90fd0826c6ce
finish converting the rest of stuff to the new soap api, signing on, getting
Ka-Hing Cheung <khc@hxbc.us>
parents:
20501
diff
changeset
|
1133 MsnCallbackState *state = data; |
20501
f6dff814d95f
cleans up ownership of soap callback data, this soap stuff is perfect
Ka-Hing Cheung <khc@hxbc.us>
parents:
20495
diff
changeset
|
1134 |
23515
eb8bd060b987
Update MSN Contact tokens when an invalid token error is returned.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
23509
diff
changeset
|
1135 if (msn_userlist_rem_buddy_from_group(state->session->userlist, |
eb8bd060b987
Update MSN Contact tokens when an invalid token error is returned.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
23509
diff
changeset
|
1136 state->who, state->old_group_name)) { |
23564
7bceac816e19
The great MSN debug message cleanup! Threw in a few whitespace fixes,
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
23552
diff
changeset
|
1137 purple_debug_info("msn", "Contact %s deleted successfully from group %s\n", state->who, state->old_group_name); |
23515
eb8bd060b987
Update MSN Contact tokens when an invalid token error is returned.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
23509
diff
changeset
|
1138 } else { |
23564
7bceac816e19
The great MSN debug message cleanup! Threw in a few whitespace fixes,
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
23552
diff
changeset
|
1139 purple_debug_info("msn", "Contact %s deleted successfully from group %s in the server, but failed in the local list\n", state->who, state->old_group_name); |
20481
eb93710aec4d
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:
20479
diff
changeset
|
1140 } |
eb93710aec4d
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:
20479
diff
changeset
|
1141 } |
eb93710aec4d
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:
20479
diff
changeset
|
1142 |
eb93710aec4d
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:
20479
diff
changeset
|
1143 void |
23504
69af5301e1a7
killing MsnContact which just wraps MsnSession
Ka-Hing Cheung <khc@hxbc.us>
parents:
23498
diff
changeset
|
1144 msn_del_contact_from_group(MsnSession *session, const char *passport, const char *group_name) |
20481
eb93710aec4d
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:
20479
diff
changeset
|
1145 { |
eb93710aec4d
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:
20479
diff
changeset
|
1146 MsnUserList * userlist; |
eb93710aec4d
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:
20479
diff
changeset
|
1147 MsnUser *user; |
eb93710aec4d
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:
20479
diff
changeset
|
1148 MsnCallbackState *state; |
20538
90fd0826c6ce
finish converting the rest of stuff to the new soap api, signing on, getting
Ka-Hing Cheung <khc@hxbc.us>
parents:
20501
diff
changeset
|
1149 gchar *body, *contact_id_xml; |
20481
eb93710aec4d
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:
20479
diff
changeset
|
1150 const gchar *groupId; |
23300
5cdd93dac7a2
Delete trailing whitespace
Mark Doliner <mark@kingant.net>
parents:
22808
diff
changeset
|
1151 |
20481
eb93710aec4d
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:
20479
diff
changeset
|
1152 g_return_if_fail(passport != NULL); |
eb93710aec4d
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:
20479
diff
changeset
|
1153 g_return_if_fail(group_name != NULL); |
23504
69af5301e1a7
killing MsnContact which just wraps MsnSession
Ka-Hing Cheung <khc@hxbc.us>
parents:
23498
diff
changeset
|
1154 g_return_if_fail(session != NULL); |
23300
5cdd93dac7a2
Delete trailing whitespace
Mark Doliner <mark@kingant.net>
parents:
22808
diff
changeset
|
1155 |
23504
69af5301e1a7
killing MsnContact which just wraps MsnSession
Ka-Hing Cheung <khc@hxbc.us>
parents:
23498
diff
changeset
|
1156 userlist = session->userlist; |
23300
5cdd93dac7a2
Delete trailing whitespace
Mark Doliner <mark@kingant.net>
parents:
22808
diff
changeset
|
1157 |
20481
eb93710aec4d
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:
20479
diff
changeset
|
1158 groupId = msn_userlist_find_group_id(userlist, group_name); |
eb93710aec4d
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:
20479
diff
changeset
|
1159 if (groupId != NULL) { |
23564
7bceac816e19
The great MSN debug message cleanup! Threw in a few whitespace fixes,
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
23552
diff
changeset
|
1160 purple_debug_info("msn", "Deleting user %s from group %s\n", passport, group_name); |
20481
eb93710aec4d
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:
20479
diff
changeset
|
1161 } else { |
23564
7bceac816e19
The great MSN debug message cleanup! Threw in a few whitespace fixes,
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
23552
diff
changeset
|
1162 purple_debug_warning("msn", "Unable to retrieve group id from group %s !\n", group_name); |
20481
eb93710aec4d
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:
20479
diff
changeset
|
1163 return; |
eb93710aec4d
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:
20479
diff
changeset
|
1164 } |
23300
5cdd93dac7a2
Delete trailing whitespace
Mark Doliner <mark@kingant.net>
parents:
22808
diff
changeset
|
1165 |
20481
eb93710aec4d
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:
20479
diff
changeset
|
1166 user = msn_userlist_find_user(userlist, passport); |
23300
5cdd93dac7a2
Delete trailing whitespace
Mark Doliner <mark@kingant.net>
parents:
22808
diff
changeset
|
1167 |
20481
eb93710aec4d
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:
20479
diff
changeset
|
1168 if (user == NULL) { |
23564
7bceac816e19
The great MSN debug message cleanup! Threw in a few whitespace fixes,
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
23552
diff
changeset
|
1169 purple_debug_warning("msn", "Unable to retrieve user from passport %s!\n", passport); |
20481
eb93710aec4d
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:
20479
diff
changeset
|
1170 return; |
eb93710aec4d
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:
20479
diff
changeset
|
1171 } |
20484
98613886411a
Handle special cases in buddy/group management (wrt MSN_INDIVIDUALS_GROUP and MSN_NON_IM_GROUP).
Carlos Silva <typ0@pidgin.im>
parents:
20481
diff
changeset
|
1172 |
98613886411a
Handle special cases in buddy/group management (wrt MSN_INDIVIDUALS_GROUP and MSN_NON_IM_GROUP).
Carlos Silva <typ0@pidgin.im>
parents:
20481
diff
changeset
|
1173 if ( !strcmp(groupId, MSN_INDIVIDUALS_GROUP_ID) || !strcmp(groupId, MSN_NON_IM_GROUP_ID)) { |
98613886411a
Handle special cases in buddy/group management (wrt MSN_INDIVIDUALS_GROUP and MSN_NON_IM_GROUP).
Carlos Silva <typ0@pidgin.im>
parents:
20481
diff
changeset
|
1174 msn_user_remove_group_id(user, groupId); |
98613886411a
Handle special cases in buddy/group management (wrt MSN_INDIVIDUALS_GROUP and MSN_NON_IM_GROUP).
Carlos Silva <typ0@pidgin.im>
parents:
20481
diff
changeset
|
1175 return; |
98613886411a
Handle special cases in buddy/group management (wrt MSN_INDIVIDUALS_GROUP and MSN_NON_IM_GROUP).
Carlos Silva <typ0@pidgin.im>
parents:
20481
diff
changeset
|
1176 } |
98613886411a
Handle special cases in buddy/group management (wrt MSN_INDIVIDUALS_GROUP and MSN_NON_IM_GROUP).
Carlos Silva <typ0@pidgin.im>
parents:
20481
diff
changeset
|
1177 |
23504
69af5301e1a7
killing MsnContact which just wraps MsnSession
Ka-Hing Cheung <khc@hxbc.us>
parents:
23498
diff
changeset
|
1178 state = msn_callback_state_new(session); |
20481
eb93710aec4d
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:
20479
diff
changeset
|
1179 msn_callback_state_set_who(state, passport); |
eb93710aec4d
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:
20479
diff
changeset
|
1180 msn_callback_state_set_guid(state, groupId); |
eb93710aec4d
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:
20479
diff
changeset
|
1181 msn_callback_state_set_old_group_name(state, group_name); |
20666
0e1bc5c51030
A few leak plugs, some unnecessary allocation prevention, null pointer deref fixes and general robustness fixes. I'm sure there is more to do here, I got tired... Fixes #3308
Daniel Atallah <daniel.atallah@gmail.com>
parents:
20539
diff
changeset
|
1182 |
20481
eb93710aec4d
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:
20479
diff
changeset
|
1183 contact_id_xml = g_strdup_printf(MSN_CONTACT_ID_XML, user->uid); |
23515
eb8bd060b987
Update MSN Contact tokens when an invalid token error is returned.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
23509
diff
changeset
|
1184 body = g_strdup_printf(MSN_CONTACT_DEL_GROUP_TEMPLATE, contact_id_xml, groupId); |
20538
90fd0826c6ce
finish converting the rest of stuff to the new soap api, signing on, getting
Ka-Hing Cheung <khc@hxbc.us>
parents:
20501
diff
changeset
|
1185 |
23515
eb8bd060b987
Update MSN Contact tokens when an invalid token error is returned.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
23509
diff
changeset
|
1186 state->body = xmlnode_from_str(body, -1); |
eb8bd060b987
Update MSN Contact tokens when an invalid token error is returned.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
23509
diff
changeset
|
1187 state->post_action = MSN_CONTACT_DEL_GROUP_SOAP_ACTION; |
eb8bd060b987
Update MSN Contact tokens when an invalid token error is returned.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
23509
diff
changeset
|
1188 state->post_url = MSN_ADDRESS_BOOK_POST_URL; |
eb8bd060b987
Update MSN Contact tokens when an invalid token error is returned.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
23509
diff
changeset
|
1189 state->cb = msn_del_contact_from_group_read_cb; |
eb8bd060b987
Update MSN Contact tokens when an invalid token error is returned.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
23509
diff
changeset
|
1190 msn_contact_request(state); |
23300
5cdd93dac7a2
Delete trailing whitespace
Mark Doliner <mark@kingant.net>
parents:
22808
diff
changeset
|
1191 |
20538
90fd0826c6ce
finish converting the rest of stuff to the new soap api, signing on, getting
Ka-Hing Cheung <khc@hxbc.us>
parents:
20501
diff
changeset
|
1192 g_free(contact_id_xml); |
20481
eb93710aec4d
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:
20479
diff
changeset
|
1193 g_free(body); |
eb93710aec4d
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:
20479
diff
changeset
|
1194 } |
eb93710aec4d
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:
20479
diff
changeset
|
1195 |
eb93710aec4d
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:
20479
diff
changeset
|
1196 |
20394
4a099e4d0d09
propagate from branch 'im.pidgin.pidgin' (head 98b6b547b29ea1192b73cc4e1de1e674edef4328)
Richard Laager <rlaager@wiktel.com>
parents:
diff
changeset
|
1197 static void |
20538
90fd0826c6ce
finish converting the rest of stuff to the new soap api, signing on, getting
Ka-Hing Cheung <khc@hxbc.us>
parents:
20501
diff
changeset
|
1198 msn_update_contact_read_cb(MsnSoapMessage *req, MsnSoapMessage *resp, |
90fd0826c6ce
finish converting the rest of stuff to the new soap api, signing on, getting
Ka-Hing Cheung <khc@hxbc.us>
parents:
20501
diff
changeset
|
1199 gpointer data) |
20394
4a099e4d0d09
propagate from branch 'im.pidgin.pidgin' (head 98b6b547b29ea1192b73cc4e1de1e674edef4328)
Richard Laager <rlaager@wiktel.com>
parents:
diff
changeset
|
1200 { |
23564
7bceac816e19
The great MSN debug message cleanup! Threw in a few whitespace fixes,
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
23552
diff
changeset
|
1201 purple_debug_info("msn", "Contact updated successfully\n"); |
20394
4a099e4d0d09
propagate from branch 'im.pidgin.pidgin' (head 98b6b547b29ea1192b73cc4e1de1e674edef4328)
Richard Laager <rlaager@wiktel.com>
parents:
diff
changeset
|
1202 } |
4a099e4d0d09
propagate from branch 'im.pidgin.pidgin' (head 98b6b547b29ea1192b73cc4e1de1e674edef4328)
Richard Laager <rlaager@wiktel.com>
parents:
diff
changeset
|
1203 |
23517
70de4e2246ec
Add real server-side aliasing to MSN.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
23515
diff
changeset
|
1204 /* Update a contact's info */ |
20394
4a099e4d0d09
propagate from branch 'im.pidgin.pidgin' (head 98b6b547b29ea1192b73cc4e1de1e674edef4328)
Richard Laager <rlaager@wiktel.com>
parents:
diff
changeset
|
1205 void |
23517
70de4e2246ec
Add real server-side aliasing to MSN.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
23515
diff
changeset
|
1206 msn_update_contact(MsnSession *session, const char *passport, MsnContactUpdateType type, const char* value) |
20394
4a099e4d0d09
propagate from branch 'im.pidgin.pidgin' (head 98b6b547b29ea1192b73cc4e1de1e674edef4328)
Richard Laager <rlaager@wiktel.com>
parents:
diff
changeset
|
1207 { |
23515
eb8bd060b987
Update MSN Contact tokens when an invalid token error is returned.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
23509
diff
changeset
|
1208 MsnCallbackState *state; |
23517
70de4e2246ec
Add real server-side aliasing to MSN.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
23515
diff
changeset
|
1209 xmlnode *contact; |
70de4e2246ec
Add real server-side aliasing to MSN.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
23515
diff
changeset
|
1210 xmlnode *contact_info; |
70de4e2246ec
Add real server-side aliasing to MSN.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
23515
diff
changeset
|
1211 xmlnode *changes; |
20394
4a099e4d0d09
propagate from branch 'im.pidgin.pidgin' (head 98b6b547b29ea1192b73cc4e1de1e674edef4328)
Richard Laager <rlaager@wiktel.com>
parents:
diff
changeset
|
1212 |
23564
7bceac816e19
The great MSN debug message cleanup! Threw in a few whitespace fixes,
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
23552
diff
changeset
|
1213 purple_debug_info("msn", "Update contact information with new %s: %s\n", |
23517
70de4e2246ec
Add real server-side aliasing to MSN.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
23515
diff
changeset
|
1214 type==MSN_UPDATE_DISPLAY ? "display name" : "alias", value); |
23564
7bceac816e19
The great MSN debug message cleanup! Threw in a few whitespace fixes,
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
23552
diff
changeset
|
1215 purple_debug_info("msn", "passport=%s\n", passport); |
23517
70de4e2246ec
Add real server-side aliasing to MSN.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
23515
diff
changeset
|
1216 g_return_if_fail(passport != NULL); |
70de4e2246ec
Add real server-side aliasing to MSN.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
23515
diff
changeset
|
1217 contact_info = xmlnode_new("contactInfo"); |
70de4e2246ec
Add real server-side aliasing to MSN.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
23515
diff
changeset
|
1218 changes = xmlnode_new("propertiesChanged"); |
20671
4dd60add6a7c
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 <daniel.atallah@gmail.com>
parents:
20666
diff
changeset
|
1219 |
23517
70de4e2246ec
Add real server-side aliasing to MSN.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
23515
diff
changeset
|
1220 switch (type) { |
70de4e2246ec
Add real server-side aliasing to MSN.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
23515
diff
changeset
|
1221 xmlnode *annotations; |
70de4e2246ec
Add real server-side aliasing to MSN.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
23515
diff
changeset
|
1222 xmlnode *display; |
70de4e2246ec
Add real server-side aliasing to MSN.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
23515
diff
changeset
|
1223 xmlnode *a, *n, *v; |
70de4e2246ec
Add real server-side aliasing to MSN.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
23515
diff
changeset
|
1224 case MSN_UPDATE_DISPLAY: |
70de4e2246ec
Add real server-side aliasing to MSN.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
23515
diff
changeset
|
1225 display = xmlnode_new_child(contact_info, "displayName"); |
70de4e2246ec
Add real server-side aliasing to MSN.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
23515
diff
changeset
|
1226 xmlnode_insert_data(display, value, -1); |
70de4e2246ec
Add real server-side aliasing to MSN.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
23515
diff
changeset
|
1227 xmlnode_insert_data(changes, "DisplayName", -1); |
70de4e2246ec
Add real server-side aliasing to MSN.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
23515
diff
changeset
|
1228 break; |
20394
4a099e4d0d09
propagate from branch 'im.pidgin.pidgin' (head 98b6b547b29ea1192b73cc4e1de1e674edef4328)
Richard Laager <rlaager@wiktel.com>
parents:
diff
changeset
|
1229 |
23517
70de4e2246ec
Add real server-side aliasing to MSN.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
23515
diff
changeset
|
1230 case MSN_UPDATE_ALIAS: |
70de4e2246ec
Add real server-side aliasing to MSN.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
23515
diff
changeset
|
1231 annotations = xmlnode_new_child(contact_info, "annotations"); |
70de4e2246ec
Add real server-side aliasing to MSN.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
23515
diff
changeset
|
1232 xmlnode_insert_data(changes, "Annotation ", -1); |
70de4e2246ec
Add real server-side aliasing to MSN.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
23515
diff
changeset
|
1233 |
70de4e2246ec
Add real server-side aliasing to MSN.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
23515
diff
changeset
|
1234 a = xmlnode_new_child(annotations, "Annotation"); |
70de4e2246ec
Add real server-side aliasing to MSN.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
23515
diff
changeset
|
1235 n = xmlnode_new_child(a, "Name"); |
70de4e2246ec
Add real server-side aliasing to MSN.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
23515
diff
changeset
|
1236 xmlnode_insert_data(n, "AB.NickName", -1); |
70de4e2246ec
Add real server-side aliasing to MSN.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
23515
diff
changeset
|
1237 v = xmlnode_new_child(a, "Value"); |
70de4e2246ec
Add real server-side aliasing to MSN.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
23515
diff
changeset
|
1238 xmlnode_insert_data(v, value, -1); |
70de4e2246ec
Add real server-side aliasing to MSN.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
23515
diff
changeset
|
1239 break; |
70de4e2246ec
Add real server-side aliasing to MSN.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
23515
diff
changeset
|
1240 |
70de4e2246ec
Add real server-side aliasing to MSN.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
23515
diff
changeset
|
1241 default: |
70de4e2246ec
Add real server-side aliasing to MSN.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
23515
diff
changeset
|
1242 g_return_if_reached(); |
70de4e2246ec
Add real server-side aliasing to MSN.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
23515
diff
changeset
|
1243 } |
70de4e2246ec
Add real server-side aliasing to MSN.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
23515
diff
changeset
|
1244 |
70de4e2246ec
Add real server-side aliasing to MSN.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
23515
diff
changeset
|
1245 |
20538
90fd0826c6ce
finish converting the rest of stuff to the new soap api, signing on, getting
Ka-Hing Cheung <khc@hxbc.us>
parents:
20501
diff
changeset
|
1246 |
23515
eb8bd060b987
Update MSN Contact tokens when an invalid token error is returned.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
23509
diff
changeset
|
1247 state = msn_callback_state_new(session); |
23517
70de4e2246ec
Add real server-side aliasing to MSN.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
23515
diff
changeset
|
1248 |
70de4e2246ec
Add real server-side aliasing to MSN.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
23515
diff
changeset
|
1249 state->body = xmlnode_from_str(MSN_CONTACT_UPDATE_TEMPLATE, -1); |
23515
eb8bd060b987
Update MSN Contact tokens when an invalid token error is returned.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
23509
diff
changeset
|
1250 state->action = MSN_UPDATE_INFO; |
eb8bd060b987
Update MSN Contact tokens when an invalid token error is returned.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
23509
diff
changeset
|
1251 state->post_action = MSN_CONTACT_UPDATE_SOAP_ACTION; |
eb8bd060b987
Update MSN Contact tokens when an invalid token error is returned.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
23509
diff
changeset
|
1252 state->post_url = MSN_ADDRESS_BOOK_POST_URL; |
eb8bd060b987
Update MSN Contact tokens when an invalid token error is returned.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
23509
diff
changeset
|
1253 state->cb = msn_update_contact_read_cb; |
20538
90fd0826c6ce
finish converting the rest of stuff to the new soap api, signing on, getting
Ka-Hing Cheung <khc@hxbc.us>
parents:
20501
diff
changeset
|
1254 |
23517
70de4e2246ec
Add real server-side aliasing to MSN.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
23515
diff
changeset
|
1255 contact = xmlnode_get_child(state->body, "Body/ABContactUpdate/contacts/Contact"); |
70de4e2246ec
Add real server-side aliasing to MSN.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
23515
diff
changeset
|
1256 xmlnode_insert_child(contact, contact_info); |
70de4e2246ec
Add real server-side aliasing to MSN.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
23515
diff
changeset
|
1257 xmlnode_insert_child(contact, changes); |
70de4e2246ec
Add real server-side aliasing to MSN.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
23515
diff
changeset
|
1258 |
70de4e2246ec
Add real server-side aliasing to MSN.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
23515
diff
changeset
|
1259 if (!strcmp(passport, "Me")) { |
70de4e2246ec
Add real server-side aliasing to MSN.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
23515
diff
changeset
|
1260 xmlnode *contactType = xmlnode_new_child(contact_info, "contactType"); |
70de4e2246ec
Add real server-side aliasing to MSN.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
23515
diff
changeset
|
1261 xmlnode_insert_data(contactType, "Me", -1); |
70de4e2246ec
Add real server-side aliasing to MSN.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
23515
diff
changeset
|
1262 } else { |
70de4e2246ec
Add real server-side aliasing to MSN.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
23515
diff
changeset
|
1263 MsnUser *user = msn_userlist_find_user(session->userlist, passport); |
70de4e2246ec
Add real server-side aliasing to MSN.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
23515
diff
changeset
|
1264 xmlnode *contactId = xmlnode_new_child(contact, "contactId"); |
70de4e2246ec
Add real server-side aliasing to MSN.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
23515
diff
changeset
|
1265 msn_callback_state_set_uid(state, user->uid); |
70de4e2246ec
Add real server-side aliasing to MSN.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
23515
diff
changeset
|
1266 xmlnode_insert_data(contactId, state->uid, -1); |
70de4e2246ec
Add real server-side aliasing to MSN.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
23515
diff
changeset
|
1267 } |
70de4e2246ec
Add real server-side aliasing to MSN.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
23515
diff
changeset
|
1268 |
70de4e2246ec
Add real server-side aliasing to MSN.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
23515
diff
changeset
|
1269 msn_contact_request(state); |
20394
4a099e4d0d09
propagate from branch 'im.pidgin.pidgin' (head 98b6b547b29ea1192b73cc4e1de1e674edef4328)
Richard Laager <rlaager@wiktel.com>
parents:
diff
changeset
|
1270 } |
4a099e4d0d09
propagate from branch 'im.pidgin.pidgin' (head 98b6b547b29ea1192b73cc4e1de1e674edef4328)
Richard Laager <rlaager@wiktel.com>
parents:
diff
changeset
|
1271 |
4a099e4d0d09
propagate from branch 'im.pidgin.pidgin' (head 98b6b547b29ea1192b73cc4e1de1e674edef4328)
Richard Laager <rlaager@wiktel.com>
parents:
diff
changeset
|
1272 static void |
20538
90fd0826c6ce
finish converting the rest of stuff to the new soap api, signing on, getting
Ka-Hing Cheung <khc@hxbc.us>
parents:
20501
diff
changeset
|
1273 msn_del_contact_from_list_read_cb(MsnSoapMessage *req, MsnSoapMessage *resp, |
90fd0826c6ce
finish converting the rest of stuff to the new soap api, signing on, getting
Ka-Hing Cheung <khc@hxbc.us>
parents:
20501
diff
changeset
|
1274 gpointer data) |
20394
4a099e4d0d09
propagate from branch 'im.pidgin.pidgin' (head 98b6b547b29ea1192b73cc4e1de1e674edef4328)
Richard Laager <rlaager@wiktel.com>
parents:
diff
changeset
|
1275 { |
20538
90fd0826c6ce
finish converting the rest of stuff to the new soap api, signing on, getting
Ka-Hing Cheung <khc@hxbc.us>
parents:
20501
diff
changeset
|
1276 MsnCallbackState *state = data; |
90fd0826c6ce
finish converting the rest of stuff to the new soap api, signing on, getting
Ka-Hing Cheung <khc@hxbc.us>
parents:
20501
diff
changeset
|
1277 MsnSession *session = state->session; |
20486
ff4ae9dde291
Make block/unblock work right, as well as being add by a buddy. Finally fixes #723
Carlos Silva <typ0@pidgin.im>
parents:
20484
diff
changeset
|
1278 |
23564
7bceac816e19
The great MSN debug message cleanup! Threw in a few whitespace fixes,
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
23552
diff
changeset
|
1279 purple_debug_info("msn", "Contact %s deleted successfully from %s list on server!\n", state->who, MsnMemberRole[state->list_id]); |
20486
ff4ae9dde291
Make block/unblock work right, as well as being add by a buddy. Finally fixes #723
Carlos Silva <typ0@pidgin.im>
parents:
20484
diff
changeset
|
1280 |
23515
eb8bd060b987
Update MSN Contact tokens when an invalid token error is returned.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
23509
diff
changeset
|
1281 if (state->list_id == MSN_LIST_PL) { |
eb8bd060b987
Update MSN Contact tokens when an invalid token error is returned.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
23509
diff
changeset
|
1282 MsnUser *user = msn_userlist_find_user(session->userlist, state->who); |
eb8bd060b987
Update MSN Contact tokens when an invalid token error is returned.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
23509
diff
changeset
|
1283 MsnCallbackState *new_state = msn_callback_state_dup(state); |
20773
dcb28d9939ee
Keep MsnUser->list_op in sync.
Carlos Silva <typ0@pidgin.im>
parents:
20772
diff
changeset
|
1284 |
23515
eb8bd060b987
Update MSN Contact tokens when an invalid token error is returned.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
23509
diff
changeset
|
1285 if (user != NULL) |
eb8bd060b987
Update MSN Contact tokens when an invalid token error is returned.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
23509
diff
changeset
|
1286 msn_user_unset_op(user, MSN_LIST_PL_OP); |
20486
ff4ae9dde291
Make block/unblock work right, as well as being add by a buddy. Finally fixes #723
Carlos Silva <typ0@pidgin.im>
parents:
20484
diff
changeset
|
1287 |
23515
eb8bd060b987
Update MSN Contact tokens when an invalid token error is returned.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
23509
diff
changeset
|
1288 msn_add_contact_to_list(session, new_state, state->who, MSN_LIST_RL); |
eb8bd060b987
Update MSN Contact tokens when an invalid token error is returned.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
23509
diff
changeset
|
1289 return; |
eb8bd060b987
Update MSN Contact tokens when an invalid token error is returned.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
23509
diff
changeset
|
1290 } else if (state->list_id == MSN_LIST_AL) { |
eb8bd060b987
Update MSN Contact tokens when an invalid token error is returned.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
23509
diff
changeset
|
1291 purple_privacy_permit_remove(session->account, state->who, TRUE); |
eb8bd060b987
Update MSN Contact tokens when an invalid token error is returned.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
23509
diff
changeset
|
1292 msn_add_contact_to_list(session, NULL, state->who, MSN_LIST_BL); |
eb8bd060b987
Update MSN Contact tokens when an invalid token error is returned.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
23509
diff
changeset
|
1293 } else if (state->list_id == MSN_LIST_BL) { |
eb8bd060b987
Update MSN Contact tokens when an invalid token error is returned.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
23509
diff
changeset
|
1294 purple_privacy_deny_remove(session->account, state->who, TRUE); |
eb8bd060b987
Update MSN Contact tokens when an invalid token error is returned.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
23509
diff
changeset
|
1295 msn_add_contact_to_list(session, NULL, state->who, MSN_LIST_AL); |
20486
ff4ae9dde291
Make block/unblock work right, as well as being add by a buddy. Finally fixes #723
Carlos Silva <typ0@pidgin.im>
parents:
20484
diff
changeset
|
1296 } |
ff4ae9dde291
Make block/unblock work right, as well as being add by a buddy. Finally fixes #723
Carlos Silva <typ0@pidgin.im>
parents:
20484
diff
changeset
|
1297 |
20394
4a099e4d0d09
propagate from branch 'im.pidgin.pidgin' (head 98b6b547b29ea1192b73cc4e1de1e674edef4328)
Richard Laager <rlaager@wiktel.com>
parents:
diff
changeset
|
1298 } |
4a099e4d0d09
propagate from branch 'im.pidgin.pidgin' (head 98b6b547b29ea1192b73cc4e1de1e674edef4328)
Richard Laager <rlaager@wiktel.com>
parents:
diff
changeset
|
1299 |
4a099e4d0d09
propagate from branch 'im.pidgin.pidgin' (head 98b6b547b29ea1192b73cc4e1de1e674edef4328)
Richard Laager <rlaager@wiktel.com>
parents:
diff
changeset
|
1300 void |
23504
69af5301e1a7
killing MsnContact which just wraps MsnSession
Ka-Hing Cheung <khc@hxbc.us>
parents:
23498
diff
changeset
|
1301 msn_del_contact_from_list(MsnSession *session, MsnCallbackState *state, |
20486
ff4ae9dde291
Make block/unblock work right, as well as being add by a buddy. Finally fixes #723
Carlos Silva <typ0@pidgin.im>
parents:
20484
diff
changeset
|
1302 const gchar *passport, const MsnListId list) |
20394
4a099e4d0d09
propagate from branch 'im.pidgin.pidgin' (head 98b6b547b29ea1192b73cc4e1de1e674edef4328)
Richard Laager <rlaager@wiktel.com>
parents:
diff
changeset
|
1303 { |
20486
ff4ae9dde291
Make block/unblock work right, as well as being add by a buddy. Finally fixes #723
Carlos Silva <typ0@pidgin.im>
parents:
20484
diff
changeset
|
1304 gchar *body = NULL, *member = NULL; |
ff4ae9dde291
Make block/unblock work right, as well as being add by a buddy. Finally fixes #723
Carlos Silva <typ0@pidgin.im>
parents:
20484
diff
changeset
|
1305 MsnSoapPartnerScenario partner_scenario; |
ff4ae9dde291
Make block/unblock work right, as well as being add by a buddy. Finally fixes #723
Carlos Silva <typ0@pidgin.im>
parents:
20484
diff
changeset
|
1306 MsnUser *user; |
ff4ae9dde291
Make block/unblock work right, as well as being add by a buddy. Finally fixes #723
Carlos Silva <typ0@pidgin.im>
parents:
20484
diff
changeset
|
1307 |
23504
69af5301e1a7
killing MsnContact which just wraps MsnSession
Ka-Hing Cheung <khc@hxbc.us>
parents:
23498
diff
changeset
|
1308 g_return_if_fail(session != NULL); |
20486
ff4ae9dde291
Make block/unblock work right, as well as being add by a buddy. Finally fixes #723
Carlos Silva <typ0@pidgin.im>
parents:
20484
diff
changeset
|
1309 g_return_if_fail(passport != NULL); |
ff4ae9dde291
Make block/unblock work right, as well as being add by a buddy. Finally fixes #723
Carlos Silva <typ0@pidgin.im>
parents:
20484
diff
changeset
|
1310 g_return_if_fail(list < 5); |
ff4ae9dde291
Make block/unblock work right, as well as being add by a buddy. Finally fixes #723
Carlos Silva <typ0@pidgin.im>
parents:
20484
diff
changeset
|
1311 |
23564
7bceac816e19
The great MSN debug message cleanup! Threw in a few whitespace fixes,
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
23552
diff
changeset
|
1312 purple_debug_info("msn", "Deleting contact %s from %s list\n", passport, MsnMemberRole[list]); |
20486
ff4ae9dde291
Make block/unblock work right, as well as being add by a buddy. Finally fixes #723
Carlos Silva <typ0@pidgin.im>
parents:
20484
diff
changeset
|
1313 |
ff4ae9dde291
Make block/unblock work right, as well as being add by a buddy. Finally fixes #723
Carlos Silva <typ0@pidgin.im>
parents:
20484
diff
changeset
|
1314 if (state == NULL) { |
23504
69af5301e1a7
killing MsnContact which just wraps MsnSession
Ka-Hing Cheung <khc@hxbc.us>
parents:
23498
diff
changeset
|
1315 state = msn_callback_state_new(session); |
20486
ff4ae9dde291
Make block/unblock work right, as well as being add by a buddy. Finally fixes #723
Carlos Silva <typ0@pidgin.im>
parents:
20484
diff
changeset
|
1316 } |
ff4ae9dde291
Make block/unblock work right, as well as being add by a buddy. Finally fixes #723
Carlos Silva <typ0@pidgin.im>
parents:
20484
diff
changeset
|
1317 msn_callback_state_set_list_id(state, list); |
ff4ae9dde291
Make block/unblock work right, as well as being add by a buddy. Finally fixes #723
Carlos Silva <typ0@pidgin.im>
parents:
20484
diff
changeset
|
1318 msn_callback_state_set_who(state, passport); |
ff4ae9dde291
Make block/unblock work right, as well as being add by a buddy. Finally fixes #723
Carlos Silva <typ0@pidgin.im>
parents:
20484
diff
changeset
|
1319 |
ff4ae9dde291
Make block/unblock work right, as well as being add by a buddy. Finally fixes #723
Carlos Silva <typ0@pidgin.im>
parents:
20484
diff
changeset
|
1320 if (list == MSN_LIST_PL) { |
23504
69af5301e1a7
killing MsnContact which just wraps MsnSession
Ka-Hing Cheung <khc@hxbc.us>
parents:
23498
diff
changeset
|
1321 g_return_if_fail(session->userlist != NULL); |
20486
ff4ae9dde291
Make block/unblock work right, as well as being add by a buddy. Finally fixes #723
Carlos Silva <typ0@pidgin.im>
parents:
20484
diff
changeset
|
1322 |
23504
69af5301e1a7
killing MsnContact which just wraps MsnSession
Ka-Hing Cheung <khc@hxbc.us>
parents:
23498
diff
changeset
|
1323 user = msn_userlist_find_user(session->userlist, passport); |
20486
ff4ae9dde291
Make block/unblock work right, as well as being add by a buddy. Finally fixes #723
Carlos Silva <typ0@pidgin.im>
parents:
20484
diff
changeset
|
1324 |
ff4ae9dde291
Make block/unblock work right, as well as being add by a buddy. Finally fixes #723
Carlos Silva <typ0@pidgin.im>
parents:
20484
diff
changeset
|
1325 partner_scenario = MSN_PS_CONTACT_API; |
ff4ae9dde291
Make block/unblock work right, as well as being add by a buddy. Finally fixes #723
Carlos Silva <typ0@pidgin.im>
parents:
20484
diff
changeset
|
1326 member = g_strdup_printf(MSN_MEMBER_MEMBERSHIPID_XML, user->membership_id[MSN_LIST_PL]); |
ff4ae9dde291
Make block/unblock work right, as well as being add by a buddy. Finally fixes #723
Carlos Silva <typ0@pidgin.im>
parents:
20484
diff
changeset
|
1327 } else { |
ff4ae9dde291
Make block/unblock work right, as well as being add by a buddy. Finally fixes #723
Carlos Silva <typ0@pidgin.im>
parents:
20484
diff
changeset
|
1328 /* list == MSN_LIST_AL || list == MSN_LIST_BL */ |
ff4ae9dde291
Make block/unblock work right, as well as being add by a buddy. Finally fixes #723
Carlos Silva <typ0@pidgin.im>
parents:
20484
diff
changeset
|
1329 partner_scenario = MSN_PS_BLOCK_UNBLOCK; |
ff4ae9dde291
Make block/unblock work right, as well as being add by a buddy. Finally fixes #723
Carlos Silva <typ0@pidgin.im>
parents:
20484
diff
changeset
|
1330 |
ff4ae9dde291
Make block/unblock work right, as well as being add by a buddy. Finally fixes #723
Carlos Silva <typ0@pidgin.im>
parents:
20484
diff
changeset
|
1331 member = g_strdup_printf(MSN_MEMBER_PASSPORT_XML, passport); |
ff4ae9dde291
Make block/unblock work right, as well as being add by a buddy. Finally fixes #723
Carlos Silva <typ0@pidgin.im>
parents:
20484
diff
changeset
|
1332 } |
ff4ae9dde291
Make block/unblock work right, as well as being add by a buddy. Finally fixes #723
Carlos Silva <typ0@pidgin.im>
parents:
20484
diff
changeset
|
1333 |
23515
eb8bd060b987
Update MSN Contact tokens when an invalid token error is returned.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
23509
diff
changeset
|
1334 body = g_strdup_printf(MSN_CONTACT_DELECT_FROM_LIST_TEMPLATE, |
23492
72aa2ccad28d
fix sending offline message in p15 by sending the correct token. In msnp14,
Ka-Hing Cheung <khc@hxbc.us>
parents:
23491
diff
changeset
|
1335 MsnSoapPartnerScenarioText[partner_scenario], |
72aa2ccad28d
fix sending offline message in p15 by sending the correct token. In msnp14,
Ka-Hing Cheung <khc@hxbc.us>
parents:
23491
diff
changeset
|
1336 MsnMemberRole[list], member); |
20486
ff4ae9dde291
Make block/unblock work right, as well as being add by a buddy. Finally fixes #723
Carlos Silva <typ0@pidgin.im>
parents:
20484
diff
changeset
|
1337 |
23515
eb8bd060b987
Update MSN Contact tokens when an invalid token error is returned.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
23509
diff
changeset
|
1338 state->body = xmlnode_from_str(body, -1); |
eb8bd060b987
Update MSN Contact tokens when an invalid token error is returned.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
23509
diff
changeset
|
1339 state->post_action = MSN_DELETE_MEMBER_FROM_LIST_SOAP_ACTION; |
eb8bd060b987
Update MSN Contact tokens when an invalid token error is returned.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
23509
diff
changeset
|
1340 state->post_url = MSN_SHARE_POST_URL; |
eb8bd060b987
Update MSN Contact tokens when an invalid token error is returned.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
23509
diff
changeset
|
1341 state->cb = msn_del_contact_from_list_read_cb; |
eb8bd060b987
Update MSN Contact tokens when an invalid token error is returned.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
23509
diff
changeset
|
1342 msn_contact_request(state); |
20486
ff4ae9dde291
Make block/unblock work right, as well as being add by a buddy. Finally fixes #723
Carlos Silva <typ0@pidgin.im>
parents:
20484
diff
changeset
|
1343 |
20538
90fd0826c6ce
finish converting the rest of stuff to the new soap api, signing on, getting
Ka-Hing Cheung <khc@hxbc.us>
parents:
20501
diff
changeset
|
1344 g_free(member); |
20486
ff4ae9dde291
Make block/unblock work right, as well as being add by a buddy. Finally fixes #723
Carlos Silva <typ0@pidgin.im>
parents:
20484
diff
changeset
|
1345 g_free(body); |
ff4ae9dde291
Make block/unblock work right, as well as being add by a buddy. Finally fixes #723
Carlos Silva <typ0@pidgin.im>
parents:
20484
diff
changeset
|
1346 } |
ff4ae9dde291
Make block/unblock work right, as well as being add by a buddy. Finally fixes #723
Carlos Silva <typ0@pidgin.im>
parents:
20484
diff
changeset
|
1347 |
ff4ae9dde291
Make block/unblock work right, as well as being add by a buddy. Finally fixes #723
Carlos Silva <typ0@pidgin.im>
parents:
20484
diff
changeset
|
1348 static void |
20538
90fd0826c6ce
finish converting the rest of stuff to the new soap api, signing on, getting
Ka-Hing Cheung <khc@hxbc.us>
parents:
20501
diff
changeset
|
1349 msn_add_contact_to_list_read_cb(MsnSoapMessage *req, MsnSoapMessage *resp, |
90fd0826c6ce
finish converting the rest of stuff to the new soap api, signing on, getting
Ka-Hing Cheung <khc@hxbc.us>
parents:
20501
diff
changeset
|
1350 gpointer data) |
20486
ff4ae9dde291
Make block/unblock work right, as well as being add by a buddy. Finally fixes #723
Carlos Silva <typ0@pidgin.im>
parents:
20484
diff
changeset
|
1351 { |
20538
90fd0826c6ce
finish converting the rest of stuff to the new soap api, signing on, getting
Ka-Hing Cheung <khc@hxbc.us>
parents:
20501
diff
changeset
|
1352 MsnCallbackState *state = data; |
20486
ff4ae9dde291
Make block/unblock work right, as well as being add by a buddy. Finally fixes #723
Carlos Silva <typ0@pidgin.im>
parents:
20484
diff
changeset
|
1353 |
20538
90fd0826c6ce
finish converting the rest of stuff to the new soap api, signing on, getting
Ka-Hing Cheung <khc@hxbc.us>
parents:
20501
diff
changeset
|
1354 g_return_if_fail(state != NULL); |
90fd0826c6ce
finish converting the rest of stuff to the new soap api, signing on, getting
Ka-Hing Cheung <khc@hxbc.us>
parents:
20501
diff
changeset
|
1355 g_return_if_fail(state->session != NULL); |
23300
5cdd93dac7a2
Delete trailing whitespace
Mark Doliner <mark@kingant.net>
parents:
22808
diff
changeset
|
1356 |
23564
7bceac816e19
The great MSN debug message cleanup! Threw in a few whitespace fixes,
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
23552
diff
changeset
|
1357 purple_debug_info("msn", "Contact %s added successfully to %s list on server!\n", state->who, MsnMemberRole[state->list_id]); |
20394
4a099e4d0d09
propagate from branch 'im.pidgin.pidgin' (head 98b6b547b29ea1192b73cc4e1de1e674edef4328)
Richard Laager <rlaager@wiktel.com>
parents:
diff
changeset
|
1358 |
23515
eb8bd060b987
Update MSN Contact tokens when an invalid token error is returned.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
23509
diff
changeset
|
1359 if (state->list_id == MSN_LIST_RL) { |
eb8bd060b987
Update MSN Contact tokens when an invalid token error is returned.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
23509
diff
changeset
|
1360 MsnUser *user = msn_userlist_find_user(state->session->userlist, state->who); |
23300
5cdd93dac7a2
Delete trailing whitespace
Mark Doliner <mark@kingant.net>
parents:
22808
diff
changeset
|
1361 |
23515
eb8bd060b987
Update MSN Contact tokens when an invalid token error is returned.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
23509
diff
changeset
|
1362 if (user != NULL) { |
eb8bd060b987
Update MSN Contact tokens when an invalid token error is returned.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
23509
diff
changeset
|
1363 msn_user_set_op(user, MSN_LIST_RL_OP); |
eb8bd060b987
Update MSN Contact tokens when an invalid token error is returned.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
23509
diff
changeset
|
1364 } |
20486
ff4ae9dde291
Make block/unblock work right, as well as being add by a buddy. Finally fixes #723
Carlos Silva <typ0@pidgin.im>
parents:
20484
diff
changeset
|
1365 |
23515
eb8bd060b987
Update MSN Contact tokens when an invalid token error is returned.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
23509
diff
changeset
|
1366 if (state->action & MSN_DENIED_BUDDY) { |
eb8bd060b987
Update MSN Contact tokens when an invalid token error is returned.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
23509
diff
changeset
|
1367 msn_add_contact_to_list(state->session, NULL, state->who, MSN_LIST_BL); |
eb8bd060b987
Update MSN Contact tokens when an invalid token error is returned.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
23509
diff
changeset
|
1368 } else if (state->list_id == MSN_LIST_AL) { |
eb8bd060b987
Update MSN Contact tokens when an invalid token error is returned.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
23509
diff
changeset
|
1369 purple_privacy_permit_add(state->session->account, state->who, TRUE); |
eb8bd060b987
Update MSN Contact tokens when an invalid token error is returned.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
23509
diff
changeset
|
1370 } else if (state->list_id == MSN_LIST_BL) { |
eb8bd060b987
Update MSN Contact tokens when an invalid token error is returned.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
23509
diff
changeset
|
1371 purple_privacy_deny_add(state->session->account, state->who, TRUE); |
20538
90fd0826c6ce
finish converting the rest of stuff to the new soap api, signing on, getting
Ka-Hing Cheung <khc@hxbc.us>
parents:
20501
diff
changeset
|
1372 } |
20486
ff4ae9dde291
Make block/unblock work right, as well as being add by a buddy. Finally fixes #723
Carlos Silva <typ0@pidgin.im>
parents:
20484
diff
changeset
|
1373 } |
ff4ae9dde291
Make block/unblock work right, as well as being add by a buddy. Finally fixes #723
Carlos Silva <typ0@pidgin.im>
parents:
20484
diff
changeset
|
1374 } |
ff4ae9dde291
Make block/unblock work right, as well as being add by a buddy. Finally fixes #723
Carlos Silva <typ0@pidgin.im>
parents:
20484
diff
changeset
|
1375 |
ff4ae9dde291
Make block/unblock work right, as well as being add by a buddy. Finally fixes #723
Carlos Silva <typ0@pidgin.im>
parents:
20484
diff
changeset
|
1376 void |
23504
69af5301e1a7
killing MsnContact which just wraps MsnSession
Ka-Hing Cheung <khc@hxbc.us>
parents:
23498
diff
changeset
|
1377 msn_add_contact_to_list(MsnSession *session, MsnCallbackState *state, |
20486
ff4ae9dde291
Make block/unblock work right, as well as being add by a buddy. Finally fixes #723
Carlos Silva <typ0@pidgin.im>
parents:
20484
diff
changeset
|
1378 const gchar *passport, const MsnListId list) |
ff4ae9dde291
Make block/unblock work right, as well as being add by a buddy. Finally fixes #723
Carlos Silva <typ0@pidgin.im>
parents:
20484
diff
changeset
|
1379 { |
ff4ae9dde291
Make block/unblock work right, as well as being add by a buddy. Finally fixes #723
Carlos Silva <typ0@pidgin.im>
parents:
20484
diff
changeset
|
1380 gchar *body = NULL, *member = NULL; |
ff4ae9dde291
Make block/unblock work right, as well as being add by a buddy. Finally fixes #723
Carlos Silva <typ0@pidgin.im>
parents:
20484
diff
changeset
|
1381 MsnSoapPartnerScenario partner_scenario; |
ff4ae9dde291
Make block/unblock work right, as well as being add by a buddy. Finally fixes #723
Carlos Silva <typ0@pidgin.im>
parents:
20484
diff
changeset
|
1382 |
23504
69af5301e1a7
killing MsnContact which just wraps MsnSession
Ka-Hing Cheung <khc@hxbc.us>
parents:
23498
diff
changeset
|
1383 g_return_if_fail(session != NULL); |
20486
ff4ae9dde291
Make block/unblock work right, as well as being add by a buddy. Finally fixes #723
Carlos Silva <typ0@pidgin.im>
parents:
20484
diff
changeset
|
1384 g_return_if_fail(passport != NULL); |
ff4ae9dde291
Make block/unblock work right, as well as being add by a buddy. Finally fixes #723
Carlos Silva <typ0@pidgin.im>
parents:
20484
diff
changeset
|
1385 g_return_if_fail(list < 5); |
ff4ae9dde291
Make block/unblock work right, as well as being add by a buddy. Finally fixes #723
Carlos Silva <typ0@pidgin.im>
parents:
20484
diff
changeset
|
1386 |
23564
7bceac816e19
The great MSN debug message cleanup! Threw in a few whitespace fixes,
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
23552
diff
changeset
|
1387 purple_debug_info("msn", "Adding contact %s to %s list\n", passport, MsnMemberRole[list]); |
20486
ff4ae9dde291
Make block/unblock work right, as well as being add by a buddy. Finally fixes #723
Carlos Silva <typ0@pidgin.im>
parents:
20484
diff
changeset
|
1388 |
ff4ae9dde291
Make block/unblock work right, as well as being add by a buddy. Finally fixes #723
Carlos Silva <typ0@pidgin.im>
parents:
20484
diff
changeset
|
1389 if (state == NULL) { |
23504
69af5301e1a7
killing MsnContact which just wraps MsnSession
Ka-Hing Cheung <khc@hxbc.us>
parents:
23498
diff
changeset
|
1390 state = msn_callback_state_new(session); |
20486
ff4ae9dde291
Make block/unblock work right, as well as being add by a buddy. Finally fixes #723
Carlos Silva <typ0@pidgin.im>
parents:
20484
diff
changeset
|
1391 } |
ff4ae9dde291
Make block/unblock work right, as well as being add by a buddy. Finally fixes #723
Carlos Silva <typ0@pidgin.im>
parents:
20484
diff
changeset
|
1392 msn_callback_state_set_list_id(state, list); |
ff4ae9dde291
Make block/unblock work right, as well as being add by a buddy. Finally fixes #723
Carlos Silva <typ0@pidgin.im>
parents:
20484
diff
changeset
|
1393 msn_callback_state_set_who(state, passport); |
ff4ae9dde291
Make block/unblock work right, as well as being add by a buddy. Finally fixes #723
Carlos Silva <typ0@pidgin.im>
parents:
20484
diff
changeset
|
1394 |
ff4ae9dde291
Make block/unblock work right, as well as being add by a buddy. Finally fixes #723
Carlos Silva <typ0@pidgin.im>
parents:
20484
diff
changeset
|
1395 partner_scenario = (list == MSN_LIST_RL) ? MSN_PS_CONTACT_API : MSN_PS_BLOCK_UNBLOCK; |
ff4ae9dde291
Make block/unblock work right, as well as being add by a buddy. Finally fixes #723
Carlos Silva <typ0@pidgin.im>
parents:
20484
diff
changeset
|
1396 |
21134
abc18354ef66
fix allowing to be added, some old fix was lost during one of the merges
Ka-Hing Cheung <khc@hxbc.us>
parents:
21127
diff
changeset
|
1397 member = g_strdup_printf(MSN_MEMBER_PASSPORT_XML, state->who); |
20486
ff4ae9dde291
Make block/unblock work right, as well as being add by a buddy. Finally fixes #723
Carlos Silva <typ0@pidgin.im>
parents:
20484
diff
changeset
|
1398 |
23300
5cdd93dac7a2
Delete trailing whitespace
Mark Doliner <mark@kingant.net>
parents:
22808
diff
changeset
|
1399 body = g_strdup_printf(MSN_CONTACT_ADD_TO_LIST_TEMPLATE, |
23492
72aa2ccad28d
fix sending offline message in p15 by sending the correct token. In msnp14,
Ka-Hing Cheung <khc@hxbc.us>
parents:
23491
diff
changeset
|
1400 MsnSoapPartnerScenarioText[partner_scenario], |
72aa2ccad28d
fix sending offline message in p15 by sending the correct token. In msnp14,
Ka-Hing Cheung <khc@hxbc.us>
parents:
23491
diff
changeset
|
1401 MsnMemberRole[list], member); |
20486
ff4ae9dde291
Make block/unblock work right, as well as being add by a buddy. Finally fixes #723
Carlos Silva <typ0@pidgin.im>
parents:
20484
diff
changeset
|
1402 |
23515
eb8bd060b987
Update MSN Contact tokens when an invalid token error is returned.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
23509
diff
changeset
|
1403 state->body = xmlnode_from_str(body, -1); |
eb8bd060b987
Update MSN Contact tokens when an invalid token error is returned.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
23509
diff
changeset
|
1404 state->post_action = MSN_ADD_MEMBER_TO_LIST_SOAP_ACTION; |
eb8bd060b987
Update MSN Contact tokens when an invalid token error is returned.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
23509
diff
changeset
|
1405 state->post_url = MSN_SHARE_POST_URL; |
eb8bd060b987
Update MSN Contact tokens when an invalid token error is returned.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
23509
diff
changeset
|
1406 state->cb = msn_add_contact_to_list_read_cb; |
eb8bd060b987
Update MSN Contact tokens when an invalid token error is returned.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
23509
diff
changeset
|
1407 msn_contact_request(state); |
20486
ff4ae9dde291
Make block/unblock work right, as well as being add by a buddy. Finally fixes #723
Carlos Silva <typ0@pidgin.im>
parents:
20484
diff
changeset
|
1408 |
20538
90fd0826c6ce
finish converting the rest of stuff to the new soap api, signing on, getting
Ka-Hing Cheung <khc@hxbc.us>
parents:
20501
diff
changeset
|
1409 g_free(member); |
20394
4a099e4d0d09
propagate from branch 'im.pidgin.pidgin' (head 98b6b547b29ea1192b73cc4e1de1e674edef4328)
Richard Laager <rlaager@wiktel.com>
parents:
diff
changeset
|
1410 g_free(body); |
4a099e4d0d09
propagate from branch 'im.pidgin.pidgin' (head 98b6b547b29ea1192b73cc4e1de1e674edef4328)
Richard Laager <rlaager@wiktel.com>
parents:
diff
changeset
|
1411 } |
4a099e4d0d09
propagate from branch 'im.pidgin.pidgin' (head 98b6b547b29ea1192b73cc4e1de1e674edef4328)
Richard Laager <rlaager@wiktel.com>
parents:
diff
changeset
|
1412 |
20427
059cc0bf6c91
Fix a compile warning by #if 0'ing out some unused code
Stu Tomlinson <stu@nosnilmot.com>
parents:
20403
diff
changeset
|
1413 #if 0 |
20394
4a099e4d0d09
propagate from branch 'im.pidgin.pidgin' (head 98b6b547b29ea1192b73cc4e1de1e674edef4328)
Richard Laager <rlaager@wiktel.com>
parents:
diff
changeset
|
1414 static void |
20538
90fd0826c6ce
finish converting the rest of stuff to the new soap api, signing on, getting
Ka-Hing Cheung <khc@hxbc.us>
parents:
20501
diff
changeset
|
1415 msn_gleams_read_cb(MsnSoapMessage *req, MsnSoapMessage *resp, gpointer data) |
20394
4a099e4d0d09
propagate from branch 'im.pidgin.pidgin' (head 98b6b547b29ea1192b73cc4e1de1e674edef4328)
Richard Laager <rlaager@wiktel.com>
parents:
diff
changeset
|
1416 { |
23564
7bceac816e19
The great MSN debug message cleanup! Threw in a few whitespace fixes,
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
23552
diff
changeset
|
1417 purple_debug_info("msn", "Gleams read done\n"); |
20394
4a099e4d0d09
propagate from branch 'im.pidgin.pidgin' (head 98b6b547b29ea1192b73cc4e1de1e674edef4328)
Richard Laager <rlaager@wiktel.com>
parents:
diff
changeset
|
1418 } |
4a099e4d0d09
propagate from branch 'im.pidgin.pidgin' (head 98b6b547b29ea1192b73cc4e1de1e674edef4328)
Richard Laager <rlaager@wiktel.com>
parents:
diff
changeset
|
1419 |
4a099e4d0d09
propagate from branch 'im.pidgin.pidgin' (head 98b6b547b29ea1192b73cc4e1de1e674edef4328)
Richard Laager <rlaager@wiktel.com>
parents:
diff
changeset
|
1420 /*get the gleams info*/ |
4a099e4d0d09
propagate from branch 'im.pidgin.pidgin' (head 98b6b547b29ea1192b73cc4e1de1e674edef4328)
Richard Laager <rlaager@wiktel.com>
parents:
diff
changeset
|
1421 void |
23504
69af5301e1a7
killing MsnContact which just wraps MsnSession
Ka-Hing Cheung <khc@hxbc.us>
parents:
23498
diff
changeset
|
1422 msn_get_gleams(MsnSession *session) |
20394
4a099e4d0d09
propagate from branch 'im.pidgin.pidgin' (head 98b6b547b29ea1192b73cc4e1de1e674edef4328)
Richard Laager <rlaager@wiktel.com>
parents:
diff
changeset
|
1423 { |
4a099e4d0d09
propagate from branch 'im.pidgin.pidgin' (head 98b6b547b29ea1192b73cc4e1de1e674edef4328)
Richard Laager <rlaager@wiktel.com>
parents:
diff
changeset
|
1424 MsnSoapReq *soap_request; |
4a099e4d0d09
propagate from branch 'im.pidgin.pidgin' (head 98b6b547b29ea1192b73cc4e1de1e674edef4328)
Richard Laager <rlaager@wiktel.com>
parents:
diff
changeset
|
1425 |
23564
7bceac816e19
The great MSN debug message cleanup! Threw in a few whitespace fixes,
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
23552
diff
changeset
|
1426 purple_debug_info("msn", "msn get gleams info...\n"); |
23509
1ac5faa72c8d
explicit merge of '9d90ebdb7e38fdd77bb504bc3302a083616360d9'
Elliott Sales de Andrade <qulogic@pidgin.im>
diff
changeset
|
1427 |
23515
eb8bd060b987
Update MSN Contact tokens when an invalid token error is returned.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
23509
diff
changeset
|
1428 state = msn_callback_state_new(session); |
eb8bd060b987
Update MSN Contact tokens when an invalid token error is returned.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
23509
diff
changeset
|
1429 state->body = xmlnode_from_str(MSN_GLEAMS_TEMPLATE, -1); |
eb8bd060b987
Update MSN Contact tokens when an invalid token error is returned.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
23509
diff
changeset
|
1430 state->post_action = MSN_GET_GLEAMS_SOAP_ACTION; |
eb8bd060b987
Update MSN Contact tokens when an invalid token error is returned.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
23509
diff
changeset
|
1431 state->post_url = MSN_ADDRESS_BOOK_POST_URL; |
eb8bd060b987
Update MSN Contact tokens when an invalid token error is returned.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
23509
diff
changeset
|
1432 state->cb = msn_gleams_read_cb; |
eb8bd060b987
Update MSN Contact tokens when an invalid token error is returned.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
23509
diff
changeset
|
1433 msn_contact_request(state); |
20394
4a099e4d0d09
propagate from branch 'im.pidgin.pidgin' (head 98b6b547b29ea1192b73cc4e1de1e674edef4328)
Richard Laager <rlaager@wiktel.com>
parents:
diff
changeset
|
1434 } |
4a099e4d0d09
propagate from branch 'im.pidgin.pidgin' (head 98b6b547b29ea1192b73cc4e1de1e674edef4328)
Richard Laager <rlaager@wiktel.com>
parents:
diff
changeset
|
1435 #endif |
4a099e4d0d09
propagate from branch 'im.pidgin.pidgin' (head 98b6b547b29ea1192b73cc4e1de1e674edef4328)
Richard Laager <rlaager@wiktel.com>
parents:
diff
changeset
|
1436 |
20481
eb93710aec4d
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:
20479
diff
changeset
|
1437 |
20394
4a099e4d0d09
propagate from branch 'im.pidgin.pidgin' (head 98b6b547b29ea1192b73cc4e1de1e674edef4328)
Richard Laager <rlaager@wiktel.com>
parents:
diff
changeset
|
1438 /*************************************************************** |
20481
eb93710aec4d
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:
20479
diff
changeset
|
1439 * Group Operations |
20394
4a099e4d0d09
propagate from branch 'im.pidgin.pidgin' (head 98b6b547b29ea1192b73cc4e1de1e674edef4328)
Richard Laager <rlaager@wiktel.com>
parents:
diff
changeset
|
1440 ***************************************************************/ |
20481
eb93710aec4d
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:
20479
diff
changeset
|
1441 |
20394
4a099e4d0d09
propagate from branch 'im.pidgin.pidgin' (head 98b6b547b29ea1192b73cc4e1de1e674edef4328)
Richard Laager <rlaager@wiktel.com>
parents:
diff
changeset
|
1442 static void |
20538
90fd0826c6ce
finish converting the rest of stuff to the new soap api, signing on, getting
Ka-Hing Cheung <khc@hxbc.us>
parents:
20501
diff
changeset
|
1443 msn_group_read_cb(MsnSoapMessage *req, MsnSoapMessage *resp, gpointer data) |
20394
4a099e4d0d09
propagate from branch 'im.pidgin.pidgin' (head 98b6b547b29ea1192b73cc4e1de1e674edef4328)
Richard Laager <rlaager@wiktel.com>
parents:
diff
changeset
|
1444 { |
20538
90fd0826c6ce
finish converting the rest of stuff to the new soap api, signing on, getting
Ka-Hing Cheung <khc@hxbc.us>
parents:
20501
diff
changeset
|
1445 MsnCallbackState *state = data; |
23515
eb8bd060b987
Update MSN Contact tokens when an invalid token error is returned.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
23509
diff
changeset
|
1446 MsnSession *session; |
eb8bd060b987
Update MSN Contact tokens when an invalid token error is returned.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
23509
diff
changeset
|
1447 MsnUserList *userlist; |
23300
5cdd93dac7a2
Delete trailing whitespace
Mark Doliner <mark@kingant.net>
parents:
22808
diff
changeset
|
1448 |
23564
7bceac816e19
The great MSN debug message cleanup! Threw in a few whitespace fixes,
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
23552
diff
changeset
|
1449 purple_debug_info("msn", "Group request successful.\n"); |
23300
5cdd93dac7a2
Delete trailing whitespace
Mark Doliner <mark@kingant.net>
parents:
22808
diff
changeset
|
1450 |
20538
90fd0826c6ce
finish converting the rest of stuff to the new soap api, signing on, getting
Ka-Hing Cheung <khc@hxbc.us>
parents:
20501
diff
changeset
|
1451 g_return_if_fail(state->session != NULL); |
90fd0826c6ce
finish converting the rest of stuff to the new soap api, signing on, getting
Ka-Hing Cheung <khc@hxbc.us>
parents:
20501
diff
changeset
|
1452 g_return_if_fail(state->session->userlist != NULL); |
20501
f6dff814d95f
cleans up ownership of soap callback data, this soap stuff is perfect
Ka-Hing Cheung <khc@hxbc.us>
parents:
20495
diff
changeset
|
1453 |
23515
eb8bd060b987
Update MSN Contact tokens when an invalid token error is returned.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
23509
diff
changeset
|
1454 session = state->session; |
eb8bd060b987
Update MSN Contact tokens when an invalid token error is returned.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
23509
diff
changeset
|
1455 userlist = session->userlist; |
eb8bd060b987
Update MSN Contact tokens when an invalid token error is returned.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
23509
diff
changeset
|
1456 |
eb8bd060b987
Update MSN Contact tokens when an invalid token error is returned.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
23509
diff
changeset
|
1457 if (state->action & MSN_RENAME_GROUP) { |
eb8bd060b987
Update MSN Contact tokens when an invalid token error is returned.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
23509
diff
changeset
|
1458 msn_userlist_rename_group_id(session->userlist, |
eb8bd060b987
Update MSN Contact tokens when an invalid token error is returned.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
23509
diff
changeset
|
1459 state->guid, |
eb8bd060b987
Update MSN Contact tokens when an invalid token error is returned.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
23509
diff
changeset
|
1460 state->new_group_name); |
20501
f6dff814d95f
cleans up ownership of soap callback data, this soap stuff is perfect
Ka-Hing Cheung <khc@hxbc.us>
parents:
20495
diff
changeset
|
1461 } |
20538
90fd0826c6ce
finish converting the rest of stuff to the new soap api, signing on, getting
Ka-Hing Cheung <khc@hxbc.us>
parents:
20501
diff
changeset
|
1462 |
23515
eb8bd060b987
Update MSN Contact tokens when an invalid token error is returned.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
23509
diff
changeset
|
1463 if (state->action & MSN_ADD_GROUP) { |
eb8bd060b987
Update MSN Contact tokens when an invalid token error is returned.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
23509
diff
changeset
|
1464 /* the response is taken from |
eb8bd060b987
Update MSN Contact tokens when an invalid token error is returned.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
23509
diff
changeset
|
1465 http://telepathy.freedesktop.org/wiki/Pymsn/MSNP/ContactListActions |
eb8bd060b987
Update MSN Contact tokens when an invalid token error is returned.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
23509
diff
changeset
|
1466 should copy it to msnpiki some day */ |
eb8bd060b987
Update MSN Contact tokens when an invalid token error is returned.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
23509
diff
changeset
|
1467 xmlnode *guid_node = xmlnode_get_child(resp->xml, |
eb8bd060b987
Update MSN Contact tokens when an invalid token error is returned.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
23509
diff
changeset
|
1468 "Body/ABGroupAddResponse/ABGroupAddResult/guid"); |
23300
5cdd93dac7a2
Delete trailing whitespace
Mark Doliner <mark@kingant.net>
parents:
22808
diff
changeset
|
1469 |
23515
eb8bd060b987
Update MSN Contact tokens when an invalid token error is returned.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
23509
diff
changeset
|
1470 if (guid_node) { |
eb8bd060b987
Update MSN Contact tokens when an invalid token error is returned.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
23509
diff
changeset
|
1471 char *guid = xmlnode_get_data(guid_node); |
20538
90fd0826c6ce
finish converting the rest of stuff to the new soap api, signing on, getting
Ka-Hing Cheung <khc@hxbc.us>
parents:
20501
diff
changeset
|
1472 |
23515
eb8bd060b987
Update MSN Contact tokens when an invalid token error is returned.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
23509
diff
changeset
|
1473 /* create and add the new group to the userlist */ |
23564
7bceac816e19
The great MSN debug message cleanup! Threw in a few whitespace fixes,
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
23552
diff
changeset
|
1474 purple_debug_info("msn", "Adding group %s with guid = %s to the userlist\n", state->new_group_name, guid); |
23515
eb8bd060b987
Update MSN Contact tokens when an invalid token error is returned.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
23509
diff
changeset
|
1475 msn_group_new(session->userlist, guid, state->new_group_name); |
20477
9a2a4a0c0003
Add the possibility to create an Address Book, useful for newly registered MSN users.
Carlos Silva <typ0@pidgin.im>
parents:
20471
diff
changeset
|
1476 |
23515
eb8bd060b987
Update MSN Contact tokens when an invalid token error is returned.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
23509
diff
changeset
|
1477 if (state->action & MSN_ADD_BUDDY) { |
eb8bd060b987
Update MSN Contact tokens when an invalid token error is returned.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
23509
diff
changeset
|
1478 msn_userlist_add_buddy(session->userlist, |
eb8bd060b987
Update MSN Contact tokens when an invalid token error is returned.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
23509
diff
changeset
|
1479 state->who, |
20538
90fd0826c6ce
finish converting the rest of stuff to the new soap api, signing on, getting
Ka-Hing Cheung <khc@hxbc.us>
parents:
20501
diff
changeset
|
1480 state->new_group_name); |
23515
eb8bd060b987
Update MSN Contact tokens when an invalid token error is returned.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
23509
diff
changeset
|
1481 } else if (state->action & MSN_MOVE_BUDDY) { |
eb8bd060b987
Update MSN Contact tokens when an invalid token error is returned.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
23509
diff
changeset
|
1482 /* This will be freed when the add contact callback fires */ |
eb8bd060b987
Update MSN Contact tokens when an invalid token error is returned.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
23509
diff
changeset
|
1483 MsnCallbackState *new_state = msn_callback_state_dup(state); |
eb8bd060b987
Update MSN Contact tokens when an invalid token error is returned.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
23509
diff
changeset
|
1484 msn_add_contact_to_group(session, new_state, state->who, guid); |
eb8bd060b987
Update MSN Contact tokens when an invalid token error is returned.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
23509
diff
changeset
|
1485 g_free(guid); |
eb8bd060b987
Update MSN Contact tokens when an invalid token error is returned.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
23509
diff
changeset
|
1486 return; |
20481
eb93710aec4d
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:
20479
diff
changeset
|
1487 } |
23515
eb8bd060b987
Update MSN Contact tokens when an invalid token error is returned.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
23509
diff
changeset
|
1488 g_free(guid); |
eb8bd060b987
Update MSN Contact tokens when an invalid token error is returned.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
23509
diff
changeset
|
1489 } else { |
23564
7bceac816e19
The great MSN debug message cleanup! Threw in a few whitespace fixes,
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
23552
diff
changeset
|
1490 purple_debug_info("msn", "Adding group %s failed\n", |
23515
eb8bd060b987
Update MSN Contact tokens when an invalid token error is returned.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
23509
diff
changeset
|
1491 state->new_group_name); |
20481
eb93710aec4d
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:
20479
diff
changeset
|
1492 } |
23515
eb8bd060b987
Update MSN Contact tokens when an invalid token error is returned.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
23509
diff
changeset
|
1493 } |
23300
5cdd93dac7a2
Delete trailing whitespace
Mark Doliner <mark@kingant.net>
parents:
22808
diff
changeset
|
1494 |
23515
eb8bd060b987
Update MSN Contact tokens when an invalid token error is returned.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
23509
diff
changeset
|
1495 if (state->action & MSN_DEL_GROUP) { |
eb8bd060b987
Update MSN Contact tokens when an invalid token error is returned.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
23509
diff
changeset
|
1496 GList *l; |
eb8bd060b987
Update MSN Contact tokens when an invalid token error is returned.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
23509
diff
changeset
|
1497 |
eb8bd060b987
Update MSN Contact tokens when an invalid token error is returned.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
23509
diff
changeset
|
1498 msn_userlist_remove_group_id(session->userlist, state->guid); |
eb8bd060b987
Update MSN Contact tokens when an invalid token error is returned.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
23509
diff
changeset
|
1499 for (l = userlist->users; l != NULL; l = l->next) { |
eb8bd060b987
Update MSN Contact tokens when an invalid token error is returned.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
23509
diff
changeset
|
1500 msn_user_remove_group_id( (MsnUser *)l->data, state->guid); |
20481
eb93710aec4d
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:
20479
diff
changeset
|
1501 } |
eb93710aec4d
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:
20479
diff
changeset
|
1502 } |
20394
4a099e4d0d09
propagate from branch 'im.pidgin.pidgin' (head 98b6b547b29ea1192b73cc4e1de1e674edef4328)
Richard Laager <rlaager@wiktel.com>
parents:
diff
changeset
|
1503 } |
4a099e4d0d09
propagate from branch 'im.pidgin.pidgin' (head 98b6b547b29ea1192b73cc4e1de1e674edef4328)
Richard Laager <rlaager@wiktel.com>
parents:
diff
changeset
|
1504 |
20481
eb93710aec4d
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:
20479
diff
changeset
|
1505 /* add group */ |
eb93710aec4d
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:
20479
diff
changeset
|
1506 void |
eb93710aec4d
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:
20479
diff
changeset
|
1507 msn_add_group(MsnSession *session, MsnCallbackState *state, const char* group_name) |
20394
4a099e4d0d09
propagate from branch 'im.pidgin.pidgin' (head 98b6b547b29ea1192b73cc4e1de1e674edef4328)
Richard Laager <rlaager@wiktel.com>
parents:
diff
changeset
|
1508 { |
4a099e4d0d09
propagate from branch 'im.pidgin.pidgin' (head 98b6b547b29ea1192b73cc4e1de1e674edef4328)
Richard Laager <rlaager@wiktel.com>
parents:
diff
changeset
|
1509 char *body = NULL; |
23491
f1f5efd679a4
Patch 4 from Qulogic, this one fixes a group name escape bug introduced by
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
23490
diff
changeset
|
1510 char *escaped_group_name = NULL; |
20394
4a099e4d0d09
propagate from branch 'im.pidgin.pidgin' (head 98b6b547b29ea1192b73cc4e1de1e674edef4328)
Richard Laager <rlaager@wiktel.com>
parents:
diff
changeset
|
1511 |
4a099e4d0d09
propagate from branch 'im.pidgin.pidgin' (head 98b6b547b29ea1192b73cc4e1de1e674edef4328)
Richard Laager <rlaager@wiktel.com>
parents:
diff
changeset
|
1512 g_return_if_fail(session != NULL); |
20481
eb93710aec4d
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:
20479
diff
changeset
|
1513 g_return_if_fail(group_name != NULL); |
23300
5cdd93dac7a2
Delete trailing whitespace
Mark Doliner <mark@kingant.net>
parents:
22808
diff
changeset
|
1514 |
23564
7bceac816e19
The great MSN debug message cleanup! Threw in a few whitespace fixes,
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
23552
diff
changeset
|
1515 purple_debug_info("msn", "Adding group %s to contact list.\n", group_name); |
20481
eb93710aec4d
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:
20479
diff
changeset
|
1516 |
eb93710aec4d
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:
20479
diff
changeset
|
1517 if (state == NULL) { |
20538
90fd0826c6ce
finish converting the rest of stuff to the new soap api, signing on, getting
Ka-Hing Cheung <khc@hxbc.us>
parents:
20501
diff
changeset
|
1518 state = msn_callback_state_new(session); |
20481
eb93710aec4d
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:
20479
diff
changeset
|
1519 } |
20394
4a099e4d0d09
propagate from branch 'im.pidgin.pidgin' (head 98b6b547b29ea1192b73cc4e1de1e674edef4328)
Richard Laager <rlaager@wiktel.com>
parents:
diff
changeset
|
1520 |
20481
eb93710aec4d
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:
20479
diff
changeset
|
1521 msn_callback_state_set_action(state, MSN_ADD_GROUP); |
eb93710aec4d
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:
20479
diff
changeset
|
1522 msn_callback_state_set_new_group_name(state, group_name); |
eb93710aec4d
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:
20479
diff
changeset
|
1523 |
eb93710aec4d
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:
20479
diff
changeset
|
1524 /* escape group name's html special chars so it can safely be sent |
eb93710aec4d
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:
20479
diff
changeset
|
1525 * in a XML SOAP request |
eb93710aec4d
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:
20479
diff
changeset
|
1526 */ |
23491
f1f5efd679a4
Patch 4 from Qulogic, this one fixes a group name escape bug introduced by
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
23490
diff
changeset
|
1527 escaped_group_name = g_markup_escape_text(group_name, -1); |
23515
eb8bd060b987
Update MSN Contact tokens when an invalid token error is returned.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
23509
diff
changeset
|
1528 body = g_strdup_printf(MSN_GROUP_ADD_TEMPLATE, escaped_group_name); |
20481
eb93710aec4d
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:
20479
diff
changeset
|
1529 |
23515
eb8bd060b987
Update MSN Contact tokens when an invalid token error is returned.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
23509
diff
changeset
|
1530 state->body = xmlnode_from_str(body, -1); |
eb8bd060b987
Update MSN Contact tokens when an invalid token error is returned.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
23509
diff
changeset
|
1531 state->post_action = MSN_GROUP_ADD_SOAP_ACTION; |
eb8bd060b987
Update MSN Contact tokens when an invalid token error is returned.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
23509
diff
changeset
|
1532 state->post_url = MSN_ADDRESS_BOOK_POST_URL; |
eb8bd060b987
Update MSN Contact tokens when an invalid token error is returned.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
23509
diff
changeset
|
1533 state->cb = msn_group_read_cb; |
eb8bd060b987
Update MSN Contact tokens when an invalid token error is returned.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
23509
diff
changeset
|
1534 msn_contact_request(state); |
20538
90fd0826c6ce
finish converting the rest of stuff to the new soap api, signing on, getting
Ka-Hing Cheung <khc@hxbc.us>
parents:
20501
diff
changeset
|
1535 |
23492
72aa2ccad28d
fix sending offline message in p15 by sending the correct token. In msnp14,
Ka-Hing Cheung <khc@hxbc.us>
parents:
23491
diff
changeset
|
1536 g_free(escaped_group_name); |
20481
eb93710aec4d
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:
20479
diff
changeset
|
1537 g_free(body); |
eb93710aec4d
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:
20479
diff
changeset
|
1538 } |
20394
4a099e4d0d09
propagate from branch 'im.pidgin.pidgin' (head 98b6b547b29ea1192b73cc4e1de1e674edef4328)
Richard Laager <rlaager@wiktel.com>
parents:
diff
changeset
|
1539 |
20481
eb93710aec4d
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:
20479
diff
changeset
|
1540 /* delete group */ |
eb93710aec4d
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:
20479
diff
changeset
|
1541 void |
eb93710aec4d
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:
20479
diff
changeset
|
1542 msn_del_group(MsnSession *session, const gchar *group_name) |
eb93710aec4d
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:
20479
diff
changeset
|
1543 { |
eb93710aec4d
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:
20479
diff
changeset
|
1544 MsnCallbackState *state; |
eb93710aec4d
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:
20479
diff
changeset
|
1545 char *body = NULL; |
eb93710aec4d
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:
20479
diff
changeset
|
1546 const gchar *guid; |
eb93710aec4d
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:
20479
diff
changeset
|
1547 |
eb93710aec4d
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:
20479
diff
changeset
|
1548 g_return_if_fail(session != NULL); |
23300
5cdd93dac7a2
Delete trailing whitespace
Mark Doliner <mark@kingant.net>
parents:
22808
diff
changeset
|
1549 |
20481
eb93710aec4d
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:
20479
diff
changeset
|
1550 g_return_if_fail(group_name != NULL); |
23564
7bceac816e19
The great MSN debug message cleanup! Threw in a few whitespace fixes,
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
23552
diff
changeset
|
1551 purple_debug_info("msn", "Deleting group %s from contact list\n", group_name); |
23300
5cdd93dac7a2
Delete trailing whitespace
Mark Doliner <mark@kingant.net>
parents:
22808
diff
changeset
|
1552 |
20481
eb93710aec4d
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:
20479
diff
changeset
|
1553 guid = msn_userlist_find_group_id(session->userlist, group_name); |
23300
5cdd93dac7a2
Delete trailing whitespace
Mark Doliner <mark@kingant.net>
parents:
22808
diff
changeset
|
1554 |
5cdd93dac7a2
Delete trailing whitespace
Mark Doliner <mark@kingant.net>
parents:
22808
diff
changeset
|
1555 /* if group uid we need to del is NULL, |
20481
eb93710aec4d
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:
20479
diff
changeset
|
1556 * we need to delete nothing |
eb93710aec4d
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:
20479
diff
changeset
|
1557 */ |
eb93710aec4d
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:
20479
diff
changeset
|
1558 if (guid == NULL) { |
23564
7bceac816e19
The great MSN debug message cleanup! Threw in a few whitespace fixes,
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
23552
diff
changeset
|
1559 purple_debug_info("msn", "Group %s guid not found, returning.\n", group_name); |
20481
eb93710aec4d
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:
20479
diff
changeset
|
1560 return; |
eb93710aec4d
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:
20479
diff
changeset
|
1561 } |
20484
98613886411a
Handle special cases in buddy/group management (wrt MSN_INDIVIDUALS_GROUP and MSN_NON_IM_GROUP).
Carlos Silva <typ0@pidgin.im>
parents:
20481
diff
changeset
|
1562 |
98613886411a
Handle special cases in buddy/group management (wrt MSN_INDIVIDUALS_GROUP and MSN_NON_IM_GROUP).
Carlos Silva <typ0@pidgin.im>
parents:
20481
diff
changeset
|
1563 if ( !strcmp(guid, MSN_INDIVIDUALS_GROUP_ID) || !strcmp(guid, MSN_NON_IM_GROUP_ID) ) { |
23566
a0e957b7b923
Take care of more cleanup in the MSN code.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
23564
diff
changeset
|
1564 /* XXX add back PurpleGroup since it isn't really removed in the server? */ |
20484
98613886411a
Handle special cases in buddy/group management (wrt MSN_INDIVIDUALS_GROUP and MSN_NON_IM_GROUP).
Carlos Silva <typ0@pidgin.im>
parents:
20481
diff
changeset
|
1565 return; |
98613886411a
Handle special cases in buddy/group management (wrt MSN_INDIVIDUALS_GROUP and MSN_NON_IM_GROUP).
Carlos Silva <typ0@pidgin.im>
parents:
20481
diff
changeset
|
1566 } |
98613886411a
Handle special cases in buddy/group management (wrt MSN_INDIVIDUALS_GROUP and MSN_NON_IM_GROUP).
Carlos Silva <typ0@pidgin.im>
parents:
20481
diff
changeset
|
1567 |
20538
90fd0826c6ce
finish converting the rest of stuff to the new soap api, signing on, getting
Ka-Hing Cheung <khc@hxbc.us>
parents:
20501
diff
changeset
|
1568 state = msn_callback_state_new(session); |
20481
eb93710aec4d
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:
20479
diff
changeset
|
1569 msn_callback_state_set_action(state, MSN_DEL_GROUP); |
eb93710aec4d
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:
20479
diff
changeset
|
1570 msn_callback_state_set_guid(state, guid); |
23300
5cdd93dac7a2
Delete trailing whitespace
Mark Doliner <mark@kingant.net>
parents:
22808
diff
changeset
|
1571 |
23515
eb8bd060b987
Update MSN Contact tokens when an invalid token error is returned.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
23509
diff
changeset
|
1572 body = g_strdup_printf(MSN_GROUP_DEL_TEMPLATE, guid); |
20538
90fd0826c6ce
finish converting the rest of stuff to the new soap api, signing on, getting
Ka-Hing Cheung <khc@hxbc.us>
parents:
20501
diff
changeset
|
1573 |
23515
eb8bd060b987
Update MSN Contact tokens when an invalid token error is returned.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
23509
diff
changeset
|
1574 state->body = xmlnode_from_str(body, -1); |
eb8bd060b987
Update MSN Contact tokens when an invalid token error is returned.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
23509
diff
changeset
|
1575 state->post_action = MSN_GROUP_DEL_SOAP_ACTION; |
eb8bd060b987
Update MSN Contact tokens when an invalid token error is returned.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
23509
diff
changeset
|
1576 state->post_url = MSN_ADDRESS_BOOK_POST_URL; |
eb8bd060b987
Update MSN Contact tokens when an invalid token error is returned.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
23509
diff
changeset
|
1577 state->cb = msn_group_read_cb; |
eb8bd060b987
Update MSN Contact tokens when an invalid token error is returned.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
23509
diff
changeset
|
1578 msn_contact_request(state); |
20481
eb93710aec4d
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:
20479
diff
changeset
|
1579 |
eb93710aec4d
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:
20479
diff
changeset
|
1580 g_free(body); |
eb93710aec4d
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:
20479
diff
changeset
|
1581 } |
eb93710aec4d
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:
20479
diff
changeset
|
1582 |
eb93710aec4d
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:
20479
diff
changeset
|
1583 /* rename group */ |
eb93710aec4d
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:
20479
diff
changeset
|
1584 void |
eb93710aec4d
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:
20479
diff
changeset
|
1585 msn_contact_rename_group(MsnSession *session, const char *old_group_name, const char *new_group_name) |
eb93710aec4d
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:
20479
diff
changeset
|
1586 { |
20538
90fd0826c6ce
finish converting the rest of stuff to the new soap api, signing on, getting
Ka-Hing Cheung <khc@hxbc.us>
parents:
20501
diff
changeset
|
1587 gchar *body = NULL; |
20481
eb93710aec4d
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:
20479
diff
changeset
|
1588 const gchar * guid; |
20538
90fd0826c6ce
finish converting the rest of stuff to the new soap api, signing on, getting
Ka-Hing Cheung <khc@hxbc.us>
parents:
20501
diff
changeset
|
1589 MsnCallbackState *state; |
23491
f1f5efd679a4
Patch 4 from Qulogic, this one fixes a group name escape bug introduced by
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
23490
diff
changeset
|
1590 char *escaped_group_name; |
23300
5cdd93dac7a2
Delete trailing whitespace
Mark Doliner <mark@kingant.net>
parents:
22808
diff
changeset
|
1591 |
20481
eb93710aec4d
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:
20479
diff
changeset
|
1592 g_return_if_fail(session != NULL); |
eb93710aec4d
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:
20479
diff
changeset
|
1593 g_return_if_fail(session->userlist != NULL); |
eb93710aec4d
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:
20479
diff
changeset
|
1594 g_return_if_fail(old_group_name != NULL); |
eb93710aec4d
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:
20479
diff
changeset
|
1595 g_return_if_fail(new_group_name != NULL); |
23300
5cdd93dac7a2
Delete trailing whitespace
Mark Doliner <mark@kingant.net>
parents:
22808
diff
changeset
|
1596 |
23564
7bceac816e19
The great MSN debug message cleanup! Threw in a few whitespace fixes,
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
23552
diff
changeset
|
1597 purple_debug_info("msn", "Renaming group %s to %s.\n", old_group_name, new_group_name); |
23300
5cdd93dac7a2
Delete trailing whitespace
Mark Doliner <mark@kingant.net>
parents:
22808
diff
changeset
|
1598 |
20481
eb93710aec4d
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:
20479
diff
changeset
|
1599 guid = msn_userlist_find_group_id(session->userlist, old_group_name); |
eb93710aec4d
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:
20479
diff
changeset
|
1600 if (guid == NULL) |
eb93710aec4d
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:
20479
diff
changeset
|
1601 return; |
20484
98613886411a
Handle special cases in buddy/group management (wrt MSN_INDIVIDUALS_GROUP and MSN_NON_IM_GROUP).
Carlos Silva <typ0@pidgin.im>
parents:
20481
diff
changeset
|
1602 |
20538
90fd0826c6ce
finish converting the rest of stuff to the new soap api, signing on, getting
Ka-Hing Cheung <khc@hxbc.us>
parents:
20501
diff
changeset
|
1603 state = msn_callback_state_new(session); |
20481
eb93710aec4d
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:
20479
diff
changeset
|
1604 msn_callback_state_set_guid(state, guid); |
eb93710aec4d
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:
20479
diff
changeset
|
1605 msn_callback_state_set_new_group_name(state, new_group_name); |
20484
98613886411a
Handle special cases in buddy/group management (wrt MSN_INDIVIDUALS_GROUP and MSN_NON_IM_GROUP).
Carlos Silva <typ0@pidgin.im>
parents:
20481
diff
changeset
|
1606 |
98613886411a
Handle special cases in buddy/group management (wrt MSN_INDIVIDUALS_GROUP and MSN_NON_IM_GROUP).
Carlos Silva <typ0@pidgin.im>
parents:
20481
diff
changeset
|
1607 if ( !strcmp(guid, MSN_INDIVIDUALS_GROUP_ID) || !strcmp(guid, MSN_NON_IM_GROUP_ID) ) { |
23515
eb8bd060b987
Update MSN Contact tokens when an invalid token error is returned.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
23509
diff
changeset
|
1608 MsnCallbackState *new_state = msn_callback_state_dup(state); |
eb8bd060b987
Update MSN Contact tokens when an invalid token error is returned.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
23509
diff
changeset
|
1609 msn_add_group(session, new_state, new_group_name); |
23566
a0e957b7b923
Take care of more cleanup in the MSN code.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
23564
diff
changeset
|
1610 /* XXX move every buddy there (we probably need to fix concurrent SOAP reqs first) */ |
20484
98613886411a
Handle special cases in buddy/group management (wrt MSN_INDIVIDUALS_GROUP and MSN_NON_IM_GROUP).
Carlos Silva <typ0@pidgin.im>
parents:
20481
diff
changeset
|
1611 } |
98613886411a
Handle special cases in buddy/group management (wrt MSN_INDIVIDUALS_GROUP and MSN_NON_IM_GROUP).
Carlos Silva <typ0@pidgin.im>
parents:
20481
diff
changeset
|
1612 |
98613886411a
Handle special cases in buddy/group management (wrt MSN_INDIVIDUALS_GROUP and MSN_NON_IM_GROUP).
Carlos Silva <typ0@pidgin.im>
parents:
20481
diff
changeset
|
1613 msn_callback_state_set_action(state, MSN_RENAME_GROUP); |
23300
5cdd93dac7a2
Delete trailing whitespace
Mark Doliner <mark@kingant.net>
parents:
22808
diff
changeset
|
1614 |
23491
f1f5efd679a4
Patch 4 from Qulogic, this one fixes a group name escape bug introduced by
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
23490
diff
changeset
|
1615 escaped_group_name = g_markup_escape_text(new_group_name, -1); |
23515
eb8bd060b987
Update MSN Contact tokens when an invalid token error is returned.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
23509
diff
changeset
|
1616 body = g_strdup_printf(MSN_GROUP_RENAME_TEMPLATE, guid, escaped_group_name); |
23300
5cdd93dac7a2
Delete trailing whitespace
Mark Doliner <mark@kingant.net>
parents:
22808
diff
changeset
|
1617 |
23515
eb8bd060b987
Update MSN Contact tokens when an invalid token error is returned.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
23509
diff
changeset
|
1618 state->body = xmlnode_from_str(body, -1); |
eb8bd060b987
Update MSN Contact tokens when an invalid token error is returned.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
23509
diff
changeset
|
1619 state->post_action = MSN_GROUP_RENAME_SOAP_ACTION; |
eb8bd060b987
Update MSN Contact tokens when an invalid token error is returned.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
23509
diff
changeset
|
1620 state->post_url = MSN_ADDRESS_BOOK_POST_URL; |
eb8bd060b987
Update MSN Contact tokens when an invalid token error is returned.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
23509
diff
changeset
|
1621 state->cb = msn_group_read_cb; |
eb8bd060b987
Update MSN Contact tokens when an invalid token error is returned.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
23509
diff
changeset
|
1622 msn_contact_request(state); |
20538
90fd0826c6ce
finish converting the rest of stuff to the new soap api, signing on, getting
Ka-Hing Cheung <khc@hxbc.us>
parents:
20501
diff
changeset
|
1623 |
23492
72aa2ccad28d
fix sending offline message in p15 by sending the correct token. In msnp14,
Ka-Hing Cheung <khc@hxbc.us>
parents:
23491
diff
changeset
|
1624 g_free(escaped_group_name); |
20394
4a099e4d0d09
propagate from branch 'im.pidgin.pidgin' (head 98b6b547b29ea1192b73cc4e1de1e674edef4328)
Richard Laager <rlaager@wiktel.com>
parents:
diff
changeset
|
1625 g_free(body); |
4a099e4d0d09
propagate from branch 'im.pidgin.pidgin' (head 98b6b547b29ea1192b73cc4e1de1e674edef4328)
Richard Laager <rlaager@wiktel.com>
parents:
diff
changeset
|
1626 } |