annotate libpurple/protocols/msn/contact.c @ 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.
author Daniel Atallah <daniel.atallah@gmail.com>
date Fri, 28 Sep 2007 01:57:55 +0000
parents 0e1bc5c51030
children 48ee7ec3426d 8e53c75bb87c
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
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"
4a099e4d0d09 propagate from branch 'im.pidgin.pidgin' (head 98b6b547b29ea1192b73cc4e1de1e674edef4328)
Richard Laager <rlaager@wiktel.com>
parents:
diff changeset
31
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
32 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
33 {
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
34 "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
35 "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
36 "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
37 "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
38 "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
39 };
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
40
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
41 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
42 {
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 "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
44 "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
45 "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
46 "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
47 "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
48 };
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
49
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
50 /* new a contact */
20394
4a099e4d0d09 propagate from branch 'im.pidgin.pidgin' (head 98b6b547b29ea1192b73cc4e1de1e674edef4328)
Richard Laager <rlaager@wiktel.com>
parents:
diff changeset
51 MsnContact *
4a099e4d0d09 propagate from branch 'im.pidgin.pidgin' (head 98b6b547b29ea1192b73cc4e1de1e674edef4328)
Richard Laager <rlaager@wiktel.com>
parents:
diff changeset
52 msn_contact_new(MsnSession *session)
4a099e4d0d09 propagate from branch 'im.pidgin.pidgin' (head 98b6b547b29ea1192b73cc4e1de1e674edef4328)
Richard Laager <rlaager@wiktel.com>
parents:
diff changeset
53 {
4a099e4d0d09 propagate from branch 'im.pidgin.pidgin' (head 98b6b547b29ea1192b73cc4e1de1e674edef4328)
Richard Laager <rlaager@wiktel.com>
parents:
diff changeset
54 MsnContact *contact;
4a099e4d0d09 propagate from branch 'im.pidgin.pidgin' (head 98b6b547b29ea1192b73cc4e1de1e674edef4328)
Richard Laager <rlaager@wiktel.com>
parents:
diff changeset
55
4a099e4d0d09 propagate from branch 'im.pidgin.pidgin' (head 98b6b547b29ea1192b73cc4e1de1e674edef4328)
Richard Laager <rlaager@wiktel.com>
parents:
diff changeset
56 contact = g_new0(MsnContact, 1);
4a099e4d0d09 propagate from branch 'im.pidgin.pidgin' (head 98b6b547b29ea1192b73cc4e1de1e674edef4328)
Richard Laager <rlaager@wiktel.com>
parents:
diff changeset
57 contact->session = session;
4a099e4d0d09 propagate from branch 'im.pidgin.pidgin' (head 98b6b547b29ea1192b73cc4e1de1e674edef4328)
Richard Laager <rlaager@wiktel.com>
parents:
diff changeset
58 contact->soapconn = msn_soap_new(session,contact,1);
4a099e4d0d09 propagate from branch 'im.pidgin.pidgin' (head 98b6b547b29ea1192b73cc4e1de1e674edef4328)
Richard Laager <rlaager@wiktel.com>
parents:
diff changeset
59
4a099e4d0d09 propagate from branch 'im.pidgin.pidgin' (head 98b6b547b29ea1192b73cc4e1de1e674edef4328)
Richard Laager <rlaager@wiktel.com>
parents:
diff changeset
60 return contact;
4a099e4d0d09 propagate from branch 'im.pidgin.pidgin' (head 98b6b547b29ea1192b73cc4e1de1e674edef4328)
Richard Laager <rlaager@wiktel.com>
parents:
diff changeset
61 }
4a099e4d0d09 propagate from branch 'im.pidgin.pidgin' (head 98b6b547b29ea1192b73cc4e1de1e674edef4328)
Richard Laager <rlaager@wiktel.com>
parents:
diff changeset
62
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
63 /* destroy the contact */
20394
4a099e4d0d09 propagate from branch 'im.pidgin.pidgin' (head 98b6b547b29ea1192b73cc4e1de1e674edef4328)
Richard Laager <rlaager@wiktel.com>
parents:
diff changeset
64 void
4a099e4d0d09 propagate from branch 'im.pidgin.pidgin' (head 98b6b547b29ea1192b73cc4e1de1e674edef4328)
Richard Laager <rlaager@wiktel.com>
parents:
diff changeset
65 msn_contact_destroy(MsnContact *contact)
4a099e4d0d09 propagate from branch 'im.pidgin.pidgin' (head 98b6b547b29ea1192b73cc4e1de1e674edef4328)
Richard Laager <rlaager@wiktel.com>
parents:
diff changeset
66 {
4a099e4d0d09 propagate from branch 'im.pidgin.pidgin' (head 98b6b547b29ea1192b73cc4e1de1e674edef4328)
Richard Laager <rlaager@wiktel.com>
parents:
diff changeset
67 msn_soap_destroy(contact->soapconn);
4a099e4d0d09 propagate from branch 'im.pidgin.pidgin' (head 98b6b547b29ea1192b73cc4e1de1e674edef4328)
Richard Laager <rlaager@wiktel.com>
parents:
diff changeset
68 g_free(contact);
4a099e4d0d09 propagate from branch 'im.pidgin.pidgin' (head 98b6b547b29ea1192b73cc4e1de1e674edef4328)
Richard Laager <rlaager@wiktel.com>
parents:
diff changeset
69 }
4a099e4d0d09 propagate from branch 'im.pidgin.pidgin' (head 98b6b547b29ea1192b73cc4e1de1e674edef4328)
Richard Laager <rlaager@wiktel.com>
parents:
diff changeset
70
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
71 MsnCallbackState *
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
72 msn_callback_state_new(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
73 {
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
74 return g_new0(MsnCallbackState, 1);
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
75 }
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
76
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
77 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
78 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
79 {
20501
f6dff814d95f cleans up ownership of soap callback data, this soap stuff is perfect
Ka-Hing Cheung <khc@hxbc.us>
parents: 20495
diff changeset
80 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
81 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
82
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
83 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
84 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
85 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
86 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
87 g_free(state->guid);
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
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
89 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
90 }
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
91
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
92 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
93 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
94 {
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
95 gchar *new_str = NULL;
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
96
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
97 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
98
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
99 if (who != NULL)
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
100 new_str = g_strdup(who);
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
101
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
102 g_free(state->who);
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 state->who = new_str;
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
104 }
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
105
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 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
107 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
108 {
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
109 gchar *new_str = 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
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 if (uid != 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
114 new_str = 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
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
116 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
117 state->uid = new_str;
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
118 }
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
119
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
120 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
121 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
122 {
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
123 gchar *new_str = NULL;
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
124
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
125 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
126
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
127 if (old_group_name != NULL)
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
128 new_str = g_strdup(old_group_name);
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
129
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
130 g_free(state->old_group_name);
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
131 state->old_group_name = new_str;
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
132 }
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 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
135 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
136 {
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
137 gchar *new_str = NULL;
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
138
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
139 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
140
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
141 if (new_group_name != NULL)
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
142 new_str = g_strdup(new_group_name);
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
143
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
144 g_free(state->new_group_name);
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
145 state->new_group_name = new_str;
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
146 }
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 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
149 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
150 {
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
151 gchar *new_str = NULL;
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
152
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
153 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
154
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
155 if (guid != NULL)
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
156 new_str = g_strdup(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
157
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
158 g_free(state->guid);
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
159 state->guid = new_str;
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
160 }
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
161
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
162
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
163 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
164 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
165 {
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
166 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
167
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
168 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
169 }
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
170
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 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
172 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
173 {
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
174 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
175
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
176 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
177 }
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
178
20394
4a099e4d0d09 propagate from branch 'im.pidgin.pidgin' (head 98b6b547b29ea1192b73cc4e1de1e674edef4328)
Richard Laager <rlaager@wiktel.com>
parents:
diff changeset
179 /*contact SOAP server login error*/
4a099e4d0d09 propagate from branch 'im.pidgin.pidgin' (head 98b6b547b29ea1192b73cc4e1de1e674edef4328)
Richard Laager <rlaager@wiktel.com>
parents:
diff changeset
180 static 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
181 msn_contact_login_error_cb(MsnSoapConn *soapconn, PurpleSslConnection *gsc, PurpleSslErrorType error)
20394
4a099e4d0d09 propagate from branch 'im.pidgin.pidgin' (head 98b6b547b29ea1192b73cc4e1de1e674edef4328)
Richard Laager <rlaager@wiktel.com>
parents:
diff changeset
182 {
4a099e4d0d09 propagate from branch 'im.pidgin.pidgin' (head 98b6b547b29ea1192b73cc4e1de1e674edef4328)
Richard Laager <rlaager@wiktel.com>
parents:
diff changeset
183 MsnSession *session;
4a099e4d0d09 propagate from branch 'im.pidgin.pidgin' (head 98b6b547b29ea1192b73cc4e1de1e674edef4328)
Richard Laager <rlaager@wiktel.com>
parents:
diff changeset
184
4a099e4d0d09 propagate from branch 'im.pidgin.pidgin' (head 98b6b547b29ea1192b73cc4e1de1e674edef4328)
Richard Laager <rlaager@wiktel.com>
parents:
diff changeset
185 session = soapconn->session;
4a099e4d0d09 propagate from branch 'im.pidgin.pidgin' (head 98b6b547b29ea1192b73cc4e1de1e674edef4328)
Richard Laager <rlaager@wiktel.com>
parents:
diff changeset
186 g_return_if_fail(session != NULL);
4a099e4d0d09 propagate from branch 'im.pidgin.pidgin' (head 98b6b547b29ea1192b73cc4e1de1e674edef4328)
Richard Laager <rlaager@wiktel.com>
parents:
diff changeset
187
4a099e4d0d09 propagate from branch 'im.pidgin.pidgin' (head 98b6b547b29ea1192b73cc4e1de1e674edef4328)
Richard Laager <rlaager@wiktel.com>
parents:
diff changeset
188 msn_session_set_error(session, MSN_ERROR_SERV_DOWN, _("Unable to connect to contact server"));
4a099e4d0d09 propagate from branch 'im.pidgin.pidgin' (head 98b6b547b29ea1192b73cc4e1de1e674edef4328)
Richard Laager <rlaager@wiktel.com>
parents:
diff changeset
189 }
4a099e4d0d09 propagate from branch 'im.pidgin.pidgin' (head 98b6b547b29ea1192b73cc4e1de1e674edef4328)
Richard Laager <rlaager@wiktel.com>
parents:
diff changeset
190
4a099e4d0d09 propagate from branch 'im.pidgin.pidgin' (head 98b6b547b29ea1192b73cc4e1de1e674edef4328)
Richard Laager <rlaager@wiktel.com>
parents:
diff changeset
191 /*msn contact SOAP server connect process*/
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
192 static gboolean
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
193 msn_contact_login_connect_cb(MsnSoapConn *soapconn, PurpleSslConnection *gsc)
20394
4a099e4d0d09 propagate from branch 'im.pidgin.pidgin' (head 98b6b547b29ea1192b73cc4e1de1e674edef4328)
Richard Laager <rlaager@wiktel.com>
parents:
diff changeset
194 {
4a099e4d0d09 propagate from branch 'im.pidgin.pidgin' (head 98b6b547b29ea1192b73cc4e1de1e674edef4328)
Richard Laager <rlaager@wiktel.com>
parents:
diff changeset
195 MsnSession * session;
4a099e4d0d09 propagate from branch 'im.pidgin.pidgin' (head 98b6b547b29ea1192b73cc4e1de1e674edef4328)
Richard Laager <rlaager@wiktel.com>
parents:
diff changeset
196 MsnContact *contact;
4a099e4d0d09 propagate from branch 'im.pidgin.pidgin' (head 98b6b547b29ea1192b73cc4e1de1e674edef4328)
Richard Laager <rlaager@wiktel.com>
parents:
diff changeset
197
4a099e4d0d09 propagate from branch 'im.pidgin.pidgin' (head 98b6b547b29ea1192b73cc4e1de1e674edef4328)
Richard Laager <rlaager@wiktel.com>
parents:
diff changeset
198 contact = soapconn->parent;
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
199 g_return_val_if_fail(contact != NULL, TRUE);
20394
4a099e4d0d09 propagate from branch 'im.pidgin.pidgin' (head 98b6b547b29ea1192b73cc4e1de1e674edef4328)
Richard Laager <rlaager@wiktel.com>
parents:
diff changeset
200
4a099e4d0d09 propagate from branch 'im.pidgin.pidgin' (head 98b6b547b29ea1192b73cc4e1de1e674edef4328)
Richard Laager <rlaager@wiktel.com>
parents:
diff changeset
201 session = contact->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
202 g_return_val_if_fail(session != NULL, FALSE);
20394
4a099e4d0d09 propagate from branch 'im.pidgin.pidgin' (head 98b6b547b29ea1192b73cc4e1de1e674edef4328)
Richard Laager <rlaager@wiktel.com>
parents:
diff changeset
203
4a099e4d0d09 propagate from branch 'im.pidgin.pidgin' (head 98b6b547b29ea1192b73cc4e1de1e674edef4328)
Richard Laager <rlaager@wiktel.com>
parents:
diff changeset
204 /*login ok!We can retrieve the contact list*/
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
205 // msn_get_contact_list(contact, MSN_PS_INITIAL, 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
206 return TRUE;
20394
4a099e4d0d09 propagate from branch 'im.pidgin.pidgin' (head 98b6b547b29ea1192b73cc4e1de1e674edef4328)
Richard Laager <rlaager@wiktel.com>
parents:
diff changeset
207 }
4a099e4d0d09 propagate from branch 'im.pidgin.pidgin' (head 98b6b547b29ea1192b73cc4e1de1e674edef4328)
Richard Laager <rlaager@wiktel.com>
parents:
diff changeset
208
4a099e4d0d09 propagate from branch 'im.pidgin.pidgin' (head 98b6b547b29ea1192b73cc4e1de1e674edef4328)
Richard Laager <rlaager@wiktel.com>
parents:
diff changeset
209 /*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
210 static MsnListId
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
211 msn_get_memberrole(char *role)
20394
4a099e4d0d09 propagate from branch 'im.pidgin.pidgin' (head 98b6b547b29ea1192b73cc4e1de1e674edef4328)
Richard Laager <rlaager@wiktel.com>
parents:
diff changeset
212 {
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
213 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
214
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
215 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
216 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
217 } 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
218 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
219 } 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
220 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
221 } 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
222 return MSN_LIST_PL;
20394
4a099e4d0d09 propagate from branch 'im.pidgin.pidgin' (head 98b6b547b29ea1192b73cc4e1de1e674edef4328)
Richard Laager <rlaager@wiktel.com>
parents:
diff changeset
223 }
4a099e4d0d09 propagate from branch 'im.pidgin.pidgin' (head 98b6b547b29ea1192b73cc4e1de1e674edef4328)
Richard Laager <rlaager@wiktel.com>
parents:
diff changeset
224 return 0;
4a099e4d0d09 propagate from branch 'im.pidgin.pidgin' (head 98b6b547b29ea1192b73cc4e1de1e674edef4328)
Richard Laager <rlaager@wiktel.com>
parents:
diff changeset
225 }
4a099e4d0d09 propagate from branch 'im.pidgin.pidgin' (head 98b6b547b29ea1192b73cc4e1de1e674edef4328)
Richard Laager <rlaager@wiktel.com>
parents:
diff changeset
226
4a099e4d0d09 propagate from branch 'im.pidgin.pidgin' (head 98b6b547b29ea1192b73cc4e1de1e674edef4328)
Richard Laager <rlaager@wiktel.com>
parents:
diff changeset
227 /*get User 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
228 static int
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
229 msn_get_user_type(char *type)
20394
4a099e4d0d09 propagate from branch 'im.pidgin.pidgin' (head 98b6b547b29ea1192b73cc4e1de1e674edef4328)
Richard Laager <rlaager@wiktel.com>
parents:
diff changeset
230 {
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
231 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
232
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
233 if (!strcmp(type,"Regular")) {
20442
a1c6206f0205 Make the MsnUser type an enum so we have fewer magic numbers
Stu Tomlinson <stu@nosnilmot.com>
parents: 20440
diff changeset
234 return MSN_USER_TYPE_PASSPORT;
20394
4a099e4d0d09 propagate from branch 'im.pidgin.pidgin' (head 98b6b547b29ea1192b73cc4e1de1e674edef4328)
Richard Laager <rlaager@wiktel.com>
parents:
diff changeset
235 }
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
236 if (!strcmp(type,"Live")) {
20442
a1c6206f0205 Make the MsnUser type an enum so we have fewer magic numbers
Stu Tomlinson <stu@nosnilmot.com>
parents: 20440
diff changeset
237 return MSN_USER_TYPE_PASSPORT;
20394
4a099e4d0d09 propagate from branch 'im.pidgin.pidgin' (head 98b6b547b29ea1192b73cc4e1de1e674edef4328)
Richard Laager <rlaager@wiktel.com>
parents:
diff changeset
238 }
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
239 if (!strcmp(type,"LivePending")) {
20442
a1c6206f0205 Make the MsnUser type an enum so we have fewer magic numbers
Stu Tomlinson <stu@nosnilmot.com>
parents: 20440
diff changeset
240 return MSN_USER_TYPE_PASSPORT;
20394
4a099e4d0d09 propagate from branch 'im.pidgin.pidgin' (head 98b6b547b29ea1192b73cc4e1de1e674edef4328)
Richard Laager <rlaager@wiktel.com>
parents:
diff changeset
241 }
4a099e4d0d09 propagate from branch 'im.pidgin.pidgin' (head 98b6b547b29ea1192b73cc4e1de1e674edef4328)
Richard Laager <rlaager@wiktel.com>
parents:
diff changeset
242
20442
a1c6206f0205 Make the MsnUser type an enum so we have fewer magic numbers
Stu Tomlinson <stu@nosnilmot.com>
parents: 20440
diff changeset
243 return MSN_USER_TYPE_UNKNOWN;
20394
4a099e4d0d09 propagate from branch 'im.pidgin.pidgin' (head 98b6b547b29ea1192b73cc4e1de1e674edef4328)
Richard Laager <rlaager@wiktel.com>
parents:
diff changeset
244 }
4a099e4d0d09 propagate from branch 'im.pidgin.pidgin' (head 98b6b547b29ea1192b73cc4e1de1e674edef4328)
Richard Laager <rlaager@wiktel.com>
parents:
diff changeset
245
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
246 /* Create the AddressBook in the server, if we don't have one */
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
247 static gboolean
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
248 msn_create_address_cb(MsnSoapConn *soapconn)
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
249 {
9a2a4a0c0003 Add the possibility to create an Address Book, useful for newly registered MSN users.
Carlos Silva <typ0@pidgin.im>
parents: 20471
diff changeset
250 MsnContact *contact;
9a2a4a0c0003 Add the possibility to create an Address Book, useful for newly registered MSN users.
Carlos Silva <typ0@pidgin.im>
parents: 20471
diff changeset
251
20501
f6dff814d95f cleans up ownership of soap callback data, this soap stuff is perfect
Ka-Hing Cheung <khc@hxbc.us>
parents: 20495
diff changeset
252 if (soapconn->body == 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
253 return TRUE;
20501
f6dff814d95f cleans up ownership of soap callback data, this soap stuff is perfect
Ka-Hing Cheung <khc@hxbc.us>
parents: 20495
diff changeset
254
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
255 contact = soapconn->parent;
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
256 g_return_val_if_fail(contact != NULL, 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
257
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
258 purple_debug_info("MSN AddressBook", "Address Book successfully created!\n");
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
259 msn_get_address_book(contact, MSN_PS_INITIAL, 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
260
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
261 // msn_soap_free_read_buf(soapconn);
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
262 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
263 }
9a2a4a0c0003 Add the possibility to create an Address Book, useful for newly registered MSN users.
Carlos Silva <typ0@pidgin.im>
parents: 20471
diff changeset
264
9a2a4a0c0003 Add the possibility to create an Address Book, useful for newly registered MSN users.
Carlos Silva <typ0@pidgin.im>
parents: 20471
diff changeset
265 static 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
266 msn_create_address_written_cb(MsnSoapConn *soapconn)
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
267 {
9a2a4a0c0003 Add the possibility to create an Address Book, useful for newly registered MSN users.
Carlos Silva <typ0@pidgin.im>
parents: 20471
diff changeset
268 purple_debug_info("MSN AddressBook","AddressBookAdd written\n");
9a2a4a0c0003 Add the possibility to create an Address Book, useful for newly registered MSN users.
Carlos Silva <typ0@pidgin.im>
parents: 20471
diff changeset
269 soapconn->read_cb = msn_create_address_cb;
9a2a4a0c0003 Add the possibility to create an Address Book, useful for newly registered MSN users.
Carlos Silva <typ0@pidgin.im>
parents: 20471
diff changeset
270
9a2a4a0c0003 Add the possibility to create an Address Book, useful for newly registered MSN users.
Carlos Silva <typ0@pidgin.im>
parents: 20471
diff changeset
271 return;
9a2a4a0c0003 Add the possibility to create an Address Book, useful for newly registered MSN users.
Carlos Silva <typ0@pidgin.im>
parents: 20471
diff changeset
272 }
9a2a4a0c0003 Add the possibility to create an Address Book, useful for newly registered MSN users.
Carlos Silva <typ0@pidgin.im>
parents: 20471
diff changeset
273
9a2a4a0c0003 Add the possibility to create an Address Book, useful for newly registered MSN users.
Carlos Silva <typ0@pidgin.im>
parents: 20471
diff changeset
274 static void
9a2a4a0c0003 Add the possibility to create an Address Book, useful for newly registered MSN users.
Carlos Silva <typ0@pidgin.im>
parents: 20471
diff changeset
275 msn_create_address_book(MsnContact * contact)
9a2a4a0c0003 Add the possibility to create an Address Book, useful for newly registered MSN users.
Carlos Silva <typ0@pidgin.im>
parents: 20471
diff changeset
276 {
9a2a4a0c0003 Add the possibility to create an Address Book, useful for newly registered MSN users.
Carlos Silva <typ0@pidgin.im>
parents: 20471
diff changeset
277 MsnSoapReq *soap_request;
9a2a4a0c0003 Add the possibility to create an Address Book, useful for newly registered MSN users.
Carlos Silva <typ0@pidgin.im>
parents: 20471
diff changeset
278 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
279
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
280 g_return_if_fail(contact != 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
281 g_return_if_fail(contact->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
282 g_return_if_fail(contact->session->user != 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
283 g_return_if_fail(contact->session->user->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
284
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
285 purple_debug_info("MSN AddressBook","Creating an Address Book.\n");
9a2a4a0c0003 Add the possibility to create an Address Book, useful for newly registered MSN users.
Carlos Silva <typ0@pidgin.im>
parents: 20471
diff changeset
286
9a2a4a0c0003 Add the possibility to create an Address Book, useful for newly registered MSN users.
Carlos Silva <typ0@pidgin.im>
parents: 20471
diff changeset
287 body = g_strdup_printf(MSN_ADD_ADDRESSBOOK_TEMPLATE, contact->session->user->passport);
9a2a4a0c0003 Add the possibility to create an Address Book, useful for newly registered MSN users.
Carlos Silva <typ0@pidgin.im>
parents: 20471
diff changeset
288
9a2a4a0c0003 Add the possibility to create an Address Book, useful for newly registered MSN users.
Carlos Silva <typ0@pidgin.im>
parents: 20471
diff changeset
289 soap_request = msn_soap_request_new(MSN_CONTACT_SERVER,
9a2a4a0c0003 Add the possibility to create an Address Book, useful for newly registered MSN users.
Carlos Silva <typ0@pidgin.im>
parents: 20471
diff changeset
290 MSN_ADDRESS_BOOK_POST_URL,MSN_ADD_ADDRESSBOOK_SOAP_ACTION,
9a2a4a0c0003 Add the possibility to create an Address Book, useful for newly registered MSN users.
Carlos Silva <typ0@pidgin.im>
parents: 20471
diff changeset
291 body,
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
292 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
293 msn_create_address_cb,
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
294 msn_create_address_written_cb,
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
295 msn_contact_connect_init);
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
296 msn_soap_post(contact->soapconn, soap_request);
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
297
9a2a4a0c0003 Add the possibility to create an Address Book, useful for newly registered MSN users.
Carlos Silva <typ0@pidgin.im>
parents: 20471
diff changeset
298 g_free(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
299
9a2a4a0c0003 Add the possibility to create an Address Book, useful for newly registered MSN users.
Carlos Silva <typ0@pidgin.im>
parents: 20471
diff changeset
300 return;
9a2a4a0c0003 Add the possibility to create an Address Book, useful for newly registered MSN users.
Carlos Silva <typ0@pidgin.im>
parents: 20471
diff changeset
301 }
9a2a4a0c0003 Add the possibility to create an Address Book, useful for newly registered MSN users.
Carlos Silva <typ0@pidgin.im>
parents: 20471
diff changeset
302
20394
4a099e4d0d09 propagate from branch 'im.pidgin.pidgin' (head 98b6b547b29ea1192b73cc4e1de1e674edef4328)
Richard Laager <rlaager@wiktel.com>
parents:
diff changeset
303 /*parse contact list*/
4a099e4d0d09 propagate from branch 'im.pidgin.pidgin' (head 98b6b547b29ea1192b73cc4e1de1e674edef4328)
Richard Laager <rlaager@wiktel.com>
parents:
diff changeset
304 static void
4a099e4d0d09 propagate from branch 'im.pidgin.pidgin' (head 98b6b547b29ea1192b73cc4e1de1e674edef4328)
Richard Laager <rlaager@wiktel.com>
parents:
diff changeset
305 msn_parse_contact_list(MsnContact * contact)
4a099e4d0d09 propagate from branch 'im.pidgin.pidgin' (head 98b6b547b29ea1192b73cc4e1de1e674edef4328)
Richard Laager <rlaager@wiktel.com>
parents:
diff changeset
306 {
4a099e4d0d09 propagate from branch 'im.pidgin.pidgin' (head 98b6b547b29ea1192b73cc4e1de1e674edef4328)
Richard Laager <rlaager@wiktel.com>
parents:
diff changeset
307 MsnSession * 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
308 MsnListOp list_op = 0;
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
309 MsnListId list;
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
310 char * passport, *typedata;
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
311 xmlnode *fault, *faultstringnode, *faultdetail, *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
312 xmlnode *node, *body, *response, *result, *services;
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
313 xmlnode *service, *memberships, *info, *handle, *handletype;
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
314 xmlnode *membershipnode, *members, *member, *passportNode;
20394
4a099e4d0d09 propagate from branch 'im.pidgin.pidgin' (head 98b6b547b29ea1192b73cc4e1de1e674edef4328)
Richard Laager <rlaager@wiktel.com>
parents:
diff changeset
315
4a099e4d0d09 propagate from branch 'im.pidgin.pidgin' (head 98b6b547b29ea1192b73cc4e1de1e674edef4328)
Richard Laager <rlaager@wiktel.com>
parents:
diff changeset
316 session = contact->session;
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
317 node = xmlnode_from_str(contact->soapconn->body, contact->soapconn->body_len);
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
318
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
319 if (node == NULL) {
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
320 purple_debug_error("MSNCL","Unable to parse SOAP data!\n");
20394
4a099e4d0d09 propagate from branch 'im.pidgin.pidgin' (head 98b6b547b29ea1192b73cc4e1de1e674edef4328)
Richard Laager <rlaager@wiktel.com>
parents:
diff changeset
321 return;
4a099e4d0d09 propagate from branch 'im.pidgin.pidgin' (head 98b6b547b29ea1192b73cc4e1de1e674edef4328)
Richard Laager <rlaager@wiktel.com>
parents:
diff changeset
322 }
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
323
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
324 purple_debug_misc("MSNCL","Parsing contact list with size %d\n", contact->soapconn->body_len);
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
325
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
326 purple_debug_misc("MSNCL","Root node @ %p: Name: '%s', child: '%s', lastchild: '%s'\n", node,
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
327 node->name ? node->name : "(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
328 (node->child && node->child->name) ? node->child->name : "(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
329 (node->lastchild && node->lastchild->name) ? node->lastchild->name : "(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
330
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
331 body = xmlnode_get_child(node, "Body");
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
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 if (body == NULL) {
9a2a4a0c0003 Add the possibility to create an Address Book, useful for newly registered MSN users.
Carlos Silva <typ0@pidgin.im>
parents: 20471
diff changeset
334 purple_debug_warning("MSNCL", "Failed to parse contact list Body node\n");
9a2a4a0c0003 Add the possibility to create an Address Book, useful for newly registered MSN users.
Carlos Silva <typ0@pidgin.im>
parents: 20471
diff changeset
335 xmlnode_free(node);
9a2a4a0c0003 Add the possibility to create an Address Book, useful for newly registered MSN users.
Carlos Silva <typ0@pidgin.im>
parents: 20471
diff changeset
336 return;
9a2a4a0c0003 Add the possibility to create an Address Book, useful for newly registered MSN users.
Carlos Silva <typ0@pidgin.im>
parents: 20471
diff changeset
337 }
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
338 purple_debug_info("MSNCL","Body @ %p: Name: '%s'\n",body,body->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
339
9a2a4a0c0003 Add the possibility to create an Address Book, useful for newly registered MSN users.
Carlos Silva <typ0@pidgin.im>
parents: 20471
diff changeset
340 /* Did we receive a <Fault> ? */
9a2a4a0c0003 Add the possibility to create an Address Book, useful for newly registered MSN users.
Carlos Silva <typ0@pidgin.im>
parents: 20471
diff changeset
341 if ( (fault = xmlnode_get_child(body, "Fault")) != NULL) {
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 purple_debug_info("MSNCL","Fault received from SOAP server!\n");
9a2a4a0c0003 Add the possibility to create an Address Book, useful for newly registered MSN users.
Carlos Silva <typ0@pidgin.im>
parents: 20471
diff changeset
343
9a2a4a0c0003 Add the possibility to create an Address Book, useful for newly registered MSN users.
Carlos Silva <typ0@pidgin.im>
parents: 20471
diff changeset
344 if ( (faultstringnode = xmlnode_get_child(fault, "faultstring")) != NULL ) {
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
345 gchar * faultstring = xmlnode_get_data(faultstringnode);
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
346 purple_debug_info("MSNCL", "Faultstring: %s\n", faultstring ? faultstring : "(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
347 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
348 }
9a2a4a0c0003 Add the possibility to create an Address Book, useful for newly registered MSN users.
Carlos Silva <typ0@pidgin.im>
parents: 20471
diff changeset
349 if ( (faultdetail = xmlnode_get_child(fault, "detail")) != NULL ) {
9a2a4a0c0003 Add the possibility to create an Address Book, useful for newly registered MSN users.
Carlos Silva <typ0@pidgin.im>
parents: 20471
diff changeset
350 purple_debug_info("MSNCL","detail @ %p, name: %s\n",faultdetail, faultdetail->name);
9a2a4a0c0003 Add the possibility to create an Address Book, useful for newly registered MSN users.
Carlos Silva <typ0@pidgin.im>
parents: 20471
diff changeset
351
9a2a4a0c0003 Add the possibility to create an Address Book, useful for newly registered MSN users.
Carlos Silva <typ0@pidgin.im>
parents: 20471
diff changeset
352 if ( (errorcode = xmlnode_get_child(faultdetail, "errorcode")) != 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
353 purple_debug_info("MSNCL","errorcode @ %p, name: %s\n", errorcode, errorcode->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
354
9a2a4a0c0003 Add the possibility to create an Address Book, useful for newly registered MSN users.
Carlos Silva <typ0@pidgin.im>
parents: 20471
diff changeset
355 if (errorcode->child != NULL) {
9a2a4a0c0003 Add the possibility to create an Address Book, useful for newly registered MSN users.
Carlos Silva <typ0@pidgin.im>
parents: 20471
diff changeset
356 gchar *errorcodestring = xmlnode_get_data(errorcode);
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
357 purple_debug_info("MSNCL", "Error Code: %s\n", errorcodestring ? errorcodestring : "(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
358
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
359 if (errorcodestring && !strncmp(errorcodestring, "ABDoesNotExist", 14) ) {
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
360 xmlnode_free(node);
9a2a4a0c0003 Add the possibility to create an Address Book, useful for newly registered MSN users.
Carlos Silva <typ0@pidgin.im>
parents: 20471
diff changeset
361 g_free(errorcodestring);
9a2a4a0c0003 Add the possibility to create an Address Book, useful for newly registered MSN users.
Carlos Silva <typ0@pidgin.im>
parents: 20471
diff changeset
362 msn_create_address_book(contact);
9a2a4a0c0003 Add the possibility to create an Address Book, useful for newly registered MSN users.
Carlos Silva <typ0@pidgin.im>
parents: 20471
diff changeset
363 return;
9a2a4a0c0003 Add the possibility to create an Address Book, useful for newly registered MSN users.
Carlos Silva <typ0@pidgin.im>
parents: 20471
diff changeset
364 }
9a2a4a0c0003 Add the possibility to create an Address Book, useful for newly registered MSN users.
Carlos Silva <typ0@pidgin.im>
parents: 20471
diff changeset
365 g_free(errorcodestring);
9a2a4a0c0003 Add the possibility to create an Address Book, useful for newly registered MSN users.
Carlos Silva <typ0@pidgin.im>
parents: 20471
diff changeset
366 }
9a2a4a0c0003 Add the possibility to create an Address Book, useful for newly registered MSN users.
Carlos Silva <typ0@pidgin.im>
parents: 20471
diff changeset
367 }
9a2a4a0c0003 Add the possibility to create an Address Book, useful for newly registered MSN users.
Carlos Silva <typ0@pidgin.im>
parents: 20471
diff changeset
368 }
9a2a4a0c0003 Add the possibility to create an Address Book, useful for newly registered MSN users.
Carlos Silva <typ0@pidgin.im>
parents: 20471
diff changeset
369 xmlnode_free(node);
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
370 msn_get_contact_list(contact, MSN_PS_INITIAL, 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
371 return;
9a2a4a0c0003 Add the possibility to create an Address Book, useful for newly registered MSN users.
Carlos Silva <typ0@pidgin.im>
parents: 20471
diff changeset
372 }
9a2a4a0c0003 Add the possibility to create an Address Book, useful for newly registered MSN users.
Carlos Silva <typ0@pidgin.im>
parents: 20471
diff changeset
373
20394
4a099e4d0d09 propagate from branch 'im.pidgin.pidgin' (head 98b6b547b29ea1192b73cc4e1de1e674edef4328)
Richard Laager <rlaager@wiktel.com>
parents:
diff changeset
374 response = xmlnode_get_child(body,"FindMembershipResponse");
4a099e4d0d09 propagate from branch 'im.pidgin.pidgin' (head 98b6b547b29ea1192b73cc4e1de1e674edef4328)
Richard Laager <rlaager@wiktel.com>
parents:
diff changeset
375
4a099e4d0d09 propagate from branch 'im.pidgin.pidgin' (head 98b6b547b29ea1192b73cc4e1de1e674edef4328)
Richard Laager <rlaager@wiktel.com>
parents:
diff changeset
376 if (response == NULL) {
4a099e4d0d09 propagate from branch 'im.pidgin.pidgin' (head 98b6b547b29ea1192b73cc4e1de1e674edef4328)
Richard Laager <rlaager@wiktel.com>
parents:
diff changeset
377 /* we may get a response if our cache data is too old:
4a099e4d0d09 propagate from branch 'im.pidgin.pidgin' (head 98b6b547b29ea1192b73cc4e1de1e674edef4328)
Richard Laager <rlaager@wiktel.com>
parents:
diff changeset
378 *
4a099e4d0d09 propagate from branch 'im.pidgin.pidgin' (head 98b6b547b29ea1192b73cc4e1de1e674edef4328)
Richard Laager <rlaager@wiktel.com>
parents:
diff changeset
379 * <faultstring>Need to do full sync. Can't sync deltas Client
4a099e4d0d09 propagate from branch 'im.pidgin.pidgin' (head 98b6b547b29ea1192b73cc4e1de1e674edef4328)
Richard Laager <rlaager@wiktel.com>
parents:
diff changeset
380 * has too old a copy for us to do a delta sync</faultstring>
4a099e4d0d09 propagate from branch 'im.pidgin.pidgin' (head 98b6b547b29ea1192b73cc4e1de1e674edef4328)
Richard Laager <rlaager@wiktel.com>
parents:
diff changeset
381 */
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
382 xmlnode_free(node);
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
383 msn_get_contact_list(contact, MSN_PS_INITIAL, NULL);
20394
4a099e4d0d09 propagate from branch 'im.pidgin.pidgin' (head 98b6b547b29ea1192b73cc4e1de1e674edef4328)
Richard Laager <rlaager@wiktel.com>
parents:
diff changeset
384 return;
4a099e4d0d09 propagate from branch 'im.pidgin.pidgin' (head 98b6b547b29ea1192b73cc4e1de1e674edef4328)
Richard Laager <rlaager@wiktel.com>
parents:
diff changeset
385 }
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
386 purple_debug_info("MSNCL","FindMembershipResponse @ %p: Name: '%s'\n",response,response->name);
20394
4a099e4d0d09 propagate from branch 'im.pidgin.pidgin' (head 98b6b547b29ea1192b73cc4e1de1e674edef4328)
Richard Laager <rlaager@wiktel.com>
parents:
diff changeset
387
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
388 result = xmlnode_get_child(response,"FindMembershipResult");
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
389 if (result == NULL) {
9a2a4a0c0003 Add the possibility to create an Address Book, useful for newly registered MSN users.
Carlos Silva <typ0@pidgin.im>
parents: 20471
diff changeset
390 purple_debug_warning("MSNCL","Received No Update!\n");
9a2a4a0c0003 Add the possibility to create an Address Book, useful for newly registered MSN users.
Carlos Silva <typ0@pidgin.im>
parents: 20471
diff changeset
391 xmlnode_free(node);
20439
bee467c81570 A bunch of MSNP14 stuff:
Stu Tomlinson <stu@nosnilmot.com>
parents: 20432
diff changeset
392 return;
bee467c81570 A bunch of MSNP14 stuff:
Stu Tomlinson <stu@nosnilmot.com>
parents: 20432
diff changeset
393 }
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
394 purple_debug_info("MSNCL","Result @ %p: Name: '%s'\n", result, result->name);
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
395
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
396 if ( (services = xmlnode_get_child(result,"Services")) == NULL) {
9a2a4a0c0003 Add the possibility to create an Address Book, useful for newly registered MSN users.
Carlos Silva <typ0@pidgin.im>
parents: 20471
diff changeset
397 purple_debug_misc("MSNCL","No <Services> received.\n");
9a2a4a0c0003 Add the possibility to create an Address Book, useful for newly registered MSN users.
Carlos Silva <typ0@pidgin.im>
parents: 20471
diff changeset
398 xmlnode_free(node);
9a2a4a0c0003 Add the possibility to create an Address Book, useful for newly registered MSN users.
Carlos Silva <typ0@pidgin.im>
parents: 20471
diff changeset
399 return;
9a2a4a0c0003 Add the possibility to create an Address Book, useful for newly registered MSN users.
Carlos Silva <typ0@pidgin.im>
parents: 20471
diff changeset
400 }
9a2a4a0c0003 Add the possibility to create an Address Book, useful for newly registered MSN users.
Carlos Silva <typ0@pidgin.im>
parents: 20471
diff changeset
401
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
402 purple_debug_info("MSNCL","Services @ %p\n",services);
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
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
404 for (service = xmlnode_get_child(services, "Service"); service;
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
405 service = xmlnode_get_next_twin(service)) {
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
406 purple_debug_info("MSNCL","Service @ %p\n",service);
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
407
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
408 if ( (info = xmlnode_get_child(service,"Info")) == NULL ) {
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
409 purple_debug_error("MSNCL","Error getting 'Info' child node\n");
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
410 continue;
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
411 }
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
412 if ( (handle = xmlnode_get_child(info,"Handle")) == NULL ) {
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
413 purple_debug_error("MSNCL","Error getting 'Handle' child node\n");
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
414 continue;
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
415 }
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
416 if ( (handletype = xmlnode_get_child(handle,"Type")) == NULL ) {
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
417 purple_debug_error("MSNCL","Error getting 'Type' child node\n");
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
418 continue;
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
419 }
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
420
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
421 if ( (typedata = xmlnode_get_data(handletype)) == NULL) {
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
422 purple_debug_error("MSNCL","Error retrieving data from 'Type' child node\n");
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
423 continue;
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
424 }
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
425
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
426 purple_debug_info("MSNCL","processing '%s' Service\n", typedata);
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
427
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
428 if ( !g_strcasecmp(typedata, "Profile") ) {
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
429 /* Process Windows Live 'Messenger Roaming Identity' */
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
430 g_free(typedata);
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 continue;
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
432 }
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
433
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
434 if ( !g_strcasecmp(typedata, "Messenger") ) {
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
435 char *LastChangeStr = 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
436 xmlnode *LastChangeNode;
20394
4a099e4d0d09 propagate from branch 'im.pidgin.pidgin' (head 98b6b547b29ea1192b73cc4e1de1e674edef4328)
Richard Laager <rlaager@wiktel.com>
parents:
diff changeset
437
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
438 /*Last Change Node*/
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
439 if ((LastChangeNode = xmlnode_get_child(service, "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
440 LastChangeStr = xmlnode_get_data(LastChangeNode);
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
441 purple_debug_info("MSNCL","LastChangeNode: '%s'\n",LastChangeStr ? LastChangeStr : "(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
442 purple_account_set_string(session->account, "CLLastChange", LastChangeStr);
9a2a4a0c0003 Add the possibility to create an Address Book, useful for newly registered MSN users.
Carlos Silva <typ0@pidgin.im>
parents: 20471
diff changeset
443 g_free(LastChangeStr);
9a2a4a0c0003 Add the possibility to create an Address Book, useful for newly registered MSN users.
Carlos Silva <typ0@pidgin.im>
parents: 20471
diff changeset
444
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
445 memberships = xmlnode_get_child(service,"Memberships");
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
446 if (memberships == NULL) {
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
447 purple_debug_warning("MSNCL","Memberships = NULL, cleaning up and returning.\n");
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
448 g_free(typedata);
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
449 xmlnode_free(node);
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
450 return;
20394
4a099e4d0d09 propagate from branch 'im.pidgin.pidgin' (head 98b6b547b29ea1192b73cc4e1de1e674edef4328)
Richard Laager <rlaager@wiktel.com>
parents:
diff changeset
451 }
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
452 purple_debug_info("MSNCL","Memberships @ %p: Name: '%s'\n",memberships,memberships->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
453 for (membershipnode = xmlnode_get_child(memberships, "Membership"); membershipnode;
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
454 membershipnode = xmlnode_get_next_twin(membershipnode)){
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
455 xmlnode *roleNode;
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
456 char *role = 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
457 list = 0;
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
458
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
459 if ((roleNode = xmlnode_get_child(membershipnode,"MemberRole"))) {
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
460 role = xmlnode_get_data(roleNode);
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
461 list = msn_get_memberrole(role);
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
462 }
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
463 list_op = 1 << 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
464
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
465 purple_debug_info("MSNCL","MemberRole role: %s, list_op: %d\n", role ? role : "(null)", list_op);
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
466
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
467 g_free(role);
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
468
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
469 members = xmlnode_get_child(membershipnode, "Members");
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
470 for (member = xmlnode_get_child(members, "Member"); member;
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
471 member = xmlnode_get_next_twin(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
472 MsnUser *user = 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
473 xmlnode *typeNode, *membershipIdNode = 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
474 gchar *type, *membershipId = 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
475 const char *member_type = xmlnode_get_attrib(member, "type");
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
476
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
477 if (!member_type) {
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
478 purple_debug_error("msn", "No Member Type specified for Member.\n");
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
479 continue;
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
480 }
20394
4a099e4d0d09 propagate from branch 'im.pidgin.pidgin' (head 98b6b547b29ea1192b73cc4e1de1e674edef4328)
Richard Laager <rlaager@wiktel.com>
parents:
diff changeset
481
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
482 if(!g_strcasecmp(member_type, "PassportMember") ) {
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
483 passport = type = 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
484 if ((passportNode = xmlnode_get_child(member, "PassportName")))
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
485 passport = xmlnode_get_data(passportNode);
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
486 if ((typeNode = xmlnode_get_child(member, "Type")))
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
487 type = xmlnode_get_data(typeNode);
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
488 purple_debug_info("MSNCL","Passport name: '%s', Type: %s\n", passport ? passport : "(null)", type ? type : "(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
489 /* Why do we even bother parsing it just to free it??? */
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
490 g_free(type);
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
491
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
492 user = msn_userlist_find_add_user(session->userlist,passport,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
493 g_free(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
494
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
495 membershipIdNode = xmlnode_get_child(member,"MembershipId");
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
496 if (membershipIdNode != 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
497 membershipId = xmlnode_get_data(membershipIdNode);
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
498 if (membershipId != 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
499 user->membership_id[list] = atoi(membershipId);
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
500 g_free(membershipId);
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
501 }
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
502 }
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
503
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
504 msn_got_lst_user(session, user, list_op, NULL);
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
505 }
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
506 else if (!g_strcasecmp(member_type, "PhoneMember")) {
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
507 purple_debug_info("msn", "Recieved Phone Member; ignoring.\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
508 }
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
509 else if (!g_strcasecmp(member_type, "EmailMember")) {
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
510 xmlnode *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
511 passport = NULL;
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
512
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
513 if ((emailNode = xmlnode_get_child(member, "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
514 passport = xmlnode_get_data(emailNode);
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
515 purple_debug_info("MSNCL","Email Member: Name: '%s', list_op: %d\n", passport ? passport : "(null)", list_op);
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
516
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
517 user = msn_userlist_find_add_user(session->userlist, passport, 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
518 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
519
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
520 membershipIdNode = xmlnode_get_child(member,"MembershipId");
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
521 if (membershipIdNode != 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
522 membershipId = xmlnode_get_data(membershipIdNode);
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
523 if (membershipId != 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
524 user->membership_id[list] = atoi(membershipId);
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
525 g_free(membershipId);
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
526 }
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
527 }
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
528
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
529 msn_got_lst_user(session, user, list_op, 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
530 } else {
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
531 purple_debug_info("msn", "Unknown Member type: %s\n", member_type);
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
532 }
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
533 }
20394
4a099e4d0d09 propagate from branch 'im.pidgin.pidgin' (head 98b6b547b29ea1192b73cc4e1de1e674edef4328)
Richard Laager <rlaager@wiktel.com>
parents:
diff changeset
534 }
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
535 g_free(typedata); /* Free 'Type' node data after processing 'Messenger' Service */
20394
4a099e4d0d09 propagate from branch 'im.pidgin.pidgin' (head 98b6b547b29ea1192b73cc4e1de1e674edef4328)
Richard Laager <rlaager@wiktel.com>
parents:
diff changeset
536 }
4a099e4d0d09 propagate from branch 'im.pidgin.pidgin' (head 98b6b547b29ea1192b73cc4e1de1e674edef4328)
Richard Laager <rlaager@wiktel.com>
parents:
diff changeset
537 }
4a099e4d0d09 propagate from branch 'im.pidgin.pidgin' (head 98b6b547b29ea1192b73cc4e1de1e674edef4328)
Richard Laager <rlaager@wiktel.com>
parents:
diff changeset
538
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
539 xmlnode_free(node); /* Free the whole XML tree */
20394
4a099e4d0d09 propagate from branch 'im.pidgin.pidgin' (head 98b6b547b29ea1192b73cc4e1de1e674edef4328)
Richard Laager <rlaager@wiktel.com>
parents:
diff changeset
540 }
4a099e4d0d09 propagate from branch 'im.pidgin.pidgin' (head 98b6b547b29ea1192b73cc4e1de1e674edef4328)
Richard Laager <rlaager@wiktel.com>
parents:
diff changeset
541
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
542 static gboolean
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
543 msn_get_contact_list_cb(MsnSoapConn *soapconn)
20394
4a099e4d0d09 propagate from branch 'im.pidgin.pidgin' (head 98b6b547b29ea1192b73cc4e1de1e674edef4328)
Richard Laager <rlaager@wiktel.com>
parents:
diff changeset
544 {
4a099e4d0d09 propagate from branch 'im.pidgin.pidgin' (head 98b6b547b29ea1192b73cc4e1de1e674edef4328)
Richard Laager <rlaager@wiktel.com>
parents:
diff changeset
545 MsnContact *contact;
4a099e4d0d09 propagate from branch 'im.pidgin.pidgin' (head 98b6b547b29ea1192b73cc4e1de1e674edef4328)
Richard Laager <rlaager@wiktel.com>
parents:
diff changeset
546 MsnSession *session;
4a099e4d0d09 propagate from branch 'im.pidgin.pidgin' (head 98b6b547b29ea1192b73cc4e1de1e674edef4328)
Richard Laager <rlaager@wiktel.com>
parents:
diff changeset
547 const char *abLastChange;
4a099e4d0d09 propagate from branch 'im.pidgin.pidgin' (head 98b6b547b29ea1192b73cc4e1de1e674edef4328)
Richard Laager <rlaager@wiktel.com>
parents:
diff changeset
548 const char *dynamicItemLastChange;
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
549 gchar *partner_scenario;
20394
4a099e4d0d09 propagate from branch 'im.pidgin.pidgin' (head 98b6b547b29ea1192b73cc4e1de1e674edef4328)
Richard Laager <rlaager@wiktel.com>
parents:
diff changeset
550
20501
f6dff814d95f cleans up ownership of soap callback data, this soap stuff is perfect
Ka-Hing Cheung <khc@hxbc.us>
parents: 20495
diff changeset
551 if (soapconn->body == 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
552 return TRUE;
20501
f6dff814d95f cleans up ownership of soap callback data, this soap stuff is perfect
Ka-Hing Cheung <khc@hxbc.us>
parents: 20495
diff changeset
553
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
554 purple_debug_misc("MSNCL","Got the contact list!\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
555
20394
4a099e4d0d09 propagate from branch 'im.pidgin.pidgin' (head 98b6b547b29ea1192b73cc4e1de1e674edef4328)
Richard Laager <rlaager@wiktel.com>
parents:
diff changeset
556 contact = soapconn->parent;
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
557 g_return_val_if_fail(contact != NULL, TRUE);
20394
4a099e4d0d09 propagate from branch 'im.pidgin.pidgin' (head 98b6b547b29ea1192b73cc4e1de1e674edef4328)
Richard Laager <rlaager@wiktel.com>
parents:
diff changeset
558 session = soapconn->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
559 g_return_val_if_fail(session != NULL, FALSE);
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
560 g_return_val_if_fail(soapconn->data_cb != NULL, TRUE);
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
561
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
562 partner_scenario = soapconn->data_cb;
20394
4a099e4d0d09 propagate from branch 'im.pidgin.pidgin' (head 98b6b547b29ea1192b73cc4e1de1e674edef4328)
Richard Laager <rlaager@wiktel.com>
parents:
diff changeset
563
4a099e4d0d09 propagate from branch 'im.pidgin.pidgin' (head 98b6b547b29ea1192b73cc4e1de1e674edef4328)
Richard Laager <rlaager@wiktel.com>
parents:
diff changeset
564 msn_parse_contact_list(contact);
4a099e4d0d09 propagate from branch 'im.pidgin.pidgin' (head 98b6b547b29ea1192b73cc4e1de1e674edef4328)
Richard Laager <rlaager@wiktel.com>
parents:
diff changeset
565 /*free the read buffer*/
4a099e4d0d09 propagate from branch 'im.pidgin.pidgin' (head 98b6b547b29ea1192b73cc4e1de1e674edef4328)
Richard Laager <rlaager@wiktel.com>
parents:
diff changeset
566 msn_soap_free_read_buf(soapconn);
4a099e4d0d09 propagate from branch 'im.pidgin.pidgin' (head 98b6b547b29ea1192b73cc4e1de1e674edef4328)
Richard Laager <rlaager@wiktel.com>
parents:
diff changeset
567
20432
703fc3437ab5 Store account specific settings in the account, not in some random blist
Stu Tomlinson <stu@nosnilmot.com>
parents: 20427
diff changeset
568 abLastChange = purple_account_get_string(session->account, "ablastChange", NULL);
703fc3437ab5 Store account specific settings in the account, not in some random blist
Stu Tomlinson <stu@nosnilmot.com>
parents: 20427
diff changeset
569 dynamicItemLastChange = purple_account_get_string(session->account, "dynamicItemLastChange", NULL);
20439
bee467c81570 A bunch of MSNP14 stuff:
Stu Tomlinson <stu@nosnilmot.com>
parents: 20432
diff changeset
570
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
571 if (!strcmp(partner_scenario, MsnSoapPartnerScenarioText[MSN_PS_INITIAL])) {
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
572
20440
5ecaa00090d7 Always get the full contact list too, as we need it for the reverse list
Stu Tomlinson <stu@nosnilmot.com>
parents: 20439
diff changeset
573 #ifdef MSN_PARTIAL_LISTS
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
574 /* XXX: this should be enabled when we can correctly do partial
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
575 syncs with the server. Currently we need to retrieve the whole
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
576 list to detect sync issues */
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
577 msn_get_address_book(contact, MSN_PS_INITIAL, abLastChange, dynamicItemLastChange);
20439
bee467c81570 A bunch of MSNP14 stuff:
Stu Tomlinson <stu@nosnilmot.com>
parents: 20432
diff changeset
578 #else
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
579 msn_get_address_book(contact, MSN_PS_INITIAL, NULL, NULL);
20439
bee467c81570 A bunch of MSNP14 stuff:
Stu Tomlinson <stu@nosnilmot.com>
parents: 20432
diff changeset
580 #endif
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
581 } 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
582 msn_soap_free_read_buf(soapconn);
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
583 }
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
584
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
585 return TRUE;
20394
4a099e4d0d09 propagate from branch 'im.pidgin.pidgin' (head 98b6b547b29ea1192b73cc4e1de1e674edef4328)
Richard Laager <rlaager@wiktel.com>
parents:
diff changeset
586 }
4a099e4d0d09 propagate from branch 'im.pidgin.pidgin' (head 98b6b547b29ea1192b73cc4e1de1e674edef4328)
Richard Laager <rlaager@wiktel.com>
parents:
diff changeset
587
4a099e4d0d09 propagate from branch 'im.pidgin.pidgin' (head 98b6b547b29ea1192b73cc4e1de1e674edef4328)
Richard Laager <rlaager@wiktel.com>
parents:
diff changeset
588 static 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
589 msn_get_contact_written_cb(MsnSoapConn *soapconn)
20394
4a099e4d0d09 propagate from branch 'im.pidgin.pidgin' (head 98b6b547b29ea1192b73cc4e1de1e674edef4328)
Richard Laager <rlaager@wiktel.com>
parents:
diff changeset
590 {
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
591 purple_debug_misc("MSNCL","Sent SOAP request for the contact list.\n");
20394
4a099e4d0d09 propagate from branch 'im.pidgin.pidgin' (head 98b6b547b29ea1192b73cc4e1de1e674edef4328)
Richard Laager <rlaager@wiktel.com>
parents:
diff changeset
592 soapconn->read_cb = msn_get_contact_list_cb;
4a099e4d0d09 propagate from branch 'im.pidgin.pidgin' (head 98b6b547b29ea1192b73cc4e1de1e674edef4328)
Richard Laager <rlaager@wiktel.com>
parents:
diff changeset
593 }
4a099e4d0d09 propagate from branch 'im.pidgin.pidgin' (head 98b6b547b29ea1192b73cc4e1de1e674edef4328)
Richard Laager <rlaager@wiktel.com>
parents:
diff changeset
594
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
595 /* SOAP get contact list*/
20394
4a099e4d0d09 propagate from branch 'im.pidgin.pidgin' (head 98b6b547b29ea1192b73cc4e1de1e674edef4328)
Richard Laager <rlaager@wiktel.com>
parents:
diff changeset
596 void
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
597 msn_get_contact_list(MsnContact * contact, 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
598 {
4a099e4d0d09 propagate from branch 'im.pidgin.pidgin' (head 98b6b547b29ea1192b73cc4e1de1e674edef4328)
Richard Laager <rlaager@wiktel.com>
parents:
diff changeset
599 MsnSoapReq *soap_request;
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
600 gchar *body;
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
601 gchar *update_str = 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
602 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
603
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
604 purple_debug_misc("MSNCL","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
605
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
606 if ( update_time != NULL ) {
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
607 purple_debug_info("MSNCL","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
608 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
609 }
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
610
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
611 body = g_strdup_printf(MSN_GET_CONTACT_TEMPLATE, partner_scenario_str, 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
612 g_free(update_str);
9a2a4a0c0003 Add the possibility to create an Address Book, useful for newly registered MSN users.
Carlos Silva <typ0@pidgin.im>
parents: 20471
diff changeset
613
20394
4a099e4d0d09 propagate from branch 'im.pidgin.pidgin' (head 98b6b547b29ea1192b73cc4e1de1e674edef4328)
Richard Laager <rlaager@wiktel.com>
parents:
diff changeset
614 soap_request = msn_soap_request_new(MSN_CONTACT_SERVER,
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
615 MSN_GET_CONTACT_POST_URL,
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
616 MSN_GET_CONTACT_SOAP_ACTION,
20394
4a099e4d0d09 propagate from branch 'im.pidgin.pidgin' (head 98b6b547b29ea1192b73cc4e1de1e674edef4328)
Richard Laager <rlaager@wiktel.com>
parents:
diff changeset
617 body,
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
618 (gpointer) partner_scenario_str,
20394
4a099e4d0d09 propagate from branch 'im.pidgin.pidgin' (head 98b6b547b29ea1192b73cc4e1de1e674edef4328)
Richard Laager <rlaager@wiktel.com>
parents:
diff changeset
619 msn_get_contact_list_cb,
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
620 msn_get_contact_written_cb,
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
621 msn_contact_connect_init);
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
622 msn_soap_post(contact->soapconn,soap_request);
20394
4a099e4d0d09 propagate from branch 'im.pidgin.pidgin' (head 98b6b547b29ea1192b73cc4e1de1e674edef4328)
Richard Laager <rlaager@wiktel.com>
parents:
diff changeset
623 g_free(body);
4a099e4d0d09 propagate from branch 'im.pidgin.pidgin' (head 98b6b547b29ea1192b73cc4e1de1e674edef4328)
Richard Laager <rlaager@wiktel.com>
parents:
diff changeset
624 }
4a099e4d0d09 propagate from branch 'im.pidgin.pidgin' (head 98b6b547b29ea1192b73cc4e1de1e674edef4328)
Richard Laager <rlaager@wiktel.com>
parents:
diff changeset
625
20439
bee467c81570 A bunch of MSNP14 stuff:
Stu Tomlinson <stu@nosnilmot.com>
parents: 20432
diff changeset
626 static void
bee467c81570 A bunch of MSNP14 stuff:
Stu Tomlinson <stu@nosnilmot.com>
parents: 20432
diff changeset
627 msn_parse_addressbook_groups(MsnContact *contact, xmlnode *node)
20394
4a099e4d0d09 propagate from branch 'im.pidgin.pidgin' (head 98b6b547b29ea1192b73cc4e1de1e674edef4328)
Richard Laager <rlaager@wiktel.com>
parents:
diff changeset
628 {
20439
bee467c81570 A bunch of MSNP14 stuff:
Stu Tomlinson <stu@nosnilmot.com>
parents: 20432
diff changeset
629 MsnSession *session = contact->session;
bee467c81570 A bunch of MSNP14 stuff:
Stu Tomlinson <stu@nosnilmot.com>
parents: 20432
diff changeset
630 xmlnode *group;
20394
4a099e4d0d09 propagate from branch 'im.pidgin.pidgin' (head 98b6b547b29ea1192b73cc4e1de1e674edef4328)
Richard Laager <rlaager@wiktel.com>
parents:
diff changeset
631
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
632 purple_debug_info("MsnAb","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
633
20439
bee467c81570 A bunch of MSNP14 stuff:
Stu Tomlinson <stu@nosnilmot.com>
parents: 20432
diff changeset
634 for(group = xmlnode_get_child(node, "Group"); group;
bee467c81570 A bunch of MSNP14 stuff:
Stu Tomlinson <stu@nosnilmot.com>
parents: 20432
diff changeset
635 group = xmlnode_get_next_twin(group)){
bee467c81570 A bunch of MSNP14 stuff:
Stu Tomlinson <stu@nosnilmot.com>
parents: 20432
diff changeset
636 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
637 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
638
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
639 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
640 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
641 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
642 group_name = xmlnode_get_data(groupname);
20394
4a099e4d0d09 propagate from branch 'im.pidgin.pidgin' (head 98b6b547b29ea1192b73cc4e1de1e674edef4328)
Richard Laager <rlaager@wiktel.com>
parents:
diff changeset
643
4a099e4d0d09 propagate from branch 'im.pidgin.pidgin' (head 98b6b547b29ea1192b73cc4e1de1e674edef4328)
Richard Laager <rlaager@wiktel.com>
parents:
diff changeset
644 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
645
4a099e4d0d09 propagate from branch 'im.pidgin.pidgin' (head 98b6b547b29ea1192b73cc4e1de1e674edef4328)
Richard Laager <rlaager@wiktel.com>
parents:
diff changeset
646 if (group_id == NULL){
4a099e4d0d09 propagate from branch 'im.pidgin.pidgin' (head 98b6b547b29ea1192b73cc4e1de1e674edef4328)
Richard Laager <rlaager@wiktel.com>
parents:
diff changeset
647 /* 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
648 g_free(group_name);
20394
4a099e4d0d09 propagate from branch 'im.pidgin.pidgin' (head 98b6b547b29ea1192b73cc4e1de1e674edef4328)
Richard Laager <rlaager@wiktel.com>
parents:
diff changeset
649 continue;
4a099e4d0d09 propagate from branch 'im.pidgin.pidgin' (head 98b6b547b29ea1192b73cc4e1de1e674edef4328)
Richard Laager <rlaager@wiktel.com>
parents:
diff changeset
650 }
4a099e4d0d09 propagate from branch 'im.pidgin.pidgin' (head 98b6b547b29ea1192b73cc4e1de1e674edef4328)
Richard Laager <rlaager@wiktel.com>
parents:
diff changeset
651
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
652 purple_debug_info("MsnAB","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
653 if ((purple_find_group(group_name)) == NULL){
4ddc27c18781 Fix up some gaim -> purple issues.
Richard Laager <rlaager@wiktel.com>
parents: 20394
diff changeset
654 PurpleGroup *g = purple_group_new(group_name);
4ddc27c18781 Fix up some gaim -> purple issues.
Richard Laager <rlaager@wiktel.com>
parents: 20394
diff changeset
655 purple_blist_add_group(g, NULL);
20394
4a099e4d0d09 propagate from branch 'im.pidgin.pidgin' (head 98b6b547b29ea1192b73cc4e1de1e674edef4328)
Richard Laager <rlaager@wiktel.com>
parents:
diff changeset
656 }
4a099e4d0d09 propagate from branch 'im.pidgin.pidgin' (head 98b6b547b29ea1192b73cc4e1de1e674edef4328)
Richard Laager <rlaager@wiktel.com>
parents:
diff changeset
657 g_free(group_id);
4a099e4d0d09 propagate from branch 'im.pidgin.pidgin' (head 98b6b547b29ea1192b73cc4e1de1e674edef4328)
Richard Laager <rlaager@wiktel.com>
parents:
diff changeset
658 g_free(group_name);
4a099e4d0d09 propagate from branch 'im.pidgin.pidgin' (head 98b6b547b29ea1192b73cc4e1de1e674edef4328)
Richard Laager <rlaager@wiktel.com>
parents:
diff changeset
659 }
20439
bee467c81570 A bunch of MSNP14 stuff:
Stu Tomlinson <stu@nosnilmot.com>
parents: 20432
diff changeset
660 }
20394
4a099e4d0d09 propagate from branch 'im.pidgin.pidgin' (head 98b6b547b29ea1192b73cc4e1de1e674edef4328)
Richard Laager <rlaager@wiktel.com>
parents:
diff changeset
661
20439
bee467c81570 A bunch of MSNP14 stuff:
Stu Tomlinson <stu@nosnilmot.com>
parents: 20432
diff changeset
662 static void
bee467c81570 A bunch of MSNP14 stuff:
Stu Tomlinson <stu@nosnilmot.com>
parents: 20432
diff changeset
663 msn_parse_addressbook_contacts(MsnContact *contact, xmlnode *node)
bee467c81570 A bunch of MSNP14 stuff:
Stu Tomlinson <stu@nosnilmot.com>
parents: 20432
diff changeset
664 {
bee467c81570 A bunch of MSNP14 stuff:
Stu Tomlinson <stu@nosnilmot.com>
parents: 20432
diff changeset
665 MsnSession *session = contact->session;
bee467c81570 A bunch of MSNP14 stuff:
Stu Tomlinson <stu@nosnilmot.com>
parents: 20432
diff changeset
666 xmlnode *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
667 char *passport = NULL, *Name = NULL, *uid = NULL, *type = NULL;
20394
4a099e4d0d09 propagate from branch 'im.pidgin.pidgin' (head 98b6b547b29ea1192b73cc4e1de1e674edef4328)
Richard Laager <rlaager@wiktel.com>
parents:
diff changeset
668
20439
bee467c81570 A bunch of MSNP14 stuff:
Stu Tomlinson <stu@nosnilmot.com>
parents: 20432
diff changeset
669 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
670 contactNode = xmlnode_get_next_twin(contactNode)) {
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
671 xmlnode *contactId, *contactInfo, *contactType, *passportName, *displayName, *guid, *groupIds;
20394
4a099e4d0d09 propagate from branch 'im.pidgin.pidgin' (head 98b6b547b29ea1192b73cc4e1de1e674edef4328)
Richard Laager <rlaager@wiktel.com>
parents:
diff changeset
672 MsnUser *user;
20447
18ecdee88ed0 Add Pending list to recognized lists during contact list parsing
Stu Tomlinson <stu@nosnilmot.com>
parents: 20442
diff changeset
673 MsnUserType usertype;
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
674
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
675 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
676 || !(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
677 || !(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
678 continue;
20394
4a099e4d0d09 propagate from branch 'im.pidgin.pidgin' (head 98b6b547b29ea1192b73cc4e1de1e674edef4328)
Richard Laager <rlaager@wiktel.com>
parents:
diff changeset
679
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
680 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
681 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
682 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
683 g_free(type);
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
684 passport = Name = uid = type = 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
685
20394
4a099e4d0d09 propagate from branch 'im.pidgin.pidgin' (head 98b6b547b29ea1192b73cc4e1de1e674edef4328)
Richard Laager <rlaager@wiktel.com>
parents:
diff changeset
686 uid = xmlnode_get_data(contactId);
4a099e4d0d09 propagate from branch 'im.pidgin.pidgin' (head 98b6b547b29ea1192b73cc4e1de1e674edef4328)
Richard Laager <rlaager@wiktel.com>
parents:
diff changeset
687 type = xmlnode_get_data(contactType);
4a099e4d0d09 propagate from branch 'im.pidgin.pidgin' (head 98b6b547b29ea1192b73cc4e1de1e674edef4328)
Richard Laager <rlaager@wiktel.com>
parents:
diff changeset
688
4a099e4d0d09 propagate from branch 'im.pidgin.pidgin' (head 98b6b547b29ea1192b73cc4e1de1e674edef4328)
Richard Laager <rlaager@wiktel.com>
parents:
diff changeset
689 /*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
690 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
691 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
692 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
693 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
694 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
695 g_free(friendly);
20403
599b5a4aebab The last of the merge fix-ups.
Richard Laager <rlaager@wiktel.com>
parents: 20401
diff changeset
696 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
697 }
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
698
20447
18ecdee88ed0 Add Pending list to recognized lists during contact list parsing
Stu Tomlinson <stu@nosnilmot.com>
parents: 20442
diff changeset
699 usertype = msn_get_user_type(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
700 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
701 if (passportName == NULL) {
20394
4a099e4d0d09 propagate from branch 'im.pidgin.pidgin' (head 98b6b547b29ea1192b73cc4e1de1e674edef4328)
Richard Laager <rlaager@wiktel.com>
parents:
diff changeset
702 xmlnode *emailsNode, *contactEmailNode, *emailNode;
4a099e4d0d09 propagate from branch 'im.pidgin.pidgin' (head 98b6b547b29ea1192b73cc4e1de1e674edef4328)
Richard Laager <rlaager@wiktel.com>
parents:
diff changeset
703 xmlnode *messengerEnabledNode;
4a099e4d0d09 propagate from branch 'im.pidgin.pidgin' (head 98b6b547b29ea1192b73cc4e1de1e674edef4328)
Richard Laager <rlaager@wiktel.com>
parents:
diff changeset
704 char *msnEnabled;
4a099e4d0d09 propagate from branch 'im.pidgin.pidgin' (head 98b6b547b29ea1192b73cc4e1de1e674edef4328)
Richard Laager <rlaager@wiktel.com>
parents:
diff changeset
705
4a099e4d0d09 propagate from branch 'im.pidgin.pidgin' (head 98b6b547b29ea1192b73cc4e1de1e674edef4328)
Richard Laager <rlaager@wiktel.com>
parents:
diff changeset
706 /*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
707 /*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
708 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
709 if (emailsNode == NULL) {
20394
4a099e4d0d09 propagate from branch 'im.pidgin.pidgin' (head 98b6b547b29ea1192b73cc4e1de1e674edef4328)
Richard Laager <rlaager@wiktel.com>
parents:
diff changeset
710 /*TODO: need to support the Mobile type*/
4a099e4d0d09 propagate from branch 'im.pidgin.pidgin' (head 98b6b547b29ea1192b73cc4e1de1e674edef4328)
Richard Laager <rlaager@wiktel.com>
parents:
diff changeset
711 continue;
4a099e4d0d09 propagate from branch 'im.pidgin.pidgin' (head 98b6b547b29ea1192b73cc4e1de1e674edef4328)
Richard Laager <rlaager@wiktel.com>
parents:
diff changeset
712 }
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
713 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
714 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
715 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
716 /* 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
717 break;
4a099e4d0d09 propagate from branch 'im.pidgin.pidgin' (head 98b6b547b29ea1192b73cc4e1de1e674edef4328)
Richard Laager <rlaager@wiktel.com>
parents:
diff changeset
718 }
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
719
20394
4a099e4d0d09 propagate from branch 'im.pidgin.pidgin' (head 98b6b547b29ea1192b73cc4e1de1e674edef4328)
Richard Laager <rlaager@wiktel.com>
parents:
diff changeset
720 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
721
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
722 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
723 g_free(passport);
20394
4a099e4d0d09 propagate from branch 'im.pidgin.pidgin' (head 98b6b547b29ea1192b73cc4e1de1e674edef4328)
Richard Laager <rlaager@wiktel.com>
parents:
diff changeset
724 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
725 }
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
726
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
727 if(msnEnabled && !strcmp(msnEnabled, "true")) {
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
728 /*Messenger enabled, Get the 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
729 purple_debug_info("MsnAB", "Yahoo User %s\n", passport ? passport : "(null)");
20447
18ecdee88ed0 Add Pending list to recognized lists during contact list parsing
Stu Tomlinson <stu@nosnilmot.com>
parents: 20442
diff changeset
730 usertype = MSN_USER_TYPE_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
731 g_free(msnEnabled);
20394
4a099e4d0d09 propagate from branch 'im.pidgin.pidgin' (head 98b6b547b29ea1192b73cc4e1de1e674edef4328)
Richard Laager <rlaager@wiktel.com>
parents:
diff changeset
732 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
733 } else {
20401
4ddc27c18781 Fix up some gaim -> purple issues.
Richard Laager <rlaager@wiktel.com>
parents: 20394
diff changeset
734 /*TODO maybe we can just ignore it in Purple?*/
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
735 purple_debug_info("MSNAB", "Other type user\n");
20394
4a099e4d0d09 propagate from branch 'im.pidgin.pidgin' (head 98b6b547b29ea1192b73cc4e1de1e674edef4328)
Richard Laager <rlaager@wiktel.com>
parents:
diff changeset
736 }
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
737
20394
4a099e4d0d09 propagate from branch 'im.pidgin.pidgin' (head 98b6b547b29ea1192b73cc4e1de1e674edef4328)
Richard Laager <rlaager@wiktel.com>
parents:
diff changeset
738 g_free(msnEnabled);
4a099e4d0d09 propagate from branch 'im.pidgin.pidgin' (head 98b6b547b29ea1192b73cc4e1de1e674edef4328)
Richard Laager <rlaager@wiktel.com>
parents:
diff changeset
739 }
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
740 } else {
20394
4a099e4d0d09 propagate from branch 'im.pidgin.pidgin' (head 98b6b547b29ea1192b73cc4e1de1e674edef4328)
Richard Laager <rlaager@wiktel.com>
parents:
diff changeset
741 passport = xmlnode_get_data(passportName);
4a099e4d0d09 propagate from branch 'im.pidgin.pidgin' (head 98b6b547b29ea1192b73cc4e1de1e674edef4328)
Richard Laager <rlaager@wiktel.com>
parents:
diff changeset
742 }
4a099e4d0d09 propagate from branch 'im.pidgin.pidgin' (head 98b6b547b29ea1192b73cc4e1de1e674edef4328)
Richard Laager <rlaager@wiktel.com>
parents:
diff changeset
743
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
744 if (passport == NULL)
20394
4a099e4d0d09 propagate from branch 'im.pidgin.pidgin' (head 98b6b547b29ea1192b73cc4e1de1e674edef4328)
Richard Laager <rlaager@wiktel.com>
parents:
diff changeset
745 continue;
4a099e4d0d09 propagate from branch 'im.pidgin.pidgin' (head 98b6b547b29ea1192b73cc4e1de1e674edef4328)
Richard Laager <rlaager@wiktel.com>
parents:
diff changeset
746
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 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
748 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
749 else
20394
4a099e4d0d09 propagate from branch 'im.pidgin.pidgin' (head 98b6b547b29ea1192b73cc4e1de1e674edef4328)
Richard Laager <rlaager@wiktel.com>
parents:
diff changeset
750 Name = g_strdup(passport);
4a099e4d0d09 propagate from branch 'im.pidgin.pidgin' (head 98b6b547b29ea1192b73cc4e1de1e674edef4328)
Richard Laager <rlaager@wiktel.com>
parents:
diff changeset
751
20401
4ddc27c18781 Fix up some gaim -> purple issues.
Richard Laager <rlaager@wiktel.com>
parents: 20394
diff changeset
752 purple_debug_misc("MsnAB","passport:{%s} uid:{%s} display:{%s}\n",
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 passport, uid ? uid : "(null)", Name ? Name : "(null)");
20394
4a099e4d0d09 propagate from branch 'im.pidgin.pidgin' (head 98b6b547b29ea1192b73cc4e1de1e674edef4328)
Richard Laager <rlaager@wiktel.com>
parents:
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 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
756 msn_user_set_uid(user, uid);
20447
18ecdee88ed0 Add Pending list to recognized lists during contact list parsing
Stu Tomlinson <stu@nosnilmot.com>
parents: 20442
diff changeset
757 msn_user_set_type(user, usertype);
20394
4a099e4d0d09 propagate from branch 'im.pidgin.pidgin' (head 98b6b547b29ea1192b73cc4e1de1e674edef4328)
Richard Laager <rlaager@wiktel.com>
parents:
diff changeset
758
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 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
760 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
761 for (guid = xmlnode_get_child(groupIds, "guid"); guid;
20394
4a099e4d0d09 propagate from branch 'im.pidgin.pidgin' (head 98b6b547b29ea1192b73cc4e1de1e674edef4328)
Richard Laager <rlaager@wiktel.com>
parents:
diff changeset
762 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
763 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
764 msn_user_add_group_id(user, group_id);
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
765 purple_debug_misc("MsnAB", "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
766 g_free(group_id);
4a099e4d0d09 propagate from branch 'im.pidgin.pidgin' (head 98b6b547b29ea1192b73cc4e1de1e674edef4328)
Richard Laager <rlaager@wiktel.com>
parents:
diff changeset
767 }
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
768 } 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
769 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
770 /*not in any group,Then set default group*/
20439
bee467c81570 A bunch of MSNP14 stuff:
Stu Tomlinson <stu@nosnilmot.com>
parents: 20432
diff changeset
771 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
772 }
20439
bee467c81570 A bunch of MSNP14 stuff:
Stu Tomlinson <stu@nosnilmot.com>
parents: 20432
diff changeset
773
bee467c81570 A bunch of MSNP14 stuff:
Stu Tomlinson <stu@nosnilmot.com>
parents: 20432
diff changeset
774 msn_got_lst_user(session, user, MSN_LIST_FL_OP, NULL);
bee467c81570 A bunch of MSNP14 stuff:
Stu Tomlinson <stu@nosnilmot.com>
parents: 20432
diff changeset
775 }
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
776
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
777 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
778 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
779 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
780 g_free(type);
20439
bee467c81570 A bunch of MSNP14 stuff:
Stu Tomlinson <stu@nosnilmot.com>
parents: 20432
diff changeset
781 }
bee467c81570 A bunch of MSNP14 stuff:
Stu Tomlinson <stu@nosnilmot.com>
parents: 20432
diff changeset
782
bee467c81570 A bunch of MSNP14 stuff:
Stu Tomlinson <stu@nosnilmot.com>
parents: 20432
diff changeset
783 static gboolean
bee467c81570 A bunch of MSNP14 stuff:
Stu Tomlinson <stu@nosnilmot.com>
parents: 20432
diff changeset
784 msn_parse_addressbook(MsnContact * contact)
bee467c81570 A bunch of MSNP14 stuff:
Stu Tomlinson <stu@nosnilmot.com>
parents: 20432
diff changeset
785 {
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
786 MsnSession *session;
20439
bee467c81570 A bunch of MSNP14 stuff:
Stu Tomlinson <stu@nosnilmot.com>
parents: 20432
diff changeset
787 xmlnode * node,*body,*response,*result;
bee467c81570 A bunch of MSNP14 stuff:
Stu Tomlinson <stu@nosnilmot.com>
parents: 20432
diff changeset
788 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
789 xmlnode *contacts;
20439
bee467c81570 A bunch of MSNP14 stuff:
Stu Tomlinson <stu@nosnilmot.com>
parents: 20432
diff changeset
790 xmlnode *abNode;
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
791 xmlnode *fault, *faultstringnode, *faultdetail, *errorcode;
20439
bee467c81570 A bunch of MSNP14 stuff:
Stu Tomlinson <stu@nosnilmot.com>
parents: 20432
diff changeset
792
bee467c81570 A bunch of MSNP14 stuff:
Stu Tomlinson <stu@nosnilmot.com>
parents: 20432
diff changeset
793 session = contact->session;
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
794
20439
bee467c81570 A bunch of MSNP14 stuff:
Stu Tomlinson <stu@nosnilmot.com>
parents: 20432
diff changeset
795 node = xmlnode_from_str(contact->soapconn->body, contact->soapconn->body_len);
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
796 if ( node == NULL ) {
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
797 purple_debug_error("MSN AddressBook","Error parsing Address Book with size %d\n", contact->soapconn->body_len);
20439
bee467c81570 A bunch of MSNP14 stuff:
Stu Tomlinson <stu@nosnilmot.com>
parents: 20432
diff changeset
798 return FALSE;
bee467c81570 A bunch of MSNP14 stuff:
Stu Tomlinson <stu@nosnilmot.com>
parents: 20432
diff changeset
799 }
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
800
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
801 purple_debug_misc("MSN AddressBook", "Parsing Address Book with size %d\n", contact->soapconn->body_len);
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
802
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
803 purple_debug_misc("MSN AddressBook","node{%p},name:%s,child:%s,last:%s\n", node,
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
804 node->name ? node->name : "(null)",
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
805 (node->child && node->child->name) ? node->child->name : "(null)",
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
806 (node->lastchild && node->lastchild->name) ? node->lastchild->name : "(null)");
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
807
20439
bee467c81570 A bunch of MSNP14 stuff:
Stu Tomlinson <stu@nosnilmot.com>
parents: 20432
diff changeset
808 body = xmlnode_get_child(node,"Body");
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
809 purple_debug_misc("MSN AddressBook","body{%p},name:%s\n",body,body->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
810
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
811 /* TODO: This appears to be used in a number of places and should be de-duplicated */
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
812 if ( (fault = xmlnode_get_child(body, "Fault")) != NULL) {
9a2a4a0c0003 Add the possibility to create an Address Book, useful for newly registered MSN users.
Carlos Silva <typ0@pidgin.im>
parents: 20471
diff changeset
813 purple_debug_info("MSN AddressBook","Fault received from SOAP server!\n");
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
9a2a4a0c0003 Add the possibility to create an Address Book, useful for newly registered MSN users.
Carlos Silva <typ0@pidgin.im>
parents: 20471
diff changeset
815 if ( (faultstringnode = xmlnode_get_child(fault, "faultstring")) != NULL ) {
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
816 gchar *faultstring = xmlnode_get_data(faultstringnode);
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
817 purple_debug_info("MSN AddressBook","Faultstring: %s\n", faultstring ? faultstring : "(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
818 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
819 }
9a2a4a0c0003 Add the possibility to create an Address Book, useful for newly registered MSN users.
Carlos Silva <typ0@pidgin.im>
parents: 20471
diff changeset
820 if ( (faultdetail = xmlnode_get_child(fault, "detail")) != NULL ) {
9a2a4a0c0003 Add the possibility to create an Address Book, useful for newly registered MSN users.
Carlos Silva <typ0@pidgin.im>
parents: 20471
diff changeset
821 purple_debug_info("MSN AddressBook","detail @ %p, name: %s\n",faultdetail, faultdetail->name);
9a2a4a0c0003 Add the possibility to create an Address Book, useful for newly registered MSN users.
Carlos Silva <typ0@pidgin.im>
parents: 20471
diff changeset
822
9a2a4a0c0003 Add the possibility to create an Address Book, useful for newly registered MSN users.
Carlos Silva <typ0@pidgin.im>
parents: 20471
diff changeset
823 if ( (errorcode = xmlnode_get_child(faultdetail, "errorcode")) != NULL ) {
9a2a4a0c0003 Add the possibility to create an Address Book, useful for newly registered MSN users.
Carlos Silva <typ0@pidgin.im>
parents: 20471
diff changeset
824 gchar *errorcodestring;
9a2a4a0c0003 Add the possibility to create an Address Book, useful for newly registered MSN users.
Carlos Silva <typ0@pidgin.im>
parents: 20471
diff changeset
825 purple_debug_info("MSN AddressBook","errorcode @ %p, name: %s\n",errorcode, errorcode->name);
9a2a4a0c0003 Add the possibility to create an Address Book, useful for newly registered MSN users.
Carlos Silva <typ0@pidgin.im>
parents: 20471
diff changeset
826
9a2a4a0c0003 Add the possibility to create an Address Book, useful for newly registered MSN users.
Carlos Silva <typ0@pidgin.im>
parents: 20471
diff changeset
827 errorcodestring = xmlnode_get_data(errorcode);
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
828 purple_debug_info("MSN AddressBook", "Error Code: %s\n", errorcodestring ? errorcodestring : "(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
829
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
830 if (errorcodestring && !strncmp(errorcodestring, "ABDoesNotExist", 14) ) {
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
831 g_free(errorcodestring);
20494
82d8797e06f3 Plug memory leaks.
Sadrul Habib Chowdhury <imadil@gmail.com>
parents: 20489
diff changeset
832 xmlnode_free(node);
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
833 return TRUE;
9a2a4a0c0003 Add the possibility to create an Address Book, useful for newly registered MSN users.
Carlos Silva <typ0@pidgin.im>
parents: 20471
diff changeset
834 }
9a2a4a0c0003 Add the possibility to create an Address Book, useful for newly registered MSN users.
Carlos Silva <typ0@pidgin.im>
parents: 20471
diff changeset
835 g_free(errorcodestring);
9a2a4a0c0003 Add the possibility to create an Address Book, useful for newly registered MSN users.
Carlos Silva <typ0@pidgin.im>
parents: 20471
diff changeset
836 }
9a2a4a0c0003 Add the possibility to create an Address Book, useful for newly registered MSN users.
Carlos Silva <typ0@pidgin.im>
parents: 20471
diff changeset
837 }
20494
82d8797e06f3 Plug memory leaks.
Sadrul Habib Chowdhury <imadil@gmail.com>
parents: 20489
diff changeset
838 xmlnode_free(node);
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
839 return FALSE;
9a2a4a0c0003 Add the possibility to create an Address Book, useful for newly registered MSN users.
Carlos Silva <typ0@pidgin.im>
parents: 20471
diff changeset
840 }
9a2a4a0c0003 Add the possibility to create an Address Book, useful for newly registered MSN users.
Carlos Silva <typ0@pidgin.im>
parents: 20471
diff changeset
841
9a2a4a0c0003 Add the possibility to create an Address Book, useful for newly registered MSN users.
Carlos Silva <typ0@pidgin.im>
parents: 20471
diff changeset
842
20439
bee467c81570 A bunch of MSNP14 stuff:
Stu Tomlinson <stu@nosnilmot.com>
parents: 20432
diff changeset
843 response = xmlnode_get_child(body,"ABFindAllResponse");
bee467c81570 A bunch of MSNP14 stuff:
Stu Tomlinson <stu@nosnilmot.com>
parents: 20432
diff changeset
844
bee467c81570 A bunch of MSNP14 stuff:
Stu Tomlinson <stu@nosnilmot.com>
parents: 20432
diff changeset
845 if (response == NULL) {
20494
82d8797e06f3 Plug memory leaks.
Sadrul Habib Chowdhury <imadil@gmail.com>
parents: 20489
diff changeset
846 xmlnode_free(node);
20439
bee467c81570 A bunch of MSNP14 stuff:
Stu Tomlinson <stu@nosnilmot.com>
parents: 20432
diff changeset
847 return FALSE;
bee467c81570 A bunch of MSNP14 stuff:
Stu Tomlinson <stu@nosnilmot.com>
parents: 20432
diff changeset
848 }
bee467c81570 A bunch of MSNP14 stuff:
Stu Tomlinson <stu@nosnilmot.com>
parents: 20432
diff changeset
849
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
850 purple_debug_misc("MSN SOAP","response{%p},name:%s\n",response,response->name);
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
851 result = xmlnode_get_child(response,"ABFindAllResult");
20439
bee467c81570 A bunch of MSNP14 stuff:
Stu Tomlinson <stu@nosnilmot.com>
parents: 20432
diff changeset
852 if(result == NULL){
bee467c81570 A bunch of MSNP14 stuff:
Stu Tomlinson <stu@nosnilmot.com>
parents: 20432
diff changeset
853 purple_debug_misc("MSNAB","receive no address book update\n");
20494
82d8797e06f3 Plug memory leaks.
Sadrul Habib Chowdhury <imadil@gmail.com>
parents: 20489
diff changeset
854 xmlnode_free(node);
20439
bee467c81570 A bunch of MSNP14 stuff:
Stu Tomlinson <stu@nosnilmot.com>
parents: 20432
diff changeset
855 return TRUE;
bee467c81570 A bunch of MSNP14 stuff:
Stu Tomlinson <stu@nosnilmot.com>
parents: 20432
diff changeset
856 }
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
857 purple_debug_info("MSN SOAP","result{%p},name:%s\n",result,result->name);
20439
bee467c81570 A bunch of MSNP14 stuff:
Stu Tomlinson <stu@nosnilmot.com>
parents: 20432
diff changeset
858
bee467c81570 A bunch of MSNP14 stuff:
Stu Tomlinson <stu@nosnilmot.com>
parents: 20432
diff changeset
859 /*Process Group List*/
bee467c81570 A bunch of MSNP14 stuff:
Stu Tomlinson <stu@nosnilmot.com>
parents: 20432
diff changeset
860 groups = xmlnode_get_child(result,"groups");
bee467c81570 A bunch of MSNP14 stuff:
Stu Tomlinson <stu@nosnilmot.com>
parents: 20432
diff changeset
861 if (groups != NULL) {
bee467c81570 A bunch of MSNP14 stuff:
Stu Tomlinson <stu@nosnilmot.com>
parents: 20432
diff changeset
862 msn_parse_addressbook_groups(contact, groups);
bee467c81570 A bunch of MSNP14 stuff:
Stu Tomlinson <stu@nosnilmot.com>
parents: 20432
diff changeset
863 }
bee467c81570 A bunch of MSNP14 stuff:
Stu Tomlinson <stu@nosnilmot.com>
parents: 20432
diff changeset
864
bee467c81570 A bunch of MSNP14 stuff:
Stu Tomlinson <stu@nosnilmot.com>
parents: 20432
diff changeset
865 /*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
866 msn_group_new(session->userlist, MSN_INDIVIDUALS_GROUP_ID,
bee467c81570 A bunch of MSNP14 stuff:
Stu Tomlinson <stu@nosnilmot.com>
parents: 20432
diff changeset
867 MSN_INDIVIDUALS_GROUP_NAME);
bee467c81570 A bunch of MSNP14 stuff:
Stu Tomlinson <stu@nosnilmot.com>
parents: 20432
diff changeset
868 purple_debug_misc("MsnAB","group_id:%s name:%s\n",
bee467c81570 A bunch of MSNP14 stuff:
Stu Tomlinson <stu@nosnilmot.com>
parents: 20432
diff changeset
869 MSN_INDIVIDUALS_GROUP_ID, MSN_INDIVIDUALS_GROUP_NAME);
bee467c81570 A bunch of MSNP14 stuff:
Stu Tomlinson <stu@nosnilmot.com>
parents: 20432
diff changeset
870 if ((purple_find_group(MSN_INDIVIDUALS_GROUP_NAME)) == NULL){
bee467c81570 A bunch of MSNP14 stuff:
Stu Tomlinson <stu@nosnilmot.com>
parents: 20432
diff changeset
871 PurpleGroup *g = purple_group_new(MSN_INDIVIDUALS_GROUP_NAME);
bee467c81570 A bunch of MSNP14 stuff:
Stu Tomlinson <stu@nosnilmot.com>
parents: 20432
diff changeset
872 purple_blist_add_group(g, NULL);
bee467c81570 A bunch of MSNP14 stuff:
Stu Tomlinson <stu@nosnilmot.com>
parents: 20432
diff changeset
873 }
bee467c81570 A bunch of MSNP14 stuff:
Stu Tomlinson <stu@nosnilmot.com>
parents: 20432
diff changeset
874
bee467c81570 A bunch of MSNP14 stuff:
Stu Tomlinson <stu@nosnilmot.com>
parents: 20432
diff changeset
875 /*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
876 msn_group_new(session->userlist, MSN_NON_IM_GROUP_ID, MSN_NON_IM_GROUP_NAME);
bee467c81570 A bunch of MSNP14 stuff:
Stu Tomlinson <stu@nosnilmot.com>
parents: 20432
diff changeset
877 purple_debug_misc("MsnAB","group_id:%s name:%s\n", MSN_NON_IM_GROUP_ID, MSN_NON_IM_GROUP_NAME);
bee467c81570 A bunch of MSNP14 stuff:
Stu Tomlinson <stu@nosnilmot.com>
parents: 20432
diff changeset
878 if ((purple_find_group(MSN_NON_IM_GROUP_NAME)) == NULL){
bee467c81570 A bunch of MSNP14 stuff:
Stu Tomlinson <stu@nosnilmot.com>
parents: 20432
diff changeset
879 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
880 purple_blist_add_group(g, NULL);
bee467c81570 A bunch of MSNP14 stuff:
Stu Tomlinson <stu@nosnilmot.com>
parents: 20432
diff changeset
881 }
bee467c81570 A bunch of MSNP14 stuff:
Stu Tomlinson <stu@nosnilmot.com>
parents: 20432
diff changeset
882
bee467c81570 A bunch of MSNP14 stuff:
Stu Tomlinson <stu@nosnilmot.com>
parents: 20432
diff changeset
883 /*Process contact List*/
bee467c81570 A bunch of MSNP14 stuff:
Stu Tomlinson <stu@nosnilmot.com>
parents: 20432
diff changeset
884 purple_debug_info("MSNAB","process contact list...\n");
bee467c81570 A bunch of MSNP14 stuff:
Stu Tomlinson <stu@nosnilmot.com>
parents: 20432
diff changeset
885 contacts =xmlnode_get_child(result,"contacts");
bee467c81570 A bunch of MSNP14 stuff:
Stu Tomlinson <stu@nosnilmot.com>
parents: 20432
diff changeset
886 if (contacts != NULL) {
bee467c81570 A bunch of MSNP14 stuff:
Stu Tomlinson <stu@nosnilmot.com>
parents: 20432
diff changeset
887 msn_parse_addressbook_contacts(contact, contacts);
20394
4a099e4d0d09 propagate from branch 'im.pidgin.pidgin' (head 98b6b547b29ea1192b73cc4e1de1e674edef4328)
Richard Laager <rlaager@wiktel.com>
parents:
diff changeset
888 }
4a099e4d0d09 propagate from branch 'im.pidgin.pidgin' (head 98b6b547b29ea1192b73cc4e1de1e674edef4328)
Richard Laager <rlaager@wiktel.com>
parents:
diff changeset
889
4a099e4d0d09 propagate from branch 'im.pidgin.pidgin' (head 98b6b547b29ea1192b73cc4e1de1e674edef4328)
Richard Laager <rlaager@wiktel.com>
parents:
diff changeset
890 abNode =xmlnode_get_child(result,"ab");
4a099e4d0d09 propagate from branch 'im.pidgin.pidgin' (head 98b6b547b29ea1192b73cc4e1de1e674edef4328)
Richard Laager <rlaager@wiktel.com>
parents:
diff changeset
891 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
892 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
893 char *tmp = NULL;
20394
4a099e4d0d09 propagate from branch 'im.pidgin.pidgin' (head 98b6b547b29ea1192b73cc4e1de1e674edef4328)
Richard Laager <rlaager@wiktel.com>
parents:
diff changeset
894
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
895 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
896 tmp = xmlnode_get_data(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
897 purple_debug_info("MsnAB"," lastchanged Time:{%s}\n", 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
898 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
899
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
900 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
901 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
902 tmp = xmlnode_get_data(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
903 purple_debug_info("MsnAB"," DynamicItemLastChanged :{%s}\n", 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
904 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
905 g_free(tmp);
20394
4a099e4d0d09 propagate from branch 'im.pidgin.pidgin' (head 98b6b547b29ea1192b73cc4e1de1e674edef4328)
Richard Laager <rlaager@wiktel.com>
parents:
diff changeset
906 }
4a099e4d0d09 propagate from branch 'im.pidgin.pidgin' (head 98b6b547b29ea1192b73cc4e1de1e674edef4328)
Richard Laager <rlaager@wiktel.com>
parents:
diff changeset
907
4a099e4d0d09 propagate from branch 'im.pidgin.pidgin' (head 98b6b547b29ea1192b73cc4e1de1e674edef4328)
Richard Laager <rlaager@wiktel.com>
parents:
diff changeset
908 xmlnode_free(node);
4a099e4d0d09 propagate from branch 'im.pidgin.pidgin' (head 98b6b547b29ea1192b73cc4e1de1e674edef4328)
Richard Laager <rlaager@wiktel.com>
parents:
diff changeset
909 msn_soap_free_read_buf(contact->soapconn);
4a099e4d0d09 propagate from branch 'im.pidgin.pidgin' (head 98b6b547b29ea1192b73cc4e1de1e674edef4328)
Richard Laager <rlaager@wiktel.com>
parents:
diff changeset
910 return TRUE;
4a099e4d0d09 propagate from branch 'im.pidgin.pidgin' (head 98b6b547b29ea1192b73cc4e1de1e674edef4328)
Richard Laager <rlaager@wiktel.com>
parents:
diff changeset
911 }
4a099e4d0d09 propagate from branch 'im.pidgin.pidgin' (head 98b6b547b29ea1192b73cc4e1de1e674edef4328)
Richard Laager <rlaager@wiktel.com>
parents:
diff changeset
912
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
913 static gboolean
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
914 msn_get_address_cb(MsnSoapConn *soapconn)
20394
4a099e4d0d09 propagate from branch 'im.pidgin.pidgin' (head 98b6b547b29ea1192b73cc4e1de1e674edef4328)
Richard Laager <rlaager@wiktel.com>
parents:
diff changeset
915 {
4a099e4d0d09 propagate from branch 'im.pidgin.pidgin' (head 98b6b547b29ea1192b73cc4e1de1e674edef4328)
Richard Laager <rlaager@wiktel.com>
parents:
diff changeset
916 MsnContact *contact;
4a099e4d0d09 propagate from branch 'im.pidgin.pidgin' (head 98b6b547b29ea1192b73cc4e1de1e674edef4328)
Richard Laager <rlaager@wiktel.com>
parents:
diff changeset
917 MsnSession *session;
4a099e4d0d09 propagate from branch 'im.pidgin.pidgin' (head 98b6b547b29ea1192b73cc4e1de1e674edef4328)
Richard Laager <rlaager@wiktel.com>
parents:
diff changeset
918
20501
f6dff814d95f cleans up ownership of soap callback data, this soap stuff is perfect
Ka-Hing Cheung <khc@hxbc.us>
parents: 20495
diff changeset
919 if (soapconn->body == 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
920 return TRUE;
20501
f6dff814d95f cleans up ownership of soap callback data, this soap stuff is perfect
Ka-Hing Cheung <khc@hxbc.us>
parents: 20495
diff changeset
921
20394
4a099e4d0d09 propagate from branch 'im.pidgin.pidgin' (head 98b6b547b29ea1192b73cc4e1de1e674edef4328)
Richard Laager <rlaager@wiktel.com>
parents:
diff changeset
922 contact = soapconn->parent;
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
923 g_return_val_if_fail(contact != NULL, TRUE);
20394
4a099e4d0d09 propagate from branch 'im.pidgin.pidgin' (head 98b6b547b29ea1192b73cc4e1de1e674edef4328)
Richard Laager <rlaager@wiktel.com>
parents:
diff changeset
924 session = soapconn->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
925 g_return_val_if_fail(session != NULL, FALSE);
20394
4a099e4d0d09 propagate from branch 'im.pidgin.pidgin' (head 98b6b547b29ea1192b73cc4e1de1e674edef4328)
Richard Laager <rlaager@wiktel.com>
parents:
diff changeset
926
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
927 purple_debug_misc("MSN AddressBook", "Got the Address Book!\n");
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
928
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
929 if ( msn_parse_addressbook(contact) ) {
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
930 //msn_soap_free_read_buf(soapconn);
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
931
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
932 if (!session->logged_in) {
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
933 msn_send_privacy(session->account->gc);
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
934 msn_notification_dump_contact(session);
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
935 }
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
936
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
937 /*free the read buffer*/
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
938 msn_soap_free_read_buf(soapconn);
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
939 return TRUE;
20394
4a099e4d0d09 propagate from branch 'im.pidgin.pidgin' (head 98b6b547b29ea1192b73cc4e1de1e674edef4328)
Richard Laager <rlaager@wiktel.com>
parents:
diff changeset
940 } else {
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
941 /* This is making us loop infinitely when we fail to parse the address book,
9a2a4a0c0003 Add the possibility to create an Address Book, useful for newly registered MSN users.
Carlos Silva <typ0@pidgin.im>
parents: 20471
diff changeset
942 disable for now (we should re-enable when we send timestamps)
9a2a4a0c0003 Add the possibility to create an Address Book, useful for newly registered MSN users.
Carlos Silva <typ0@pidgin.im>
parents: 20471
diff changeset
943 */
9a2a4a0c0003 Add the possibility to create an Address Book, useful for newly registered MSN users.
Carlos Silva <typ0@pidgin.im>
parents: 20471
diff changeset
944 /*
20394
4a099e4d0d09 propagate from branch 'im.pidgin.pidgin' (head 98b6b547b29ea1192b73cc4e1de1e674edef4328)
Richard Laager <rlaager@wiktel.com>
parents:
diff changeset
945 msn_get_address_book(contact, 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
946 */
9a2a4a0c0003 Add the possibility to create an Address Book, useful for newly registered MSN users.
Carlos Silva <typ0@pidgin.im>
parents: 20471
diff changeset
947 msn_session_disconnect(session);
9a2a4a0c0003 Add the possibility to create an Address Book, useful for newly registered MSN users.
Carlos Silva <typ0@pidgin.im>
parents: 20471
diff changeset
948 purple_connection_error(session->account->gc, _("Unable to retrieve MSN Address Book"));
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
949 return FALSE;
20394
4a099e4d0d09 propagate from branch 'im.pidgin.pidgin' (head 98b6b547b29ea1192b73cc4e1de1e674edef4328)
Richard Laager <rlaager@wiktel.com>
parents:
diff changeset
950 }
4a099e4d0d09 propagate from branch 'im.pidgin.pidgin' (head 98b6b547b29ea1192b73cc4e1de1e674edef4328)
Richard Laager <rlaager@wiktel.com>
parents:
diff changeset
951 }
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 /**/
4a099e4d0d09 propagate from branch 'im.pidgin.pidgin' (head 98b6b547b29ea1192b73cc4e1de1e674edef4328)
Richard Laager <rlaager@wiktel.com>
parents:
diff changeset
954 static 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
955 msn_address_written_cb(MsnSoapConn *soapconn)
20394
4a099e4d0d09 propagate from branch 'im.pidgin.pidgin' (head 98b6b547b29ea1192b73cc4e1de1e674edef4328)
Richard Laager <rlaager@wiktel.com>
parents:
diff changeset
956 {
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
957 purple_debug_misc("MSN AddressBook","Sent SOAP request for the Address Book.\n");
20394
4a099e4d0d09 propagate from branch 'im.pidgin.pidgin' (head 98b6b547b29ea1192b73cc4e1de1e674edef4328)
Richard Laager <rlaager@wiktel.com>
parents:
diff changeset
958 soapconn->read_cb = msn_get_address_cb;
4a099e4d0d09 propagate from branch 'im.pidgin.pidgin' (head 98b6b547b29ea1192b73cc4e1de1e674edef4328)
Richard Laager <rlaager@wiktel.com>
parents:
diff changeset
959 }
4a099e4d0d09 propagate from branch 'im.pidgin.pidgin' (head 98b6b547b29ea1192b73cc4e1de1e674edef4328)
Richard Laager <rlaager@wiktel.com>
parents:
diff changeset
960
4a099e4d0d09 propagate from branch 'im.pidgin.pidgin' (head 98b6b547b29ea1192b73cc4e1de1e674edef4328)
Richard Laager <rlaager@wiktel.com>
parents:
diff changeset
961 /*get the address book*/
4a099e4d0d09 propagate from branch 'im.pidgin.pidgin' (head 98b6b547b29ea1192b73cc4e1de1e674edef4328)
Richard Laager <rlaager@wiktel.com>
parents:
diff changeset
962 void
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 msn_get_address_book(MsnContact *contact, const MsnSoapPartnerScenario partner_scenario, const char *LastChanged, const char *dynamicItemLastChange)
20394
4a099e4d0d09 propagate from branch 'im.pidgin.pidgin' (head 98b6b547b29ea1192b73cc4e1de1e674edef4328)
Richard Laager <rlaager@wiktel.com>
parents:
diff changeset
964 {
4a099e4d0d09 propagate from branch 'im.pidgin.pidgin' (head 98b6b547b29ea1192b73cc4e1de1e674edef4328)
Richard Laager <rlaager@wiktel.com>
parents:
diff changeset
965 MsnSoapReq *soap_request;
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
966 char *body;
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
967 char *update_str = NULL;
20394
4a099e4d0d09 propagate from branch 'im.pidgin.pidgin' (head 98b6b547b29ea1192b73cc4e1de1e674edef4328)
Richard Laager <rlaager@wiktel.com>
parents:
diff changeset
968
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
969 purple_debug_misc("MSN AddressBook","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
970
20394
4a099e4d0d09 propagate from branch 'im.pidgin.pidgin' (head 98b6b547b29ea1192b73cc4e1de1e674edef4328)
Richard Laager <rlaager@wiktel.com>
parents:
diff changeset
971 /*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
972 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
973 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
974 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
975 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
976
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
977
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
978 body = g_strdup_printf(MSN_GET_ADDRESS_TEMPLATE, MsnSoapPartnerScenarioText[partner_scenario], 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
979 g_free(update_str);
9a2a4a0c0003 Add the possibility to create an Address Book, useful for newly registered MSN users.
Carlos Silva <typ0@pidgin.im>
parents: 20471
diff changeset
980
20394
4a099e4d0d09 propagate from branch 'im.pidgin.pidgin' (head 98b6b547b29ea1192b73cc4e1de1e674edef4328)
Richard Laager <rlaager@wiktel.com>
parents:
diff changeset
981 soap_request = msn_soap_request_new(MSN_CONTACT_SERVER,
4a099e4d0d09 propagate from branch 'im.pidgin.pidgin' (head 98b6b547b29ea1192b73cc4e1de1e674edef4328)
Richard Laager <rlaager@wiktel.com>
parents:
diff changeset
982 MSN_ADDRESS_BOOK_POST_URL,MSN_GET_ADDRESS_SOAP_ACTION,
4a099e4d0d09 propagate from branch 'im.pidgin.pidgin' (head 98b6b547b29ea1192b73cc4e1de1e674edef4328)
Richard Laager <rlaager@wiktel.com>
parents:
diff changeset
983 body,
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 NULL,
20394
4a099e4d0d09 propagate from branch 'im.pidgin.pidgin' (head 98b6b547b29ea1192b73cc4e1de1e674edef4328)
Richard Laager <rlaager@wiktel.com>
parents:
diff changeset
985 msn_get_address_cb,
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
986 msn_address_written_cb,
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
987 msn_contact_connect_init);
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
988 msn_soap_post(contact->soapconn,soap_request);
20394
4a099e4d0d09 propagate from branch 'im.pidgin.pidgin' (head 98b6b547b29ea1192b73cc4e1de1e674edef4328)
Richard Laager <rlaager@wiktel.com>
parents:
diff changeset
989 g_free(body);
4a099e4d0d09 propagate from branch 'im.pidgin.pidgin' (head 98b6b547b29ea1192b73cc4e1de1e674edef4328)
Richard Laager <rlaager@wiktel.com>
parents:
diff changeset
990 }
4a099e4d0d09 propagate from branch 'im.pidgin.pidgin' (head 98b6b547b29ea1192b73cc4e1de1e674edef4328)
Richard Laager <rlaager@wiktel.com>
parents:
diff changeset
991
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
992 static gboolean
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
993 msn_add_contact_read_cb(MsnSoapConn *soapconn)
20394
4a099e4d0d09 propagate from branch 'im.pidgin.pidgin' (head 98b6b547b29ea1192b73cc4e1de1e674edef4328)
Richard Laager <rlaager@wiktel.com>
parents:
diff changeset
994 {
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
995 MsnCallbackState *state = 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
996 MsnUserList *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
997 MsnUser *user;
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
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
999 g_return_val_if_fail(soapconn->data_cb != NULL, TRUE);
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
1000 g_return_val_if_fail(soapconn->session != NULL, FALSE);
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
1001 g_return_val_if_fail(soapconn->session->userlist != NULL, TRUE);
20501
f6dff814d95f cleans up ownership of soap callback data, this soap stuff is perfect
Ka-Hing Cheung <khc@hxbc.us>
parents: 20495
diff changeset
1002
f6dff814d95f cleans up ownership of soap callback data, this soap stuff is perfect
Ka-Hing Cheung <khc@hxbc.us>
parents: 20495
diff changeset
1003 state = (MsnCallbackState *) soapconn->data_cb;
f6dff814d95f cleans up ownership of soap callback data, this soap stuff is perfect
Ka-Hing Cheung <khc@hxbc.us>
parents: 20495
diff changeset
1004
f6dff814d95f cleans up ownership of soap callback data, this soap stuff is perfect
Ka-Hing Cheung <khc@hxbc.us>
parents: 20495
diff changeset
1005 if (soapconn->body == NULL) {
f6dff814d95f cleans up ownership of soap callback data, this soap stuff is perfect
Ka-Hing Cheung <khc@hxbc.us>
parents: 20495
diff changeset
1006 msn_callback_state_free(state);
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
1007 return TRUE;
20501
f6dff814d95f cleans up ownership of soap callback data, this soap stuff is perfect
Ka-Hing Cheung <khc@hxbc.us>
parents: 20495
diff changeset
1008 }
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
1009
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
1010 userlist = soapconn->session->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
1011
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
1012 purple_debug_info("MSNCL","Contact added successfully\n");
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
1013
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 // the code this block is replacing didn't send ADL for yahoo contacts,
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
1015 // but i haven't confirmed this is WLM's behaviour wrt yahoo contacts
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
1016
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
1017 if ( !msn_user_is_yahoo(soapconn->session->account, state->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
1018
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 msn_userlist_add_buddy_to_list(userlist, state->who, MSN_LIST_AL);
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 msn_userlist_add_buddy_to_list(userlist, state->who, MSN_LIST_FL);
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
1021 }
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
1022 msn_notification_send_fqy(soapconn->session, 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
1023
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
1024 user = msn_userlist_find_add_user(userlist, state->who, state->who);
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
1025 msn_user_add_group_id(user, 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
1026
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
1027 if (msn_userlist_user_is_in_list(user, 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
1028 msn_del_contact_from_list(soapconn->session->contact, NULL, state->who, 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
1029 } 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
1030 msn_soap_free_read_buf(soapconn);
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
1031 }
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
1032
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
1033 msn_callback_state_free(state);
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
1034
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
1035 return TRUE;
20394
4a099e4d0d09 propagate from branch 'im.pidgin.pidgin' (head 98b6b547b29ea1192b73cc4e1de1e674edef4328)
Richard Laager <rlaager@wiktel.com>
parents:
diff changeset
1036 }
4a099e4d0d09 propagate from branch 'im.pidgin.pidgin' (head 98b6b547b29ea1192b73cc4e1de1e674edef4328)
Richard Laager <rlaager@wiktel.com>
parents:
diff changeset
1037
4a099e4d0d09 propagate from branch 'im.pidgin.pidgin' (head 98b6b547b29ea1192b73cc4e1de1e674edef4328)
Richard Laager <rlaager@wiktel.com>
parents:
diff changeset
1038 static 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
1039 msn_add_contact_written_cb(MsnSoapConn *soapconn)
20394
4a099e4d0d09 propagate from branch 'im.pidgin.pidgin' (head 98b6b547b29ea1192b73cc4e1de1e674edef4328)
Richard Laager <rlaager@wiktel.com>
parents:
diff changeset
1040 {
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
1041 purple_debug_info("MSNCL","Add contact request written\n");
20394
4a099e4d0d09 propagate from branch 'im.pidgin.pidgin' (head 98b6b547b29ea1192b73cc4e1de1e674edef4328)
Richard Laager <rlaager@wiktel.com>
parents:
diff changeset
1042 soapconn->read_cb = msn_add_contact_read_cb;
4a099e4d0d09 propagate from branch 'im.pidgin.pidgin' (head 98b6b547b29ea1192b73cc4e1de1e674edef4328)
Richard Laager <rlaager@wiktel.com>
parents:
diff changeset
1043 }
4a099e4d0d09 propagate from branch 'im.pidgin.pidgin' (head 98b6b547b29ea1192b73cc4e1de1e674edef4328)
Richard Laager <rlaager@wiktel.com>
parents:
diff changeset
1044
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
1045 /* 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
1046 void
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 msn_add_contact(MsnContact *contact, MsnCallbackState *state, const char *passport)
20394
4a099e4d0d09 propagate from branch 'im.pidgin.pidgin' (head 98b6b547b29ea1192b73cc4e1de1e674edef4328)
Richard Laager <rlaager@wiktel.com>
parents:
diff changeset
1048 {
4a099e4d0d09 propagate from branch 'im.pidgin.pidgin' (head 98b6b547b29ea1192b73cc4e1de1e674edef4328)
Richard Laager <rlaager@wiktel.com>
parents:
diff changeset
1049 MsnSoapReq *soap_request;
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
1050 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
1051 gchar *contact_xml = 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
1052
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
1053 g_return_if_fail(passport != NULL);
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
1054 /* gchar *escaped_displayname;
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
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
1056
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
1057 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
1058 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
1059 } 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
1060 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
1061 }
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
1062 contact_xml = g_strdup_printf(MSN_XML_ADD_CONTACT, 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
1063 */
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
1064 purple_debug_info("MSNCL","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
1065
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
1066 // if ( !strcmp(state->guid, MSN_INDIVIDUALS_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
1067 contact_xml = g_strdup_printf(MSN_CONTACT_XML, 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
1068 // }
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 body = g_strdup_printf(MSN_ADD_CONTACT_TEMPLATE, contact_xml);
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
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 g_free(contact_xml);
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 /*build SOAP and POST it*/
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
1074
20394
4a099e4d0d09 propagate from branch 'im.pidgin.pidgin' (head 98b6b547b29ea1192b73cc4e1de1e674edef4328)
Richard Laager <rlaager@wiktel.com>
parents:
diff changeset
1075 soap_request = msn_soap_request_new(MSN_CONTACT_SERVER,
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
1076 MSN_ADDRESS_BOOK_POST_URL,
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
1077 MSN_CONTACT_ADD_SOAP_ACTION,
20394
4a099e4d0d09 propagate from branch 'im.pidgin.pidgin' (head 98b6b547b29ea1192b73cc4e1de1e674edef4328)
Richard Laager <rlaager@wiktel.com>
parents:
diff changeset
1078 body,
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
1079 state,
20394
4a099e4d0d09 propagate from branch 'im.pidgin.pidgin' (head 98b6b547b29ea1192b73cc4e1de1e674edef4328)
Richard Laager <rlaager@wiktel.com>
parents:
diff changeset
1080 msn_add_contact_read_cb,
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
1081 msn_add_contact_written_cb,
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
1082 msn_contact_connect_init);
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
1083 msn_soap_post(contact->soapconn,soap_request);
20394
4a099e4d0d09 propagate from branch 'im.pidgin.pidgin' (head 98b6b547b29ea1192b73cc4e1de1e674edef4328)
Richard Laager <rlaager@wiktel.com>
parents:
diff changeset
1084
4a099e4d0d09 propagate from branch 'im.pidgin.pidgin' (head 98b6b547b29ea1192b73cc4e1de1e674edef4328)
Richard Laager <rlaager@wiktel.com>
parents:
diff changeset
1085 g_free(body);
4a099e4d0d09 propagate from branch 'im.pidgin.pidgin' (head 98b6b547b29ea1192b73cc4e1de1e674edef4328)
Richard Laager <rlaager@wiktel.com>
parents:
diff changeset
1086 }
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
1087
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
1088 static gboolean
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
1089 msn_add_contact_to_group_read_cb(MsnSoapConn *soapconn)
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
1090 {
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
1091 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
1092 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
1093
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
1094 g_return_val_if_fail(soapconn->data_cb != NULL, TRUE);
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
1095 g_return_val_if_fail(soapconn->session != NULL, FALSE);
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
1096 g_return_val_if_fail(soapconn->session->userlist != NULL, TRUE);
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
1097
20501
f6dff814d95f cleans up ownership of soap callback data, this soap stuff is perfect
Ka-Hing Cheung <khc@hxbc.us>
parents: 20495
diff changeset
1098 userlist = soapconn->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
1099
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
1100 state = (MsnCallbackState *) soapconn->data_cb;
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
1101
20501
f6dff814d95f cleans up ownership of soap callback data, this soap stuff is perfect
Ka-Hing Cheung <khc@hxbc.us>
parents: 20495
diff changeset
1102 if (soapconn->body == NULL) {
f6dff814d95f cleans up ownership of soap callback data, this soap stuff is perfect
Ka-Hing Cheung <khc@hxbc.us>
parents: 20495
diff changeset
1103 msn_callback_state_free(state);
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
1104 return TRUE;
20501
f6dff814d95f cleans up ownership of soap callback data, this soap stuff is perfect
Ka-Hing Cheung <khc@hxbc.us>
parents: 20495
diff changeset
1105 }
f6dff814d95f cleans up ownership of soap callback data, this soap stuff is perfect
Ka-Hing Cheung <khc@hxbc.us>
parents: 20495
diff changeset
1106
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
1107 if (msn_userlist_add_buddy_to_group(userlist, state->who, state->new_group_name) == TRUE) {
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
1108 purple_debug_info("MSNCL", "Contact %s added to group %s successfully!\n", state->who, state->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
1109 } 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
1110 purple_debug_info("MSNCL","Contact %s added to group %s successfully on server, but failed in the local list\n", state->who, state->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
1111 }
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
1112
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
1113 if (state->action & MSN_ADD_BUDDY) {
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
1114 MsnUser *user = msn_userlist_find_user(userlist, state->who);
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
1115
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
1116 if ( !msn_user_is_yahoo(soapconn->session->account, state->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
1117
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
1118 msn_userlist_add_buddy_to_list(userlist, state->who, MSN_LIST_AL);
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
1119 msn_userlist_add_buddy_to_list(userlist, state->who, MSN_LIST_FL);
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
1120 }
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
1121 msn_notification_send_fqy(soapconn->session, 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
1122
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
1123 if (msn_userlist_user_is_in_list(user, 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
1124 msn_del_contact_from_list(soapconn->session->contact, NULL, state->who, 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
1125 msn_callback_state_free(state);
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
1126 return TRUE;
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
1127 }
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
1128 }
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
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
1130 if (state->action & MSN_MOVE_BUDDY) {
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
1131 msn_del_contact_from_group(soapconn->session->contact, state->who, state->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
1132 } 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
1133 msn_callback_state_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
1134 msn_soap_free_read_buf(soapconn);
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
1135 }
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
1136 return TRUE;
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
1137 }
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
1138
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
1139 static 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
1140 msn_add_contact_to_group_written_cb(MsnSoapConn *soapconn)
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
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 purple_debug_info("MSNCL","Add contact to group request sent!\n");
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 soapconn->read_cb = msn_add_contact_to_group_read_cb;
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
1144 }
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 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
1147 msn_add_contact_to_group(MsnContact *contact, 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
1148 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
1149 {
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 MsnSoapReq *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
1151 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
1152 MsnUser *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
1153 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
1154
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
1155 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
1156 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
1157
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 g_return_if_fail(contact != 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
1159 g_return_if_fail(contact->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
1160 g_return_if_fail(contact->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
1161
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
1162 userlist = contact->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
1163
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
1164 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
1165
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
1166 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
1167
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
1168 if (state->action & MSN_ADD_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
1169 msn_add_contact(contact, state, 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
1170 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
1171 }
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 (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
1174 msn_user_add_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 msn_del_contact_from_group(contact, passport, state->old_group_name);
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 } 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
1177 msn_callback_state_free(state);
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
1178 }
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
1179
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
1180 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
1181 }
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
1182
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
1183
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
1184 purple_debug_info("MSNCL", "Adding user %s to group %s\n", 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
1185 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
1186
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
1187 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
1188 if (user == 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
1189 purple_debug_warning("MSN CL", "Unable to retrieve user %s from the userlist!\n", 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
1190 }
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
1191
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
1192 if (user->uid != 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
1193 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
1194 } 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
1195 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
1196 }
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
1197
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
1198 body = g_strdup_printf(MSN_ADD_CONTACT_GROUP_TEMPLATE, groupId, contact_xml);
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
1199 g_free(contact_xml);
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
1200
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
1201 /*build SOAP and POST it*/
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
1202
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
1203 soap_request = msn_soap_request_new(MSN_CONTACT_SERVER,
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
1204 MSN_ADDRESS_BOOK_POST_URL,
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
1205 MSN_ADD_CONTACT_GROUP_SOAP_ACTION,
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
1206 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
1207 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
1208 msn_add_contact_to_group_read_cb,
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
1209 msn_add_contact_to_group_written_cb,
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
1210 msn_contact_connect_init);
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
1211 msn_soap_post(contact->soapconn,soap_request);
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
1212
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
1213 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
1214 }
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
1215
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
1216
20394
4a099e4d0d09 propagate from branch 'im.pidgin.pidgin' (head 98b6b547b29ea1192b73cc4e1de1e674edef4328)
Richard Laager <rlaager@wiktel.com>
parents:
diff changeset
1217
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
1218 static gboolean
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
1219 msn_delete_contact_read_cb(MsnSoapConn *soapconn)
20394
4a099e4d0d09 propagate from branch 'im.pidgin.pidgin' (head 98b6b547b29ea1192b73cc4e1de1e674edef4328)
Richard Laager <rlaager@wiktel.com>
parents:
diff changeset
1220 {
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
1221 MsnUser *user;
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
1222 MsnCallbackState *state = (MsnCallbackState *) soapconn->data_cb;
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
1223 MsnUserList *userlist;
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
1224
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
1225 g_return_val_if_fail(soapconn->session != NULL, FALSE);
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
1226 g_return_val_if_fail(soapconn->session->userlist != NULL, TRUE);
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
1227
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
1228 userlist = soapconn->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
1229
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
1230 if (soapconn->body == NULL) {
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
1231 msn_callback_state_free(state);
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
1232 return TRUE;
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
1233 }
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
1234
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
1235 purple_debug_info("MSNCL","Delete contact successful\n");
20501
f6dff814d95f cleans up ownership of soap callback data, this soap stuff is perfect
Ka-Hing Cheung <khc@hxbc.us>
parents: 20495
diff changeset
1236
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
1237 user = msn_userlist_find_user_with_id(userlist, state->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
1238 if (user != NULL) {
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
1239 msn_userlist_remove_user(userlist, user);
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
1240 }
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
1241
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
1242 msn_callback_state_free(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
1243 msn_soap_free_read_buf(soapconn);
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
1244
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
1245 return TRUE;
20394
4a099e4d0d09 propagate from branch 'im.pidgin.pidgin' (head 98b6b547b29ea1192b73cc4e1de1e674edef4328)
Richard Laager <rlaager@wiktel.com>
parents:
diff changeset
1246 }
4a099e4d0d09 propagate from branch 'im.pidgin.pidgin' (head 98b6b547b29ea1192b73cc4e1de1e674edef4328)
Richard Laager <rlaager@wiktel.com>
parents:
diff changeset
1247
4a099e4d0d09 propagate from branch 'im.pidgin.pidgin' (head 98b6b547b29ea1192b73cc4e1de1e674edef4328)
Richard Laager <rlaager@wiktel.com>
parents:
diff changeset
1248 static 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
1249 msn_delete_contact_written_cb(MsnSoapConn *soapconn)
20394
4a099e4d0d09 propagate from branch 'im.pidgin.pidgin' (head 98b6b547b29ea1192b73cc4e1de1e674edef4328)
Richard Laager <rlaager@wiktel.com>
parents:
diff changeset
1250 {
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
1251 purple_debug_info("MSNCL","Delete contact request written\n");
20394
4a099e4d0d09 propagate from branch 'im.pidgin.pidgin' (head 98b6b547b29ea1192b73cc4e1de1e674edef4328)
Richard Laager <rlaager@wiktel.com>
parents:
diff changeset
1252 soapconn->read_cb = msn_delete_contact_read_cb;
4a099e4d0d09 propagate from branch 'im.pidgin.pidgin' (head 98b6b547b29ea1192b73cc4e1de1e674edef4328)
Richard Laager <rlaager@wiktel.com>
parents:
diff changeset
1253 }
4a099e4d0d09 propagate from branch 'im.pidgin.pidgin' (head 98b6b547b29ea1192b73cc4e1de1e674edef4328)
Richard Laager <rlaager@wiktel.com>
parents:
diff changeset
1254
4a099e4d0d09 propagate from branch 'im.pidgin.pidgin' (head 98b6b547b29ea1192b73cc4e1de1e674edef4328)
Richard Laager <rlaager@wiktel.com>
parents:
diff changeset
1255 /*delete a Contact*/
4a099e4d0d09 propagate from branch 'im.pidgin.pidgin' (head 98b6b547b29ea1192b73cc4e1de1e674edef4328)
Richard Laager <rlaager@wiktel.com>
parents:
diff changeset
1256 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
1257 msn_delete_contact(MsnContact *contact, const char *contactId)
20394
4a099e4d0d09 propagate from branch 'im.pidgin.pidgin' (head 98b6b547b29ea1192b73cc4e1de1e674edef4328)
Richard Laager <rlaager@wiktel.com>
parents:
diff changeset
1258 {
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
1259 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
1260 gchar *contact_id_xml = NULL ;
20394
4a099e4d0d09 propagate from branch 'im.pidgin.pidgin' (head 98b6b547b29ea1192b73cc4e1de1e674edef4328)
Richard Laager <rlaager@wiktel.com>
parents:
diff changeset
1261 MsnSoapReq *soap_request;
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
1262 MsnCallbackState *state;
20394
4a099e4d0d09 propagate from branch 'im.pidgin.pidgin' (head 98b6b547b29ea1192b73cc4e1de1e674edef4328)
Richard Laager <rlaager@wiktel.com>
parents:
diff changeset
1263
4a099e4d0d09 propagate from branch 'im.pidgin.pidgin' (head 98b6b547b29ea1192b73cc4e1de1e674edef4328)
Richard Laager <rlaager@wiktel.com>
parents:
diff changeset
1264 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
1265 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
1266
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
1267 state = msn_callback_state_new();
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
1268 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
1269
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
1270 /* build 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
1271 purple_debug_info("MSNCL","Deleting contact with contactId: %s\n", 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
1272 body = g_strdup_printf(MSN_DEL_CONTACT_TEMPLATE, contact_id_xml);
20394
4a099e4d0d09 propagate from branch 'im.pidgin.pidgin' (head 98b6b547b29ea1192b73cc4e1de1e674edef4328)
Richard Laager <rlaager@wiktel.com>
parents:
diff changeset
1273 soap_request = msn_soap_request_new(MSN_CONTACT_SERVER,
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
1274 MSN_ADDRESS_BOOK_POST_URL,
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
1275 MSN_CONTACT_DEL_SOAP_ACTION,
20394
4a099e4d0d09 propagate from branch 'im.pidgin.pidgin' (head 98b6b547b29ea1192b73cc4e1de1e674edef4328)
Richard Laager <rlaager@wiktel.com>
parents:
diff changeset
1276 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
1277 state,
20394
4a099e4d0d09 propagate from branch 'im.pidgin.pidgin' (head 98b6b547b29ea1192b73cc4e1de1e674edef4328)
Richard Laager <rlaager@wiktel.com>
parents:
diff changeset
1278 msn_delete_contact_read_cb,
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
1279 msn_delete_contact_written_cb,
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
1280 msn_contact_connect_init);
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
1281
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
1282 g_free(contact_id_xml);
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
1283
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
1284 /* POST the SOAP request */
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
1285 msn_soap_post(contact->soapconn, soap_request);
20394
4a099e4d0d09 propagate from branch 'im.pidgin.pidgin' (head 98b6b547b29ea1192b73cc4e1de1e674edef4328)
Richard Laager <rlaager@wiktel.com>
parents:
diff changeset
1286
4a099e4d0d09 propagate from branch 'im.pidgin.pidgin' (head 98b6b547b29ea1192b73cc4e1de1e674edef4328)
Richard Laager <rlaager@wiktel.com>
parents:
diff changeset
1287 g_free(body);
4a099e4d0d09 propagate from branch 'im.pidgin.pidgin' (head 98b6b547b29ea1192b73cc4e1de1e674edef4328)
Richard Laager <rlaager@wiktel.com>
parents:
diff changeset
1288 }
4a099e4d0d09 propagate from branch 'im.pidgin.pidgin' (head 98b6b547b29ea1192b73cc4e1de1e674edef4328)
Richard Laager <rlaager@wiktel.com>
parents:
diff changeset
1289
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
1290 static gboolean
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
1291 msn_del_contact_from_group_read_cb(MsnSoapConn *soapconn)
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
1292 {
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
1293 MsnCallbackState *state = (MsnCallbackState *) soapconn->data_cb;
20501
f6dff814d95f cleans up ownership of soap callback data, this soap stuff is perfect
Ka-Hing Cheung <khc@hxbc.us>
parents: 20495
diff changeset
1294
f6dff814d95f cleans up ownership of soap callback data, this soap stuff is perfect
Ka-Hing Cheung <khc@hxbc.us>
parents: 20495
diff changeset
1295 if (soapconn->body == NULL) {
f6dff814d95f cleans up ownership of soap callback data, this soap stuff is perfect
Ka-Hing Cheung <khc@hxbc.us>
parents: 20495
diff changeset
1296 msn_callback_state_free(state);
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
1297 return TRUE;
20501
f6dff814d95f cleans up ownership of soap callback data, this soap stuff is perfect
Ka-Hing Cheung <khc@hxbc.us>
parents: 20495
diff changeset
1298 }
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
1299
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
1300 if (msn_userlist_rem_buddy_from_group(soapconn->session->userlist, state->who, state->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
1301 purple_debug_info("MSN CL", "Contact %s deleted successfully from group %s\n", state->who, state->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
1302 } 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
1303 purple_debug_info("MSN CL", "Contact %s deleted successfully from group %s in the server, but failed in the local list\n", state->who, state->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
1304 }
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
1305
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
1306 msn_callback_state_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
1307 msn_soap_free_read_buf(soapconn);
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
1308
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
1309 return TRUE;
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
1310 }
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
1311
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
1312 static 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
1313 msn_del_contact_from_group_written_cb(MsnSoapConn *soapconn)
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
1314 {
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
1315 purple_debug_info("MSN CL","Del contact from group request sent!\n");
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
1316 soapconn->read_cb = msn_del_contact_from_group_read_cb;
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
1317 }
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
1318
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
1319 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
1320 msn_del_contact_from_group(MsnContact *contact, const char *passport, const char *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
1321 {
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
1322 MsnSoapReq *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
1323 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
1324 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
1325 MsnCallbackState *state;
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
1326 gchar *body = NULL, *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
1327 const gchar *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
1328
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
1329 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
1330 g_return_if_fail(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
1331 g_return_if_fail(contact != 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
1332 g_return_if_fail(contact->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
1333 g_return_if_fail(contact->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
1334
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
1335 userlist = contact->session->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
1336
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
1337 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
1338 if (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
1339 purple_debug_info("MSN CL", "Deleting user %s from group %s\n", passport, 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
1340 } 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
1341 purple_debug_warning("MSN CL", "Unable to retrieve group id from group %s !\n", 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
1342 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
1343 }
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
1344
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
1345 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
1346
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
1347 if (user == 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
1348 purple_debug_warning("MSN CL", "Unable to retrieve user from passport %s!\n", 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
1349 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
1350 }
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
1351
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
1352 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
1353 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
1354 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
1355 }
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
1356
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
1357 state = msn_callback_state_new();
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
1358 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
1359 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
1360 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
1361
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
1362 contact_id_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
1363 body = g_strdup_printf(MSN_CONTACT_DEL_GROUP_TEMPLATE, contact_id_xml, 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
1364 g_free(contact_id_xml);
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
1365
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
1366 /*build SOAP and POST it*/
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
1367 soap_request = msn_soap_request_new(MSN_CONTACT_SERVER,
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
1368 MSN_ADDRESS_BOOK_POST_URL,
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
1369 MSN_CONTACT_DEL_GROUP_SOAP_ACTION,
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
1370 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
1371 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
1372 msn_del_contact_from_group_read_cb,
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
1373 msn_del_contact_from_group_written_cb,
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
1374 msn_contact_connect_init);
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
1375 msn_soap_post(contact->soapconn,soap_request);
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
1376
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
1377 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
1378 }
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
1379
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
1380
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
1381 static gboolean
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
1382 msn_update_contact_read_cb(MsnSoapConn *soapconn)
20394
4a099e4d0d09 propagate from branch 'im.pidgin.pidgin' (head 98b6b547b29ea1192b73cc4e1de1e674edef4328)
Richard Laager <rlaager@wiktel.com>
parents:
diff changeset
1383 {
20501
f6dff814d95f cleans up ownership of soap callback data, this soap stuff is perfect
Ka-Hing Cheung <khc@hxbc.us>
parents: 20495
diff changeset
1384 if (soapconn->body == 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
1385 return TRUE;
20501
f6dff814d95f cleans up ownership of soap callback data, this soap stuff is perfect
Ka-Hing Cheung <khc@hxbc.us>
parents: 20495
diff changeset
1386
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
1387 purple_debug_info("MSN CL","Contact updated successfully\n");
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
1388
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
1389 return TRUE;
20394
4a099e4d0d09 propagate from branch 'im.pidgin.pidgin' (head 98b6b547b29ea1192b73cc4e1de1e674edef4328)
Richard Laager <rlaager@wiktel.com>
parents:
diff changeset
1390 }
4a099e4d0d09 propagate from branch 'im.pidgin.pidgin' (head 98b6b547b29ea1192b73cc4e1de1e674edef4328)
Richard Laager <rlaager@wiktel.com>
parents:
diff changeset
1391
4a099e4d0d09 propagate from branch 'im.pidgin.pidgin' (head 98b6b547b29ea1192b73cc4e1de1e674edef4328)
Richard Laager <rlaager@wiktel.com>
parents:
diff changeset
1392 static 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
1393 msn_update_contact_written_cb(MsnSoapConn *soapconn)
20394
4a099e4d0d09 propagate from branch 'im.pidgin.pidgin' (head 98b6b547b29ea1192b73cc4e1de1e674edef4328)
Richard Laager <rlaager@wiktel.com>
parents:
diff changeset
1394 {
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
1395 purple_debug_info("MSN CL","Update contact information request sent\n");
20394
4a099e4d0d09 propagate from branch 'im.pidgin.pidgin' (head 98b6b547b29ea1192b73cc4e1de1e674edef4328)
Richard Laager <rlaager@wiktel.com>
parents:
diff changeset
1396 soapconn->read_cb = msn_update_contact_read_cb;
4a099e4d0d09 propagate from branch 'im.pidgin.pidgin' (head 98b6b547b29ea1192b73cc4e1de1e674edef4328)
Richard Laager <rlaager@wiktel.com>
parents:
diff changeset
1397 }
4a099e4d0d09 propagate from branch 'im.pidgin.pidgin' (head 98b6b547b29ea1192b73cc4e1de1e674edef4328)
Richard Laager <rlaager@wiktel.com>
parents:
diff changeset
1398
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
1399 /* Update a contact's nickname */
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
1400
20394
4a099e4d0d09 propagate from branch 'im.pidgin.pidgin' (head 98b6b547b29ea1192b73cc4e1de1e674edef4328)
Richard Laager <rlaager@wiktel.com>
parents:
diff changeset
1401 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
1402 msn_update_contact(MsnContact *contact, const char* nickname)
20394
4a099e4d0d09 propagate from branch 'im.pidgin.pidgin' (head 98b6b547b29ea1192b73cc4e1de1e674edef4328)
Richard Laager <rlaager@wiktel.com>
parents:
diff changeset
1403 {
4a099e4d0d09 propagate from branch 'im.pidgin.pidgin' (head 98b6b547b29ea1192b73cc4e1de1e674edef4328)
Richard Laager <rlaager@wiktel.com>
parents:
diff changeset
1404 MsnSoapReq *soap_request;
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
1405 gchar *body, *escaped_nickname;
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
1406
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
1407 /* I'm not sure this is right, but if it isn't, the rest of this function will need to be fixed */
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
1408 g_return_if_fail(nickname != NULL);
20394
4a099e4d0d09 propagate from branch 'im.pidgin.pidgin' (head 98b6b547b29ea1192b73cc4e1de1e674edef4328)
Richard Laager <rlaager@wiktel.com>
parents:
diff changeset
1409
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
1410 purple_debug_info("MSN CL","Update contact information with new friendly name: %s\n", nickname);
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
1411
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
1412 escaped_nickname = g_markup_escape_text(nickname, -1);
20394
4a099e4d0d09 propagate from branch 'im.pidgin.pidgin' (head 98b6b547b29ea1192b73cc4e1de1e674edef4328)
Richard Laager <rlaager@wiktel.com>
parents:
diff changeset
1413
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
1414 body = g_strdup_printf(MSN_CONTACT_UPDATE_TEMPLATE, escaped_nickname);
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
1415
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
1416 g_free(escaped_nickname);
20394
4a099e4d0d09 propagate from branch 'im.pidgin.pidgin' (head 98b6b547b29ea1192b73cc4e1de1e674edef4328)
Richard Laager <rlaager@wiktel.com>
parents:
diff changeset
1417 /*build SOAP and POST it*/
4a099e4d0d09 propagate from branch 'im.pidgin.pidgin' (head 98b6b547b29ea1192b73cc4e1de1e674edef4328)
Richard Laager <rlaager@wiktel.com>
parents:
diff changeset
1418 soap_request = msn_soap_request_new(MSN_CONTACT_SERVER,
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
1419 MSN_ADDRESS_BOOK_POST_URL,
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
1420 MSN_CONTACT_UPDATE_SOAP_ACTION,
20394
4a099e4d0d09 propagate from branch 'im.pidgin.pidgin' (head 98b6b547b29ea1192b73cc4e1de1e674edef4328)
Richard Laager <rlaager@wiktel.com>
parents:
diff changeset
1421 body,
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
1422 NULL,
20394
4a099e4d0d09 propagate from branch 'im.pidgin.pidgin' (head 98b6b547b29ea1192b73cc4e1de1e674edef4328)
Richard Laager <rlaager@wiktel.com>
parents:
diff changeset
1423 msn_update_contact_read_cb,
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
1424 msn_update_contact_written_cb,
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
1425 msn_contact_connect_init);
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
1426 msn_soap_post(contact->soapconn, soap_request);
20394
4a099e4d0d09 propagate from branch 'im.pidgin.pidgin' (head 98b6b547b29ea1192b73cc4e1de1e674edef4328)
Richard Laager <rlaager@wiktel.com>
parents:
diff changeset
1427
4a099e4d0d09 propagate from branch 'im.pidgin.pidgin' (head 98b6b547b29ea1192b73cc4e1de1e674edef4328)
Richard Laager <rlaager@wiktel.com>
parents:
diff changeset
1428 g_free(body);
4a099e4d0d09 propagate from branch 'im.pidgin.pidgin' (head 98b6b547b29ea1192b73cc4e1de1e674edef4328)
Richard Laager <rlaager@wiktel.com>
parents:
diff changeset
1429 }
4a099e4d0d09 propagate from branch 'im.pidgin.pidgin' (head 98b6b547b29ea1192b73cc4e1de1e674edef4328)
Richard Laager <rlaager@wiktel.com>
parents:
diff changeset
1430
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
1431
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
1432 static gboolean
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
1433 msn_del_contact_from_list_read_cb(MsnSoapConn *soapconn)
20394
4a099e4d0d09 propagate from branch 'im.pidgin.pidgin' (head 98b6b547b29ea1192b73cc4e1de1e674edef4328)
Richard Laager <rlaager@wiktel.com>
parents:
diff changeset
1434 {
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
1435 MsnCallbackState *state = 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
1436
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
1437 g_return_val_if_fail(soapconn->data_cb != NULL, TRUE);
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
1438 g_return_val_if_fail(soapconn->session != NULL, FALSE);
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
1439 g_return_val_if_fail(soapconn->session->contact != NULL, FALSE);
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
1440
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
1441 state = (MsnCallbackState *) soapconn->data_cb;
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
1442
20501
f6dff814d95f cleans up ownership of soap callback data, this soap stuff is perfect
Ka-Hing Cheung <khc@hxbc.us>
parents: 20495
diff changeset
1443 if (soapconn->body == NULL) {
f6dff814d95f cleans up ownership of soap callback data, this soap stuff is perfect
Ka-Hing Cheung <khc@hxbc.us>
parents: 20495
diff changeset
1444 msn_callback_state_free(state);
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
1445 return TRUE;
20501
f6dff814d95f cleans up ownership of soap callback data, this soap stuff is perfect
Ka-Hing Cheung <khc@hxbc.us>
parents: 20495
diff changeset
1446 }
f6dff814d95f cleans up ownership of soap callback data, this soap stuff is perfect
Ka-Hing Cheung <khc@hxbc.us>
parents: 20495
diff changeset
1447
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
1448 purple_debug_info("MSN CL", "Contact %s deleted successfully from %s list on server!\n", state->who, MsnMemberRole[state->list_id]);
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
1449
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
1450 if (state->list_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
1451 msn_add_contact_to_list(soapconn->session->contact, state, state->who, MSN_LIST_RL);
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
1452 return TRUE;
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
1453 }
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
1454
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
1455 if (state->list_id == MSN_LIST_AL) {
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
1456 purple_privacy_permit_remove(soapconn->session->account, state->who, TRUE);
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
1457 msn_add_contact_to_list(soapconn->session->contact, NULL, state->who, 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
1458 msn_callback_state_free(state);
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
1459 return TRUE;
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
1460 }
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
1461
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
1462 if (state->list_id == 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
1463 purple_privacy_deny_remove(soapconn->session->account, state->who, TRUE);
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
1464 msn_add_contact_to_list(soapconn->session->contact, NULL, state->who, MSN_LIST_AL);
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
1465 msn_callback_state_free(state);
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
1466 return TRUE;
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
1467 }
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
1468
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
1469 msn_callback_state_free(state);
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
1470 msn_soap_free_read_buf(soapconn);
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
1471
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
1472 return TRUE;
20394
4a099e4d0d09 propagate from branch 'im.pidgin.pidgin' (head 98b6b547b29ea1192b73cc4e1de1e674edef4328)
Richard Laager <rlaager@wiktel.com>
parents:
diff changeset
1473 }
4a099e4d0d09 propagate from branch 'im.pidgin.pidgin' (head 98b6b547b29ea1192b73cc4e1de1e674edef4328)
Richard Laager <rlaager@wiktel.com>
parents:
diff changeset
1474
4a099e4d0d09 propagate from branch 'im.pidgin.pidgin' (head 98b6b547b29ea1192b73cc4e1de1e674edef4328)
Richard Laager <rlaager@wiktel.com>
parents:
diff changeset
1475 static 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
1476 msn_del_contact_from_list_written_cb(MsnSoapConn *soapconn)
20394
4a099e4d0d09 propagate from branch 'im.pidgin.pidgin' (head 98b6b547b29ea1192b73cc4e1de1e674edef4328)
Richard Laager <rlaager@wiktel.com>
parents:
diff changeset
1477 {
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
1478 purple_debug_info("MSN CL","Delete contact from list SOAP request sent!\n");
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
1479 soapconn->read_cb = msn_del_contact_from_list_read_cb;
20394
4a099e4d0d09 propagate from branch 'im.pidgin.pidgin' (head 98b6b547b29ea1192b73cc4e1de1e674edef4328)
Richard Laager <rlaager@wiktel.com>
parents:
diff changeset
1480 }
4a099e4d0d09 propagate from branch 'im.pidgin.pidgin' (head 98b6b547b29ea1192b73cc4e1de1e674edef4328)
Richard Laager <rlaager@wiktel.com>
parents:
diff changeset
1481
4a099e4d0d09 propagate from branch 'im.pidgin.pidgin' (head 98b6b547b29ea1192b73cc4e1de1e674edef4328)
Richard Laager <rlaager@wiktel.com>
parents:
diff changeset
1482 void
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
1483 msn_del_contact_from_list(MsnContact *contact, MsnCallbackState *state,
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
1484 const gchar *passport, const MsnListId list)
20394
4a099e4d0d09 propagate from branch 'im.pidgin.pidgin' (head 98b6b547b29ea1192b73cc4e1de1e674edef4328)
Richard Laager <rlaager@wiktel.com>
parents:
diff changeset
1485 {
4a099e4d0d09 propagate from branch 'im.pidgin.pidgin' (head 98b6b547b29ea1192b73cc4e1de1e674edef4328)
Richard Laager <rlaager@wiktel.com>
parents:
diff changeset
1486 MsnSoapReq *soap_request;
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
1487 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
1488 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
1489 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
1490
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
1491 g_return_if_fail(contact != 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
1492 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
1493 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
1494
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
1495 purple_debug_info("MSN CL", "Deleting contact %s from %s list\n", passport, MsnMemberRole[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
1496
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
1497 if (state == 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
1498 state = msn_callback_state_new();
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
1499 }
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
1500 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
1501 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
1502
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
1503 if (list == 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
1504 g_return_if_fail(contact->session != 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
1505 g_return_if_fail(contact->session->userlist != 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
1506
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
1507 user = msn_userlist_find_user(contact->session->userlist, 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
1508
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
1509 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
1510 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
1511 } 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
1512 /* 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
1513 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
1514
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
1515 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
1516 }
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
1517
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
1518 body = g_strdup_printf( MSN_CONTACT_DELECT_FROM_LIST_TEMPLATE,
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
1519 MsnSoapPartnerScenarioText[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
1520 MsnMemberRole[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
1521 member);
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
1522 g_free(member);
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
1523
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
1524 soap_request = msn_soap_request_new( MSN_CONTACT_SERVER,
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
1525 MSN_SHARE_POST_URL,
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
1526 MSN_DELETE_MEMBER_FROM_LIST_SOAP_ACTION,
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
1527 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
1528 state,
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
1529 msn_del_contact_from_list_read_cb,
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
1530 msn_del_contact_from_list_written_cb,
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
1531 msn_contact_connect_init);
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
1532
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
1533 msn_soap_post(contact->soapconn,soap_request);
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
1534
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
1535 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
1536 }
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
1537
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
1538 static gboolean
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
1539 msn_add_contact_to_list_read_cb(MsnSoapConn *soapconn)
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
1540 {
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
1541 MsnCallbackState *state = 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
1542
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
1543 g_return_val_if_fail(soapconn->data_cb != NULL, TRUE);
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
1544
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
1545 state = (MsnCallbackState *) soapconn->data_cb;
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
1546
20501
f6dff814d95f cleans up ownership of soap callback data, this soap stuff is perfect
Ka-Hing Cheung <khc@hxbc.us>
parents: 20495
diff changeset
1547 if (soapconn->body == NULL) {
f6dff814d95f cleans up ownership of soap callback data, this soap stuff is perfect
Ka-Hing Cheung <khc@hxbc.us>
parents: 20495
diff changeset
1548 msn_callback_state_free(state);
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
1549 return TRUE;
20501
f6dff814d95f cleans up ownership of soap callback data, this soap stuff is perfect
Ka-Hing Cheung <khc@hxbc.us>
parents: 20495
diff changeset
1550 }
f6dff814d95f cleans up ownership of soap callback data, this soap stuff is perfect
Ka-Hing Cheung <khc@hxbc.us>
parents: 20495
diff changeset
1551
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
1552 purple_debug_info("MSN CL", "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
1553
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
1554 if (state->list_id == MSN_LIST_RL && (state->action & MSN_DENIED_BUDDY) ) {
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
1555 g_return_val_if_fail(soapconn->session != NULL, FALSE);
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
1556 g_return_val_if_fail(soapconn->session->contact != NULL, FALSE);
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
1557
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
1558 msn_add_contact_to_list(soapconn->session->contact, NULL, state->who, MSN_LIST_BL);
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
1559 return TRUE;
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
1560 }
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
1561
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
1562 if (state->list_id == MSN_LIST_AL) {
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
1563 purple_privacy_permit_add(soapconn->session->account, state->who, TRUE);
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
1564 } else if (state->list_id == 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
1565 purple_privacy_deny_add(soapconn->session->account, state->who, TRUE);
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
1566 }
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
1567
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
1568 msn_callback_state_free(state);
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
1569 msn_soap_free_read_buf(soapconn);
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
1570 return TRUE;
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
1571 }
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
1572
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
1573
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
1574 static 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
1575 msn_add_contact_to_list_written_cb(MsnSoapConn *soapconn)
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
1576 {
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
1577 purple_debug_info("MSN CL","Add contact to list SOAP request sent!\n");
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
1578 soapconn->read_cb = msn_add_contact_to_list_read_cb;
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
1579 }
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
1580
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
1581 void
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
1582 msn_add_contact_to_list(MsnContact *contact, MsnCallbackState *state,
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
1583 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
1584 {
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
1585 MsnSoapReq *soap_request;
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
1586 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
1587 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
1588
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
1589 g_return_if_fail(contact != 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
1590 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
1591 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
1592
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
1593 purple_debug_info("MSN CL", "Adding contact %s to %s list\n", passport, MsnMemberRole[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
1594
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
1595 if (state == 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
1596 state = msn_callback_state_new();
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
1597 }
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
1598 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
1599 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
1600
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
1601 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
1602
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
1603 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
1604
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
1605 body = g_strdup_printf(MSN_CONTACT_ADD_TO_LIST_TEMPLATE,
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
1606 MsnSoapPartnerScenarioText[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
1607 MsnMemberRole[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
1608 member);
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
1609
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
1610 g_free(member);
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
1611
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
1612 soap_request = msn_soap_request_new( MSN_CONTACT_SERVER,
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
1613 MSN_SHARE_POST_URL,
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
1614 MSN_ADD_MEMBER_TO_LIST_SOAP_ACTION,
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
1615 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
1616 state,
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
1617 msn_add_contact_to_list_read_cb,
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
1618 msn_add_contact_to_list_written_cb,
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
1619 msn_contact_connect_init);
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
1620
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
1621 msn_soap_post(contact->soapconn, soap_request);
20394
4a099e4d0d09 propagate from branch 'im.pidgin.pidgin' (head 98b6b547b29ea1192b73cc4e1de1e674edef4328)
Richard Laager <rlaager@wiktel.com>
parents:
diff changeset
1622
4a099e4d0d09 propagate from branch 'im.pidgin.pidgin' (head 98b6b547b29ea1192b73cc4e1de1e674edef4328)
Richard Laager <rlaager@wiktel.com>
parents:
diff changeset
1623 g_free(body);
4a099e4d0d09 propagate from branch 'im.pidgin.pidgin' (head 98b6b547b29ea1192b73cc4e1de1e674edef4328)
Richard Laager <rlaager@wiktel.com>
parents:
diff changeset
1624 }
4a099e4d0d09 propagate from branch 'im.pidgin.pidgin' (head 98b6b547b29ea1192b73cc4e1de1e674edef4328)
Richard Laager <rlaager@wiktel.com>
parents:
diff changeset
1625
4a099e4d0d09 propagate from branch 'im.pidgin.pidgin' (head 98b6b547b29ea1192b73cc4e1de1e674edef4328)
Richard Laager <rlaager@wiktel.com>
parents:
diff changeset
1626
20427
059cc0bf6c91 Fix a compile warning by #if 0'ing out some unused code
Stu Tomlinson <stu@nosnilmot.com>
parents: 20403
diff changeset
1627 #if 0
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
1628 static gboolean
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
1629 msn_gleams_read_cb(MsnSoapConn * soapconn)
20394
4a099e4d0d09 propagate from branch 'im.pidgin.pidgin' (head 98b6b547b29ea1192b73cc4e1de1e674edef4328)
Richard Laager <rlaager@wiktel.com>
parents:
diff changeset
1630 {
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
1631 purple_debug_info("MSN CL","Gleams read done\n");
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
1632 return TRUE;
20394
4a099e4d0d09 propagate from branch 'im.pidgin.pidgin' (head 98b6b547b29ea1192b73cc4e1de1e674edef4328)
Richard Laager <rlaager@wiktel.com>
parents:
diff changeset
1633 }
4a099e4d0d09 propagate from branch 'im.pidgin.pidgin' (head 98b6b547b29ea1192b73cc4e1de1e674edef4328)
Richard Laager <rlaager@wiktel.com>
parents:
diff changeset
1634
4a099e4d0d09 propagate from branch 'im.pidgin.pidgin' (head 98b6b547b29ea1192b73cc4e1de1e674edef4328)
Richard Laager <rlaager@wiktel.com>
parents:
diff changeset
1635 static 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
1636 msn_gleams_written_cb(MsnSoapConn * soapconn)
20394
4a099e4d0d09 propagate from branch 'im.pidgin.pidgin' (head 98b6b547b29ea1192b73cc4e1de1e674edef4328)
Richard Laager <rlaager@wiktel.com>
parents:
diff changeset
1637 {
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
1638 purple_debug_info("MSNP14","finish Group written\n");
20394
4a099e4d0d09 propagate from branch 'im.pidgin.pidgin' (head 98b6b547b29ea1192b73cc4e1de1e674edef4328)
Richard Laager <rlaager@wiktel.com>
parents:
diff changeset
1639 soapconn->read_cb = msn_gleams_read_cb;
4a099e4d0d09 propagate from branch 'im.pidgin.pidgin' (head 98b6b547b29ea1192b73cc4e1de1e674edef4328)
Richard Laager <rlaager@wiktel.com>
parents:
diff changeset
1640 // msn_soap_read_cb(data,source,cond);
4a099e4d0d09 propagate from branch 'im.pidgin.pidgin' (head 98b6b547b29ea1192b73cc4e1de1e674edef4328)
Richard Laager <rlaager@wiktel.com>
parents:
diff changeset
1641 }
4a099e4d0d09 propagate from branch 'im.pidgin.pidgin' (head 98b6b547b29ea1192b73cc4e1de1e674edef4328)
Richard Laager <rlaager@wiktel.com>
parents:
diff changeset
1642
4a099e4d0d09 propagate from branch 'im.pidgin.pidgin' (head 98b6b547b29ea1192b73cc4e1de1e674edef4328)
Richard Laager <rlaager@wiktel.com>
parents:
diff changeset
1643 /*get the gleams info*/
4a099e4d0d09 propagate from branch 'im.pidgin.pidgin' (head 98b6b547b29ea1192b73cc4e1de1e674edef4328)
Richard Laager <rlaager@wiktel.com>
parents:
diff changeset
1644 void
4a099e4d0d09 propagate from branch 'im.pidgin.pidgin' (head 98b6b547b29ea1192b73cc4e1de1e674edef4328)
Richard Laager <rlaager@wiktel.com>
parents:
diff changeset
1645 msn_get_gleams(MsnContact *contact)
4a099e4d0d09 propagate from branch 'im.pidgin.pidgin' (head 98b6b547b29ea1192b73cc4e1de1e674edef4328)
Richard Laager <rlaager@wiktel.com>
parents:
diff changeset
1646 {
4a099e4d0d09 propagate from branch 'im.pidgin.pidgin' (head 98b6b547b29ea1192b73cc4e1de1e674edef4328)
Richard Laager <rlaager@wiktel.com>
parents:
diff changeset
1647 MsnSoapReq *soap_request;
4a099e4d0d09 propagate from branch 'im.pidgin.pidgin' (head 98b6b547b29ea1192b73cc4e1de1e674edef4328)
Richard Laager <rlaager@wiktel.com>
parents:
diff changeset
1648
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
1649 purple_debug_info("MSNP14","msn get gleams info...\n");
20394
4a099e4d0d09 propagate from branch 'im.pidgin.pidgin' (head 98b6b547b29ea1192b73cc4e1de1e674edef4328)
Richard Laager <rlaager@wiktel.com>
parents:
diff changeset
1650 /*build SOAP and POST it*/
4a099e4d0d09 propagate from branch 'im.pidgin.pidgin' (head 98b6b547b29ea1192b73cc4e1de1e674edef4328)
Richard Laager <rlaager@wiktel.com>
parents:
diff changeset
1651 soap_request = msn_soap_request_new(MSN_CONTACT_SERVER,
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
1652 MSN_ADDRESS_BOOK_POST_URL,
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
1653 MSN_GET_GLEAMS_SOAP_ACTION,
20394
4a099e4d0d09 propagate from branch 'im.pidgin.pidgin' (head 98b6b547b29ea1192b73cc4e1de1e674edef4328)
Richard Laager <rlaager@wiktel.com>
parents:
diff changeset
1654 MSN_GLEAMS_TEMPLATE,
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
1655 NULL,
20394
4a099e4d0d09 propagate from branch 'im.pidgin.pidgin' (head 98b6b547b29ea1192b73cc4e1de1e674edef4328)
Richard Laager <rlaager@wiktel.com>
parents:
diff changeset
1656 msn_gleams_read_cb,
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
1657 msn_gleams_written_cb,
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
1658 msn_contact_connect_init);
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
1659 msn_soap_post(contact->soapconn,soap_request);
20394
4a099e4d0d09 propagate from branch 'im.pidgin.pidgin' (head 98b6b547b29ea1192b73cc4e1de1e674edef4328)
Richard Laager <rlaager@wiktel.com>
parents:
diff changeset
1660 }
4a099e4d0d09 propagate from branch 'im.pidgin.pidgin' (head 98b6b547b29ea1192b73cc4e1de1e674edef4328)
Richard Laager <rlaager@wiktel.com>
parents:
diff changeset
1661 #endif
4a099e4d0d09 propagate from branch 'im.pidgin.pidgin' (head 98b6b547b29ea1192b73cc4e1de1e674edef4328)
Richard Laager <rlaager@wiktel.com>
parents:
diff changeset
1662
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
1663
20394
4a099e4d0d09 propagate from branch 'im.pidgin.pidgin' (head 98b6b547b29ea1192b73cc4e1de1e674edef4328)
Richard Laager <rlaager@wiktel.com>
parents:
diff changeset
1664 /***************************************************************
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
1665 * Group Operations
20394
4a099e4d0d09 propagate from branch 'im.pidgin.pidgin' (head 98b6b547b29ea1192b73cc4e1de1e674edef4328)
Richard Laager <rlaager@wiktel.com>
parents:
diff changeset
1666 ***************************************************************/
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
1667
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
1668 static gboolean
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
1669 msn_group_read_cb(MsnSoapConn *soapconn)
20394
4a099e4d0d09 propagate from branch 'im.pidgin.pidgin' (head 98b6b547b29ea1192b73cc4e1de1e674edef4328)
Richard Laager <rlaager@wiktel.com>
parents:
diff changeset
1670 {
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
1671 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
1672 MsnCallbackState *state = 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
1673
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
1674 purple_debug_info("MSN CL", "Group request successful.\n");
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
1675
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
1676 g_return_val_if_fail(soapconn->session != NULL, FALSE);
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
1677 g_return_val_if_fail(soapconn->session->userlist != NULL, TRUE);
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
1678 g_return_val_if_fail(soapconn->session->contact != NULL, FALSE);
20501
f6dff814d95f cleans up ownership of soap callback data, this soap stuff is perfect
Ka-Hing Cheung <khc@hxbc.us>
parents: 20495
diff changeset
1679
f6dff814d95f cleans up ownership of soap callback data, this soap stuff is perfect
Ka-Hing Cheung <khc@hxbc.us>
parents: 20495
diff changeset
1680 state = (MsnCallbackState *) soapconn->data_cb;
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
1681
20501
f6dff814d95f cleans up ownership of soap callback data, this soap stuff is perfect
Ka-Hing Cheung <khc@hxbc.us>
parents: 20495
diff changeset
1682 if (soapconn->body == NULL) {
f6dff814d95f cleans up ownership of soap callback data, this soap stuff is perfect
Ka-Hing Cheung <khc@hxbc.us>
parents: 20495
diff changeset
1683 msn_callback_state_free(state);
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
1684 return TRUE;
20501
f6dff814d95f cleans up ownership of soap callback data, this soap stuff is perfect
Ka-Hing Cheung <khc@hxbc.us>
parents: 20495
diff changeset
1685 }
f6dff814d95f cleans up ownership of soap callback data, this soap stuff is perfect
Ka-Hing Cheung <khc@hxbc.us>
parents: 20495
diff changeset
1686
f6dff814d95f cleans up ownership of soap callback data, this soap stuff is perfect
Ka-Hing Cheung <khc@hxbc.us>
parents: 20495
diff changeset
1687 if (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
1688 userlist = soapconn->session->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
1689
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
1690 if (state->action & MSN_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
1691 msn_userlist_rename_group_id(soapconn->session->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
1692 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
1693 state->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
1694 }
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
1695
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
1696 if (state->action & 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
1697 gchar *guid, *endguid;
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
1698
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
1699 guid = g_strstr_len(soapconn->read_buf, soapconn->read_len, "<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
1700 guid += 6;
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
1701 endguid = g_strstr_len(soapconn->read_buf, soapconn->read_len, "</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
1702 *endguid = '\0';
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
1703 /* create and add the new group to the 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
1704 purple_debug_info("MSN CL", "Adding group %s with guid = %s to the userlist\n", state->new_group_name, 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
1705 msn_group_new(soapconn->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
1706
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
1707 if (state->action & MSN_ADD_BUDDY) {
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
1708 msn_userlist_add_buddy(soapconn->session->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
1709 state->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
1710 state->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
1711 msn_callback_state_free(state);
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
1712 return TRUE;
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
1713 }
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
1714
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
1715 if (state->action & MSN_MOVE_BUDDY) {
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
1716 msn_add_contact_to_group(soapconn->session->contact, state, state->who, guid);
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
1717 return TRUE;
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
1718 }
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
1719 }
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
1720
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
1721 if (state->action & 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
1722 GList *l;
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
1723
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
1724 msn_userlist_remove_group_id(soapconn->session->userlist, 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
1725 for (l = userlist->users; l != NULL; l = l->next) {
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
1726 msn_user_remove_group_id( (MsnUser *)l->data, 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
1727 }
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
1728
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
1729 }
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
1730
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
1731 msn_callback_state_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
1732 }
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
1733
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
1734 msn_soap_free_read_buf(soapconn);
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
1735 return TRUE;
20394
4a099e4d0d09 propagate from branch 'im.pidgin.pidgin' (head 98b6b547b29ea1192b73cc4e1de1e674edef4328)
Richard Laager <rlaager@wiktel.com>
parents:
diff changeset
1736 }
4a099e4d0d09 propagate from branch 'im.pidgin.pidgin' (head 98b6b547b29ea1192b73cc4e1de1e674edef4328)
Richard Laager <rlaager@wiktel.com>
parents:
diff changeset
1737
4a099e4d0d09 propagate from branch 'im.pidgin.pidgin' (head 98b6b547b29ea1192b73cc4e1de1e674edef4328)
Richard Laager <rlaager@wiktel.com>
parents:
diff changeset
1738 static 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
1739 msn_group_written_cb(MsnSoapConn *soapconn)
20394
4a099e4d0d09 propagate from branch 'im.pidgin.pidgin' (head 98b6b547b29ea1192b73cc4e1de1e674edef4328)
Richard Laager <rlaager@wiktel.com>
parents:
diff changeset
1740 {
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
1741 purple_debug_info("MSN CL","Sent group request.\n");
20394
4a099e4d0d09 propagate from branch 'im.pidgin.pidgin' (head 98b6b547b29ea1192b73cc4e1de1e674edef4328)
Richard Laager <rlaager@wiktel.com>
parents:
diff changeset
1742 soapconn->read_cb = msn_group_read_cb;
4a099e4d0d09 propagate from branch 'im.pidgin.pidgin' (head 98b6b547b29ea1192b73cc4e1de1e674edef4328)
Richard Laager <rlaager@wiktel.com>
parents:
diff changeset
1743 }
4a099e4d0d09 propagate from branch 'im.pidgin.pidgin' (head 98b6b547b29ea1192b73cc4e1de1e674edef4328)
Richard Laager <rlaager@wiktel.com>
parents:
diff changeset
1744
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
1745 /* 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
1746 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
1747 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
1748 {
4a099e4d0d09 propagate from branch 'im.pidgin.pidgin' (head 98b6b547b29ea1192b73cc4e1de1e674edef4328)
Richard Laager <rlaager@wiktel.com>
parents:
diff changeset
1749 MsnSoapReq *soap_request;
4a099e4d0d09 propagate from branch 'im.pidgin.pidgin' (head 98b6b547b29ea1192b73cc4e1de1e674edef4328)
Richard Laager <rlaager@wiktel.com>
parents:
diff changeset
1750 MsnContact *contact;
4a099e4d0d09 propagate from branch 'im.pidgin.pidgin' (head 98b6b547b29ea1192b73cc4e1de1e674edef4328)
Richard Laager <rlaager@wiktel.com>
parents:
diff changeset
1751 char *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
1752 gchar *escaped_group_name;
20394
4a099e4d0d09 propagate from branch 'im.pidgin.pidgin' (head 98b6b547b29ea1192b73cc4e1de1e674edef4328)
Richard Laager <rlaager@wiktel.com>
parents:
diff changeset
1753
4a099e4d0d09 propagate from branch 'im.pidgin.pidgin' (head 98b6b547b29ea1192b73cc4e1de1e674edef4328)
Richard Laager <rlaager@wiktel.com>
parents:
diff changeset
1754 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
1755 g_return_if_fail(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
1756
20394
4a099e4d0d09 propagate from branch 'im.pidgin.pidgin' (head 98b6b547b29ea1192b73cc4e1de1e674edef4328)
Richard Laager <rlaager@wiktel.com>
parents:
diff changeset
1757 contact = session->contact;
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
1758 purple_debug_info("MSN CL","Adding group %s to contact list.\n", 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
1759
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
1760 if (state == 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
1761 state = msn_callback_state_new();
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
1762 }
20394
4a099e4d0d09 propagate from branch 'im.pidgin.pidgin' (head 98b6b547b29ea1192b73cc4e1de1e674edef4328)
Richard Laager <rlaager@wiktel.com>
parents:
diff changeset
1763
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
1764 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
1765 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
1766
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
1767 /* 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
1768 * 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
1769 */
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
1770 escaped_group_name = g_markup_escape_text(group_name, -1);
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
1771 body = g_strdup_printf(MSN_GROUP_ADD_TEMPLATE, escaped_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
1772 g_free(escaped_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
1773
20394
4a099e4d0d09 propagate from branch 'im.pidgin.pidgin' (head 98b6b547b29ea1192b73cc4e1de1e674edef4328)
Richard Laager <rlaager@wiktel.com>
parents:
diff changeset
1774 /*build SOAP and POST it*/
4a099e4d0d09 propagate from branch 'im.pidgin.pidgin' (head 98b6b547b29ea1192b73cc4e1de1e674edef4328)
Richard Laager <rlaager@wiktel.com>
parents:
diff changeset
1775 soap_request = msn_soap_request_new(MSN_CONTACT_SERVER,
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
1776 MSN_ADDRESS_BOOK_POST_URL,
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
1777 MSN_GROUP_ADD_SOAP_ACTION,
20394
4a099e4d0d09 propagate from branch 'im.pidgin.pidgin' (head 98b6b547b29ea1192b73cc4e1de1e674edef4328)
Richard Laager <rlaager@wiktel.com>
parents:
diff changeset
1778 body,
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
1779 state,
20394
4a099e4d0d09 propagate from branch 'im.pidgin.pidgin' (head 98b6b547b29ea1192b73cc4e1de1e674edef4328)
Richard Laager <rlaager@wiktel.com>
parents:
diff changeset
1780 msn_group_read_cb,
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
1781 msn_group_written_cb,
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
1782 msn_contact_connect_init);
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
1783 msn_soap_post(contact->soapconn,soap_request);
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
1784
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
1785 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
1786 }
20394
4a099e4d0d09 propagate from branch 'im.pidgin.pidgin' (head 98b6b547b29ea1192b73cc4e1de1e674edef4328)
Richard Laager <rlaager@wiktel.com>
parents:
diff changeset
1787
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
1788 /* 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
1789 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
1790 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
1791 {
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
1792 MsnSoapReq *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
1793 MsnContact *contact;
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
1794 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
1795 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
1796 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
1797
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
1798 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
1799
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
1800 g_return_if_fail(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
1801 contact = session->contact;
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
1802 purple_debug_info("MSN CL","Deleting group %s from contact list\n", 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
1803
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
1804 guid = msn_userlist_find_group_id(session->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
1805
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
1806 /* if group uid we need to del is 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
1807 * 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
1808 */
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
1809 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
1810 purple_debug_info("MSN CL", "Group %s guid not found, returning.\n", 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
1811 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
1812 }
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
1813
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
1814 if ( !strcmp(guid, MSN_INDIVIDUALS_GROUP_ID) || !strcmp(guid, MSN_NON_IM_GROUP_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
1815 // 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
1816 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
1817 }
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
1818
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
1819 state = msn_callback_state_new();
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
1820 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
1821 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
1822
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
1823 body = g_strdup_printf(MSN_GROUP_DEL_TEMPLATE, 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
1824 /*build SOAP and POST it*/
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
1825 soap_request = msn_soap_request_new(MSN_CONTACT_SERVER,
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
1826 MSN_ADDRESS_BOOK_POST_URL,
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
1827 MSN_GROUP_DEL_SOAP_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
1828 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
1829 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
1830 msn_group_read_cb,
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
1831 msn_group_written_cb,
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
1832 msn_contact_connect_init);
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
1833 msn_soap_post(contact->soapconn, soap_request);
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
1834
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
1835 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
1836 }
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
1837
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
1838 /* 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
1839 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
1840 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
1841 {
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
1842 MsnSoapReq *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
1843 MsnContact *contact;
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
1844 gchar * escaped_group_name, *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
1845 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
1846 MsnCallbackState *state = msn_callback_state_new();
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
1847
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
1848 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
1849 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
1850 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
1851 g_return_if_fail(new_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
1852
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
1853 contact = session->contact;
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
1854 purple_debug_info("MSN CL", "Renaming group %s to %s.\n", old_group_name, 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
1855
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
1856 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
1857 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
1858 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
1859
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
1860 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
1861 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
1862
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
1863 if ( !strcmp(guid, MSN_INDIVIDUALS_GROUP_ID) || !strcmp(guid, 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
1864 msn_add_group(session, state, new_group_name);
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
1865 // XXX move every buddy there (we probably need to fix concurrent SOAP reqs first)
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
1866 }
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
1867
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
1868 msn_callback_state_set_action(state, MSN_RENAME_GROUP);
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
1869
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
1870 /* 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
1871 * 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
1872 */
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
1873 escaped_group_name = g_markup_escape_text(new_group_name, -1);
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
1874
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
1875 body = g_strdup_printf(MSN_GROUP_RENAME_TEMPLATE, guid, escaped_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
1876
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
1877 soap_request = msn_soap_request_new(MSN_CONTACT_SERVER,
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
1878 MSN_ADDRESS_BOOK_POST_URL,
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
1879 MSN_GROUP_RENAME_SOAP_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
1880 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
1881 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
1882 msn_group_read_cb,
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
1883 msn_group_written_cb,
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
1884 msn_contact_connect_init);
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
1885 msn_soap_post(contact->soapconn, soap_request);
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
1886
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
1887 g_free(escaped_group_name);
20394
4a099e4d0d09 propagate from branch 'im.pidgin.pidgin' (head 98b6b547b29ea1192b73cc4e1de1e674edef4328)
Richard Laager <rlaager@wiktel.com>
parents:
diff changeset
1888 g_free(body);
4a099e4d0d09 propagate from branch 'im.pidgin.pidgin' (head 98b6b547b29ea1192b73cc4e1de1e674edef4328)
Richard Laager <rlaager@wiktel.com>
parents:
diff changeset
1889 }
4a099e4d0d09 propagate from branch 'im.pidgin.pidgin' (head 98b6b547b29ea1192b73cc4e1de1e674edef4328)
Richard Laager <rlaager@wiktel.com>
parents:
diff changeset
1890
4a099e4d0d09 propagate from branch 'im.pidgin.pidgin' (head 98b6b547b29ea1192b73cc4e1de1e674edef4328)
Richard Laager <rlaager@wiktel.com>
parents:
diff changeset
1891 void
4a099e4d0d09 propagate from branch 'im.pidgin.pidgin' (head 98b6b547b29ea1192b73cc4e1de1e674edef4328)
Richard Laager <rlaager@wiktel.com>
parents:
diff changeset
1892 msn_contact_connect_init(MsnSoapConn *soapconn)
4a099e4d0d09 propagate from branch 'im.pidgin.pidgin' (head 98b6b547b29ea1192b73cc4e1de1e674edef4328)
Richard Laager <rlaager@wiktel.com>
parents:
diff changeset
1893 {
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
1894 msn_soap_init(soapconn, MSN_CONTACT_SERVER, 1,
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
1895 msn_contact_login_connect_cb,
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
1896 msn_contact_login_error_cb);
20394
4a099e4d0d09 propagate from branch 'im.pidgin.pidgin' (head 98b6b547b29ea1192b73cc4e1de1e674edef4328)
Richard Laager <rlaager@wiktel.com>
parents:
diff changeset
1897 }