Mercurial > pidgin
annotate libpurple/protocols/msn/notification.c @ 31936:2b387aaeb89d
Don't access PurpleBuddy->proto_data directly, rather use the accessor functions.
author | andrew.victor@mxit.com |
---|---|
date | Tue, 23 Aug 2011 20:48:43 +0000 |
parents | 49d6ee09c74d |
children | 10e5000326a5 e091c8ea292e 3828a61c44da |
rev | line source |
---|---|
15373
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1 /** |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2 * @file notification.c Notification server functions |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
3 * |
15822 | 4 * purple |
15373
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
5 * |
15822 | 6 * Purple is the legal property of its developers, whose names are too numerous |
15373
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
7 * to list here. Please refer to the COPYRIGHT file distributed with this |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
8 * source distribution. |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
9 * |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
10 * This program is free software; you can redistribute it and/or modify |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
11 * it under the terms of the GNU General Public License as published by |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
12 * the Free Software Foundation; either version 2 of the License, or |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
13 * (at your option) any later version. |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
14 * |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
15 * This program is distributed in the hope that it will be useful, |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
16 * but WITHOUT ANY WARRANTY; without even the implied warranty of |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
17 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
18 * GNU General Public License for more details. |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
19 * |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
20 * You should have received a copy of the GNU General Public License |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
21 * along with this program; if not, write to the Free Software |
19681
44b4e8bd759b
The FSF changed its address a while ago; our files were out of date.
John Bailey <rekkanoryo@rekkanoryo.org>
parents:
18550
diff
changeset
|
22 * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02111-1301 USA |
15373
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
23 */ |
30742
a99b6dcdb60d
Remove unnecesary includes from msn.h.
masca@cpw.pidgin.im
parents:
30730
diff
changeset
|
24 |
30758
230caecf5435
Include internal.h on each c file to avoid windows breakage as recommended by Daniel.
masca@cpw.pidgin.im
parents:
30742
diff
changeset
|
25 #include "internal.h" |
30742
a99b6dcdb60d
Remove unnecesary includes from msn.h.
masca@cpw.pidgin.im
parents:
30730
diff
changeset
|
26 #include "cipher.h" |
30686
c1e44e9a1110
Support sending different client types in PrivateEndpointData.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
30685
diff
changeset
|
27 #include "core.h" |
30761 | 28 #include "debug.h" |
29 | |
15373
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
30 #include "notification.h" |
30761 | 31 |
23459
69af5301e1a7
killing MsnContact which just wraps MsnSession
Ka-Hing Cheung <khc@hxbc.us>
parents:
23458
diff
changeset
|
32 #include "contact.h" |
15373
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
33 #include "error.h" |
20394
4a099e4d0d09
propagate from branch 'im.pidgin.pidgin' (head 98b6b547b29ea1192b73cc4e1de1e674edef4328)
Richard Laager <rlaager@wiktel.com>
parents:
16063
diff
changeset
|
34 #include "msnutils.h" |
30761 | 35 #include "state.h" |
15373
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
36 #include "userlist.h" |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
37 |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
38 static MsnTable *cbs_table; |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
39 |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
40 /************************************************************************** |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
41 * Main |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
42 **************************************************************************/ |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
43 |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
44 static void |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
45 destroy_cb(MsnServConn *servconn) |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
46 { |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
47 MsnNotification *notification; |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
48 |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
49 notification = servconn->cmdproc->data; |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
50 g_return_if_fail(notification != NULL); |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
51 |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
52 msn_notification_destroy(notification); |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
53 } |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
54 |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
55 MsnNotification * |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
56 msn_notification_new(MsnSession *session) |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
57 { |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
58 MsnNotification *notification; |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
59 MsnServConn *servconn; |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
60 |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
61 g_return_val_if_fail(session != NULL, NULL); |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
62 |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
63 notification = g_new0(MsnNotification, 1); |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
64 |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
65 notification->session = session; |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
66 notification->servconn = servconn = msn_servconn_new(session, MSN_SERVCONN_NS); |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
67 msn_servconn_set_destroy_cb(servconn, destroy_cb); |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
68 |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
69 notification->cmdproc = servconn->cmdproc; |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
70 notification->cmdproc->data = notification; |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
71 notification->cmdproc->cbs_table = cbs_table; |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
72 |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
73 return notification; |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
74 } |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
75 |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
76 void |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
77 msn_notification_destroy(MsnNotification *notification) |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
78 { |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
79 notification->cmdproc->data = NULL; |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
80 |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
81 msn_servconn_set_destroy_cb(notification->servconn, NULL); |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
82 |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
83 msn_servconn_destroy(notification->servconn); |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
84 |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
85 g_free(notification); |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
86 } |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
87 |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
88 /************************************************************************** |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
89 * Connect |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
90 **************************************************************************/ |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
91 |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
92 static void |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
93 connect_cb(MsnServConn *servconn) |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
94 { |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
95 MsnCmdProc *cmdproc; |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
96 MsnSession *session; |
30709
4d7dfeae29c6
msn: Delete msn_cmdproc_send since it just have duplicated code from
masca@cpw.pidgin.im
parents:
30701
diff
changeset
|
97 MsnTransaction *trans; |
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:
20514
diff
changeset
|
98 GString *vers; |
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:
20514
diff
changeset
|
99 const char *ver_str; |
15373
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
100 int i; |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
101 |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
102 g_return_if_fail(servconn != NULL); |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
103 |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
104 cmdproc = servconn->cmdproc; |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
105 session = servconn->session; |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
106 |
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:
20514
diff
changeset
|
107 vers = g_string_new(""); |
15373
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
108 |
20394
4a099e4d0d09
propagate from branch 'im.pidgin.pidgin' (head 98b6b547b29ea1192b73cc4e1de1e674edef4328)
Richard Laager <rlaager@wiktel.com>
parents:
16063
diff
changeset
|
109 for (i = WLM_MAX_PROTOCOL; i >= WLM_MIN_PROTOCOL; i--) |
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:
20514
diff
changeset
|
110 g_string_append_printf(vers, " MSNP%d", i); |
15373
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
111 |
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:
20514
diff
changeset
|
112 g_string_append(vers, " CVR0"); |
15373
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
113 |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
114 if (session->login_step == MSN_LOGIN_STEP_START) |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
115 msn_session_set_login_step(session, MSN_LOGIN_STEP_HANDSHAKE); |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
116 else |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
117 msn_session_set_login_step(session, MSN_LOGIN_STEP_HANDSHAKE2); |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
118 |
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:
20514
diff
changeset
|
119 /* Skip the initial space */ |
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:
20514
diff
changeset
|
120 ver_str = (vers->str + 1); |
30709
4d7dfeae29c6
msn: Delete msn_cmdproc_send since it just have duplicated code from
masca@cpw.pidgin.im
parents:
30701
diff
changeset
|
121 trans = msn_transaction_new(cmdproc, "VER", "%s", ver_str); |
4d7dfeae29c6
msn: Delete msn_cmdproc_send since it just have duplicated code from
masca@cpw.pidgin.im
parents:
30701
diff
changeset
|
122 msn_cmdproc_send_trans(cmdproc, trans); |
15373
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
123 |
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:
20514
diff
changeset
|
124 g_string_free(vers, TRUE); |
15373
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
125 } |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
126 |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
127 gboolean |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
128 msn_notification_connect(MsnNotification *notification, const char *host, int port) |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
129 { |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
130 MsnServConn *servconn; |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
131 |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
132 g_return_val_if_fail(notification != NULL, FALSE); |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
133 |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
134 servconn = notification->servconn; |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
135 |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
136 msn_servconn_set_connect_cb(servconn, connect_cb); |
23504
5c95339855b2
Allow forcing an MSN HTTP connection to connect to a new server. This
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
23502
diff
changeset
|
137 notification->in_use = msn_servconn_connect(servconn, host, port, TRUE); |
15373
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
138 |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
139 return notification->in_use; |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
140 } |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
141 |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
142 void |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
143 msn_notification_disconnect(MsnNotification *notification) |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
144 { |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
145 g_return_if_fail(notification != NULL); |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
146 g_return_if_fail(notification->in_use); |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
147 |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
148 msn_servconn_disconnect(notification->servconn); |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
149 |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
150 notification->in_use = FALSE; |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
151 } |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
152 |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
153 /************************************************************************** |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
154 * Login |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
155 **************************************************************************/ |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
156 |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
157 void |
23444
25899ec348a4
Patch 2 from Qulogic, this one adds SSO authentication
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
23443
diff
changeset
|
158 msn_got_login_params(MsnSession *session, const char *ticket, const char *response) |
15373
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
159 { |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
160 MsnCmdProc *cmdproc; |
30709
4d7dfeae29c6
msn: Delete msn_cmdproc_send since it just have duplicated code from
masca@cpw.pidgin.im
parents:
30701
diff
changeset
|
161 MsnTransaction *trans; |
15373
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
162 |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
163 cmdproc = session->notification->cmdproc; |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
164 |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
165 msn_session_set_login_step(session, MSN_LOGIN_STEP_AUTH_END); |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
166 |
30657
e30865b62859
Initial support for msnp16, based on patch by Masca.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
28668
diff
changeset
|
167 if (session->protocol_ver >= 16) |
30709
4d7dfeae29c6
msn: Delete msn_cmdproc_send since it just have duplicated code from
masca@cpw.pidgin.im
parents:
30701
diff
changeset
|
168 trans = msn_transaction_new(cmdproc, "USR", "SSO S %s %s %s", ticket, response, session->guid); |
30657
e30865b62859
Initial support for msnp16, based on patch by Masca.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
28668
diff
changeset
|
169 else |
30709
4d7dfeae29c6
msn: Delete msn_cmdproc_send since it just have duplicated code from
masca@cpw.pidgin.im
parents:
30701
diff
changeset
|
170 trans = msn_transaction_new(cmdproc, "USR", "SSO S %s %s", ticket, response); |
4d7dfeae29c6
msn: Delete msn_cmdproc_send since it just have duplicated code from
masca@cpw.pidgin.im
parents:
30701
diff
changeset
|
171 |
4d7dfeae29c6
msn: Delete msn_cmdproc_send since it just have duplicated code from
masca@cpw.pidgin.im
parents:
30701
diff
changeset
|
172 msn_cmdproc_send_trans(cmdproc, trans); |
15373
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
173 } |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
174 |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
175 static void |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
176 cvr_cmd(MsnCmdProc *cmdproc, MsnCommand *cmd) |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
177 { |
15822 | 178 PurpleAccount *account; |
30709
4d7dfeae29c6
msn: Delete msn_cmdproc_send since it just have duplicated code from
masca@cpw.pidgin.im
parents:
30701
diff
changeset
|
179 MsnTransaction *trans; |
15373
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
180 |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
181 account = cmdproc->session->account; |
23444
25899ec348a4
Patch 2 from Qulogic, this one adds SSO authentication
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
23443
diff
changeset
|
182 |
30709
4d7dfeae29c6
msn: Delete msn_cmdproc_send since it just have duplicated code from
masca@cpw.pidgin.im
parents:
30701
diff
changeset
|
183 trans = msn_transaction_new(cmdproc, "USR", "SSO I %s", purple_account_get_username(account)); |
4d7dfeae29c6
msn: Delete msn_cmdproc_send since it just have duplicated code from
masca@cpw.pidgin.im
parents:
30701
diff
changeset
|
184 msn_cmdproc_send_trans(cmdproc, trans); |
15373
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
185 } |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
186 |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
187 static void |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
188 usr_cmd(MsnCmdProc *cmdproc, MsnCommand *cmd) |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
189 { |
30906
ac9035aeb087
Remove dead assignments in new MSN code.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
30877
diff
changeset
|
190 MsnSession *session = cmdproc->session; |
15373
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
191 |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
192 if (!g_ascii_strcasecmp(cmd->params[1], "OK")) |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
193 { |
20394
4a099e4d0d09
propagate from branch 'im.pidgin.pidgin' (head 98b6b547b29ea1192b73cc4e1de1e674edef4328)
Richard Laager <rlaager@wiktel.com>
parents:
16063
diff
changeset
|
194 /* authenticate OK */ |
15373
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
195 msn_session_set_login_step(session, MSN_LOGIN_STEP_SYN); |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
196 } |
23444
25899ec348a4
Patch 2 from Qulogic, this one adds SSO authentication
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
23443
diff
changeset
|
197 else if (!g_ascii_strcasecmp(cmd->params[1], "SSO")) |
15373
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
198 { |
23444
25899ec348a4
Patch 2 from Qulogic, this one adds SSO authentication
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
23443
diff
changeset
|
199 /* RPS authentication */ |
15373
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
200 |
31758
747c5be08e81
Destroy the existing Nexus if we get a second USR SSO. This might
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
31382
diff
changeset
|
201 if (session->nexus) |
747c5be08e81
Destroy the existing Nexus if we get a second USR SSO. This might
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
31382
diff
changeset
|
202 msn_nexus_destroy(session->nexus); |
747c5be08e81
Destroy the existing Nexus if we get a second USR SSO. This might
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
31382
diff
changeset
|
203 |
15373
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
204 session->nexus = msn_nexus_new(session); |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
205 |
23444
25899ec348a4
Patch 2 from Qulogic, this one adds SSO authentication
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
23443
diff
changeset
|
206 session->nexus->policy = g_strdup(cmd->params[3]); |
25899ec348a4
Patch 2 from Qulogic, this one adds SSO authentication
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
23443
diff
changeset
|
207 session->nexus->nonce = g_strdup(cmd->params[4]); |
15373
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
208 |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
209 msn_session_set_login_step(session, MSN_LOGIN_STEP_AUTH_START); |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
210 |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
211 msn_nexus_connect(session->nexus); |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
212 } |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
213 } |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
214 |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
215 static void |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
216 usr_error(MsnCmdProc *cmdproc, MsnTransaction *trans, int error) |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
217 { |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
218 MsnErrorType msnerr = 0; |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
219 |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
220 switch (error) |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
221 { |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
222 case 500: |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
223 case 601: |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
224 case 910: |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
225 case 921: |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
226 msnerr = MSN_ERROR_SERV_UNAVAILABLE; |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
227 break; |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
228 case 911: |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
229 msnerr = MSN_ERROR_AUTH; |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
230 break; |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
231 default: |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
232 return; |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
233 break; |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
234 } |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
235 |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
236 msn_session_set_error(cmdproc->session, msnerr, NULL); |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
237 } |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
238 |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
239 static void |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
240 ver_cmd(MsnCmdProc *cmdproc, MsnCommand *cmd) |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
241 { |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
242 MsnSession *session; |
30709
4d7dfeae29c6
msn: Delete msn_cmdproc_send since it just have duplicated code from
masca@cpw.pidgin.im
parents:
30701
diff
changeset
|
243 MsnTransaction *trans; |
15822 | 244 PurpleAccount *account; |
15373
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
245 gboolean protocol_supported = FALSE; |
30658
ed838ad00173
Fix MSN protocol version detection to use the best version returned by the
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
30657
diff
changeset
|
246 int proto_ver; |
15373
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
247 size_t i; |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
248 |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
249 session = cmdproc->session; |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
250 account = session->account; |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
251 |
30658
ed838ad00173
Fix MSN protocol version detection to use the best version returned by the
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
30657
diff
changeset
|
252 session->protocol_ver = 0; |
15373
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
253 for (i = 1; i < cmd->param_count; i++) |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
254 { |
30658
ed838ad00173
Fix MSN protocol version detection to use the best version returned by the
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
30657
diff
changeset
|
255 if (sscanf(cmd->params[i], "MSNP%d", &proto_ver) == 1) { |
ed838ad00173
Fix MSN protocol version detection to use the best version returned by the
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
30657
diff
changeset
|
256 if (proto_ver >= WLM_MIN_PROTOCOL |
ed838ad00173
Fix MSN protocol version detection to use the best version returned by the
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
30657
diff
changeset
|
257 && proto_ver <= WLM_MAX_PROTOCOL |
ed838ad00173
Fix MSN protocol version detection to use the best version returned by the
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
30657
diff
changeset
|
258 && proto_ver > session->protocol_ver) { |
ed838ad00173
Fix MSN protocol version detection to use the best version returned by the
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
30657
diff
changeset
|
259 protocol_supported = TRUE; |
ed838ad00173
Fix MSN protocol version detection to use the best version returned by the
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
30657
diff
changeset
|
260 session->protocol_ver = proto_ver; |
ed838ad00173
Fix MSN protocol version detection to use the best version returned by the
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
30657
diff
changeset
|
261 } |
15373
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
262 } |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
263 } |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
264 |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
265 if (!protocol_supported) |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
266 { |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
267 msn_session_set_error(session, MSN_ERROR_UNSUPPORTED_PROTOCOL, |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
268 NULL); |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
269 return; |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
270 } |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
271 |
30658
ed838ad00173
Fix MSN protocol version detection to use the best version returned by the
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
30657
diff
changeset
|
272 purple_debug_info("msn", "Negotiated protocol version %d with the server.\n", session->protocol_ver); |
ed838ad00173
Fix MSN protocol version detection to use the best version returned by the
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
30657
diff
changeset
|
273 |
20394
4a099e4d0d09
propagate from branch 'im.pidgin.pidgin' (head 98b6b547b29ea1192b73cc4e1de1e674edef4328)
Richard Laager <rlaager@wiktel.com>
parents:
16063
diff
changeset
|
274 /* |
23464
1ac5faa72c8d
explicit merge of '9d90ebdb7e38fdd77bb504bc3302a083616360d9'
Elliott Sales de Andrade <qulogic@pidgin.im>
diff
changeset
|
275 * Windows Live Messenger 8.5 |
20394
4a099e4d0d09
propagate from branch 'im.pidgin.pidgin' (head 98b6b547b29ea1192b73cc4e1de1e674edef4328)
Richard Laager <rlaager@wiktel.com>
parents:
16063
diff
changeset
|
276 * Notice :CVR String discriminate! |
4a099e4d0d09
propagate from branch 'im.pidgin.pidgin' (head 98b6b547b29ea1192b73cc4e1de1e674edef4328)
Richard Laager <rlaager@wiktel.com>
parents:
16063
diff
changeset
|
277 * reference of http://www.microsoft.com/globaldev/reference/oslocversion.mspx |
4a099e4d0d09
propagate from branch 'im.pidgin.pidgin' (head 98b6b547b29ea1192b73cc4e1de1e674edef4328)
Richard Laager <rlaager@wiktel.com>
parents:
16063
diff
changeset
|
278 * to see the Local ID |
4a099e4d0d09
propagate from branch 'im.pidgin.pidgin' (head 98b6b547b29ea1192b73cc4e1de1e674edef4328)
Richard Laager <rlaager@wiktel.com>
parents:
16063
diff
changeset
|
279 */ |
30709
4d7dfeae29c6
msn: Delete msn_cmdproc_send since it just have duplicated code from
masca@cpw.pidgin.im
parents:
30701
diff
changeset
|
280 trans = msn_transaction_new(cmdproc, "CVR", |
24193
345ed41d807b
Update MSN Client Version (CVR) string to match 8.5.1302.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
24192
diff
changeset
|
281 "0x0409 winnt 5.1 i386 MSNMSGR 8.5.1302 BC01 %s", |
15822 | 282 purple_account_get_username(account)); |
30709
4d7dfeae29c6
msn: Delete msn_cmdproc_send since it just have duplicated code from
masca@cpw.pidgin.im
parents:
30701
diff
changeset
|
283 msn_cmdproc_send_trans(cmdproc, trans); |
15373
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
284 } |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
285 |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
286 /************************************************************************** |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
287 * Log out |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
288 **************************************************************************/ |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
289 |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
290 static void |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
291 out_cmd(MsnCmdProc *cmdproc, MsnCommand *cmd) |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
292 { |
23512
f1ff35d14a95
When receiving an MSN OUT, don't try to dereference cmd->params when
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
23504
diff
changeset
|
293 if (cmd->param_count == 0) |
f1ff35d14a95
When receiving an MSN OUT, don't try to dereference cmd->params when
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
23504
diff
changeset
|
294 msn_session_set_error(cmdproc->session, -1, NULL); |
f1ff35d14a95
When receiving an MSN OUT, don't try to dereference cmd->params when
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
23504
diff
changeset
|
295 else if (!g_ascii_strcasecmp(cmd->params[0], "OTH")) |
15373
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
296 msn_session_set_error(cmdproc->session, MSN_ERROR_SIGN_OTHER, |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
297 NULL); |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
298 else if (!g_ascii_strcasecmp(cmd->params[0], "SSD")) |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
299 msn_session_set_error(cmdproc->session, MSN_ERROR_SERV_DOWN, NULL); |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
300 } |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
301 |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
302 void |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
303 msn_notification_close(MsnNotification *notification) |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
304 { |
30710
f7ee91763c6b
msn: Remove msn_cmdproc_send_quick in favor of msn_cmdproc_send_trans
masca@cpw.pidgin.im
parents:
30709
diff
changeset
|
305 MsnTransaction *trans; |
f7ee91763c6b
msn: Remove msn_cmdproc_send_quick in favor of msn_cmdproc_send_trans
masca@cpw.pidgin.im
parents:
30709
diff
changeset
|
306 |
15373
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
307 g_return_if_fail(notification != NULL); |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
308 |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
309 if (!notification->in_use) |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
310 return; |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
311 |
30715
59cf1be8eaa7
Fix a few little things.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
30711
diff
changeset
|
312 trans = msn_transaction_new(notification->cmdproc, "OUT", NULL); |
30716
c316749944c1
I don't really like this name.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
30715
diff
changeset
|
313 msn_transaction_set_saveable(trans, FALSE); |
30710
f7ee91763c6b
msn: Remove msn_cmdproc_send_quick in favor of msn_cmdproc_send_trans
masca@cpw.pidgin.im
parents:
30709
diff
changeset
|
314 msn_cmdproc_send_trans(notification->cmdproc, trans); |
15373
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
315 |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
316 msn_notification_disconnect(notification); |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
317 } |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
318 |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
319 /************************************************************************** |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
320 * Messages |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
321 **************************************************************************/ |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
322 |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
323 static void |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
324 msg_cmd_post(MsnCmdProc *cmdproc, MsnCommand *cmd, char *payload, |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
325 size_t len) |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
326 { |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
327 MsnMessage *msg; |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
328 |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
329 msg = msn_message_new_from_cmd(cmdproc->session, cmd); |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
330 |
23502
03ade2360ba6
Remove some MSN code duplication in processing messages from Yahoo
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
23498
diff
changeset
|
331 msn_message_parse_payload(msg, payload, len, MSG_LINE_DEM, MSG_BODY_DEM); |
27432
35b6fd563056
Change all MSN_DEBUG_* messages to use the new purple_debug_is_verbose call
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
27137
diff
changeset
|
332 if (purple_debug_is_verbose()) |
35b6fd563056
Change all MSN_DEBUG_* messages to use the new purple_debug_is_verbose call
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
27137
diff
changeset
|
333 msn_message_show_readable(msg, "Notification", TRUE); |
15373
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
334 |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
335 msn_cmdproc_process_msg(cmdproc, msg); |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
336 |
30952
b4285ea42b6e
msn_message_destroy() calls msn_message_unref() if refcount>0. This is
Mark Doliner <mark@kingant.net>
parents:
30935
diff
changeset
|
337 msn_message_unref(msg); |
15373
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
338 } |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
339 |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
340 static void |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
341 msg_cmd(MsnCmdProc *cmdproc, MsnCommand *cmd) |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
342 { |
23519
7bceac816e19
The great MSN debug message cleanup! Threw in a few whitespace fixes,
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
23517
diff
changeset
|
343 purple_debug_info("msn", "Processing MSG... \n"); |
23514
7e16d193bb57
Get rid of that whole msn_set_payload_len thing and correctly set the
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
23512
diff
changeset
|
344 |
15373
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
345 /* NOTE: cmd is not always cmdproc->last_cmd, sometimes cmd is a queued |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
346 * command and we are processing it */ |
23502
03ade2360ba6
Remove some MSN code duplication in processing messages from Yahoo
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
23498
diff
changeset
|
347 if (cmd->payload == NULL) { |
27115
5bc1f2ae4b19
Remove some cosmetic differences between msg_cmd() and ubm_cmd()
Mark Doliner <mark@kingant.net>
parents:
27066
diff
changeset
|
348 cmdproc->last_cmd->payload_cb = msg_cmd_post; |
23514
7e16d193bb57
Get rid of that whole msn_set_payload_len thing and correctly set the
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
23512
diff
changeset
|
349 cmd->payload_len = atoi(cmd->params[2]); |
23502
03ade2360ba6
Remove some MSN code duplication in processing messages from Yahoo
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
23498
diff
changeset
|
350 } else { |
15373
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
351 g_return_if_fail(cmd->payload_cb != NULL); |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
352 |
22832
f62a4a7fe365
Fix a number of leaks. As far as I can tell, MSNP14 now logs in without
Daniel Atallah <daniel.atallah@gmail.com>
parents:
22822
diff
changeset
|
353 #if 0 /* glib on win32 doesn't correctly support precision modifiers for a string */ |
27115
5bc1f2ae4b19
Remove some cosmetic differences between msg_cmd() and ubm_cmd()
Mark Doliner <mark@kingant.net>
parents:
27066
diff
changeset
|
354 purple_debug_info("msn", "MSG payload:{%.*s}\n", (guint)cmd->payload_len, cmd->payload); |
22832
f62a4a7fe365
Fix a number of leaks. As far as I can tell, MSNP14 now logs in without
Daniel Atallah <daniel.atallah@gmail.com>
parents:
22822
diff
changeset
|
355 #endif |
15373
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
356 cmd->payload_cb(cmdproc, cmd, cmd->payload, cmd->payload_len); |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
357 } |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
358 } |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
359 |
20394
4a099e4d0d09
propagate from branch 'im.pidgin.pidgin' (head 98b6b547b29ea1192b73cc4e1de1e674edef4328)
Richard Laager <rlaager@wiktel.com>
parents:
16063
diff
changeset
|
360 /*send Message to Yahoo Messenger*/ |
4a099e4d0d09
propagate from branch 'im.pidgin.pidgin' (head 98b6b547b29ea1192b73cc4e1de1e674edef4328)
Richard Laager <rlaager@wiktel.com>
parents:
16063
diff
changeset
|
361 void |
4a099e4d0d09
propagate from branch 'im.pidgin.pidgin' (head 98b6b547b29ea1192b73cc4e1de1e674edef4328)
Richard Laager <rlaager@wiktel.com>
parents:
16063
diff
changeset
|
362 uum_send_msg(MsnSession *session,MsnMessage *msg) |
4a099e4d0d09
propagate from branch 'im.pidgin.pidgin' (head 98b6b547b29ea1192b73cc4e1de1e674edef4328)
Richard Laager <rlaager@wiktel.com>
parents:
16063
diff
changeset
|
363 { |
4a099e4d0d09
propagate from branch 'im.pidgin.pidgin' (head 98b6b547b29ea1192b73cc4e1de1e674edef4328)
Richard Laager <rlaager@wiktel.com>
parents:
16063
diff
changeset
|
364 MsnCmdProc *cmdproc; |
4a099e4d0d09
propagate from branch 'im.pidgin.pidgin' (head 98b6b547b29ea1192b73cc4e1de1e674edef4328)
Richard Laager <rlaager@wiktel.com>
parents:
16063
diff
changeset
|
365 MsnTransaction *trans; |
4a099e4d0d09
propagate from branch 'im.pidgin.pidgin' (head 98b6b547b29ea1192b73cc4e1de1e674edef4328)
Richard Laager <rlaager@wiktel.com>
parents:
16063
diff
changeset
|
366 char *payload; |
4a099e4d0d09
propagate from branch 'im.pidgin.pidgin' (head 98b6b547b29ea1192b73cc4e1de1e674edef4328)
Richard Laager <rlaager@wiktel.com>
parents:
16063
diff
changeset
|
367 gsize payload_len; |
4a099e4d0d09
propagate from branch 'im.pidgin.pidgin' (head 98b6b547b29ea1192b73cc4e1de1e674edef4328)
Richard Laager <rlaager@wiktel.com>
parents:
16063
diff
changeset
|
368 int type; |
23298
5cdd93dac7a2
Delete trailing whitespace
Mark Doliner <mark@kingant.net>
parents:
22922
diff
changeset
|
369 |
20394
4a099e4d0d09
propagate from branch 'im.pidgin.pidgin' (head 98b6b547b29ea1192b73cc4e1de1e674edef4328)
Richard Laager <rlaager@wiktel.com>
parents:
16063
diff
changeset
|
370 cmdproc = session->notification->cmdproc; |
4a099e4d0d09
propagate from branch 'im.pidgin.pidgin' (head 98b6b547b29ea1192b73cc4e1de1e674edef4328)
Richard Laager <rlaager@wiktel.com>
parents:
16063
diff
changeset
|
371 g_return_if_fail(msg != NULL); |
4a099e4d0d09
propagate from branch 'im.pidgin.pidgin' (head 98b6b547b29ea1192b73cc4e1de1e674edef4328)
Richard Laager <rlaager@wiktel.com>
parents:
16063
diff
changeset
|
372 payload = msn_message_gen_payload(msg, &payload_len); |
23519
7bceac816e19
The great MSN debug message cleanup! Threw in a few whitespace fixes,
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
23517
diff
changeset
|
373 purple_debug_info("msn", |
22822
05cb3f04c01e
This cleans up a bunch of warnings that stem from the fact that size_t and
John Bailey <rekkanoryo@rekkanoryo.org>
parents:
22570
diff
changeset
|
374 "send UUM, payload{%s}, strlen:%" G_GSIZE_FORMAT ", len:%" G_GSIZE_FORMAT "\n", |
05cb3f04c01e
This cleans up a bunch of warnings that stem from the fact that size_t and
John Bailey <rekkanoryo@rekkanoryo.org>
parents:
22570
diff
changeset
|
375 payload, strlen(payload), payload_len); |
20394
4a099e4d0d09
propagate from branch 'im.pidgin.pidgin' (head 98b6b547b29ea1192b73cc4e1de1e674edef4328)
Richard Laager <rlaager@wiktel.com>
parents:
16063
diff
changeset
|
376 type = msg->type; |
22822
05cb3f04c01e
This cleans up a bunch of warnings that stem from the fact that size_t and
John Bailey <rekkanoryo@rekkanoryo.org>
parents:
22570
diff
changeset
|
377 trans = msn_transaction_new(cmdproc, "UUM", "%s 32 %d %" G_GSIZE_FORMAT, |
05cb3f04c01e
This cleans up a bunch of warnings that stem from the fact that size_t and
John Bailey <rekkanoryo@rekkanoryo.org>
parents:
22570
diff
changeset
|
378 msg->remote_user, type, payload_len); |
20394
4a099e4d0d09
propagate from branch 'im.pidgin.pidgin' (head 98b6b547b29ea1192b73cc4e1de1e674edef4328)
Richard Laager <rlaager@wiktel.com>
parents:
16063
diff
changeset
|
379 msn_transaction_set_payload(trans, payload, strlen(payload)); |
4a099e4d0d09
propagate from branch 'im.pidgin.pidgin' (head 98b6b547b29ea1192b73cc4e1de1e674edef4328)
Richard Laager <rlaager@wiktel.com>
parents:
16063
diff
changeset
|
380 msn_cmdproc_send_trans(cmdproc, trans); |
4a099e4d0d09
propagate from branch 'im.pidgin.pidgin' (head 98b6b547b29ea1192b73cc4e1de1e674edef4328)
Richard Laager <rlaager@wiktel.com>
parents:
16063
diff
changeset
|
381 } |
4a099e4d0d09
propagate from branch 'im.pidgin.pidgin' (head 98b6b547b29ea1192b73cc4e1de1e674edef4328)
Richard Laager <rlaager@wiktel.com>
parents:
16063
diff
changeset
|
382 |
4a099e4d0d09
propagate from branch 'im.pidgin.pidgin' (head 98b6b547b29ea1192b73cc4e1de1e674edef4328)
Richard Laager <rlaager@wiktel.com>
parents:
16063
diff
changeset
|
383 /*Yahoo msg process*/ |
4a099e4d0d09
propagate from branch 'im.pidgin.pidgin' (head 98b6b547b29ea1192b73cc4e1de1e674edef4328)
Richard Laager <rlaager@wiktel.com>
parents:
16063
diff
changeset
|
384 static void |
4a099e4d0d09
propagate from branch 'im.pidgin.pidgin' (head 98b6b547b29ea1192b73cc4e1de1e674edef4328)
Richard Laager <rlaager@wiktel.com>
parents:
16063
diff
changeset
|
385 ubm_cmd(MsnCmdProc *cmdproc, MsnCommand *cmd) |
4a099e4d0d09
propagate from branch 'im.pidgin.pidgin' (head 98b6b547b29ea1192b73cc4e1de1e674edef4328)
Richard Laager <rlaager@wiktel.com>
parents:
16063
diff
changeset
|
386 { |
23519
7bceac816e19
The great MSN debug message cleanup! Threw in a few whitespace fixes,
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
23517
diff
changeset
|
387 purple_debug_info("msn", "Processing UBM... \n"); |
23514
7e16d193bb57
Get rid of that whole msn_set_payload_len thing and correctly set the
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
23512
diff
changeset
|
388 |
20394
4a099e4d0d09
propagate from branch 'im.pidgin.pidgin' (head 98b6b547b29ea1192b73cc4e1de1e674edef4328)
Richard Laager <rlaager@wiktel.com>
parents:
16063
diff
changeset
|
389 /* NOTE: cmd is not always cmdproc->last_cmd, sometimes cmd is a queued |
4a099e4d0d09
propagate from branch 'im.pidgin.pidgin' (head 98b6b547b29ea1192b73cc4e1de1e674edef4328)
Richard Laager <rlaager@wiktel.com>
parents:
16063
diff
changeset
|
390 * command and we are processing it */ |
23514
7e16d193bb57
Get rid of that whole msn_set_payload_len thing and correctly set the
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
23512
diff
changeset
|
391 if (cmd->payload == NULL) { |
7e16d193bb57
Get rid of that whole msn_set_payload_len thing and correctly set the
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
23512
diff
changeset
|
392 cmdproc->last_cmd->payload_cb = msg_cmd_post; |
30985
94b3092c904d
Apparently, UBM was updated with more parameters in MSNp16. One is
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
30967
diff
changeset
|
393 if (cmdproc->session->protocol_ver >= 16) |
94b3092c904d
Apparently, UBM was updated with more parameters in MSNp16. One is
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
30967
diff
changeset
|
394 cmd->payload_len = atoi(cmd->params[5]); |
94b3092c904d
Apparently, UBM was updated with more parameters in MSNp16. One is
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
30967
diff
changeset
|
395 else |
94b3092c904d
Apparently, UBM was updated with more parameters in MSNp16. One is
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
30967
diff
changeset
|
396 cmd->payload_len = atoi(cmd->params[3]); |
23502
03ade2360ba6
Remove some MSN code duplication in processing messages from Yahoo
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
23498
diff
changeset
|
397 } else { |
20394
4a099e4d0d09
propagate from branch 'im.pidgin.pidgin' (head 98b6b547b29ea1192b73cc4e1de1e674edef4328)
Richard Laager <rlaager@wiktel.com>
parents:
16063
diff
changeset
|
398 g_return_if_fail(cmd->payload_cb != NULL); |
4a099e4d0d09
propagate from branch 'im.pidgin.pidgin' (head 98b6b547b29ea1192b73cc4e1de1e674edef4328)
Richard Laager <rlaager@wiktel.com>
parents:
16063
diff
changeset
|
399 |
23519
7bceac816e19
The great MSN debug message cleanup! Threw in a few whitespace fixes,
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
23517
diff
changeset
|
400 purple_debug_info("msn", "UBM payload:{%.*s}\n", (guint)(cmd->payload_len), cmd->payload); |
23502
03ade2360ba6
Remove some MSN code duplication in processing messages from Yahoo
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
23498
diff
changeset
|
401 msg_cmd_post(cmdproc, cmd, cmd->payload, cmd->payload_len); |
20394
4a099e4d0d09
propagate from branch 'im.pidgin.pidgin' (head 98b6b547b29ea1192b73cc4e1de1e674edef4328)
Richard Laager <rlaager@wiktel.com>
parents:
16063
diff
changeset
|
402 } |
4a099e4d0d09
propagate from branch 'im.pidgin.pidgin' (head 98b6b547b29ea1192b73cc4e1de1e674edef4328)
Richard Laager <rlaager@wiktel.com>
parents:
16063
diff
changeset
|
403 } |
4a099e4d0d09
propagate from branch 'im.pidgin.pidgin' (head 98b6b547b29ea1192b73cc4e1de1e674edef4328)
Richard Laager <rlaager@wiktel.com>
parents:
16063
diff
changeset
|
404 |
15373
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
405 /************************************************************************** |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
406 * Challenges |
20425
5048651671e1
Revert a bunch of whitespace changes so reviewing a diff against
Stu Tomlinson <stu@nosnilmot.com>
parents:
20422
diff
changeset
|
407 * we use MD5 to caculate the Challenges |
15373
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
408 **************************************************************************/ |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
409 static void |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
410 chl_cmd(MsnCmdProc *cmdproc, MsnCommand *cmd) |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
411 { |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
412 MsnTransaction *trans; |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
413 char buf[33]; |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
414 |
20394
4a099e4d0d09
propagate from branch 'im.pidgin.pidgin' (head 98b6b547b29ea1192b73cc4e1de1e674edef4328)
Richard Laager <rlaager@wiktel.com>
parents:
16063
diff
changeset
|
415 msn_handle_chl(cmd->params[1], buf); |
23443
75be80ddeca5
Patch 1 from Qulogic, this one mostly updates the version sent by pidgin
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
21790
diff
changeset
|
416 trans = msn_transaction_new(cmdproc, "QRY", "%s 32", MSNP15_WLM_PRODUCT_ID); |
15373
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
417 |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
418 msn_transaction_set_payload(trans, buf, 32); |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
419 |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
420 msn_cmdproc_send_trans(cmdproc, trans); |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
421 } |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
422 |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
423 /************************************************************************** |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
424 * Buddy Lists |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
425 **************************************************************************/ |
25633
c384d62009c0
*** Plucked rev b932d4f94f9c771877b6a8a6a1d7dd3ea9c08005 (qulogic@pidgin.im):
Ka-Hing Cheung <khc@hxbc.us>
parents:
25606
diff
changeset
|
426 |
c384d62009c0
*** Plucked rev b932d4f94f9c771877b6a8a6a1d7dd3ea9c08005 (qulogic@pidgin.im):
Ka-Hing Cheung <khc@hxbc.us>
parents:
25606
diff
changeset
|
427 typedef struct MsnFqyCbData { |
c384d62009c0
*** Plucked rev b932d4f94f9c771877b6a8a6a1d7dd3ea9c08005 (qulogic@pidgin.im):
Ka-Hing Cheung <khc@hxbc.us>
parents:
25606
diff
changeset
|
428 MsnFqyCb cb; |
c384d62009c0
*** Plucked rev b932d4f94f9c771877b6a8a6a1d7dd3ea9c08005 (qulogic@pidgin.im):
Ka-Hing Cheung <khc@hxbc.us>
parents:
25606
diff
changeset
|
429 gpointer data; |
c384d62009c0
*** Plucked rev b932d4f94f9c771877b6a8a6a1d7dd3ea9c08005 (qulogic@pidgin.im):
Ka-Hing Cheung <khc@hxbc.us>
parents:
25606
diff
changeset
|
430 } MsnFqyCbData; |
c384d62009c0
*** Plucked rev b932d4f94f9c771877b6a8a6a1d7dd3ea9c08005 (qulogic@pidgin.im):
Ka-Hing Cheung <khc@hxbc.us>
parents:
25606
diff
changeset
|
431 |
20394
4a099e4d0d09
propagate from branch 'im.pidgin.pidgin' (head 98b6b547b29ea1192b73cc4e1de1e674edef4328)
Richard Laager <rlaager@wiktel.com>
parents:
16063
diff
changeset
|
432 /* add contact to xmlnode */ |
20447
18ecdee88ed0
Add Pending list to recognized lists during contact list parsing
Stu Tomlinson <stu@nosnilmot.com>
parents:
20446
diff
changeset
|
433 static void |
30266
3ff6c193efee
The session parameter appears unused in msn_add_contact_xml.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
30151
diff
changeset
|
434 msn_add_contact_xml(xmlnode *mlNode, const char *passport, MsnListOp list_op, MsnNetwork networkId) |
20394
4a099e4d0d09
propagate from branch 'im.pidgin.pidgin' (head 98b6b547b29ea1192b73cc4e1de1e674edef4328)
Richard Laager <rlaager@wiktel.com>
parents:
16063
diff
changeset
|
435 { |
4a099e4d0d09
propagate from branch 'im.pidgin.pidgin' (head 98b6b547b29ea1192b73cc4e1de1e674edef4328)
Richard Laager <rlaager@wiktel.com>
parents:
16063
diff
changeset
|
436 xmlnode *d_node,*c_node; |
4a099e4d0d09
propagate from branch 'im.pidgin.pidgin' (head 98b6b547b29ea1192b73cc4e1de1e674edef4328)
Richard Laager <rlaager@wiktel.com>
parents:
16063
diff
changeset
|
437 char **tokens; |
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:
20514
diff
changeset
|
438 const char *email,*domain; |
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:
20514
diff
changeset
|
439 char fmt_str[3]; |
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:
20514
diff
changeset
|
440 |
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:
20514
diff
changeset
|
441 g_return_if_fail(passport != NULL); |
20394
4a099e4d0d09
propagate from branch 'im.pidgin.pidgin' (head 98b6b547b29ea1192b73cc4e1de1e674edef4328)
Richard Laager <rlaager@wiktel.com>
parents:
16063
diff
changeset
|
442 |
23519
7bceac816e19
The great MSN debug message cleanup! Threw in a few whitespace fixes,
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
23517
diff
changeset
|
443 purple_debug_info("msn", "Passport: %s, type: %d\n", passport, networkId); |
20394
4a099e4d0d09
propagate from branch 'im.pidgin.pidgin' (head 98b6b547b29ea1192b73cc4e1de1e674edef4328)
Richard Laager <rlaager@wiktel.com>
parents:
16063
diff
changeset
|
444 tokens = g_strsplit(passport, "@", 2); |
4a099e4d0d09
propagate from branch 'im.pidgin.pidgin' (head 98b6b547b29ea1192b73cc4e1de1e674edef4328)
Richard Laager <rlaager@wiktel.com>
parents:
16063
diff
changeset
|
445 email = tokens[0]; |
4a099e4d0d09
propagate from branch 'im.pidgin.pidgin' (head 98b6b547b29ea1192b73cc4e1de1e674edef4328)
Richard Laager <rlaager@wiktel.com>
parents:
16063
diff
changeset
|
446 domain = tokens[1]; |
4a099e4d0d09
propagate from branch 'im.pidgin.pidgin' (head 98b6b547b29ea1192b73cc4e1de1e674edef4328)
Richard Laager <rlaager@wiktel.com>
parents:
16063
diff
changeset
|
447 |
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:
20514
diff
changeset
|
448 if (email == NULL || domain == 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:
20514
diff
changeset
|
449 purple_debug_error("msn", "Invalid passport (%s) specified to add to contact xml.\n", passport); |
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:
20514
diff
changeset
|
450 g_strfreev(tokens); |
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:
20514
diff
changeset
|
451 g_return_if_reached(); |
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:
20514
diff
changeset
|
452 } |
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:
20514
diff
changeset
|
453 |
20394
4a099e4d0d09
propagate from branch 'im.pidgin.pidgin' (head 98b6b547b29ea1192b73cc4e1de1e674edef4328)
Richard Laager <rlaager@wiktel.com>
parents:
16063
diff
changeset
|
454 /*find a domain Node*/ |
25542
fd5eedf131b4
Generalize the FQY command so it can be used by different callbacks based
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
25477
diff
changeset
|
455 for (d_node = xmlnode_get_child(mlNode, "d"); d_node; |
fd5eedf131b4
Generalize the FQY command so it can be used by different callbacks based
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
25477
diff
changeset
|
456 d_node = xmlnode_get_next_twin(d_node)) { |
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:
20514
diff
changeset
|
457 const char *attr = xmlnode_get_attrib(d_node,"n"); |
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:
20514
diff
changeset
|
458 if (attr == NULL) |
20394
4a099e4d0d09
propagate from branch 'im.pidgin.pidgin' (head 98b6b547b29ea1192b73cc4e1de1e674edef4328)
Richard Laager <rlaager@wiktel.com>
parents:
16063
diff
changeset
|
459 continue; |
25542
fd5eedf131b4
Generalize the FQY command so it can be used by different callbacks based
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
25477
diff
changeset
|
460 if (!strcmp(attr, domain)) |
20394
4a099e4d0d09
propagate from branch 'im.pidgin.pidgin' (head 98b6b547b29ea1192b73cc4e1de1e674edef4328)
Richard Laager <rlaager@wiktel.com>
parents:
16063
diff
changeset
|
461 break; |
4a099e4d0d09
propagate from branch 'im.pidgin.pidgin' (head 98b6b547b29ea1192b73cc4e1de1e674edef4328)
Richard Laager <rlaager@wiktel.com>
parents:
16063
diff
changeset
|
462 } |
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:
20514
diff
changeset
|
463 |
25542
fd5eedf131b4
Generalize the FQY command so it can be used by different callbacks based
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
25477
diff
changeset
|
464 if (d_node == NULL) { |
20394
4a099e4d0d09
propagate from branch 'im.pidgin.pidgin' (head 98b6b547b29ea1192b73cc4e1de1e674edef4328)
Richard Laager <rlaager@wiktel.com>
parents:
16063
diff
changeset
|
465 /*domain not found, create a new domain Node*/ |
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:
20514
diff
changeset
|
466 purple_debug_info("msn", "Didn't find existing domain node, adding one.\n"); |
20394
4a099e4d0d09
propagate from branch 'im.pidgin.pidgin' (head 98b6b547b29ea1192b73cc4e1de1e674edef4328)
Richard Laager <rlaager@wiktel.com>
parents:
16063
diff
changeset
|
467 d_node = xmlnode_new("d"); |
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:
20514
diff
changeset
|
468 xmlnode_set_attrib(d_node, "n", domain); |
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:
20514
diff
changeset
|
469 xmlnode_insert_child(mlNode, d_node); |
20394
4a099e4d0d09
propagate from branch 'im.pidgin.pidgin' (head 98b6b547b29ea1192b73cc4e1de1e674edef4328)
Richard Laager <rlaager@wiktel.com>
parents:
16063
diff
changeset
|
470 } |
4a099e4d0d09
propagate from branch 'im.pidgin.pidgin' (head 98b6b547b29ea1192b73cc4e1de1e674edef4328)
Richard Laager <rlaager@wiktel.com>
parents:
16063
diff
changeset
|
471 |
4a099e4d0d09
propagate from branch 'im.pidgin.pidgin' (head 98b6b547b29ea1192b73cc4e1de1e674edef4328)
Richard Laager <rlaager@wiktel.com>
parents:
16063
diff
changeset
|
472 /*create contact node*/ |
4a099e4d0d09
propagate from branch 'im.pidgin.pidgin' (head 98b6b547b29ea1192b73cc4e1de1e674edef4328)
Richard Laager <rlaager@wiktel.com>
parents:
16063
diff
changeset
|
473 c_node = xmlnode_new("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.
Daniel Atallah <daniel.atallah@gmail.com>
parents:
20514
diff
changeset
|
474 xmlnode_set_attrib(c_node, "n", email); |
20394
4a099e4d0d09
propagate from branch 'im.pidgin.pidgin' (head 98b6b547b29ea1192b73cc4e1de1e674edef4328)
Richard Laager <rlaager@wiktel.com>
parents:
16063
diff
changeset
|
475 |
25542
fd5eedf131b4
Generalize the FQY command so it can be used by different callbacks based
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
25477
diff
changeset
|
476 if (list_op != 0) { |
fd5eedf131b4
Generalize the FQY command so it can be used by different callbacks based
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
25477
diff
changeset
|
477 purple_debug_info("msn", "list_op: %d\n", list_op); |
fd5eedf131b4
Generalize the FQY command so it can be used by different callbacks based
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
25477
diff
changeset
|
478 g_snprintf(fmt_str, sizeof(fmt_str), "%d", list_op); |
fd5eedf131b4
Generalize the FQY command so it can be used by different callbacks based
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
25477
diff
changeset
|
479 xmlnode_set_attrib(c_node, "l", fmt_str); |
fd5eedf131b4
Generalize the FQY command so it can be used by different callbacks based
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
25477
diff
changeset
|
480 } |
20447
18ecdee88ed0
Add Pending list to recognized lists during contact list parsing
Stu Tomlinson <stu@nosnilmot.com>
parents:
20446
diff
changeset
|
481 |
25542
fd5eedf131b4
Generalize the FQY command so it can be used by different callbacks based
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
25477
diff
changeset
|
482 if (networkId != MSN_NETWORK_UNKNOWN) { |
23478
31b5a1334e7e
Modifications to the MSN code for some stuff I'll be doing in later
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
23477
diff
changeset
|
483 g_snprintf(fmt_str, sizeof(fmt_str), "%d", networkId); |
25542
fd5eedf131b4
Generalize the FQY command so it can be used by different callbacks based
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
25477
diff
changeset
|
484 /*mobile*/ |
fd5eedf131b4
Generalize the FQY command so it can be used by different callbacks based
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
25477
diff
changeset
|
485 /*type_str = g_strdup_printf("4");*/ |
fd5eedf131b4
Generalize the FQY command so it can be used by different callbacks based
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
25477
diff
changeset
|
486 xmlnode_set_attrib(c_node, "t", fmt_str); |
fd5eedf131b4
Generalize the FQY command so it can be used by different callbacks based
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
25477
diff
changeset
|
487 } |
20447
18ecdee88ed0
Add Pending list to recognized lists during contact list parsing
Stu Tomlinson <stu@nosnilmot.com>
parents:
20446
diff
changeset
|
488 |
20394
4a099e4d0d09
propagate from branch 'im.pidgin.pidgin' (head 98b6b547b29ea1192b73cc4e1de1e674edef4328)
Richard Laager <rlaager@wiktel.com>
parents:
16063
diff
changeset
|
489 xmlnode_insert_child(d_node, c_node); |
4a099e4d0d09
propagate from branch 'im.pidgin.pidgin' (head 98b6b547b29ea1192b73cc4e1de1e674edef4328)
Richard Laager <rlaager@wiktel.com>
parents:
16063
diff
changeset
|
490 |
20439
bee467c81570
A bunch of MSNP14 stuff:
Stu Tomlinson <stu@nosnilmot.com>
parents:
20432
diff
changeset
|
491 g_strfreev(tokens); |
20394
4a099e4d0d09
propagate from branch 'im.pidgin.pidgin' (head 98b6b547b29ea1192b73cc4e1de1e674edef4328)
Richard Laager <rlaager@wiktel.com>
parents:
16063
diff
changeset
|
492 } |
15373
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
493 |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
494 static void |
20414
76e736b59aa4
fixes #971, we can only ADL 150 contacts at a time or the notification
Ka-Hing Cheung <khc@hxbc.us>
parents:
20410
diff
changeset
|
495 msn_notification_post_adl(MsnCmdProc *cmdproc, const char *payload, int payload_len) |
15373
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
496 { |
20394
4a099e4d0d09
propagate from branch 'im.pidgin.pidgin' (head 98b6b547b29ea1192b73cc4e1de1e674edef4328)
Richard Laager <rlaager@wiktel.com>
parents:
16063
diff
changeset
|
497 MsnTransaction *trans; |
23519
7bceac816e19
The great MSN debug message cleanup! Threw in a few whitespace fixes,
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
23517
diff
changeset
|
498 purple_debug_info("msn", "Sending ADL with payload: %s\n", payload); |
23465
1d97298ccff5
Fix up some merge errors in MSN's notification.c. Darn meld...
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
23464
diff
changeset
|
499 trans = msn_transaction_new(cmdproc, "ADL", "%i", payload_len); |
22832
f62a4a7fe365
Fix a number of leaks. As far as I can tell, MSNP14 now logs in without
Daniel Atallah <daniel.atallah@gmail.com>
parents:
22822
diff
changeset
|
500 msn_transaction_set_payload(trans, payload, payload_len); |
20394
4a099e4d0d09
propagate from branch 'im.pidgin.pidgin' (head 98b6b547b29ea1192b73cc4e1de1e674edef4328)
Richard Laager <rlaager@wiktel.com>
parents:
16063
diff
changeset
|
501 msn_cmdproc_send_trans(cmdproc, trans); |
4a099e4d0d09
propagate from branch 'im.pidgin.pidgin' (head 98b6b547b29ea1192b73cc4e1de1e674edef4328)
Richard Laager <rlaager@wiktel.com>
parents:
16063
diff
changeset
|
502 } |
4a099e4d0d09
propagate from branch 'im.pidgin.pidgin' (head 98b6b547b29ea1192b73cc4e1de1e674edef4328)
Richard Laager <rlaager@wiktel.com>
parents:
16063
diff
changeset
|
503 |
25633
c384d62009c0
*** Plucked rev b932d4f94f9c771877b6a8a6a1d7dd3ea9c08005 (qulogic@pidgin.im):
Ka-Hing Cheung <khc@hxbc.us>
parents:
25606
diff
changeset
|
504 static void |
c384d62009c0
*** Plucked rev b932d4f94f9c771877b6a8a6a1d7dd3ea9c08005 (qulogic@pidgin.im):
Ka-Hing Cheung <khc@hxbc.us>
parents:
25606
diff
changeset
|
505 msn_notification_post_rml(MsnCmdProc *cmdproc, const char *payload, int payload_len) |
c384d62009c0
*** Plucked rev b932d4f94f9c771877b6a8a6a1d7dd3ea9c08005 (qulogic@pidgin.im):
Ka-Hing Cheung <khc@hxbc.us>
parents:
25606
diff
changeset
|
506 { |
c384d62009c0
*** Plucked rev b932d4f94f9c771877b6a8a6a1d7dd3ea9c08005 (qulogic@pidgin.im):
Ka-Hing Cheung <khc@hxbc.us>
parents:
25606
diff
changeset
|
507 MsnTransaction *trans; |
c384d62009c0
*** Plucked rev b932d4f94f9c771877b6a8a6a1d7dd3ea9c08005 (qulogic@pidgin.im):
Ka-Hing Cheung <khc@hxbc.us>
parents:
25606
diff
changeset
|
508 purple_debug_info("msn", "Sending RML with payload: %s\n", payload); |
c384d62009c0
*** Plucked rev b932d4f94f9c771877b6a8a6a1d7dd3ea9c08005 (qulogic@pidgin.im):
Ka-Hing Cheung <khc@hxbc.us>
parents:
25606
diff
changeset
|
509 trans = msn_transaction_new(cmdproc, "RML", "%i", payload_len); |
c384d62009c0
*** Plucked rev b932d4f94f9c771877b6a8a6a1d7dd3ea9c08005 (qulogic@pidgin.im):
Ka-Hing Cheung <khc@hxbc.us>
parents:
25606
diff
changeset
|
510 msn_transaction_set_payload(trans, payload, payload_len); |
c384d62009c0
*** Plucked rev b932d4f94f9c771877b6a8a6a1d7dd3ea9c08005 (qulogic@pidgin.im):
Ka-Hing Cheung <khc@hxbc.us>
parents:
25606
diff
changeset
|
511 msn_cmdproc_send_trans(cmdproc, trans); |
c384d62009c0
*** Plucked rev b932d4f94f9c771877b6a8a6a1d7dd3ea9c08005 (qulogic@pidgin.im):
Ka-Hing Cheung <khc@hxbc.us>
parents:
25606
diff
changeset
|
512 } |
c384d62009c0
*** Plucked rev b932d4f94f9c771877b6a8a6a1d7dd3ea9c08005 (qulogic@pidgin.im):
Ka-Hing Cheung <khc@hxbc.us>
parents:
25606
diff
changeset
|
513 |
25542
fd5eedf131b4
Generalize the FQY command so it can be used by different callbacks based
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
25477
diff
changeset
|
514 void |
fd5eedf131b4
Generalize the FQY command so it can be used by different callbacks based
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
25477
diff
changeset
|
515 msn_notification_send_fqy(MsnSession *session, |
fd5eedf131b4
Generalize the FQY command so it can be used by different callbacks based
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
25477
diff
changeset
|
516 const char *payload, int payload_len, |
25633
c384d62009c0
*** Plucked rev b932d4f94f9c771877b6a8a6a1d7dd3ea9c08005 (qulogic@pidgin.im):
Ka-Hing Cheung <khc@hxbc.us>
parents:
25606
diff
changeset
|
517 MsnFqyCb cb, |
c384d62009c0
*** Plucked rev b932d4f94f9c771877b6a8a6a1d7dd3ea9c08005 (qulogic@pidgin.im):
Ka-Hing Cheung <khc@hxbc.us>
parents:
25606
diff
changeset
|
518 gpointer cb_data) |
25542
fd5eedf131b4
Generalize the FQY command so it can be used by different callbacks based
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
25477
diff
changeset
|
519 { |
fd5eedf131b4
Generalize the FQY command so it can be used by different callbacks based
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
25477
diff
changeset
|
520 MsnTransaction *trans; |
fd5eedf131b4
Generalize the FQY command so it can be used by different callbacks based
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
25477
diff
changeset
|
521 MsnCmdProc *cmdproc; |
25633
c384d62009c0
*** Plucked rev b932d4f94f9c771877b6a8a6a1d7dd3ea9c08005 (qulogic@pidgin.im):
Ka-Hing Cheung <khc@hxbc.us>
parents:
25606
diff
changeset
|
522 MsnFqyCbData *data; |
25542
fd5eedf131b4
Generalize the FQY command so it can be used by different callbacks based
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
25477
diff
changeset
|
523 |
fd5eedf131b4
Generalize the FQY command so it can be used by different callbacks based
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
25477
diff
changeset
|
524 cmdproc = session->notification->cmdproc; |
fd5eedf131b4
Generalize the FQY command so it can be used by different callbacks based
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
25477
diff
changeset
|
525 |
25633
c384d62009c0
*** Plucked rev b932d4f94f9c771877b6a8a6a1d7dd3ea9c08005 (qulogic@pidgin.im):
Ka-Hing Cheung <khc@hxbc.us>
parents:
25606
diff
changeset
|
526 data = g_new(MsnFqyCbData, 1); |
c384d62009c0
*** Plucked rev b932d4f94f9c771877b6a8a6a1d7dd3ea9c08005 (qulogic@pidgin.im):
Ka-Hing Cheung <khc@hxbc.us>
parents:
25606
diff
changeset
|
527 data->cb = cb; |
c384d62009c0
*** Plucked rev b932d4f94f9c771877b6a8a6a1d7dd3ea9c08005 (qulogic@pidgin.im):
Ka-Hing Cheung <khc@hxbc.us>
parents:
25606
diff
changeset
|
528 data->data = cb_data; |
c384d62009c0
*** Plucked rev b932d4f94f9c771877b6a8a6a1d7dd3ea9c08005 (qulogic@pidgin.im):
Ka-Hing Cheung <khc@hxbc.us>
parents:
25606
diff
changeset
|
529 |
25542
fd5eedf131b4
Generalize the FQY command so it can be used by different callbacks based
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
25477
diff
changeset
|
530 trans = msn_transaction_new(cmdproc, "FQY", "%d", payload_len); |
fd5eedf131b4
Generalize the FQY command so it can be used by different callbacks based
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
25477
diff
changeset
|
531 msn_transaction_set_payload(trans, payload, payload_len); |
28353
6a23d7f84143
Allow setting a destroy-function for the data. Fixes a leak.
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
28346
diff
changeset
|
532 msn_transaction_set_data(trans, data); |
6a23d7f84143
Allow setting a destroy-function for the data. Fixes a leak.
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
28346
diff
changeset
|
533 msn_transaction_set_data_free(trans, g_free); |
25542
fd5eedf131b4
Generalize the FQY command so it can be used by different callbacks based
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
25477
diff
changeset
|
534 msn_cmdproc_send_trans(cmdproc, trans); |
fd5eedf131b4
Generalize the FQY command so it can be used by different callbacks based
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
25477
diff
changeset
|
535 } |
fd5eedf131b4
Generalize the FQY command so it can be used by different callbacks based
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
25477
diff
changeset
|
536 |
fd5eedf131b4
Generalize the FQY command so it can be used by different callbacks based
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
25477
diff
changeset
|
537 static void |
25633
c384d62009c0
*** Plucked rev b932d4f94f9c771877b6a8a6a1d7dd3ea9c08005 (qulogic@pidgin.im):
Ka-Hing Cheung <khc@hxbc.us>
parents:
25606
diff
changeset
|
538 update_contact_network(MsnSession *session, const char *passport, MsnNetwork network, gpointer unused) |
25542
fd5eedf131b4
Generalize the FQY command so it can be used by different callbacks based
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
25477
diff
changeset
|
539 { |
25601
1a1765a87336
More MSN fixes to go along with f0df27a299120baecf9ea88a9fb24ffe1dbe72fd:
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
25582
diff
changeset
|
540 MsnUser *user; |
1a1765a87336
More MSN fixes to go along with f0df27a299120baecf9ea88a9fb24ffe1dbe72fd:
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
25582
diff
changeset
|
541 |
1a1765a87336
More MSN fixes to go along with f0df27a299120baecf9ea88a9fb24ffe1dbe72fd:
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
25582
diff
changeset
|
542 if (network == MSN_NETWORK_UNKNOWN) |
1a1765a87336
More MSN fixes to go along with f0df27a299120baecf9ea88a9fb24ffe1dbe72fd:
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
25582
diff
changeset
|
543 { |
1a1765a87336
More MSN fixes to go along with f0df27a299120baecf9ea88a9fb24ffe1dbe72fd:
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
25582
diff
changeset
|
544 purple_debug_warning("msn", |
1a1765a87336
More MSN fixes to go along with f0df27a299120baecf9ea88a9fb24ffe1dbe72fd:
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
25582
diff
changeset
|
545 "Ignoring user %s about which server knows nothing.\n", |
1a1765a87336
More MSN fixes to go along with f0df27a299120baecf9ea88a9fb24ffe1dbe72fd:
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
25582
diff
changeset
|
546 passport); |
25603
14abfec55b1d
Darnit, one more MSN fix:
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
25601
diff
changeset
|
547 /* Decrement the count for unknown results so that we'll continue login. |
14abfec55b1d
Darnit, one more MSN fix:
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
25601
diff
changeset
|
548 Also, need to finish the login process here as well, because ADL OK |
14abfec55b1d
Darnit, one more MSN fix:
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
25601
diff
changeset
|
549 will not be called. */ |
28065
7cebd7602c6e
This seems to not work every once in a while, so put in some code under the
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
28064
diff
changeset
|
550 if (purple_debug_is_verbose()) |
7cebd7602c6e
This seems to not work every once in a while, so put in some code under the
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
28064
diff
changeset
|
551 purple_debug_info("msn", "ADL/FQY count is %d\n", session->adl_fqy); |
25603
14abfec55b1d
Darnit, one more MSN fix:
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
25601
diff
changeset
|
552 if (--session->adl_fqy == 0) |
14abfec55b1d
Darnit, one more MSN fix:
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
25601
diff
changeset
|
553 msn_session_finish_login(session); |
25601
1a1765a87336
More MSN fixes to go along with f0df27a299120baecf9ea88a9fb24ffe1dbe72fd:
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
25582
diff
changeset
|
554 return; |
1a1765a87336
More MSN fixes to go along with f0df27a299120baecf9ea88a9fb24ffe1dbe72fd:
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
25582
diff
changeset
|
555 } |
1a1765a87336
More MSN fixes to go along with f0df27a299120baecf9ea88a9fb24ffe1dbe72fd:
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
25582
diff
changeset
|
556 |
25542
fd5eedf131b4
Generalize the FQY command so it can be used by different callbacks based
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
25477
diff
changeset
|
557 /* TODO: Also figure out how to update membership lists */ |
25601
1a1765a87336
More MSN fixes to go along with f0df27a299120baecf9ea88a9fb24ffe1dbe72fd:
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
25582
diff
changeset
|
558 user = msn_userlist_find_user(session->userlist, passport); |
25542
fd5eedf131b4
Generalize the FQY command so it can be used by different callbacks based
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
25477
diff
changeset
|
559 if (user) { |
fd5eedf131b4
Generalize the FQY command so it can be used by different callbacks based
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
25477
diff
changeset
|
560 xmlnode *adl_node; |
fd5eedf131b4
Generalize the FQY command so it can be used by different callbacks based
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
25477
diff
changeset
|
561 char *payload; |
fd5eedf131b4
Generalize the FQY command so it can be used by different callbacks based
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
25477
diff
changeset
|
562 int payload_len; |
fd5eedf131b4
Generalize the FQY command so it can be used by different callbacks based
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
25477
diff
changeset
|
563 |
fd5eedf131b4
Generalize the FQY command so it can be used by different callbacks based
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
25477
diff
changeset
|
564 msn_user_set_network(user, network); |
fd5eedf131b4
Generalize the FQY command so it can be used by different callbacks based
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
25477
diff
changeset
|
565 |
fd5eedf131b4
Generalize the FQY command so it can be used by different callbacks based
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
25477
diff
changeset
|
566 adl_node = xmlnode_new("ml"); |
fd5eedf131b4
Generalize the FQY command so it can be used by different callbacks based
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
25477
diff
changeset
|
567 xmlnode_set_attrib(adl_node, "l", "1"); |
30266
3ff6c193efee
The session parameter appears unused in msn_add_contact_xml.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
30151
diff
changeset
|
568 msn_add_contact_xml(adl_node, passport, |
3ff6c193efee
The session parameter appears unused in msn_add_contact_xml.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
30151
diff
changeset
|
569 user->list_op & MSN_LIST_OP_MASK, network); |
25542
fd5eedf131b4
Generalize the FQY command so it can be used by different callbacks based
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
25477
diff
changeset
|
570 payload = xmlnode_to_str(adl_node, &payload_len); |
fd5eedf131b4
Generalize the FQY command so it can be used by different callbacks based
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
25477
diff
changeset
|
571 msn_notification_post_adl(session->notification->cmdproc, payload, payload_len); |
28341 | 572 g_free(payload); |
31806
49d6ee09c74d
Fix a leak found by HanzZ.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
31758
diff
changeset
|
573 xmlnode_free(adl_node); |
25542
fd5eedf131b4
Generalize the FQY command so it can be used by different callbacks based
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
25477
diff
changeset
|
574 } else { |
fd5eedf131b4
Generalize the FQY command so it can be used by different callbacks based
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
25477
diff
changeset
|
575 purple_debug_error("msn", |
25575
d51b8647d43c
applied changes from 70fa4cc384b7643ab1f296bdc2399bc208542a20
Ethan Blanton <elb@pidgin.im>
parents:
25542
diff
changeset
|
576 "Got FQY update for unknown user %s on network %d.\n", |
25542
fd5eedf131b4
Generalize the FQY command so it can be used by different callbacks based
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
25477
diff
changeset
|
577 passport, network); |
fd5eedf131b4
Generalize the FQY command so it can be used by different callbacks based
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
25477
diff
changeset
|
578 } |
fd5eedf131b4
Generalize the FQY command so it can be used by different callbacks based
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
25477
diff
changeset
|
579 } |
fd5eedf131b4
Generalize the FQY command so it can be used by different callbacks based
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
25477
diff
changeset
|
580 |
20394
4a099e4d0d09
propagate from branch 'im.pidgin.pidgin' (head 98b6b547b29ea1192b73cc4e1de1e674edef4328)
Richard Laager <rlaager@wiktel.com>
parents:
16063
diff
changeset
|
581 /*dump contact info to NS*/ |
4a099e4d0d09
propagate from branch 'im.pidgin.pidgin' (head 98b6b547b29ea1192b73cc4e1de1e674edef4328)
Richard Laager <rlaager@wiktel.com>
parents:
16063
diff
changeset
|
582 void |
4a099e4d0d09
propagate from branch 'im.pidgin.pidgin' (head 98b6b547b29ea1192b73cc4e1de1e674edef4328)
Richard Laager <rlaager@wiktel.com>
parents:
16063
diff
changeset
|
583 msn_notification_dump_contact(MsnSession *session) |
4a099e4d0d09
propagate from branch 'im.pidgin.pidgin' (head 98b6b547b29ea1192b73cc4e1de1e674edef4328)
Richard Laager <rlaager@wiktel.com>
parents:
16063
diff
changeset
|
584 { |
15373
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
585 MsnUser *user; |
20394
4a099e4d0d09
propagate from branch 'im.pidgin.pidgin' (head 98b6b547b29ea1192b73cc4e1de1e674edef4328)
Richard Laager <rlaager@wiktel.com>
parents:
16063
diff
changeset
|
586 GList *l; |
4a099e4d0d09
propagate from branch 'im.pidgin.pidgin' (head 98b6b547b29ea1192b73cc4e1de1e674edef4328)
Richard Laager <rlaager@wiktel.com>
parents:
16063
diff
changeset
|
587 xmlnode *adl_node; |
25542
fd5eedf131b4
Generalize the FQY command so it can be used by different callbacks based
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
25477
diff
changeset
|
588 xmlnode *fqy_node; |
20394
4a099e4d0d09
propagate from branch 'im.pidgin.pidgin' (head 98b6b547b29ea1192b73cc4e1de1e674edef4328)
Richard Laager <rlaager@wiktel.com>
parents:
16063
diff
changeset
|
589 char *payload; |
4a099e4d0d09
propagate from branch 'im.pidgin.pidgin' (head 98b6b547b29ea1192b73cc4e1de1e674edef4328)
Richard Laager <rlaager@wiktel.com>
parents:
16063
diff
changeset
|
590 int payload_len; |
20414
76e736b59aa4
fixes #971, we can only ADL 150 contacts at a time or the notification
Ka-Hing Cheung <khc@hxbc.us>
parents:
20410
diff
changeset
|
591 int adl_count = 0; |
25542
fd5eedf131b4
Generalize the FQY command so it can be used by different callbacks based
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
25477
diff
changeset
|
592 int fqy_count = 0; |
29894
ec89b1d8571a
Implement [gs]et_public_alias in MSN.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
29761
diff
changeset
|
593 PurpleConnection *pc; |
20394
4a099e4d0d09
propagate from branch 'im.pidgin.pidgin' (head 98b6b547b29ea1192b73cc4e1de1e674edef4328)
Richard Laager <rlaager@wiktel.com>
parents:
16063
diff
changeset
|
594 const char *display_name; |
4a099e4d0d09
propagate from branch 'im.pidgin.pidgin' (head 98b6b547b29ea1192b73cc4e1de1e674edef4328)
Richard Laager <rlaager@wiktel.com>
parents:
16063
diff
changeset
|
595 |
4a099e4d0d09
propagate from branch 'im.pidgin.pidgin' (head 98b6b547b29ea1192b73cc4e1de1e674edef4328)
Richard Laager <rlaager@wiktel.com>
parents:
16063
diff
changeset
|
596 adl_node = xmlnode_new("ml"); |
4a099e4d0d09
propagate from branch 'im.pidgin.pidgin' (head 98b6b547b29ea1192b73cc4e1de1e674edef4328)
Richard Laager <rlaager@wiktel.com>
parents:
16063
diff
changeset
|
597 adl_node->child = NULL; |
4a099e4d0d09
propagate from branch 'im.pidgin.pidgin' (head 98b6b547b29ea1192b73cc4e1de1e674edef4328)
Richard Laager <rlaager@wiktel.com>
parents:
16063
diff
changeset
|
598 xmlnode_set_attrib(adl_node, "l", "1"); |
25542
fd5eedf131b4
Generalize the FQY command so it can be used by different callbacks based
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
25477
diff
changeset
|
599 fqy_node = xmlnode_new("ml"); |
20477
9a2a4a0c0003
Add the possibility to create an Address Book, useful for newly registered MSN users.
Carlos Silva <typ0@pidgin.im>
parents:
20474
diff
changeset
|
600 |
20394
4a099e4d0d09
propagate from branch 'im.pidgin.pidgin' (head 98b6b547b29ea1192b73cc4e1de1e674edef4328)
Richard Laager <rlaager@wiktel.com>
parents:
16063
diff
changeset
|
601 /*get the userlist*/ |
23938
b9d4d8a77fef
disapproval of revision 'd50e4b01c210ebbcd8f8d5a001fa72450e021a97'
Ka-Hing Cheung <khc@hxbc.us>
parents:
23937
diff
changeset
|
602 for (l = session->userlist->users; l != NULL; l = l->next) { |
20394
4a099e4d0d09
propagate from branch 'im.pidgin.pidgin' (head 98b6b547b29ea1192b73cc4e1de1e674edef4328)
Richard Laager <rlaager@wiktel.com>
parents:
16063
diff
changeset
|
603 user = l->data; |
20447
18ecdee88ed0
Add Pending list to recognized lists during contact list parsing
Stu Tomlinson <stu@nosnilmot.com>
parents:
20446
diff
changeset
|
604 |
18ecdee88ed0
Add Pending list to recognized lists during contact list parsing
Stu Tomlinson <stu@nosnilmot.com>
parents:
20446
diff
changeset
|
605 /* skip RL & PL during initial dump */ |
18ecdee88ed0
Add Pending list to recognized lists during contact list parsing
Stu Tomlinson <stu@nosnilmot.com>
parents:
20446
diff
changeset
|
606 if (!(user->list_op & MSN_LIST_OP_MASK)) |
18ecdee88ed0
Add Pending list to recognized lists during contact list parsing
Stu Tomlinson <stu@nosnilmot.com>
parents:
20446
diff
changeset
|
607 continue; |
18ecdee88ed0
Add Pending list to recognized lists during contact list parsing
Stu Tomlinson <stu@nosnilmot.com>
parents:
20446
diff
changeset
|
608 |
24229
e93ca60b97dc
References #6907, wrap a NULL check
Ka-Hing Cheung <khc@hxbc.us>
parents:
24228
diff
changeset
|
609 if (user->passport && !strcmp(user->passport, "messenger@microsoft.com")) |
23938
b9d4d8a77fef
disapproval of revision 'd50e4b01c210ebbcd8f8d5a001fa72450e021a97'
Ka-Hing Cheung <khc@hxbc.us>
parents:
23937
diff
changeset
|
610 continue; |
b9d4d8a77fef
disapproval of revision 'd50e4b01c210ebbcd8f8d5a001fa72450e021a97'
Ka-Hing Cheung <khc@hxbc.us>
parents:
23937
diff
changeset
|
611 |
25582
7ea04b53f553
Pluck the MSN bug fixes.
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
25575
diff
changeset
|
612 if ((user->list_op & MSN_LIST_OP_MASK & ~MSN_LIST_FL_OP) |
7ea04b53f553
Pluck the MSN bug fixes.
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
25575
diff
changeset
|
613 == (MSN_LIST_AL_OP | MSN_LIST_BL_OP)) { |
25477
9398f0f2cdc6
Buddies on both the Allow and Block list are now automatically removed from
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
25460
diff
changeset
|
614 /* The server will complain if we send it a user on both the |
9398f0f2cdc6
Buddies on both the Allow and Block list are now automatically removed from
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
25460
diff
changeset
|
615 Allow and Block lists. So assume they're on the Block list |
9398f0f2cdc6
Buddies on both the Allow and Block list are now automatically removed from
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
25460
diff
changeset
|
616 and remove them from the Allow list in the membership lists to |
9398f0f2cdc6
Buddies on both the Allow and Block list are now automatically removed from
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
25460
diff
changeset
|
617 stop this from happening again. */ |
9398f0f2cdc6
Buddies on both the Allow and Block list are now automatically removed from
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
25460
diff
changeset
|
618 purple_debug_warning("msn", |
25582
7ea04b53f553
Pluck the MSN bug fixes.
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
25575
diff
changeset
|
619 "User %s is on both Allow and Block list; " |
25477
9398f0f2cdc6
Buddies on both the Allow and Block list are now automatically removed from
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
25460
diff
changeset
|
620 "removing from Allow list.\n", |
9398f0f2cdc6
Buddies on both the Allow and Block list are now automatically removed from
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
25460
diff
changeset
|
621 user->passport); |
28470
dd5026ca598a
When restricting a buddy on both the Allow and Block lists to just one
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
28467
diff
changeset
|
622 msn_user_unset_op(user, MSN_LIST_AL_OP); |
25477
9398f0f2cdc6
Buddies on both the Allow and Block list are now automatically removed from
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
25460
diff
changeset
|
623 } |
9398f0f2cdc6
Buddies on both the Allow and Block list are now automatically removed from
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
25460
diff
changeset
|
624 |
25542
fd5eedf131b4
Generalize the FQY command so it can be used by different callbacks based
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
25477
diff
changeset
|
625 if (user->networkid != MSN_NETWORK_UNKNOWN) { |
30266
3ff6c193efee
The session parameter appears unused in msn_add_contact_xml.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
30151
diff
changeset
|
626 msn_add_contact_xml(adl_node, user->passport, |
3ff6c193efee
The session parameter appears unused in msn_add_contact_xml.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
30151
diff
changeset
|
627 user->list_op & MSN_LIST_OP_MASK, |
3ff6c193efee
The session parameter appears unused in msn_add_contact_xml.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
30151
diff
changeset
|
628 user->networkid); |
20414
76e736b59aa4
fixes #971, we can only ADL 150 contacts at a time or the notification
Ka-Hing Cheung <khc@hxbc.us>
parents:
20410
diff
changeset
|
629 |
25542
fd5eedf131b4
Generalize the FQY command so it can be used by different callbacks based
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
25477
diff
changeset
|
630 /* each ADL command may contain up to 150 contacts */ |
fd5eedf131b4
Generalize the FQY command so it can be used by different callbacks based
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
25477
diff
changeset
|
631 if (++adl_count % 150 == 0) { |
fd5eedf131b4
Generalize the FQY command so it can be used by different callbacks based
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
25477
diff
changeset
|
632 payload = xmlnode_to_str(adl_node, &payload_len); |
20414
76e736b59aa4
fixes #971, we can only ADL 150 contacts at a time or the notification
Ka-Hing Cheung <khc@hxbc.us>
parents:
20410
diff
changeset
|
633 |
25575
d51b8647d43c
applied changes from 70fa4cc384b7643ab1f296bdc2399bc208542a20
Ethan Blanton <elb@pidgin.im>
parents:
25542
diff
changeset
|
634 /* ADL's are returned all-together */ |
d51b8647d43c
applied changes from 70fa4cc384b7643ab1f296bdc2399bc208542a20
Ethan Blanton <elb@pidgin.im>
parents:
25542
diff
changeset
|
635 session->adl_fqy++; |
28065
7cebd7602c6e
This seems to not work every once in a while, so put in some code under the
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
28064
diff
changeset
|
636 if (purple_debug_is_verbose()) |
7cebd7602c6e
This seems to not work every once in a while, so put in some code under the
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
28064
diff
changeset
|
637 purple_debug_info("msn", "Posting ADL, count is %d\n", |
7cebd7602c6e
This seems to not work every once in a while, so put in some code under the
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
28064
diff
changeset
|
638 session->adl_fqy); |
25575
d51b8647d43c
applied changes from 70fa4cc384b7643ab1f296bdc2399bc208542a20
Ethan Blanton <elb@pidgin.im>
parents:
25542
diff
changeset
|
639 |
25542
fd5eedf131b4
Generalize the FQY command so it can be used by different callbacks based
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
25477
diff
changeset
|
640 msn_notification_post_adl(session->notification->cmdproc, |
fd5eedf131b4
Generalize the FQY command so it can be used by different callbacks based
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
25477
diff
changeset
|
641 payload, payload_len); |
20414
76e736b59aa4
fixes #971, we can only ADL 150 contacts at a time or the notification
Ka-Hing Cheung <khc@hxbc.us>
parents:
20410
diff
changeset
|
642 |
25542
fd5eedf131b4
Generalize the FQY command so it can be used by different callbacks based
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
25477
diff
changeset
|
643 g_free(payload); |
fd5eedf131b4
Generalize the FQY command so it can be used by different callbacks based
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
25477
diff
changeset
|
644 xmlnode_free(adl_node); |
fd5eedf131b4
Generalize the FQY command so it can be used by different callbacks based
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
25477
diff
changeset
|
645 |
20414
76e736b59aa4
fixes #971, we can only ADL 150 contacts at a time or the notification
Ka-Hing Cheung <khc@hxbc.us>
parents:
20410
diff
changeset
|
646 adl_node = xmlnode_new("ml"); |
76e736b59aa4
fixes #971, we can only ADL 150 contacts at a time or the notification
Ka-Hing Cheung <khc@hxbc.us>
parents:
20410
diff
changeset
|
647 adl_node->child = NULL; |
76e736b59aa4
fixes #971, we can only ADL 150 contacts at a time or the notification
Ka-Hing Cheung <khc@hxbc.us>
parents:
20410
diff
changeset
|
648 xmlnode_set_attrib(adl_node, "l", "1"); |
76e736b59aa4
fixes #971, we can only ADL 150 contacts at a time or the notification
Ka-Hing Cheung <khc@hxbc.us>
parents:
20410
diff
changeset
|
649 } |
25542
fd5eedf131b4
Generalize the FQY command so it can be used by different callbacks based
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
25477
diff
changeset
|
650 } else { |
25575
d51b8647d43c
applied changes from 70fa4cc384b7643ab1f296bdc2399bc208542a20
Ethan Blanton <elb@pidgin.im>
parents:
25542
diff
changeset
|
651 /* FQY's are returned one-at-a-time */ |
d51b8647d43c
applied changes from 70fa4cc384b7643ab1f296bdc2399bc208542a20
Ethan Blanton <elb@pidgin.im>
parents:
25542
diff
changeset
|
652 session->adl_fqy++; |
28065
7cebd7602c6e
This seems to not work every once in a while, so put in some code under the
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
28064
diff
changeset
|
653 if (purple_debug_is_verbose()) |
7cebd7602c6e
This seems to not work every once in a while, so put in some code under the
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
28064
diff
changeset
|
654 purple_debug_info("msn", "Adding FQY address, count is %d\n", |
7cebd7602c6e
This seems to not work every once in a while, so put in some code under the
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
28064
diff
changeset
|
655 session->adl_fqy); |
25575
d51b8647d43c
applied changes from 70fa4cc384b7643ab1f296bdc2399bc208542a20
Ethan Blanton <elb@pidgin.im>
parents:
25542
diff
changeset
|
656 |
30266
3ff6c193efee
The session parameter appears unused in msn_add_contact_xml.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
30151
diff
changeset
|
657 msn_add_contact_xml(fqy_node, user->passport, 0, user->networkid); |
25542
fd5eedf131b4
Generalize the FQY command so it can be used by different callbacks based
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
25477
diff
changeset
|
658 |
fd5eedf131b4
Generalize the FQY command so it can be used by different callbacks based
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
25477
diff
changeset
|
659 /* each FQY command may contain up to 150 contacts, probably */ |
fd5eedf131b4
Generalize the FQY command so it can be used by different callbacks based
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
25477
diff
changeset
|
660 if (++fqy_count % 150 == 0) { |
fd5eedf131b4
Generalize the FQY command so it can be used by different callbacks based
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
25477
diff
changeset
|
661 payload = xmlnode_to_str(fqy_node, &payload_len); |
fd5eedf131b4
Generalize the FQY command so it can be used by different callbacks based
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
25477
diff
changeset
|
662 |
fd5eedf131b4
Generalize the FQY command so it can be used by different callbacks based
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
25477
diff
changeset
|
663 msn_notification_send_fqy(session, payload, payload_len, |
25633
c384d62009c0
*** Plucked rev b932d4f94f9c771877b6a8a6a1d7dd3ea9c08005 (qulogic@pidgin.im):
Ka-Hing Cheung <khc@hxbc.us>
parents:
25606
diff
changeset
|
664 update_contact_network, NULL); |
25542
fd5eedf131b4
Generalize the FQY command so it can be used by different callbacks based
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
25477
diff
changeset
|
665 |
fd5eedf131b4
Generalize the FQY command so it can be used by different callbacks based
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
25477
diff
changeset
|
666 g_free(payload); |
fd5eedf131b4
Generalize the FQY command so it can be used by different callbacks based
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
25477
diff
changeset
|
667 xmlnode_free(fqy_node); |
fd5eedf131b4
Generalize the FQY command so it can be used by different callbacks based
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
25477
diff
changeset
|
668 fqy_node = xmlnode_new("ml"); |
fd5eedf131b4
Generalize the FQY command so it can be used by different callbacks based
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
25477
diff
changeset
|
669 } |
20414
76e736b59aa4
fixes #971, we can only ADL 150 contacts at a time or the notification
Ka-Hing Cheung <khc@hxbc.us>
parents:
20410
diff
changeset
|
670 } |
20394
4a099e4d0d09
propagate from branch 'im.pidgin.pidgin' (head 98b6b547b29ea1192b73cc4e1de1e674edef4328)
Richard Laager <rlaager@wiktel.com>
parents:
16063
diff
changeset
|
671 } |
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:
20477
diff
changeset
|
672 |
25542
fd5eedf131b4
Generalize the FQY command so it can be used by different callbacks based
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
25477
diff
changeset
|
673 /* Send the rest, or just an empty one to let the server set us online */ |
fd5eedf131b4
Generalize the FQY command so it can be used by different callbacks based
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
25477
diff
changeset
|
674 if (adl_count == 0 || adl_count % 150 != 0) { |
fd5eedf131b4
Generalize the FQY command so it can be used by different callbacks based
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
25477
diff
changeset
|
675 payload = xmlnode_to_str(adl_node, &payload_len); |
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:
20477
diff
changeset
|
676 |
25575
d51b8647d43c
applied changes from 70fa4cc384b7643ab1f296bdc2399bc208542a20
Ethan Blanton <elb@pidgin.im>
parents:
25542
diff
changeset
|
677 /* ADL's are returned all-together */ |
d51b8647d43c
applied changes from 70fa4cc384b7643ab1f296bdc2399bc208542a20
Ethan Blanton <elb@pidgin.im>
parents:
25542
diff
changeset
|
678 session->adl_fqy++; |
28065
7cebd7602c6e
This seems to not work every once in a while, so put in some code under the
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
28064
diff
changeset
|
679 if (purple_debug_is_verbose()) |
7cebd7602c6e
This seems to not work every once in a while, so put in some code under the
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
28064
diff
changeset
|
680 purple_debug_info("msn", "Posting ADL, count is %d\n", |
7cebd7602c6e
This seems to not work every once in a while, so put in some code under the
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
28064
diff
changeset
|
681 session->adl_fqy); |
25575
d51b8647d43c
applied changes from 70fa4cc384b7643ab1f296bdc2399bc208542a20
Ethan Blanton <elb@pidgin.im>
parents:
25542
diff
changeset
|
682 |
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:
20477
diff
changeset
|
683 msn_notification_post_adl(session->notification->cmdproc, payload, payload_len); |
eb93710aec4d
Make buddy and group management actually work, add some SOAP templates, redesign some parts of code and separate some bigger functions into its smaller tasks which are completely unrelated to each other
Carlos Silva <typ0@pidgin.im>
parents:
20477
diff
changeset
|
684 |
eb93710aec4d
Make buddy and group management actually work, add some SOAP templates, redesign some parts of code and separate some bigger functions into its smaller tasks which are completely unrelated to each other
Carlos Silva <typ0@pidgin.im>
parents:
20477
diff
changeset
|
685 g_free(payload); |
20477
9a2a4a0c0003
Add the possibility to create an Address Book, useful for newly registered MSN users.
Carlos Silva <typ0@pidgin.im>
parents:
20474
diff
changeset
|
686 } |
20394
4a099e4d0d09
propagate from branch 'im.pidgin.pidgin' (head 98b6b547b29ea1192b73cc4e1de1e674edef4328)
Richard Laager <rlaager@wiktel.com>
parents:
16063
diff
changeset
|
687 |
25542
fd5eedf131b4
Generalize the FQY command so it can be used by different callbacks based
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
25477
diff
changeset
|
688 if (fqy_count % 150 != 0) { |
fd5eedf131b4
Generalize the FQY command so it can be used by different callbacks based
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
25477
diff
changeset
|
689 payload = xmlnode_to_str(fqy_node, &payload_len); |
fd5eedf131b4
Generalize the FQY command so it can be used by different callbacks based
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
25477
diff
changeset
|
690 |
fd5eedf131b4
Generalize the FQY command so it can be used by different callbacks based
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
25477
diff
changeset
|
691 msn_notification_send_fqy(session, payload, payload_len, |
25633
c384d62009c0
*** Plucked rev b932d4f94f9c771877b6a8a6a1d7dd3ea9c08005 (qulogic@pidgin.im):
Ka-Hing Cheung <khc@hxbc.us>
parents:
25606
diff
changeset
|
692 update_contact_network, NULL); |
25542
fd5eedf131b4
Generalize the FQY command so it can be used by different callbacks based
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
25477
diff
changeset
|
693 |
fd5eedf131b4
Generalize the FQY command so it can be used by different callbacks based
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
25477
diff
changeset
|
694 g_free(payload); |
fd5eedf131b4
Generalize the FQY command so it can be used by different callbacks based
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
25477
diff
changeset
|
695 } |
fd5eedf131b4
Generalize the FQY command so it can be used by different callbacks based
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
25477
diff
changeset
|
696 |
fd5eedf131b4
Generalize the FQY command so it can be used by different callbacks based
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
25477
diff
changeset
|
697 xmlnode_free(adl_node); |
fd5eedf131b4
Generalize the FQY command so it can be used by different callbacks based
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
25477
diff
changeset
|
698 xmlnode_free(fqy_node); |
fd5eedf131b4
Generalize the FQY command so it can be used by different callbacks based
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
25477
diff
changeset
|
699 |
30267
88a047f92c39
Add a timeout which forces the login process to complete. This won't
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
30266
diff
changeset
|
700 msn_session_activate_login_timeout(session); |
88a047f92c39
Add a timeout which forces the login process to complete. This won't
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
30266
diff
changeset
|
701 |
29894
ec89b1d8571a
Implement [gs]et_public_alias in MSN.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
29761
diff
changeset
|
702 pc = purple_account_get_connection(session->account); |
ec89b1d8571a
Implement [gs]et_public_alias in MSN.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
29761
diff
changeset
|
703 display_name = purple_connection_get_display_name(pc); |
23298
5cdd93dac7a2
Delete trailing whitespace
Mark Doliner <mark@kingant.net>
parents:
22922
diff
changeset
|
704 if (display_name |
5cdd93dac7a2
Delete trailing whitespace
Mark Doliner <mark@kingant.net>
parents:
22922
diff
changeset
|
705 && strcmp(display_name, |
20477
9a2a4a0c0003
Add the possibility to create an Address Book, useful for newly registered MSN users.
Carlos Silva <typ0@pidgin.im>
parents:
20474
diff
changeset
|
706 purple_account_get_username(session->account))) { |
29894
ec89b1d8571a
Implement [gs]et_public_alias in MSN.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
29761
diff
changeset
|
707 msn_set_public_alias(pc, display_name, NULL, NULL); |
20394
4a099e4d0d09
propagate from branch 'im.pidgin.pidgin' (head 98b6b547b29ea1192b73cc4e1de1e674edef4328)
Richard Laager <rlaager@wiktel.com>
parents:
16063
diff
changeset
|
708 } |
4a099e4d0d09
propagate from branch 'im.pidgin.pidgin' (head 98b6b547b29ea1192b73cc4e1de1e674edef4328)
Richard Laager <rlaager@wiktel.com>
parents:
16063
diff
changeset
|
709 |
4a099e4d0d09
propagate from branch 'im.pidgin.pidgin' (head 98b6b547b29ea1192b73cc4e1de1e674edef4328)
Richard Laager <rlaager@wiktel.com>
parents:
16063
diff
changeset
|
710 } |
15373
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
711 |
20394
4a099e4d0d09
propagate from branch 'im.pidgin.pidgin' (head 98b6b547b29ea1192b73cc4e1de1e674edef4328)
Richard Laager <rlaager@wiktel.com>
parents:
16063
diff
changeset
|
712 static void |
4a099e4d0d09
propagate from branch 'im.pidgin.pidgin' (head 98b6b547b29ea1192b73cc4e1de1e674edef4328)
Richard Laager <rlaager@wiktel.com>
parents:
16063
diff
changeset
|
713 blp_cmd(MsnCmdProc *cmdproc, MsnCommand *cmd) |
4a099e4d0d09
propagate from branch 'im.pidgin.pidgin' (head 98b6b547b29ea1192b73cc4e1de1e674edef4328)
Richard Laager <rlaager@wiktel.com>
parents:
16063
diff
changeset
|
714 { |
4a099e4d0d09
propagate from branch 'im.pidgin.pidgin' (head 98b6b547b29ea1192b73cc4e1de1e674edef4328)
Richard Laager <rlaager@wiktel.com>
parents:
16063
diff
changeset
|
715 } |
4a099e4d0d09
propagate from branch 'im.pidgin.pidgin' (head 98b6b547b29ea1192b73cc4e1de1e674edef4328)
Richard Laager <rlaager@wiktel.com>
parents:
16063
diff
changeset
|
716 |
4a099e4d0d09
propagate from branch 'im.pidgin.pidgin' (head 98b6b547b29ea1192b73cc4e1de1e674edef4328)
Richard Laager <rlaager@wiktel.com>
parents:
16063
diff
changeset
|
717 static 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
|
718 adl_cmd_parse(MsnCmdProc *cmdproc, MsnCommand *cmd, char *payload, |
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
|
719 size_t len) |
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
|
720 { |
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
|
721 xmlnode *root, *domain_node; |
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
|
722 |
23519
7bceac816e19
The great MSN debug message cleanup! Threw in a few whitespace fixes,
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
23517
diff
changeset
|
723 purple_debug_misc("msn", "Parsing received ADL XML data\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
|
724 |
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
|
725 g_return_if_fail(payload != NULL); |
23298
5cdd93dac7a2
Delete trailing whitespace
Mark Doliner <mark@kingant.net>
parents:
22922
diff
changeset
|
726 |
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
|
727 root = xmlnode_from_str(payload, (gssize) len); |
23298
5cdd93dac7a2
Delete trailing whitespace
Mark Doliner <mark@kingant.net>
parents:
22922
diff
changeset
|
728 |
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
|
729 if (root == NULL) { |
23519
7bceac816e19
The great MSN debug message cleanup! Threw in a few whitespace fixes,
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
23517
diff
changeset
|
730 purple_debug_info("msn", "Invalid XML in ADL!\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
|
731 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
|
732 } |
25601
1a1765a87336
More MSN fixes to go along with f0df27a299120baecf9ea88a9fb24ffe1dbe72fd:
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
25582
diff
changeset
|
733 for (domain_node = xmlnode_get_child(root, "d"); |
1a1765a87336
More MSN fixes to go along with f0df27a299120baecf9ea88a9fb24ffe1dbe72fd:
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
25582
diff
changeset
|
734 domain_node; |
1a1765a87336
More MSN fixes to go along with f0df27a299120baecf9ea88a9fb24ffe1dbe72fd:
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
25582
diff
changeset
|
735 domain_node = xmlnode_get_next_twin(domain_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
|
736 xmlnode *contact_node = 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
|
737 |
25601
1a1765a87336
More MSN fixes to go along with f0df27a299120baecf9ea88a9fb24ffe1dbe72fd:
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
25582
diff
changeset
|
738 for (contact_node = xmlnode_get_child(domain_node, "c"); |
1a1765a87336
More MSN fixes to go along with f0df27a299120baecf9ea88a9fb24ffe1dbe72fd:
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
25582
diff
changeset
|
739 contact_node; |
1a1765a87336
More MSN fixes to go along with f0df27a299120baecf9ea88a9fb24ffe1dbe72fd:
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
25582
diff
changeset
|
740 contact_node = xmlnode_get_next_twin(contact_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
|
741 const gchar *list; |
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
|
742 gint list_op = 0; |
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
|
743 |
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
|
744 list = xmlnode_get_attrib(contact_node, "l"); |
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
|
745 if (list != 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
|
746 list_op = atoi(list); |
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
|
747 } |
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
|
748 |
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
|
749 if (list_op & MSN_LIST_RL_OP) { |
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
|
750 /* someone is adding us */ |
23459
69af5301e1a7
killing MsnContact which just wraps MsnSession
Ka-Hing Cheung <khc@hxbc.us>
parents:
23458
diff
changeset
|
751 msn_get_contact_list(cmdproc->session, MSN_PS_PENDING_LIST, 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
|
752 } |
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
|
753 } |
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
|
754 } |
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
|
755 |
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
|
756 xmlnode_free(root); |
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
|
757 } |
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
|
758 |
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
|
759 static void |
20394
4a099e4d0d09
propagate from branch 'im.pidgin.pidgin' (head 98b6b547b29ea1192b73cc4e1de1e674edef4328)
Richard Laager <rlaager@wiktel.com>
parents:
16063
diff
changeset
|
760 adl_cmd(MsnCmdProc *cmdproc, MsnCommand *cmd) |
15373
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
761 { |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
762 MsnSession *session; |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
763 |
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
|
764 g_return_if_fail(cmdproc != 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
|
765 g_return_if_fail(cmdproc->session != 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
|
766 g_return_if_fail(cmdproc->last_cmd != 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
|
767 g_return_if_fail(cmd != NULL); |
15373
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
768 |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
769 session = cmdproc->session; |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
770 |
23514
7e16d193bb57
Get rid of that whole msn_set_payload_len thing and correctly set the
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
23512
diff
changeset
|
771 if (!strcmp(cmd->params[1], "OK")) { |
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
|
772 /* ADL ack */ |
28065
7cebd7602c6e
This seems to not work every once in a while, so put in some code under the
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
28064
diff
changeset
|
773 if (purple_debug_is_verbose()) |
7cebd7602c6e
This seems to not work every once in a while, so put in some code under the
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
28064
diff
changeset
|
774 purple_debug_info("msn", "ADL ACK, count is %d\n", |
7cebd7602c6e
This seems to not work every once in a while, so put in some code under the
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
28064
diff
changeset
|
775 session->adl_fqy); |
25575
d51b8647d43c
applied changes from 70fa4cc384b7643ab1f296bdc2399bc208542a20
Ethan Blanton <elb@pidgin.im>
parents:
25542
diff
changeset
|
776 if (--session->adl_fqy == 0) |
d51b8647d43c
applied changes from 70fa4cc384b7643ab1f296bdc2399bc208542a20
Ethan Blanton <elb@pidgin.im>
parents:
25542
diff
changeset
|
777 msn_session_finish_login(session); |
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
|
778 } 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
|
779 cmdproc->last_cmd->payload_cb = adl_cmd_parse; |
23514
7e16d193bb57
Get rid of that whole msn_set_payload_len thing and correctly set the
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
23512
diff
changeset
|
780 cmd->payload_len = atoi(cmd->params[1]); |
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
|
781 } |
20477
9a2a4a0c0003
Add the possibility to create an Address Book, useful for newly registered MSN users.
Carlos Silva <typ0@pidgin.im>
parents:
20474
diff
changeset
|
782 |
9a2a4a0c0003
Add the possibility to create an Address Book, useful for newly registered MSN users.
Carlos Silva <typ0@pidgin.im>
parents:
20474
diff
changeset
|
783 return; |
20394
4a099e4d0d09
propagate from branch 'im.pidgin.pidgin' (head 98b6b547b29ea1192b73cc4e1de1e674edef4328)
Richard Laager <rlaager@wiktel.com>
parents:
16063
diff
changeset
|
784 } |
15373
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
785 |
20394
4a099e4d0d09
propagate from branch 'im.pidgin.pidgin' (head 98b6b547b29ea1192b73cc4e1de1e674edef4328)
Richard Laager <rlaager@wiktel.com>
parents:
16063
diff
changeset
|
786 static void |
24267
e473291375b4
Apply khc's patch for ADL error 205, with a few changes to get around
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
24193
diff
changeset
|
787 adl_error_parse(MsnCmdProc *cmdproc, MsnCommand *cmd, char *payload, size_t len) |
e473291375b4
Apply khc's patch for ADL error 205, with a few changes to get around
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
24193
diff
changeset
|
788 { |
e473291375b4
Apply khc's patch for ADL error 205, with a few changes to get around
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
24193
diff
changeset
|
789 MsnSession *session; |
e473291375b4
Apply khc's patch for ADL error 205, with a few changes to get around
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
24193
diff
changeset
|
790 PurpleAccount *account; |
e473291375b4
Apply khc's patch for ADL error 205, with a few changes to get around
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
24193
diff
changeset
|
791 PurpleConnection *gc; |
28466
57137d32a131
Fold the ADL 241 error handler into the base ADL error handler since it
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
28378
diff
changeset
|
792 int error = GPOINTER_TO_INT(cmd->payload_cbdata); |
24267
e473291375b4
Apply khc's patch for ADL error 205, with a few changes to get around
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
24193
diff
changeset
|
793 |
e473291375b4
Apply khc's patch for ADL error 205, with a few changes to get around
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
24193
diff
changeset
|
794 session = cmdproc->session; |
e473291375b4
Apply khc's patch for ADL error 205, with a few changes to get around
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
24193
diff
changeset
|
795 account = session->account; |
e473291375b4
Apply khc's patch for ADL error 205, with a few changes to get around
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
24193
diff
changeset
|
796 gc = purple_account_get_connection(account); |
e473291375b4
Apply khc's patch for ADL error 205, with a few changes to get around
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
24193
diff
changeset
|
797 |
28466
57137d32a131
Fold the ADL 241 error handler into the base ADL error handler since it
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
28378
diff
changeset
|
798 if (error == 241) { |
57137d32a131
Fold the ADL 241 error handler into the base ADL error handler since it
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
28378
diff
changeset
|
799 /* khc: some googling suggests that error 241 means the buddy is somehow |
57137d32a131
Fold the ADL 241 error handler into the base ADL error handler since it
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
28378
diff
changeset
|
800 in the local list, but not the server list, and that we should add |
57137d32a131
Fold the ADL 241 error handler into the base ADL error handler since it
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
28378
diff
changeset
|
801 those buddies to the addressbook. For now I will just notify the user |
57137d32a131
Fold the ADL 241 error handler into the base ADL error handler since it
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
28378
diff
changeset
|
802 about the raw payload, because I am lazy */ |
57137d32a131
Fold the ADL 241 error handler into the base ADL error handler since it
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
28378
diff
changeset
|
803 xmlnode *adl = xmlnode_from_str(payload, len); |
57137d32a131
Fold the ADL 241 error handler into the base ADL error handler since it
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
28378
diff
changeset
|
804 GString *emails = g_string_new(NULL); |
57137d32a131
Fold the ADL 241 error handler into the base ADL error handler since it
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
28378
diff
changeset
|
805 |
57137d32a131
Fold the ADL 241 error handler into the base ADL error handler since it
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
28378
diff
changeset
|
806 xmlnode *domain = xmlnode_get_child(adl, "d"); |
57137d32a131
Fold the ADL 241 error handler into the base ADL error handler since it
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
28378
diff
changeset
|
807 while (domain) { |
57137d32a131
Fold the ADL 241 error handler into the base ADL error handler since it
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
28378
diff
changeset
|
808 const char *domain_str = xmlnode_get_attrib(domain, "n"); |
57137d32a131
Fold the ADL 241 error handler into the base ADL error handler since it
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
28378
diff
changeset
|
809 xmlnode *contact = xmlnode_get_child(domain, "c"); |
57137d32a131
Fold the ADL 241 error handler into the base ADL error handler since it
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
28378
diff
changeset
|
810 while (contact) { |
57137d32a131
Fold the ADL 241 error handler into the base ADL error handler since it
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
28378
diff
changeset
|
811 g_string_append_printf(emails, "%s@%s\n", |
57137d32a131
Fold the ADL 241 error handler into the base ADL error handler since it
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
28378
diff
changeset
|
812 xmlnode_get_attrib(contact, "n"), domain_str); |
57137d32a131
Fold the ADL 241 error handler into the base ADL error handler since it
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
28378
diff
changeset
|
813 contact = xmlnode_get_next_twin(contact); |
57137d32a131
Fold the ADL 241 error handler into the base ADL error handler since it
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
28378
diff
changeset
|
814 } |
57137d32a131
Fold the ADL 241 error handler into the base ADL error handler since it
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
28378
diff
changeset
|
815 domain = xmlnode_get_next_twin(domain); |
57137d32a131
Fold the ADL 241 error handler into the base ADL error handler since it
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
28378
diff
changeset
|
816 } |
57137d32a131
Fold the ADL 241 error handler into the base ADL error handler since it
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
28378
diff
changeset
|
817 |
57137d32a131
Fold the ADL 241 error handler into the base ADL error handler since it
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
28378
diff
changeset
|
818 purple_notify_error(gc, NULL, |
57137d32a131
Fold the ADL 241 error handler into the base ADL error handler since it
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
28378
diff
changeset
|
819 _("The following users are missing from your addressbook"), |
57137d32a131
Fold the ADL 241 error handler into the base ADL error handler since it
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
28378
diff
changeset
|
820 emails->str); |
57137d32a131
Fold the ADL 241 error handler into the base ADL error handler since it
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
28378
diff
changeset
|
821 g_string_free(emails, TRUE); |
57137d32a131
Fold the ADL 241 error handler into the base ADL error handler since it
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
28378
diff
changeset
|
822 xmlnode_free(adl); |
57137d32a131
Fold the ADL 241 error handler into the base ADL error handler since it
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
28378
diff
changeset
|
823 } |
57137d32a131
Fold the ADL 241 error handler into the base ADL error handler since it
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
28378
diff
changeset
|
824 else |
57137d32a131
Fold the ADL 241 error handler into the base ADL error handler since it
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
28378
diff
changeset
|
825 { |
57137d32a131
Fold the ADL 241 error handler into the base ADL error handler since it
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
28378
diff
changeset
|
826 char *adl = g_strndup(payload, len); |
57137d32a131
Fold the ADL 241 error handler into the base ADL error handler since it
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
28378
diff
changeset
|
827 char *reason = g_strdup_printf(_("Unknown error (%d): %s"), |
57137d32a131
Fold the ADL 241 error handler into the base ADL error handler since it
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
28378
diff
changeset
|
828 error, adl); |
57137d32a131
Fold the ADL 241 error handler into the base ADL error handler since it
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
28378
diff
changeset
|
829 g_free(adl); |
57137d32a131
Fold the ADL 241 error handler into the base ADL error handler since it
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
28378
diff
changeset
|
830 |
57137d32a131
Fold the ADL 241 error handler into the base ADL error handler since it
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
28378
diff
changeset
|
831 purple_notify_error(gc, NULL, _("Unable to add user"), reason); |
57137d32a131
Fold the ADL 241 error handler into the base ADL error handler since it
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
28378
diff
changeset
|
832 g_free(reason); |
57137d32a131
Fold the ADL 241 error handler into the base ADL error handler since it
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
28378
diff
changeset
|
833 } |
24267
e473291375b4
Apply khc's patch for ADL error 205, with a few changes to get around
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
24193
diff
changeset
|
834 } |
e473291375b4
Apply khc's patch for ADL error 205, with a few changes to get around
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
24193
diff
changeset
|
835 |
e473291375b4
Apply khc's patch for ADL error 205, with a few changes to get around
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
24193
diff
changeset
|
836 static void |
20439
bee467c81570
A bunch of MSNP14 stuff:
Stu Tomlinson <stu@nosnilmot.com>
parents:
20432
diff
changeset
|
837 adl_error(MsnCmdProc *cmdproc, MsnTransaction *trans, int error) |
15373
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
838 { |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
839 MsnSession *session; |
20439
bee467c81570
A bunch of MSNP14 stuff:
Stu Tomlinson <stu@nosnilmot.com>
parents:
20432
diff
changeset
|
840 PurpleAccount *account; |
bee467c81570
A bunch of MSNP14 stuff:
Stu Tomlinson <stu@nosnilmot.com>
parents:
20432
diff
changeset
|
841 PurpleConnection *gc; |
24267
e473291375b4
Apply khc's patch for ADL error 205, with a few changes to get around
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
24193
diff
changeset
|
842 MsnCommand *cmd = cmdproc->last_cmd; |
15373
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
843 |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
844 session = cmdproc->session; |
20439
bee467c81570
A bunch of MSNP14 stuff:
Stu Tomlinson <stu@nosnilmot.com>
parents:
20432
diff
changeset
|
845 account = session->account; |
bee467c81570
A bunch of MSNP14 stuff:
Stu Tomlinson <stu@nosnilmot.com>
parents:
20432
diff
changeset
|
846 gc = purple_account_get_connection(account); |
15373
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
847 |
23519
7bceac816e19
The great MSN debug message cleanup! Threw in a few whitespace fixes,
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
23517
diff
changeset
|
848 purple_debug_error("msn", "ADL error\n"); |
24267
e473291375b4
Apply khc's patch for ADL error 205, with a few changes to get around
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
24193
diff
changeset
|
849 if (cmd->param_count > 1) { |
e473291375b4
Apply khc's patch for ADL error 205, with a few changes to get around
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
24193
diff
changeset
|
850 cmd->payload_cb = adl_error_parse; |
e473291375b4
Apply khc's patch for ADL error 205, with a few changes to get around
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
24193
diff
changeset
|
851 cmd->payload_len = atoi(cmd->params[1]); |
e473291375b4
Apply khc's patch for ADL error 205, with a few changes to get around
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
24193
diff
changeset
|
852 cmd->payload_cbdata = GINT_TO_POINTER(error); |
e473291375b4
Apply khc's patch for ADL error 205, with a few changes to get around
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
24193
diff
changeset
|
853 } else { |
e473291375b4
Apply khc's patch for ADL error 205, with a few changes to get around
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
24193
diff
changeset
|
854 char *reason = g_strdup_printf(_("Unknown error (%d)"), error); |
e473291375b4
Apply khc's patch for ADL error 205, with a few changes to get around
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
24193
diff
changeset
|
855 purple_notify_error(gc, NULL, _("Unable to add user"), reason); |
e473291375b4
Apply khc's patch for ADL error 205, with a few changes to get around
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
24193
diff
changeset
|
856 g_free(reason); |
e473291375b4
Apply khc's patch for ADL error 205, with a few changes to get around
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
24193
diff
changeset
|
857 } |
20439
bee467c81570
A bunch of MSNP14 stuff:
Stu Tomlinson <stu@nosnilmot.com>
parents:
20432
diff
changeset
|
858 } |
15373
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
859 |
20439
bee467c81570
A bunch of MSNP14 stuff:
Stu Tomlinson <stu@nosnilmot.com>
parents:
20432
diff
changeset
|
860 static void |
28467
12bdd930d99c
Add an error handler for the RML command as well.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
28466
diff
changeset
|
861 rml_error_parse(MsnCmdProc *cmdproc, MsnCommand *cmd, char *payload, size_t len) |
12bdd930d99c
Add an error handler for the RML command as well.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
28466
diff
changeset
|
862 { |
12bdd930d99c
Add an error handler for the RML command as well.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
28466
diff
changeset
|
863 MsnSession *session; |
12bdd930d99c
Add an error handler for the RML command as well.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
28466
diff
changeset
|
864 PurpleAccount *account; |
12bdd930d99c
Add an error handler for the RML command as well.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
28466
diff
changeset
|
865 PurpleConnection *gc; |
12bdd930d99c
Add an error handler for the RML command as well.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
28466
diff
changeset
|
866 char *adl, *reason; |
12bdd930d99c
Add an error handler for the RML command as well.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
28466
diff
changeset
|
867 int error = GPOINTER_TO_INT(cmd->payload_cbdata); |
12bdd930d99c
Add an error handler for the RML command as well.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
28466
diff
changeset
|
868 |
12bdd930d99c
Add an error handler for the RML command as well.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
28466
diff
changeset
|
869 session = cmdproc->session; |
12bdd930d99c
Add an error handler for the RML command as well.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
28466
diff
changeset
|
870 account = session->account; |
12bdd930d99c
Add an error handler for the RML command as well.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
28466
diff
changeset
|
871 gc = purple_account_get_connection(account); |
12bdd930d99c
Add an error handler for the RML command as well.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
28466
diff
changeset
|
872 |
12bdd930d99c
Add an error handler for the RML command as well.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
28466
diff
changeset
|
873 adl = g_strndup(payload, len); |
12bdd930d99c
Add an error handler for the RML command as well.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
28466
diff
changeset
|
874 reason = g_strdup_printf(_("Unknown error (%d): %s"), |
12bdd930d99c
Add an error handler for the RML command as well.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
28466
diff
changeset
|
875 error, adl); |
12bdd930d99c
Add an error handler for the RML command as well.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
28466
diff
changeset
|
876 g_free(adl); |
12bdd930d99c
Add an error handler for the RML command as well.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
28466
diff
changeset
|
877 |
12bdd930d99c
Add an error handler for the RML command as well.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
28466
diff
changeset
|
878 purple_notify_error(gc, NULL, _("Unable to remove user"), reason); |
12bdd930d99c
Add an error handler for the RML command as well.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
28466
diff
changeset
|
879 g_free(reason); |
12bdd930d99c
Add an error handler for the RML command as well.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
28466
diff
changeset
|
880 } |
12bdd930d99c
Add an error handler for the RML command as well.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
28466
diff
changeset
|
881 |
12bdd930d99c
Add an error handler for the RML command as well.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
28466
diff
changeset
|
882 static void |
12bdd930d99c
Add an error handler for the RML command as well.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
28466
diff
changeset
|
883 rml_error(MsnCmdProc *cmdproc, MsnTransaction *trans, int error) |
12bdd930d99c
Add an error handler for the RML command as well.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
28466
diff
changeset
|
884 { |
12bdd930d99c
Add an error handler for the RML command as well.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
28466
diff
changeset
|
885 MsnSession *session; |
12bdd930d99c
Add an error handler for the RML command as well.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
28466
diff
changeset
|
886 PurpleAccount *account; |
12bdd930d99c
Add an error handler for the RML command as well.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
28466
diff
changeset
|
887 PurpleConnection *gc; |
12bdd930d99c
Add an error handler for the RML command as well.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
28466
diff
changeset
|
888 MsnCommand *cmd = cmdproc->last_cmd; |
12bdd930d99c
Add an error handler for the RML command as well.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
28466
diff
changeset
|
889 |
12bdd930d99c
Add an error handler for the RML command as well.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
28466
diff
changeset
|
890 session = cmdproc->session; |
12bdd930d99c
Add an error handler for the RML command as well.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
28466
diff
changeset
|
891 account = session->account; |
12bdd930d99c
Add an error handler for the RML command as well.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
28466
diff
changeset
|
892 gc = purple_account_get_connection(account); |
12bdd930d99c
Add an error handler for the RML command as well.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
28466
diff
changeset
|
893 |
12bdd930d99c
Add an error handler for the RML command as well.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
28466
diff
changeset
|
894 purple_debug_error("msn", "RML error\n"); |
12bdd930d99c
Add an error handler for the RML command as well.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
28466
diff
changeset
|
895 if (cmd->param_count > 1) { |
12bdd930d99c
Add an error handler for the RML command as well.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
28466
diff
changeset
|
896 cmd->payload_cb = rml_error_parse; |
12bdd930d99c
Add an error handler for the RML command as well.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
28466
diff
changeset
|
897 cmd->payload_len = atoi(cmd->params[1]); |
12bdd930d99c
Add an error handler for the RML command as well.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
28466
diff
changeset
|
898 cmd->payload_cbdata = GINT_TO_POINTER(error); |
12bdd930d99c
Add an error handler for the RML command as well.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
28466
diff
changeset
|
899 } else { |
12bdd930d99c
Add an error handler for the RML command as well.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
28466
diff
changeset
|
900 char *reason = g_strdup_printf(_("Unknown error (%d)"), error); |
12bdd930d99c
Add an error handler for the RML command as well.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
28466
diff
changeset
|
901 purple_notify_error(gc, NULL, _("Unable to remove user"), reason); |
12bdd930d99c
Add an error handler for the RML command as well.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
28466
diff
changeset
|
902 g_free(reason); |
12bdd930d99c
Add an error handler for the RML command as well.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
28466
diff
changeset
|
903 } |
12bdd930d99c
Add an error handler for the RML command as well.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
28466
diff
changeset
|
904 } |
12bdd930d99c
Add an error handler for the RML command as well.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
28466
diff
changeset
|
905 |
12bdd930d99c
Add an error handler for the RML command as well.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
28466
diff
changeset
|
906 static void |
20394
4a099e4d0d09
propagate from branch 'im.pidgin.pidgin' (head 98b6b547b29ea1192b73cc4e1de1e674edef4328)
Richard Laager <rlaager@wiktel.com>
parents:
16063
diff
changeset
|
907 fqy_cmd_post(MsnCmdProc *cmdproc, MsnCommand *cmd, char *payload, |
4a099e4d0d09
propagate from branch 'im.pidgin.pidgin' (head 98b6b547b29ea1192b73cc4e1de1e674edef4328)
Richard Laager <rlaager@wiktel.com>
parents:
16063
diff
changeset
|
908 size_t len) |
4a099e4d0d09
propagate from branch 'im.pidgin.pidgin' (head 98b6b547b29ea1192b73cc4e1de1e674edef4328)
Richard Laager <rlaager@wiktel.com>
parents:
16063
diff
changeset
|
909 { |
25542
fd5eedf131b4
Generalize the FQY command so it can be used by different callbacks based
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
25477
diff
changeset
|
910 MsnSession *session; |
24518
4fd22591e3f0
Send FQY as the first thing when adding a buddy so that we know what network
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
24510
diff
changeset
|
911 xmlnode *ml, *d, *c; |
4fd22591e3f0
Send FQY as the first thing when adding a buddy so that we know what network
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
24510
diff
changeset
|
912 const char *domain; |
4fd22591e3f0
Send FQY as the first thing when adding a buddy so that we know what network
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
24510
diff
changeset
|
913 const char *local; |
4fd22591e3f0
Send FQY as the first thing when adding a buddy so that we know what network
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
24510
diff
changeset
|
914 const char *type; |
4fd22591e3f0
Send FQY as the first thing when adding a buddy so that we know what network
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
24510
diff
changeset
|
915 char *passport; |
4fd22591e3f0
Send FQY as the first thing when adding a buddy so that we know what network
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
24510
diff
changeset
|
916 MsnNetwork network = MSN_NETWORK_PASSPORT; |
4fd22591e3f0
Send FQY as the first thing when adding a buddy so that we know what network
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
24510
diff
changeset
|
917 |
25542
fd5eedf131b4
Generalize the FQY command so it can be used by different callbacks based
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
25477
diff
changeset
|
918 session = cmdproc->session; |
24518
4fd22591e3f0
Send FQY as the first thing when adding a buddy so that we know what network
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
24510
diff
changeset
|
919 |
4fd22591e3f0
Send FQY as the first thing when adding a buddy so that we know what network
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
24510
diff
changeset
|
920 /* FQY response: |
4fd22591e3f0
Send FQY as the first thing when adding a buddy so that we know what network
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
24510
diff
changeset
|
921 <ml><d n="domain.com"><c n="local-node" t="network" /></d></ml> */ |
4fd22591e3f0
Send FQY as the first thing when adding a buddy so that we know what network
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
24510
diff
changeset
|
922 ml = xmlnode_from_str(payload, len); |
25542
fd5eedf131b4
Generalize the FQY command so it can be used by different callbacks based
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
25477
diff
changeset
|
923 for (d = xmlnode_get_child(ml, "d"); |
fd5eedf131b4
Generalize the FQY command so it can be used by different callbacks based
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
25477
diff
changeset
|
924 d != NULL; |
fd5eedf131b4
Generalize the FQY command so it can be used by different callbacks based
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
25477
diff
changeset
|
925 d = xmlnode_get_next_twin(d)) { |
fd5eedf131b4
Generalize the FQY command so it can be used by different callbacks based
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
25477
diff
changeset
|
926 domain = xmlnode_get_attrib(d, "n"); |
fd5eedf131b4
Generalize the FQY command so it can be used by different callbacks based
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
25477
diff
changeset
|
927 for (c = xmlnode_get_child(d, "c"); |
fd5eedf131b4
Generalize the FQY command so it can be used by different callbacks based
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
25477
diff
changeset
|
928 c != NULL; |
fd5eedf131b4
Generalize the FQY command so it can be used by different callbacks based
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
25477
diff
changeset
|
929 c = xmlnode_get_next_twin(c)) { |
fd5eedf131b4
Generalize the FQY command so it can be used by different callbacks based
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
25477
diff
changeset
|
930 local = xmlnode_get_attrib(c, "n"); |
fd5eedf131b4
Generalize the FQY command so it can be used by different callbacks based
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
25477
diff
changeset
|
931 type = xmlnode_get_attrib(c, "t"); |
24518
4fd22591e3f0
Send FQY as the first thing when adding a buddy so that we know what network
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
24510
diff
changeset
|
932 |
25542
fd5eedf131b4
Generalize the FQY command so it can be used by different callbacks based
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
25477
diff
changeset
|
933 passport = g_strdup_printf("%s@%s", local, domain); |
24518
4fd22591e3f0
Send FQY as the first thing when adding a buddy so that we know what network
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
24510
diff
changeset
|
934 |
25633
c384d62009c0
*** Plucked rev b932d4f94f9c771877b6a8a6a1d7dd3ea9c08005 (qulogic@pidgin.im):
Ka-Hing Cheung <khc@hxbc.us>
parents:
25606
diff
changeset
|
935 if (g_ascii_isdigit(cmd->command[0])) |
c384d62009c0
*** Plucked rev b932d4f94f9c771877b6a8a6a1d7dd3ea9c08005 (qulogic@pidgin.im):
Ka-Hing Cheung <khc@hxbc.us>
parents:
25606
diff
changeset
|
936 network = MSN_NETWORK_UNKNOWN; |
c384d62009c0
*** Plucked rev b932d4f94f9c771877b6a8a6a1d7dd3ea9c08005 (qulogic@pidgin.im):
Ka-Hing Cheung <khc@hxbc.us>
parents:
25606
diff
changeset
|
937 else if (type != NULL) |
25542
fd5eedf131b4
Generalize the FQY command so it can be used by different callbacks based
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
25477
diff
changeset
|
938 network = (MsnNetwork)strtoul(type, NULL, 10); |
24518
4fd22591e3f0
Send FQY as the first thing when adding a buddy so that we know what network
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
24510
diff
changeset
|
939 |
25542
fd5eedf131b4
Generalize the FQY command so it can be used by different callbacks based
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
25477
diff
changeset
|
940 purple_debug_info("msn", "FQY response says %s is from network %d\n", |
fd5eedf131b4
Generalize the FQY command so it can be used by different callbacks based
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
25477
diff
changeset
|
941 passport, network); |
25633
c384d62009c0
*** Plucked rev b932d4f94f9c771877b6a8a6a1d7dd3ea9c08005 (qulogic@pidgin.im):
Ka-Hing Cheung <khc@hxbc.us>
parents:
25606
diff
changeset
|
942 if (cmd->trans->data) { |
c384d62009c0
*** Plucked rev b932d4f94f9c771877b6a8a6a1d7dd3ea9c08005 (qulogic@pidgin.im):
Ka-Hing Cheung <khc@hxbc.us>
parents:
25606
diff
changeset
|
943 MsnFqyCbData *fqy_data = cmd->trans->data; |
c384d62009c0
*** Plucked rev b932d4f94f9c771877b6a8a6a1d7dd3ea9c08005 (qulogic@pidgin.im):
Ka-Hing Cheung <khc@hxbc.us>
parents:
25606
diff
changeset
|
944 fqy_data->cb(session, passport, network, fqy_data->data); |
28363
7f80b0fc825d
Minor comment typo.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
28353
diff
changeset
|
945 /* Don't free fqy_data yet since the server responds to FQY multiple times. |
28353
6a23d7f84143
Allow setting a destroy-function for the data. Fixes a leak.
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
28346
diff
changeset
|
946 It will be freed when cmd->trans is freed. */ |
25633
c384d62009c0
*** Plucked rev b932d4f94f9c771877b6a8a6a1d7dd3ea9c08005 (qulogic@pidgin.im):
Ka-Hing Cheung <khc@hxbc.us>
parents:
25606
diff
changeset
|
947 } |
25542
fd5eedf131b4
Generalize the FQY command so it can be used by different callbacks based
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
25477
diff
changeset
|
948 |
fd5eedf131b4
Generalize the FQY command so it can be used by different callbacks based
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
25477
diff
changeset
|
949 g_free(passport); |
fd5eedf131b4
Generalize the FQY command so it can be used by different callbacks based
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
25477
diff
changeset
|
950 } |
fd5eedf131b4
Generalize the FQY command so it can be used by different callbacks based
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
25477
diff
changeset
|
951 } |
fd5eedf131b4
Generalize the FQY command so it can be used by different callbacks based
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
25477
diff
changeset
|
952 |
24518
4fd22591e3f0
Send FQY as the first thing when adding a buddy so that we know what network
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
24510
diff
changeset
|
953 xmlnode_free(ml); |
20394
4a099e4d0d09
propagate from branch 'im.pidgin.pidgin' (head 98b6b547b29ea1192b73cc4e1de1e674edef4328)
Richard Laager <rlaager@wiktel.com>
parents:
16063
diff
changeset
|
954 } |
15373
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
955 |
20394
4a099e4d0d09
propagate from branch 'im.pidgin.pidgin' (head 98b6b547b29ea1192b73cc4e1de1e674edef4328)
Richard Laager <rlaager@wiktel.com>
parents:
16063
diff
changeset
|
956 static void |
25601
1a1765a87336
More MSN fixes to go along with f0df27a299120baecf9ea88a9fb24ffe1dbe72fd:
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
25582
diff
changeset
|
957 fqy_error(MsnCmdProc *cmdproc, MsnTransaction *trans, int error) |
1a1765a87336
More MSN fixes to go along with f0df27a299120baecf9ea88a9fb24ffe1dbe72fd:
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
25582
diff
changeset
|
958 { |
1a1765a87336
More MSN fixes to go along with f0df27a299120baecf9ea88a9fb24ffe1dbe72fd:
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
25582
diff
changeset
|
959 MsnCommand *cmd = cmdproc->last_cmd; |
1a1765a87336
More MSN fixes to go along with f0df27a299120baecf9ea88a9fb24ffe1dbe72fd:
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
25582
diff
changeset
|
960 |
1a1765a87336
More MSN fixes to go along with f0df27a299120baecf9ea88a9fb24ffe1dbe72fd:
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
25582
diff
changeset
|
961 purple_debug_warning("msn", "FQY error %d\n", error); |
1a1765a87336
More MSN fixes to go along with f0df27a299120baecf9ea88a9fb24ffe1dbe72fd:
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
25582
diff
changeset
|
962 if (cmd->param_count > 1) { |
1a1765a87336
More MSN fixes to go along with f0df27a299120baecf9ea88a9fb24ffe1dbe72fd:
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
25582
diff
changeset
|
963 cmd->payload_cb = fqy_cmd_post; |
1a1765a87336
More MSN fixes to go along with f0df27a299120baecf9ea88a9fb24ffe1dbe72fd:
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
25582
diff
changeset
|
964 cmd->payload_len = atoi(cmd->params[1]); |
1a1765a87336
More MSN fixes to go along with f0df27a299120baecf9ea88a9fb24ffe1dbe72fd:
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
25582
diff
changeset
|
965 cmd->payload_cbdata = GINT_TO_POINTER(error); |
1a1765a87336
More MSN fixes to go along with f0df27a299120baecf9ea88a9fb24ffe1dbe72fd:
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
25582
diff
changeset
|
966 } |
1a1765a87336
More MSN fixes to go along with f0df27a299120baecf9ea88a9fb24ffe1dbe72fd:
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
25582
diff
changeset
|
967 #if 0 |
1a1765a87336
More MSN fixes to go along with f0df27a299120baecf9ea88a9fb24ffe1dbe72fd:
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
25582
diff
changeset
|
968 /* If the server didn't send us a corresponding email address for this |
1a1765a87336
More MSN fixes to go along with f0df27a299120baecf9ea88a9fb24ffe1dbe72fd:
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
25582
diff
changeset
|
969 FQY error, it's probably going to disconnect us. So it isn't necessary |
1a1765a87336
More MSN fixes to go along with f0df27a299120baecf9ea88a9fb24ffe1dbe72fd:
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
25582
diff
changeset
|
970 to tell the handler about it. */ |
1a1765a87336
More MSN fixes to go along with f0df27a299120baecf9ea88a9fb24ffe1dbe72fd:
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
25582
diff
changeset
|
971 else if (trans->data) |
25633
c384d62009c0
*** Plucked rev b932d4f94f9c771877b6a8a6a1d7dd3ea9c08005 (qulogic@pidgin.im):
Ka-Hing Cheung <khc@hxbc.us>
parents:
25606
diff
changeset
|
972 ((MsnFqyCb)trans->data)(session, NULL, MSN_NETWORK_UNKNOWN, NULL); |
25601
1a1765a87336
More MSN fixes to go along with f0df27a299120baecf9ea88a9fb24ffe1dbe72fd:
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
25582
diff
changeset
|
973 #endif |
1a1765a87336
More MSN fixes to go along with f0df27a299120baecf9ea88a9fb24ffe1dbe72fd:
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
25582
diff
changeset
|
974 } |
1a1765a87336
More MSN fixes to go along with f0df27a299120baecf9ea88a9fb24ffe1dbe72fd:
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
25582
diff
changeset
|
975 |
1a1765a87336
More MSN fixes to go along with f0df27a299120baecf9ea88a9fb24ffe1dbe72fd:
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
25582
diff
changeset
|
976 static void |
20394
4a099e4d0d09
propagate from branch 'im.pidgin.pidgin' (head 98b6b547b29ea1192b73cc4e1de1e674edef4328)
Richard Laager <rlaager@wiktel.com>
parents:
16063
diff
changeset
|
977 fqy_cmd(MsnCmdProc *cmdproc, MsnCommand *cmd) |
4a099e4d0d09
propagate from branch 'im.pidgin.pidgin' (head 98b6b547b29ea1192b73cc4e1de1e674edef4328)
Richard Laager <rlaager@wiktel.com>
parents:
16063
diff
changeset
|
978 { |
23519
7bceac816e19
The great MSN debug message cleanup! Threw in a few whitespace fixes,
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
23517
diff
changeset
|
979 purple_debug_info("msn", "Process FQY\n"); |
20481
eb93710aec4d
Make buddy and group management actually work, add some SOAP templates, redesign some parts of code and separate some bigger functions into its smaller tasks which are completely unrelated to each other
Carlos Silva <typ0@pidgin.im>
parents:
20477
diff
changeset
|
980 cmdproc->last_cmd->payload_cb = fqy_cmd_post; |
23514
7e16d193bb57
Get rid of that whole msn_set_payload_len thing and correctly set the
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
23512
diff
changeset
|
981 cmd->payload_len = atoi(cmd->params[1]); |
7e16d193bb57
Get rid of that whole msn_set_payload_len thing and correctly set the
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
23512
diff
changeset
|
982 } |
7e16d193bb57
Get rid of that whole msn_set_payload_len thing and correctly set the
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
23512
diff
changeset
|
983 |
7e16d193bb57
Get rid of that whole msn_set_payload_len thing and correctly set the
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
23512
diff
changeset
|
984 static void |
7e16d193bb57
Get rid of that whole msn_set_payload_len thing and correctly set the
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
23512
diff
changeset
|
985 rml_cmd_post(MsnCmdProc *cmdproc, MsnCommand *cmd, char *payload, |
7e16d193bb57
Get rid of that whole msn_set_payload_len thing and correctly set the
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
23512
diff
changeset
|
986 size_t len) |
7e16d193bb57
Get rid of that whole msn_set_payload_len thing and correctly set the
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
23512
diff
changeset
|
987 { |
7e16d193bb57
Get rid of that whole msn_set_payload_len thing and correctly set the
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
23512
diff
changeset
|
988 if (payload != NULL) |
7e16d193bb57
Get rid of that whole msn_set_payload_len thing and correctly set the
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
23512
diff
changeset
|
989 purple_debug_info("msn", "Received RML:\n%s\n", payload); |
20394
4a099e4d0d09
propagate from branch 'im.pidgin.pidgin' (head 98b6b547b29ea1192b73cc4e1de1e674edef4328)
Richard Laager <rlaager@wiktel.com>
parents:
16063
diff
changeset
|
990 } |
15373
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
991 |
20394
4a099e4d0d09
propagate from branch 'im.pidgin.pidgin' (head 98b6b547b29ea1192b73cc4e1de1e674edef4328)
Richard Laager <rlaager@wiktel.com>
parents:
16063
diff
changeset
|
992 static void |
4a099e4d0d09
propagate from branch 'im.pidgin.pidgin' (head 98b6b547b29ea1192b73cc4e1de1e674edef4328)
Richard Laager <rlaager@wiktel.com>
parents:
16063
diff
changeset
|
993 rml_cmd(MsnCmdProc *cmdproc, MsnCommand *cmd) |
4a099e4d0d09
propagate from branch 'im.pidgin.pidgin' (head 98b6b547b29ea1192b73cc4e1de1e674edef4328)
Richard Laager <rlaager@wiktel.com>
parents:
16063
diff
changeset
|
994 { |
23519
7bceac816e19
The great MSN debug message cleanup! Threw in a few whitespace fixes,
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
23517
diff
changeset
|
995 purple_debug_info("msn", "Process RML\n"); |
23514
7e16d193bb57
Get rid of that whole msn_set_payload_len thing and correctly set the
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
23512
diff
changeset
|
996 cmd->payload_len = atoi(cmd->params[1]); |
7e16d193bb57
Get rid of that whole msn_set_payload_len thing and correctly set the
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
23512
diff
changeset
|
997 cmdproc->last_cmd->payload_cb = rml_cmd_post; |
15373
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
998 } |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
999 |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1000 static void |
17128
3e463ddf18f7
Periodically refresh the authentication info required to automatically log
Stu Tomlinson <stu@nosnilmot.com>
parents:
17105
diff
changeset
|
1001 qng_cmd(MsnCmdProc *cmdproc, MsnCommand *cmd) |
3e463ddf18f7
Periodically refresh the authentication info required to automatically log
Stu Tomlinson <stu@nosnilmot.com>
parents:
17105
diff
changeset
|
1002 { |
23554
ab70eae012f5
Fixup MSN mailbox handling based on a patch from Felipe, plus various
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
23528
diff
changeset
|
1003 /* TODO: Call PNG after the timeout specified. */ |
17128
3e463ddf18f7
Periodically refresh the authentication info required to automatically log
Stu Tomlinson <stu@nosnilmot.com>
parents:
17105
diff
changeset
|
1004 } |
3e463ddf18f7
Periodically refresh the authentication info required to automatically log
Stu Tomlinson <stu@nosnilmot.com>
parents:
17105
diff
changeset
|
1005 |
3e463ddf18f7
Periodically refresh the authentication info required to automatically log
Stu Tomlinson <stu@nosnilmot.com>
parents:
17105
diff
changeset
|
1006 |
3e463ddf18f7
Periodically refresh the authentication info required to automatically log
Stu Tomlinson <stu@nosnilmot.com>
parents:
17105
diff
changeset
|
1007 static void |
15373
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1008 fln_cmd(MsnCmdProc *cmdproc, MsnCommand *cmd) |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1009 { |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1010 MsnUser *user; |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1011 |
23305
27f7fae4a361
Add a few bits of documentation
Mark Doliner <mark@kingant.net>
parents:
23301
diff
changeset
|
1012 /* Tell libpurple that the user has signed off */ |
15373
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1013 user = msn_userlist_find_user(cmdproc->session->userlist, cmd->params[0]); |
23498
80d09f42b157
A patch from felipec to consistently use NULL for the status of offline
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
23496
diff
changeset
|
1014 msn_user_set_state(user, NULL); |
15373
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1015 msn_user_update(user); |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1016 } |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1017 |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1018 static void |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1019 iln_cmd(MsnCmdProc *cmdproc, MsnCommand *cmd) |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1020 { |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1021 MsnSession *session; |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1022 MsnUser *user; |
23936
54432ea0a5ab
Support some older versions of the ILN command. Apparently some IM
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
23935
diff
changeset
|
1023 MsnObject *msnobj = NULL; |
30671
fc7798a661f7
Also parse extended capabilities from ILN. Probably don't need to do so in
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
30669
diff
changeset
|
1024 unsigned long clientid, extcaps; |
fc7798a661f7
Also parse extended capabilities from ILN. Probably don't need to do so in
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
30669
diff
changeset
|
1025 char *extcap_str; |
23936
54432ea0a5ab
Support some older versions of the ILN command. Apparently some IM
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
23935
diff
changeset
|
1026 int networkid = 0; |
54432ea0a5ab
Support some older versions of the ILN command. Apparently some IM
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
23935
diff
changeset
|
1027 const char *state, *passport; |
54432ea0a5ab
Support some older versions of the ILN command. Apparently some IM
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
23935
diff
changeset
|
1028 char *friendly; |
15373
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1029 |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1030 session = cmdproc->session; |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1031 |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1032 state = cmd->params[1]; |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1033 passport = cmd->params[2]; |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1034 |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1035 user = msn_userlist_find_user(session->userlist, passport); |
23936
54432ea0a5ab
Support some older versions of the ILN command. Apparently some IM
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
23935
diff
changeset
|
1036 if (user == NULL) |
54432ea0a5ab
Support some older versions of the ILN command. Apparently some IM
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
23935
diff
changeset
|
1037 /* Where'd this come from? */ |
54432ea0a5ab
Support some older versions of the ILN command. Apparently some IM
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
23935
diff
changeset
|
1038 return; |
54432ea0a5ab
Support some older versions of the ILN command. Apparently some IM
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
23935
diff
changeset
|
1039 |
28461
6100cb11bae8
Parse online presence from yahoo buddies after going online on MSN.
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
28378
diff
changeset
|
1040 if (cmd->param_count == 8) { |
6100cb11bae8
Parse online presence from yahoo buddies after going online on MSN.
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
28378
diff
changeset
|
1041 /* Yahoo! Buddy, looks like */ |
6100cb11bae8
Parse online presence from yahoo buddies after going online on MSN.
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
28378
diff
changeset
|
1042 networkid = atoi(cmd->params[3]); |
6100cb11bae8
Parse online presence from yahoo buddies after going online on MSN.
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
28378
diff
changeset
|
1043 friendly = g_strdup(purple_url_decode(cmd->params[4])); |
30671
fc7798a661f7
Also parse extended capabilities from ILN. Probably don't need to do so in
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
30669
diff
changeset
|
1044 clientid = strtoul(cmd->params[5], &extcap_str, 10); |
fc7798a661f7
Also parse extended capabilities from ILN. Probably don't need to do so in
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
30669
diff
changeset
|
1045 if (session->protocol_ver >= 16 && extcap_str && *extcap_str) |
fc7798a661f7
Also parse extended capabilities from ILN. Probably don't need to do so in
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
30669
diff
changeset
|
1046 extcaps = strtoul(extcap_str+1, NULL, 10); |
fc7798a661f7
Also parse extended capabilities from ILN. Probably don't need to do so in
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
30669
diff
changeset
|
1047 else |
fc7798a661f7
Also parse extended capabilities from ILN. Probably don't need to do so in
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
30669
diff
changeset
|
1048 extcaps = 0; |
28461
6100cb11bae8
Parse online presence from yahoo buddies after going online on MSN.
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
28378
diff
changeset
|
1049 |
6100cb11bae8
Parse online presence from yahoo buddies after going online on MSN.
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
28378
diff
changeset
|
1050 /* cmd->params[7] seems to be a URL to a Yahoo! icon: |
6100cb11bae8
Parse online presence from yahoo buddies after going online on MSN.
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
28378
diff
changeset
|
1051 https://sec.yimg.com/i/us/nt/b/purpley.1.0.png |
6100cb11bae8
Parse online presence from yahoo buddies after going online on MSN.
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
28378
diff
changeset
|
1052 ... and it's purple, HAH! |
6100cb11bae8
Parse online presence from yahoo buddies after going online on MSN.
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
28378
diff
changeset
|
1053 */ |
6100cb11bae8
Parse online presence from yahoo buddies after going online on MSN.
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
28378
diff
changeset
|
1054 } else if (cmd->param_count == 7) { |
23936
54432ea0a5ab
Support some older versions of the ILN command. Apparently some IM
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
23935
diff
changeset
|
1055 /* MSNP14+ with Display Picture object */ |
54432ea0a5ab
Support some older versions of the ILN command. Apparently some IM
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
23935
diff
changeset
|
1056 networkid = atoi(cmd->params[3]); |
54432ea0a5ab
Support some older versions of the ILN command. Apparently some IM
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
23935
diff
changeset
|
1057 friendly = g_strdup(purple_url_decode(cmd->params[4])); |
30671
fc7798a661f7
Also parse extended capabilities from ILN. Probably don't need to do so in
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
30669
diff
changeset
|
1058 clientid = strtoul(cmd->params[5], &extcap_str, 10); |
fc7798a661f7
Also parse extended capabilities from ILN. Probably don't need to do so in
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
30669
diff
changeset
|
1059 if (session->protocol_ver >= 16 && extcap_str && *extcap_str) |
fc7798a661f7
Also parse extended capabilities from ILN. Probably don't need to do so in
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
30669
diff
changeset
|
1060 extcaps = strtoul(extcap_str+1, NULL, 10); |
fc7798a661f7
Also parse extended capabilities from ILN. Probably don't need to do so in
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
30669
diff
changeset
|
1061 else |
fc7798a661f7
Also parse extended capabilities from ILN. Probably don't need to do so in
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
30669
diff
changeset
|
1062 extcaps = 0; |
23936
54432ea0a5ab
Support some older versions of the ILN command. Apparently some IM
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
23935
diff
changeset
|
1063 msnobj = msn_object_new_from_string(purple_url_decode(cmd->params[6])); |
54432ea0a5ab
Support some older versions of the ILN command. Apparently some IM
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
23935
diff
changeset
|
1064 } else if (cmd->param_count == 6) { |
54432ea0a5ab
Support some older versions of the ILN command. Apparently some IM
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
23935
diff
changeset
|
1065 /* Yes, this is 5. The friendly name could start with a number, |
54432ea0a5ab
Support some older versions of the ILN command. Apparently some IM
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
23935
diff
changeset
|
1066 but the display picture object can't... */ |
54432ea0a5ab
Support some older versions of the ILN command. Apparently some IM
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
23935
diff
changeset
|
1067 if (isdigit(cmd->params[5][0])) { |
54432ea0a5ab
Support some older versions of the ILN command. Apparently some IM
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
23935
diff
changeset
|
1068 /* MSNP14 without Display Picture object */ |
54432ea0a5ab
Support some older versions of the ILN command. Apparently some IM
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
23935
diff
changeset
|
1069 networkid = atoi(cmd->params[3]); |
54432ea0a5ab
Support some older versions of the ILN command. Apparently some IM
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
23935
diff
changeset
|
1070 friendly = g_strdup(purple_url_decode(cmd->params[4])); |
30671
fc7798a661f7
Also parse extended capabilities from ILN. Probably don't need to do so in
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
30669
diff
changeset
|
1071 clientid = strtoul(cmd->params[5], &extcap_str, 10); |
fc7798a661f7
Also parse extended capabilities from ILN. Probably don't need to do so in
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
30669
diff
changeset
|
1072 if (session->protocol_ver >= 16 && extcap_str && *extcap_str) |
fc7798a661f7
Also parse extended capabilities from ILN. Probably don't need to do so in
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
30669
diff
changeset
|
1073 extcaps = strtoul(extcap_str+1, NULL, 10); |
fc7798a661f7
Also parse extended capabilities from ILN. Probably don't need to do so in
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
30669
diff
changeset
|
1074 else |
fc7798a661f7
Also parse extended capabilities from ILN. Probably don't need to do so in
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
30669
diff
changeset
|
1075 extcaps = 0; |
23936
54432ea0a5ab
Support some older versions of the ILN command. Apparently some IM
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
23935
diff
changeset
|
1076 } else { |
54432ea0a5ab
Support some older versions of the ILN command. Apparently some IM
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
23935
diff
changeset
|
1077 /* MSNP8+ with Display Picture object */ |
54432ea0a5ab
Support some older versions of the ILN command. Apparently some IM
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
23935
diff
changeset
|
1078 friendly = g_strdup(purple_url_decode(cmd->params[3])); |
30671
fc7798a661f7
Also parse extended capabilities from ILN. Probably don't need to do so in
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
30669
diff
changeset
|
1079 clientid = strtoul(cmd->params[4], &extcap_str, 10); |
fc7798a661f7
Also parse extended capabilities from ILN. Probably don't need to do so in
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
30669
diff
changeset
|
1080 if (session->protocol_ver >= 16 && extcap_str && *extcap_str) |
fc7798a661f7
Also parse extended capabilities from ILN. Probably don't need to do so in
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
30669
diff
changeset
|
1081 extcaps = strtoul(extcap_str+1, NULL, 10); |
fc7798a661f7
Also parse extended capabilities from ILN. Probably don't need to do so in
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
30669
diff
changeset
|
1082 else |
fc7798a661f7
Also parse extended capabilities from ILN. Probably don't need to do so in
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
30669
diff
changeset
|
1083 extcaps = 0; |
23936
54432ea0a5ab
Support some older versions of the ILN command. Apparently some IM
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
23935
diff
changeset
|
1084 msnobj = msn_object_new_from_string(purple_url_decode(cmd->params[5])); |
54432ea0a5ab
Support some older versions of the ILN command. Apparently some IM
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
23935
diff
changeset
|
1085 } |
54432ea0a5ab
Support some older versions of the ILN command. Apparently some IM
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
23935
diff
changeset
|
1086 } else if (cmd->param_count == 5) { |
54432ea0a5ab
Support some older versions of the ILN command. Apparently some IM
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
23935
diff
changeset
|
1087 /* MSNP8+ without Display Picture object */ |
54432ea0a5ab
Support some older versions of the ILN command. Apparently some IM
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
23935
diff
changeset
|
1088 friendly = g_strdup(purple_url_decode(cmd->params[3])); |
30671
fc7798a661f7
Also parse extended capabilities from ILN. Probably don't need to do so in
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
30669
diff
changeset
|
1089 clientid = strtoul(cmd->params[4], &extcap_str, 10); |
fc7798a661f7
Also parse extended capabilities from ILN. Probably don't need to do so in
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
30669
diff
changeset
|
1090 if (session->protocol_ver >= 16 && extcap_str && *extcap_str) |
fc7798a661f7
Also parse extended capabilities from ILN. Probably don't need to do so in
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
30669
diff
changeset
|
1091 extcaps = strtoul(extcap_str+1, NULL, 10); |
fc7798a661f7
Also parse extended capabilities from ILN. Probably don't need to do so in
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
30669
diff
changeset
|
1092 else |
fc7798a661f7
Also parse extended capabilities from ILN. Probably don't need to do so in
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
30669
diff
changeset
|
1093 extcaps = 0; |
23936
54432ea0a5ab
Support some older versions of the ILN command. Apparently some IM
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
23935
diff
changeset
|
1094 } else { |
54432ea0a5ab
Support some older versions of the ILN command. Apparently some IM
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
23935
diff
changeset
|
1095 purple_debug_warning("msn", "Received ILN with unknown number of parameters.\n"); |
54432ea0a5ab
Support some older versions of the ILN command. Apparently some IM
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
23935
diff
changeset
|
1096 return; |
54432ea0a5ab
Support some older versions of the ILN command. Apparently some IM
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
23935
diff
changeset
|
1097 } |
15373
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1098 |
25394
ea9e0fa89c02
Update the Address Book when we recieve a new friendly name for a buddy.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
25393
diff
changeset
|
1099 if (msn_user_set_friendly_name(user, friendly)) { |
ea9e0fa89c02
Update the Address Book when we recieve a new friendly name for a buddy.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
25393
diff
changeset
|
1100 msn_update_contact(session, passport, MSN_UPDATE_DISPLAY, friendly); |
ea9e0fa89c02
Update the Address Book when we recieve a new friendly name for a buddy.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
25393
diff
changeset
|
1101 } |
23936
54432ea0a5ab
Support some older versions of the ILN command. Apparently some IM
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
23935
diff
changeset
|
1102 g_free(friendly); |
15373
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1103 |
23936
54432ea0a5ab
Support some older versions of the ILN command. Apparently some IM
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
23935
diff
changeset
|
1104 msn_user_set_object(user, msnobj); |
15373
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1105 |
31208
d235da74af79
Updated client capabilities and networks from msnpsharp.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
31086
diff
changeset
|
1106 user->mobile = (clientid & MSN_CAP_MOBILE_ON) || (user->extinfo && user->extinfo->phone_mobile && user->extinfo->phone_mobile[0] == '+'); |
23478
31b5a1334e7e
Modifications to the MSN code for some stuff I'll be doing in later
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
23477
diff
changeset
|
1107 msn_user_set_clientid(user, clientid); |
30671
fc7798a661f7
Also parse extended capabilities from ILN. Probably don't need to do so in
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
30669
diff
changeset
|
1108 msn_user_set_extcaps(user, extcaps); |
23478
31b5a1334e7e
Modifications to the MSN code for some stuff I'll be doing in later
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
23477
diff
changeset
|
1109 msn_user_set_network(user, networkid); |
22570
1168dc635ac1
some other mobile stuff that Maiku fixed, fixes #2359
Ka-Hing Cheung <khc@hxbc.us>
parents:
22536
diff
changeset
|
1110 |
15373
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1111 msn_user_set_state(user, state); |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1112 msn_user_update(user); |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1113 } |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1114 |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1115 static void |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1116 ipg_cmd_post(MsnCmdProc *cmdproc, MsnCommand *cmd, char *payload, size_t len) |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1117 { |
22536
575c4bda3b23
another patch from Maiku, this time handling IPG so we can receive paging.
Ka-Hing Cheung <khc@hxbc.us>
parents:
22535
diff
changeset
|
1118 PurpleConnection *gc; |
575c4bda3b23
another patch from Maiku, this time handling IPG so we can receive paging.
Ka-Hing Cheung <khc@hxbc.us>
parents:
22535
diff
changeset
|
1119 MsnUserList *userlist; |
24192
c5488f91bf3b
Fix a possible xmlnode leak and an extra g_strdup when processing
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
24172
diff
changeset
|
1120 const char *who = NULL; |
c5488f91bf3b
Fix a possible xmlnode leak and an extra g_strdup when processing
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
24172
diff
changeset
|
1121 char *text = NULL; |
23570
d370388bfc89
Report an error when an MSN Mobile message was not sent because it was
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
23554
diff
changeset
|
1122 const char *id = NULL; |
d370388bfc89
Report an error when an MSN Mobile message was not sent because it was
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
23554
diff
changeset
|
1123 xmlnode *payloadNode, *from, *msg, *textNode; |
22536
575c4bda3b23
another patch from Maiku, this time handling IPG so we can receive paging.
Ka-Hing Cheung <khc@hxbc.us>
parents:
22535
diff
changeset
|
1124 |
15822 | 1125 purple_debug_misc("msn", "Incoming Page: {%s}\n", payload); |
22536
575c4bda3b23
another patch from Maiku, this time handling IPG so we can receive paging.
Ka-Hing Cheung <khc@hxbc.us>
parents:
22535
diff
changeset
|
1126 |
575c4bda3b23
another patch from Maiku, this time handling IPG so we can receive paging.
Ka-Hing Cheung <khc@hxbc.us>
parents:
22535
diff
changeset
|
1127 userlist = cmdproc->session->userlist; |
575c4bda3b23
another patch from Maiku, this time handling IPG so we can receive paging.
Ka-Hing Cheung <khc@hxbc.us>
parents:
22535
diff
changeset
|
1128 gc = purple_account_get_connection(cmdproc->session->account); |
575c4bda3b23
another patch from Maiku, this time handling IPG so we can receive paging.
Ka-Hing Cheung <khc@hxbc.us>
parents:
22535
diff
changeset
|
1129 |
575c4bda3b23
another patch from Maiku, this time handling IPG so we can receive paging.
Ka-Hing Cheung <khc@hxbc.us>
parents:
22535
diff
changeset
|
1130 /* payload looks like this: |
575c4bda3b23
another patch from Maiku, this time handling IPG so we can receive paging.
Ka-Hing Cheung <khc@hxbc.us>
parents:
22535
diff
changeset
|
1131 <?xml version="1.0"?> |
575c4bda3b23
another patch from Maiku, this time handling IPG so we can receive paging.
Ka-Hing Cheung <khc@hxbc.us>
parents:
22535
diff
changeset
|
1132 <NOTIFICATION id="0" siteid="111100400" siteurl="http://mobile.msn.com/"> |
575c4bda3b23
another patch from Maiku, this time handling IPG so we can receive paging.
Ka-Hing Cheung <khc@hxbc.us>
parents:
22535
diff
changeset
|
1133 <TO name="passport@example.com"> |
575c4bda3b23
another patch from Maiku, this time handling IPG so we can receive paging.
Ka-Hing Cheung <khc@hxbc.us>
parents:
22535
diff
changeset
|
1134 <VIA agent="mobile"/> |
575c4bda3b23
another patch from Maiku, this time handling IPG so we can receive paging.
Ka-Hing Cheung <khc@hxbc.us>
parents:
22535
diff
changeset
|
1135 </TO> |
575c4bda3b23
another patch from Maiku, this time handling IPG so we can receive paging.
Ka-Hing Cheung <khc@hxbc.us>
parents:
22535
diff
changeset
|
1136 <FROM name="tel:+XXXXXXXXXXX"/> |
575c4bda3b23
another patch from Maiku, this time handling IPG so we can receive paging.
Ka-Hing Cheung <khc@hxbc.us>
parents:
22535
diff
changeset
|
1137 <MSG pri="1" id="1"> |
575c4bda3b23
another patch from Maiku, this time handling IPG so we can receive paging.
Ka-Hing Cheung <khc@hxbc.us>
parents:
22535
diff
changeset
|
1138 <CAT Id="110110001"/> |
575c4bda3b23
another patch from Maiku, this time handling IPG so we can receive paging.
Ka-Hing Cheung <khc@hxbc.us>
parents:
22535
diff
changeset
|
1139 <ACTION url="2wayIM.asp"/> |
575c4bda3b23
another patch from Maiku, this time handling IPG so we can receive paging.
Ka-Hing Cheung <khc@hxbc.us>
parents:
22535
diff
changeset
|
1140 <SUBSCR url="2wayIM.asp"/> |
575c4bda3b23
another patch from Maiku, this time handling IPG so we can receive paging.
Ka-Hing Cheung <khc@hxbc.us>
parents:
22535
diff
changeset
|
1141 <BODY lcid="1033"> |
575c4bda3b23
another patch from Maiku, this time handling IPG so we can receive paging.
Ka-Hing Cheung <khc@hxbc.us>
parents:
22535
diff
changeset
|
1142 <TEXT>Message was here</TEXT> |
575c4bda3b23
another patch from Maiku, this time handling IPG so we can receive paging.
Ka-Hing Cheung <khc@hxbc.us>
parents:
22535
diff
changeset
|
1143 </BODY> |
575c4bda3b23
another patch from Maiku, this time handling IPG so we can receive paging.
Ka-Hing Cheung <khc@hxbc.us>
parents:
22535
diff
changeset
|
1144 </MSG> |
575c4bda3b23
another patch from Maiku, this time handling IPG so we can receive paging.
Ka-Hing Cheung <khc@hxbc.us>
parents:
22535
diff
changeset
|
1145 </NOTIFICATION> |
575c4bda3b23
another patch from Maiku, this time handling IPG so we can receive paging.
Ka-Hing Cheung <khc@hxbc.us>
parents:
22535
diff
changeset
|
1146 */ |
575c4bda3b23
another patch from Maiku, this time handling IPG so we can receive paging.
Ka-Hing Cheung <khc@hxbc.us>
parents:
22535
diff
changeset
|
1147 |
23570
d370388bfc89
Report an error when an MSN Mobile message was not sent because it was
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
23554
diff
changeset
|
1148 /* This is the payload if your message was too long: |
d370388bfc89
Report an error when an MSN Mobile message was not sent because it was
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
23554
diff
changeset
|
1149 <NOTIFICATION id="TrID" siteid="111100400" siteurl="http://mobile.msn.com/"> |
d370388bfc89
Report an error when an MSN Mobile message was not sent because it was
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
23554
diff
changeset
|
1150 <TO name="passport@example.com"> |
d370388bfc89
Report an error when an MSN Mobile message was not sent because it was
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
23554
diff
changeset
|
1151 <VIA agent="mobile"/> |
d370388bfc89
Report an error when an MSN Mobile message was not sent because it was
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
23554
diff
changeset
|
1152 </TO> |
d370388bfc89
Report an error when an MSN Mobile message was not sent because it was
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
23554
diff
changeset
|
1153 <FROM name="tel:+XXXXXXXXXXX"/> |
d370388bfc89
Report an error when an MSN Mobile message was not sent because it was
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
23554
diff
changeset
|
1154 <MSG pri="1" id="407"> |
d370388bfc89
Report an error when an MSN Mobile message was not sent because it was
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
23554
diff
changeset
|
1155 <CAT Id="110110001"/> |
d370388bfc89
Report an error when an MSN Mobile message was not sent because it was
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
23554
diff
changeset
|
1156 <ACTION url="2wayIM.asp"/> |
d370388bfc89
Report an error when an MSN Mobile message was not sent because it was
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
23554
diff
changeset
|
1157 <SUBSCR url="2wayIM.asp"/> |
d370388bfc89
Report an error when an MSN Mobile message was not sent because it was
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
23554
diff
changeset
|
1158 <BODY lcid="1033"> |
d370388bfc89
Report an error when an MSN Mobile message was not sent because it was
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
23554
diff
changeset
|
1159 <TEXT></TEXT> |
d370388bfc89
Report an error when an MSN Mobile message was not sent because it was
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
23554
diff
changeset
|
1160 </BODY> |
d370388bfc89
Report an error when an MSN Mobile message was not sent because it was
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
23554
diff
changeset
|
1161 </MSG> |
d370388bfc89
Report an error when an MSN Mobile message was not sent because it was
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
23554
diff
changeset
|
1162 </NOTIFICATION> |
d370388bfc89
Report an error when an MSN Mobile message was not sent because it was
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
23554
diff
changeset
|
1163 */ |
d370388bfc89
Report an error when an MSN Mobile message was not sent because it was
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
23554
diff
changeset
|
1164 |
24192
c5488f91bf3b
Fix a possible xmlnode leak and an extra g_strdup when processing
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
24172
diff
changeset
|
1165 payloadNode = xmlnode_from_str(payload, len); |
c5488f91bf3b
Fix a possible xmlnode leak and an extra g_strdup when processing
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
24172
diff
changeset
|
1166 if (!payloadNode) |
22536
575c4bda3b23
another patch from Maiku, this time handling IPG so we can receive paging.
Ka-Hing Cheung <khc@hxbc.us>
parents:
22535
diff
changeset
|
1167 return; |
575c4bda3b23
another patch from Maiku, this time handling IPG so we can receive paging.
Ka-Hing Cheung <khc@hxbc.us>
parents:
22535
diff
changeset
|
1168 |
24192
c5488f91bf3b
Fix a possible xmlnode leak and an extra g_strdup when processing
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
24172
diff
changeset
|
1169 if (!(from = xmlnode_get_child(payloadNode, "FROM")) || |
c5488f91bf3b
Fix a possible xmlnode leak and an extra g_strdup when processing
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
24172
diff
changeset
|
1170 !(msg = xmlnode_get_child(payloadNode, "MSG")) || |
c5488f91bf3b
Fix a possible xmlnode leak and an extra g_strdup when processing
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
24172
diff
changeset
|
1171 !(textNode = xmlnode_get_child(msg, "BODY/TEXT"))) { |
c5488f91bf3b
Fix a possible xmlnode leak and an extra g_strdup when processing
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
24172
diff
changeset
|
1172 xmlnode_free(payloadNode); |
c5488f91bf3b
Fix a possible xmlnode leak and an extra g_strdup when processing
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
24172
diff
changeset
|
1173 return; |
c5488f91bf3b
Fix a possible xmlnode leak and an extra g_strdup when processing
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
24172
diff
changeset
|
1174 } |
c5488f91bf3b
Fix a possible xmlnode leak and an extra g_strdup when processing
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
24172
diff
changeset
|
1175 |
c5488f91bf3b
Fix a possible xmlnode leak and an extra g_strdup when processing
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
24172
diff
changeset
|
1176 who = xmlnode_get_attrib(from, "name"); |
22536
575c4bda3b23
another patch from Maiku, this time handling IPG so we can receive paging.
Ka-Hing Cheung <khc@hxbc.us>
parents:
22535
diff
changeset
|
1177 if (!who) return; |
575c4bda3b23
another patch from Maiku, this time handling IPG so we can receive paging.
Ka-Hing Cheung <khc@hxbc.us>
parents:
22535
diff
changeset
|
1178 |
575c4bda3b23
another patch from Maiku, this time handling IPG so we can receive paging.
Ka-Hing Cheung <khc@hxbc.us>
parents:
22535
diff
changeset
|
1179 text = xmlnode_get_data(textNode); |
575c4bda3b23
another patch from Maiku, this time handling IPG so we can receive paging.
Ka-Hing Cheung <khc@hxbc.us>
parents:
22535
diff
changeset
|
1180 |
575c4bda3b23
another patch from Maiku, this time handling IPG so we can receive paging.
Ka-Hing Cheung <khc@hxbc.us>
parents:
22535
diff
changeset
|
1181 /* Match number to user's mobile number, FROM is a phone number if the |
575c4bda3b23
another patch from Maiku, this time handling IPG so we can receive paging.
Ka-Hing Cheung <khc@hxbc.us>
parents:
22535
diff
changeset
|
1182 other side page you using your phone number */ |
23570
d370388bfc89
Report an error when an MSN Mobile message was not sent because it was
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
23554
diff
changeset
|
1183 if (!strncmp(who, "tel:+", 5)) { |
22536
575c4bda3b23
another patch from Maiku, this time handling IPG so we can receive paging.
Ka-Hing Cheung <khc@hxbc.us>
parents:
22535
diff
changeset
|
1184 MsnUser *user = |
575c4bda3b23
another patch from Maiku, this time handling IPG so we can receive paging.
Ka-Hing Cheung <khc@hxbc.us>
parents:
22535
diff
changeset
|
1185 msn_userlist_find_user_with_mobile_phone(userlist, who + 4); |
575c4bda3b23
another patch from Maiku, this time handling IPG so we can receive paging.
Ka-Hing Cheung <khc@hxbc.us>
parents:
22535
diff
changeset
|
1186 |
24192
c5488f91bf3b
Fix a possible xmlnode leak and an extra g_strdup when processing
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
24172
diff
changeset
|
1187 if (user && user->passport) |
c5488f91bf3b
Fix a possible xmlnode leak and an extra g_strdup when processing
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
24172
diff
changeset
|
1188 who = user->passport; |
22536
575c4bda3b23
another patch from Maiku, this time handling IPG so we can receive paging.
Ka-Hing Cheung <khc@hxbc.us>
parents:
22535
diff
changeset
|
1189 } |
575c4bda3b23
another patch from Maiku, this time handling IPG so we can receive paging.
Ka-Hing Cheung <khc@hxbc.us>
parents:
22535
diff
changeset
|
1190 |
23570
d370388bfc89
Report an error when an MSN Mobile message was not sent because it was
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
23554
diff
changeset
|
1191 id = xmlnode_get_attrib(msg, "id"); |
d370388bfc89
Report an error when an MSN Mobile message was not sent because it was
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
23554
diff
changeset
|
1192 |
31381
c78c13eee4e6
Output an error if the notification id was not 1 instead of it's just
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
31208
diff
changeset
|
1193 if (id && strcmp(id, "1")) { |
28064
e7a2e2208f88
Display the full message when there are errors sending a MSN Mobile message
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
27432
diff
changeset
|
1194 PurpleConversation *conv |
e7a2e2208f88
Display the full message when there are errors sending a MSN Mobile message
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
27432
diff
changeset
|
1195 = purple_find_conversation_with_account(PURPLE_CONV_TYPE_ANY, |
e7a2e2208f88
Display the full message when there are errors sending a MSN Mobile message
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
27432
diff
changeset
|
1196 who, gc->account); |
e7a2e2208f88
Display the full message when there are errors sending a MSN Mobile message
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
27432
diff
changeset
|
1197 if (conv != NULL) { |
31381
c78c13eee4e6
Output an error if the notification id was not 1 instead of it's just
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
31208
diff
changeset
|
1198 const char *error; |
c78c13eee4e6
Output an error if the notification id was not 1 instead of it's just
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
31208
diff
changeset
|
1199 if (!strcmp(id, "407")) |
c78c13eee4e6
Output an error if the notification id was not 1 instead of it's just
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
31208
diff
changeset
|
1200 error = _("Mobile message was not sent because it was too long."); |
c78c13eee4e6
Output an error if the notification id was not 1 instead of it's just
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
31208
diff
changeset
|
1201 else |
c78c13eee4e6
Output an error if the notification id was not 1 instead of it's just
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
31208
diff
changeset
|
1202 error = _("Mobile message was not sent because an unknown error occurred."); |
c78c13eee4e6
Output an error if the notification id was not 1 instead of it's just
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
31208
diff
changeset
|
1203 |
c78c13eee4e6
Output an error if the notification id was not 1 instead of it's just
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
31208
diff
changeset
|
1204 purple_conversation_write(conv, NULL, error, |
28064
e7a2e2208f88
Display the full message when there are errors sending a MSN Mobile message
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
27432
diff
changeset
|
1205 PURPLE_MESSAGE_ERROR, time(NULL)); |
e7a2e2208f88
Display the full message when there are errors sending a MSN Mobile message
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
27432
diff
changeset
|
1206 |
e7a2e2208f88
Display the full message when there are errors sending a MSN Mobile message
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
27432
diff
changeset
|
1207 if ((id = xmlnode_get_attrib(payloadNode, "id")) != NULL) { |
e7a2e2208f88
Display the full message when there are errors sending a MSN Mobile message
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
27432
diff
changeset
|
1208 unsigned int trId = atol(id); |
e7a2e2208f88
Display the full message when there are errors sending a MSN Mobile message
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
27432
diff
changeset
|
1209 MsnTransaction *trans; |
23570
d370388bfc89
Report an error when an MSN Mobile message was not sent because it was
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
23554
diff
changeset
|
1210 |
28064
e7a2e2208f88
Display the full message when there are errors sending a MSN Mobile message
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
27432
diff
changeset
|
1211 trans = msn_history_find(cmdproc->history, trId); |
31382
7b021b6a09af
Make sure we don't crash if we can't find the transaction for the
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
31381
diff
changeset
|
1212 if (trans) { |
7b021b6a09af
Make sure we don't crash if we can't find the transaction for the
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
31381
diff
changeset
|
1213 MsnMessage *msg = (MsnMessage *)trans->data; |
7b021b6a09af
Make sure we don't crash if we can't find the transaction for the
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
31381
diff
changeset
|
1214 |
7b021b6a09af
Make sure we don't crash if we can't find the transaction for the
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
31381
diff
changeset
|
1215 if (msg) { |
7b021b6a09af
Make sure we don't crash if we can't find the transaction for the
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
31381
diff
changeset
|
1216 char *body_str = msn_message_to_string(msg); |
7b021b6a09af
Make sure we don't crash if we can't find the transaction for the
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
31381
diff
changeset
|
1217 char *body_enc = g_markup_escape_text(body_str, -1); |
7b021b6a09af
Make sure we don't crash if we can't find the transaction for the
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
31381
diff
changeset
|
1218 |
7b021b6a09af
Make sure we don't crash if we can't find the transaction for the
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
31381
diff
changeset
|
1219 purple_conversation_write(conv, NULL, body_enc, |
7b021b6a09af
Make sure we don't crash if we can't find the transaction for the
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
31381
diff
changeset
|
1220 PURPLE_MESSAGE_RAW, time(NULL)); |
7b021b6a09af
Make sure we don't crash if we can't find the transaction for the
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
31381
diff
changeset
|
1221 |
7b021b6a09af
Make sure we don't crash if we can't find the transaction for the
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
31381
diff
changeset
|
1222 g_free(body_str); |
7b021b6a09af
Make sure we don't crash if we can't find the transaction for the
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
31381
diff
changeset
|
1223 g_free(body_enc); |
7b021b6a09af
Make sure we don't crash if we can't find the transaction for the
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
31381
diff
changeset
|
1224 msn_message_unref(msg); |
7b021b6a09af
Make sure we don't crash if we can't find the transaction for the
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
31381
diff
changeset
|
1225 trans->data = NULL; |
7b021b6a09af
Make sure we don't crash if we can't find the transaction for the
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
31381
diff
changeset
|
1226 } |
28064
e7a2e2208f88
Display the full message when there are errors sending a MSN Mobile message
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
27432
diff
changeset
|
1227 } |
e7a2e2208f88
Display the full message when there are errors sending a MSN Mobile message
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
27432
diff
changeset
|
1228 } |
e7a2e2208f88
Display the full message when there are errors sending a MSN Mobile message
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
27432
diff
changeset
|
1229 } |
23570
d370388bfc89
Report an error when an MSN Mobile message was not sent because it was
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
23554
diff
changeset
|
1230 } else { |
d370388bfc89
Report an error when an MSN Mobile message was not sent because it was
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
23554
diff
changeset
|
1231 serv_got_im(gc, who, text, 0, time(NULL)); |
d370388bfc89
Report an error when an MSN Mobile message was not sent because it was
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
23554
diff
changeset
|
1232 } |
22536
575c4bda3b23
another patch from Maiku, this time handling IPG so we can receive paging.
Ka-Hing Cheung <khc@hxbc.us>
parents:
22535
diff
changeset
|
1233 |
575c4bda3b23
another patch from Maiku, this time handling IPG so we can receive paging.
Ka-Hing Cheung <khc@hxbc.us>
parents:
22535
diff
changeset
|
1234 g_free(text); |
575c4bda3b23
another patch from Maiku, this time handling IPG so we can receive paging.
Ka-Hing Cheung <khc@hxbc.us>
parents:
22535
diff
changeset
|
1235 xmlnode_free(payloadNode); |
15373
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1236 } |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1237 |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1238 static void |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1239 ipg_cmd(MsnCmdProc *cmdproc, MsnCommand *cmd) |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1240 { |
23514
7e16d193bb57
Get rid of that whole msn_set_payload_len thing and correctly set the
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
23512
diff
changeset
|
1241 cmd->payload_len = atoi(cmd->params[0]); |
15373
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1242 cmdproc->last_cmd->payload_cb = ipg_cmd_post; |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1243 } |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1244 |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1245 static void |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1246 nln_cmd(MsnCmdProc *cmdproc, MsnCommand *cmd) |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1247 { |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1248 MsnSession *session; |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1249 MsnUser *user; |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1250 MsnObject *msnobj; |
30660
4cdea258b143
Save extended capabilities of an MSN buddy when receiving NLN.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
30658
diff
changeset
|
1251 unsigned long clientid, extcaps; |
4cdea258b143
Save extended capabilities of an MSN buddy when receiving NLN.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
30658
diff
changeset
|
1252 char *extcap_str; |
23478
31b5a1334e7e
Modifications to the MSN code for some stuff I'll be doing in later
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
23477
diff
changeset
|
1253 int networkid; |
25393
f5188d4d84e3
Move the check for whether to update the server alias out of nln_cmd and
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
24720
diff
changeset
|
1254 const char *state, *passport, *friendly; |
15373
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1255 |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1256 session = cmdproc->session; |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1257 |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1258 state = cmd->params[0]; |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1259 passport = cmd->params[1]; |
23478
31b5a1334e7e
Modifications to the MSN code for some stuff I'll be doing in later
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
23477
diff
changeset
|
1260 networkid = atoi(cmd->params[2]); |
20394
4a099e4d0d09
propagate from branch 'im.pidgin.pidgin' (head 98b6b547b29ea1192b73cc4e1de1e674edef4328)
Richard Laager <rlaager@wiktel.com>
parents:
16063
diff
changeset
|
1261 friendly = purple_url_decode(cmd->params[3]); |
15373
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1262 |
31022
78dccab9824c
Add the session user to the userlist. This reduces the amount of
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
31021
diff
changeset
|
1263 user = msn_userlist_find_user(session->userlist, passport); |
24168
a1a88c1bd59e
don't crash if we get a NLN command from someone not on the blist
Ka-Hing Cheung <khc@hxbc.us>
parents:
23988
diff
changeset
|
1264 if (user == NULL) return; |
15373
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1265 |
31021
007ae2d62ea4
Maybe I should actually put the fix in there too!
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
31007
diff
changeset
|
1266 if (msn_user_set_friendly_name(user, friendly) && user != session->user) |
15373
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1267 { |
25394
ea9e0fa89c02
Update the Address Book when we recieve a new friendly name for a buddy.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
25393
diff
changeset
|
1268 msn_update_contact(session, passport, MSN_UPDATE_DISPLAY, friendly); |
15373
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1269 } |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1270 |
23517
7f4473544c64
Fix updating the MSN buddy icon, which was probably broken by the
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
23514
diff
changeset
|
1271 if (cmd->param_count == 6) |
15373
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1272 { |
23481
4cb1efafa410
Remove some checks for MSN protocol_ver < 15. Those versions are
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
23478
diff
changeset
|
1273 msnobj = msn_object_new_from_string(purple_url_decode(cmd->params[5])); |
4cb1efafa410
Remove some checks for MSN protocol_ver < 15. Those versions are
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
23478
diff
changeset
|
1274 msn_user_set_object(user, msnobj); |
4cb1efafa410
Remove some checks for MSN protocol_ver < 15. Those versions are
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
23478
diff
changeset
|
1275 } |
4cb1efafa410
Remove some checks for MSN protocol_ver < 15. Those versions are
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
23478
diff
changeset
|
1276 else |
4cb1efafa410
Remove some checks for MSN protocol_ver < 15. Those versions are
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
23478
diff
changeset
|
1277 { |
4cb1efafa410
Remove some checks for MSN protocol_ver < 15. Those versions are
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
23478
diff
changeset
|
1278 msn_user_set_object(user, NULL); |
15373
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1279 } |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1280 |
30660
4cdea258b143
Save extended capabilities of an MSN buddy when receiving NLN.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
30658
diff
changeset
|
1281 clientid = strtoul(cmd->params[4], &extcap_str, 10); |
30661
ccb05979ab8a
Don't attempt to parse extended caps if not using MSNP16.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
30660
diff
changeset
|
1282 if (session->protocol_ver >= 16 && extcap_str && *extcap_str) |
30660
4cdea258b143
Save extended capabilities of an MSN buddy when receiving NLN.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
30658
diff
changeset
|
1283 extcaps = strtoul(extcap_str+1, NULL, 10); |
4cdea258b143
Save extended capabilities of an MSN buddy when receiving NLN.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
30658
diff
changeset
|
1284 else |
4cdea258b143
Save extended capabilities of an MSN buddy when receiving NLN.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
30658
diff
changeset
|
1285 extcaps = 0; |
30692
1830fa548302
propagate from branch 'im.pidgin.pidgin' (head b0098e2250f135d121960d8152e144e7e344125e)
Elliott Sales de Andrade <qulogic@pidgin.im>
diff
changeset
|
1286 |
31208
d235da74af79
Updated client capabilities and networks from msnpsharp.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
31086
diff
changeset
|
1287 user->mobile = (clientid & MSN_CAP_MOBILE_ON) || (user->extinfo && user->extinfo->phone_mobile && user->extinfo->phone_mobile[0] == '+'); |
15373
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1288 |
23478
31b5a1334e7e
Modifications to the MSN code for some stuff I'll be doing in later
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
23477
diff
changeset
|
1289 msn_user_set_clientid(user, clientid); |
30660
4cdea258b143
Save extended capabilities of an MSN buddy when receiving NLN.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
30658
diff
changeset
|
1290 msn_user_set_extcaps(user, extcaps); |
23478
31b5a1334e7e
Modifications to the MSN code for some stuff I'll be doing in later
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
23477
diff
changeset
|
1291 msn_user_set_network(user, networkid); |
31b5a1334e7e
Modifications to the MSN code for some stuff I'll be doing in later
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
23477
diff
changeset
|
1292 |
15373
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1293 msn_user_set_state(user, state); |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1294 msn_user_update(user); |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1295 } |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1296 |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1297 #if 0 |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1298 static void |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1299 chg_cmd(MsnCmdProc *cmdproc, MsnCommand *cmd) |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1300 { |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1301 char *state = cmd->params[1]; |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1302 int state_id = 0; |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1303 |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1304 if (!strcmp(state, "NLN")) |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1305 state_id = MSN_ONLINE; |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1306 else if (!strcmp(state, "BSY")) |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1307 state_id = MSN_BUSY; |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1308 else if (!strcmp(state, "IDL")) |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1309 state_id = MSN_IDLE; |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1310 else if (!strcmp(state, "BRB")) |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1311 state_id = MSN_BRB; |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1312 else if (!strcmp(state, "AWY")) |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1313 state_id = MSN_AWAY; |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1314 else if (!strcmp(state, "PHN")) |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1315 state_id = MSN_PHONE; |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1316 else if (!strcmp(state, "LUN")) |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1317 state_id = MSN_LUNCH; |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1318 else if (!strcmp(state, "HDN")) |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1319 state_id = MSN_HIDDEN; |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1320 |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1321 cmdproc->session->state = state_id; |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1322 } |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1323 #endif |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1324 |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1325 |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1326 static void |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1327 not_cmd_post(MsnCmdProc *cmdproc, MsnCommand *cmd, char *payload, size_t len) |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1328 { |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1329 #if 0 |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1330 MSN_SET_PARAMS("NOT %d\r\n%s", cmdproc->servconn->payload, payload); |
23892
e7cce5e911d8
Turn off those MSN NOTification debug messages. It should work now, and
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
23680
diff
changeset
|
1331 purple_debug_misc("msn", "Notification: {%s}\n", payload); |
23680
38c76b5b846b
Correctly save the payload_len of a MSN notification command. Also,
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
23674
diff
changeset
|
1332 #endif |
15373
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1333 } |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1334 |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1335 static void |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1336 not_cmd(MsnCmdProc *cmdproc, MsnCommand *cmd) |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1337 { |
23680
38c76b5b846b
Correctly save the payload_len of a MSN notification command. Also,
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
23674
diff
changeset
|
1338 cmd->payload_len = atoi(cmd->params[0]); |
15373
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1339 cmdproc->last_cmd->payload_cb = not_cmd_post; |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1340 } |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1341 |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1342 static void |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1343 prp_cmd(MsnCmdProc *cmdproc, MsnCommand *cmd) |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1344 { |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1345 MsnSession *session = cmdproc->session; |
29894
ec89b1d8571a
Implement [gs]et_public_alias in MSN.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
29761
diff
changeset
|
1346 const char *type, *value; |
20477
9a2a4a0c0003
Add the possibility to create an Address Book, useful for newly registered MSN users.
Carlos Silva <typ0@pidgin.im>
parents:
20474
diff
changeset
|
1347 |
15373
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1348 g_return_if_fail(cmd->param_count >= 3); |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1349 |
29894
ec89b1d8571a
Implement [gs]et_public_alias in MSN.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
29761
diff
changeset
|
1350 type = cmd->params[2]; |
15373
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1351 |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1352 if (cmd->param_count == 4) |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1353 { |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1354 value = cmd->params[3]; |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1355 if (!strcmp(type, "PHH")) |
15822 | 1356 msn_user_set_home_phone(session->user, purple_url_decode(value)); |
15373
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1357 else if (!strcmp(type, "PHW")) |
15822 | 1358 msn_user_set_work_phone(session->user, purple_url_decode(value)); |
15373
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1359 else if (!strcmp(type, "PHM")) |
15822 | 1360 msn_user_set_mobile_phone(session->user, purple_url_decode(value)); |
15373
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1361 } |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1362 else |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1363 { |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1364 if (!strcmp(type, "PHH")) |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1365 msn_user_set_home_phone(session->user, NULL); |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1366 else if (!strcmp(type, "PHW")) |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1367 msn_user_set_work_phone(session->user, NULL); |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1368 else if (!strcmp(type, "PHM")) |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1369 msn_user_set_mobile_phone(session->user, NULL); |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1370 } |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1371 } |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1372 |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1373 /************************************************************************** |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1374 * Misc commands |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1375 **************************************************************************/ |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1376 |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1377 static void |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1378 url_cmd(MsnCmdProc *cmdproc, MsnCommand *cmd) |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1379 { |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1380 MsnSession *session; |
23554
ab70eae012f5
Fixup MSN mailbox handling based on a patch from Felipe, plus various
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
23528
diff
changeset
|
1381 PurpleConnection *gc; |
15822 | 1382 PurpleAccount *account; |
15373
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1383 const char *rru; |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1384 const char *url; |
23554
ab70eae012f5
Fixup MSN mailbox handling based on a patch from Felipe, plus various
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
23528
diff
changeset
|
1385 PurpleCipherContext *cipher; |
23673
59f8890ae8cf
Fix up the MSN Inbox URL. There was a typo that caused a use-after-free
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
23612
diff
changeset
|
1386 gchar creds[33]; |
15373
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1387 char *buf; |
23554
ab70eae012f5
Fixup MSN mailbox handling based on a patch from Felipe, plus various
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
23528
diff
changeset
|
1388 |
ab70eae012f5
Fixup MSN mailbox handling based on a patch from Felipe, plus various
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
23528
diff
changeset
|
1389 gulong tmp_timestamp; |
15373
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1390 |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1391 session = cmdproc->session; |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1392 account = session->account; |
23554
ab70eae012f5
Fixup MSN mailbox handling based on a patch from Felipe, plus various
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
23528
diff
changeset
|
1393 gc = account->gc; |
15373
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1394 |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1395 rru = cmd->params[1]; |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1396 url = cmd->params[2]; |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1397 |
23554
ab70eae012f5
Fixup MSN mailbox handling based on a patch from Felipe, plus various
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
23528
diff
changeset
|
1398 session->passport_info.mail_timestamp = time(NULL); |
ab70eae012f5
Fixup MSN mailbox handling based on a patch from Felipe, plus various
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
23528
diff
changeset
|
1399 tmp_timestamp = session->passport_info.mail_timestamp - session->passport_info.sl; |
ab70eae012f5
Fixup MSN mailbox handling based on a patch from Felipe, plus various
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
23528
diff
changeset
|
1400 |
15373
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1401 buf = g_strdup_printf("%s%lu%s", |
23674
4ca41efb75a7
Some whitespace changes to make code from that previous commit look better.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
23673
diff
changeset
|
1402 session->passport_info.mspauth ? session->passport_info.mspauth : "BOGUS", |
4ca41efb75a7
Some whitespace changes to make code from that previous commit look better.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
23673
diff
changeset
|
1403 tmp_timestamp, |
4ca41efb75a7
Some whitespace changes to make code from that previous commit look better.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
23673
diff
changeset
|
1404 purple_connection_get_password(gc)); |
15373
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1405 |
23554
ab70eae012f5
Fixup MSN mailbox handling based on a patch from Felipe, plus various
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
23528
diff
changeset
|
1406 cipher = purple_cipher_context_new_by_name("md5", NULL); |
ab70eae012f5
Fixup MSN mailbox handling based on a patch from Felipe, plus various
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
23528
diff
changeset
|
1407 purple_cipher_context_append(cipher, (const guchar *)buf, strlen(buf)); |
23673
59f8890ae8cf
Fix up the MSN Inbox URL. There was a typo that caused a use-after-free
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
23612
diff
changeset
|
1408 purple_cipher_context_digest_to_str(cipher, sizeof(creds), creds, NULL); |
23554
ab70eae012f5
Fixup MSN mailbox handling based on a patch from Felipe, plus various
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
23528
diff
changeset
|
1409 purple_cipher_context_destroy(cipher); |
15373
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1410 g_free(buf); |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1411 |
23612
7f4b697c6947
Use a URL to open MSN Hotmail inbox instead of a temporary file.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
23611
diff
changeset
|
1412 g_free(session->passport_info.mail_url); |
23674
4ca41efb75a7
Some whitespace changes to make code from that previous commit look better.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
23673
diff
changeset
|
1413 session->passport_info.mail_url = |
4ca41efb75a7
Some whitespace changes to make code from that previous commit look better.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
23673
diff
changeset
|
1414 g_strdup_printf("%s&auth=%s&creds=%s&sl=%ld&username=%s&mode=ttl&sid=%s&id=2&rru=%s&svc=mail&js=yes", |
4ca41efb75a7
Some whitespace changes to make code from that previous commit look better.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
23673
diff
changeset
|
1415 url, |
4ca41efb75a7
Some whitespace changes to make code from that previous commit look better.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
23673
diff
changeset
|
1416 session->passport_info.mspauth ? purple_url_encode(session->passport_info.mspauth) : "BOGUS", |
4ca41efb75a7
Some whitespace changes to make code from that previous commit look better.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
23673
diff
changeset
|
1417 creds, |
4ca41efb75a7
Some whitespace changes to make code from that previous commit look better.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
23673
diff
changeset
|
1418 tmp_timestamp, |
4ca41efb75a7
Some whitespace changes to make code from that previous commit look better.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
23673
diff
changeset
|
1419 msn_user_get_passport(session->user), |
4ca41efb75a7
Some whitespace changes to make code from that previous commit look better.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
23673
diff
changeset
|
1420 session->passport_info.sid, |
4ca41efb75a7
Some whitespace changes to make code from that previous commit look better.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
23673
diff
changeset
|
1421 rru); |
15373
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1422 |
23612
7f4b697c6947
Use a URL to open MSN Hotmail inbox instead of a temporary file.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
23611
diff
changeset
|
1423 /* The user wants to check his or her email */ |
7f4b697c6947
Use a URL to open MSN Hotmail inbox instead of a temporary file.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
23611
diff
changeset
|
1424 if (cmd->trans && cmd->trans->data) |
7f4b697c6947
Use a URL to open MSN Hotmail inbox instead of a temporary file.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
23611
diff
changeset
|
1425 purple_notify_uri(purple_account_get_connection(account), session->passport_info.mail_url); |
15373
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1426 } |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1427 /************************************************************************** |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1428 * Switchboards |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1429 **************************************************************************/ |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1430 |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1431 static void |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1432 rng_cmd(MsnCmdProc *cmdproc, MsnCommand *cmd) |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1433 { |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1434 MsnSession *session; |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1435 MsnSwitchBoard *swboard; |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1436 const char *session_id; |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1437 char *host; |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1438 int port; |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1439 |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1440 session = cmdproc->session; |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1441 session_id = cmd->params[0]; |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1442 |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1443 msn_parse_socket(cmd->params[1], &host, &port); |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1444 |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1445 if (session->http_method) |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1446 port = 80; |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1447 |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1448 swboard = msn_switchboard_new(session); |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1449 |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1450 msn_switchboard_set_invited(swboard, TRUE); |
30906
ac9035aeb087
Remove dead assignments in new MSN code.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
30877
diff
changeset
|
1451 msn_switchboard_set_session_id(swboard, session_id); |
15373
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1452 msn_switchboard_set_auth_key(swboard, cmd->params[3]); |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1453 swboard->im_user = g_strdup(cmd->params[4]); |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1454 /* msn_switchboard_add_user(swboard, cmd->params[4]); */ |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1455 |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1456 if (!msn_switchboard_connect(swboard, host, port)) |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1457 msn_switchboard_destroy(swboard); |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1458 |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1459 g_free(host); |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1460 } |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1461 |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1462 static void |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1463 xfr_cmd(MsnCmdProc *cmdproc, MsnCommand *cmd) |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1464 { |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1465 char *host; |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1466 int port; |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1467 |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1468 if (strcmp(cmd->params[1], "SB") && strcmp(cmd->params[1], "NS")) |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1469 { |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1470 /* Maybe we can have a generic bad command error. */ |
15822 | 1471 purple_debug_error("msn", "Bad XFR command (%s)\n", cmd->params[1]); |
15373
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1472 return; |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1473 } |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1474 |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1475 msn_parse_socket(cmd->params[2], &host, &port); |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1476 |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1477 if (!strcmp(cmd->params[1], "SB")) |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1478 { |
15822 | 1479 purple_debug_error("msn", "This shouldn't be handled here.\n"); |
15373
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1480 } |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1481 else if (!strcmp(cmd->params[1], "NS")) |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1482 { |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1483 MsnSession *session; |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1484 |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1485 session = cmdproc->session; |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1486 |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1487 msn_session_set_login_step(session, MSN_LOGIN_STEP_TRANSFER); |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1488 |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1489 msn_notification_connect(session->notification, host, port); |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1490 } |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1491 |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1492 g_free(host); |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1493 } |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1494 |
20394
4a099e4d0d09
propagate from branch 'im.pidgin.pidgin' (head 98b6b547b29ea1192b73cc4e1de1e674edef4328)
Richard Laager <rlaager@wiktel.com>
parents:
16063
diff
changeset
|
1495 static void |
4a099e4d0d09
propagate from branch 'im.pidgin.pidgin' (head 98b6b547b29ea1192b73cc4e1de1e674edef4328)
Richard Laager <rlaager@wiktel.com>
parents:
16063
diff
changeset
|
1496 gcf_cmd_post(MsnCmdProc *cmdproc, MsnCommand *cmd, char *payload, |
4a099e4d0d09
propagate from branch 'im.pidgin.pidgin' (head 98b6b547b29ea1192b73cc4e1de1e674edef4328)
Richard Laager <rlaager@wiktel.com>
parents:
16063
diff
changeset
|
1497 size_t len) |
4a099e4d0d09
propagate from branch 'im.pidgin.pidgin' (head 98b6b547b29ea1192b73cc4e1de1e674edef4328)
Richard Laager <rlaager@wiktel.com>
parents:
16063
diff
changeset
|
1498 { |
23527
25aec47d9671
Disable the MSN blocked text dialog for now because it doesn't always
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
23521
diff
changeset
|
1499 /* QuLogic: Disabled until confirmed correct. */ |
25aec47d9671
Disable the MSN blocked text dialog for now because it doesn't always
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
23521
diff
changeset
|
1500 #if 0 |
23477
fd124c21ebb7
Properly parse (most of) the MSN GCF command. Provides a
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
23475
diff
changeset
|
1501 xmlnode *root; |
fd124c21ebb7
Properly parse (most of) the MSN GCF command. Provides a
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
23475
diff
changeset
|
1502 xmlnode *policy; |
20468
b888c2f15c79
Print the policies sent by the server (GCF command) in a human-readable way.
Carlos Silva <typ0@pidgin.im>
parents:
20467
diff
changeset
|
1503 |
b888c2f15c79
Print the policies sent by the server (GCF command) in a human-readable way.
Carlos Silva <typ0@pidgin.im>
parents:
20467
diff
changeset
|
1504 g_return_if_fail(cmd->payload != NULL); |
b888c2f15c79
Print the policies sent by the server (GCF command) in a human-readable way.
Carlos Silva <typ0@pidgin.im>
parents:
20467
diff
changeset
|
1505 |
b888c2f15c79
Print the policies sent by the server (GCF command) in a human-readable way.
Carlos Silva <typ0@pidgin.im>
parents:
20467
diff
changeset
|
1506 if ( (root = xmlnode_from_str(cmd->payload, cmd->payload_len)) == NULL) |
b888c2f15c79
Print the policies sent by the server (GCF command) in a human-readable way.
Carlos Silva <typ0@pidgin.im>
parents:
20467
diff
changeset
|
1507 { |
26196
399776a9ad98
Add some missing newlines in debug messages.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
25954
diff
changeset
|
1508 purple_debug_error("msn", "Unable to parse GCF payload into a XML tree\n"); |
20468
b888c2f15c79
Print the policies sent by the server (GCF command) in a human-readable way.
Carlos Silva <typ0@pidgin.im>
parents:
20467
diff
changeset
|
1509 return; |
b888c2f15c79
Print the policies sent by the server (GCF command) in a human-readable way.
Carlos Silva <typ0@pidgin.im>
parents:
20467
diff
changeset
|
1510 } |
23298
5cdd93dac7a2
Delete trailing whitespace
Mark Doliner <mark@kingant.net>
parents:
22922
diff
changeset
|
1511 |
23477
fd124c21ebb7
Properly parse (most of) the MSN GCF command. Provides a
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
23475
diff
changeset
|
1512 |
fd124c21ebb7
Properly parse (most of) the MSN GCF command. Provides a
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
23475
diff
changeset
|
1513 g_free(cmdproc->session->blocked_text); |
fd124c21ebb7
Properly parse (most of) the MSN GCF command. Provides a
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
23475
diff
changeset
|
1514 cmdproc->session->blocked_text = NULL; |
fd124c21ebb7
Properly parse (most of) the MSN GCF command. Provides a
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
23475
diff
changeset
|
1515 |
fd124c21ebb7
Properly parse (most of) the MSN GCF command. Provides a
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
23475
diff
changeset
|
1516 /* We need a get_child with attrib... */ |
fd124c21ebb7
Properly parse (most of) the MSN GCF command. Provides a
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
23475
diff
changeset
|
1517 policy = xmlnode_get_child(root, "Policy"); |
fd124c21ebb7
Properly parse (most of) the MSN GCF command. Provides a
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
23475
diff
changeset
|
1518 while (policy) { |
fd124c21ebb7
Properly parse (most of) the MSN GCF command. Provides a
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
23475
diff
changeset
|
1519 if (g_str_equal(xmlnode_get_attrib(policy, "type"), "SHIELDS")) |
fd124c21ebb7
Properly parse (most of) the MSN GCF command. Provides a
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
23475
diff
changeset
|
1520 break; |
fd124c21ebb7
Properly parse (most of) the MSN GCF command. Provides a
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
23475
diff
changeset
|
1521 policy = xmlnode_get_next_twin(policy); |
fd124c21ebb7
Properly parse (most of) the MSN GCF command. Provides a
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
23475
diff
changeset
|
1522 } |
20468
b888c2f15c79
Print the policies sent by the server (GCF command) in a human-readable way.
Carlos Silva <typ0@pidgin.im>
parents:
20467
diff
changeset
|
1523 |
23477
fd124c21ebb7
Properly parse (most of) the MSN GCF command. Provides a
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
23475
diff
changeset
|
1524 if (policy) { |
fd124c21ebb7
Properly parse (most of) the MSN GCF command. Provides a
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
23475
diff
changeset
|
1525 GString *blocked = g_string_new(NULL); |
fd124c21ebb7
Properly parse (most of) the MSN GCF command. Provides a
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
23475
diff
changeset
|
1526 xmlnode *imtext = xmlnode_get_child(policy, |
fd124c21ebb7
Properly parse (most of) the MSN GCF command. Provides a
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
23475
diff
changeset
|
1527 "config/block/regexp/imtext"); |
fd124c21ebb7
Properly parse (most of) the MSN GCF command. Provides a
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
23475
diff
changeset
|
1528 while (imtext) { |
fd124c21ebb7
Properly parse (most of) the MSN GCF command. Provides a
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
23475
diff
changeset
|
1529 const char *value = xmlnode_get_attrib(imtext, "value"); |
fd124c21ebb7
Properly parse (most of) the MSN GCF command. Provides a
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
23475
diff
changeset
|
1530 g_string_append_printf(blocked, "%s<br/>\n", |
fd124c21ebb7
Properly parse (most of) the MSN GCF command. Provides a
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
23475
diff
changeset
|
1531 purple_base64_decode(value, NULL)); |
fd124c21ebb7
Properly parse (most of) the MSN GCF command. Provides a
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
23475
diff
changeset
|
1532 imtext = xmlnode_get_next_twin(imtext); |
fd124c21ebb7
Properly parse (most of) the MSN GCF command. Provides a
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
23475
diff
changeset
|
1533 } |
23298
5cdd93dac7a2
Delete trailing whitespace
Mark Doliner <mark@kingant.net>
parents:
22922
diff
changeset
|
1534 |
23477
fd124c21ebb7
Properly parse (most of) the MSN GCF command. Provides a
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
23475
diff
changeset
|
1535 cmdproc->session->blocked_text = g_string_free(blocked, FALSE); |
fd124c21ebb7
Properly parse (most of) the MSN GCF command. Provides a
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
23475
diff
changeset
|
1536 } |
fd124c21ebb7
Properly parse (most of) the MSN GCF command. Provides a
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
23475
diff
changeset
|
1537 |
20468
b888c2f15c79
Print the policies sent by the server (GCF command) in a human-readable way.
Carlos Silva <typ0@pidgin.im>
parents:
20467
diff
changeset
|
1538 xmlnode_free(root); |
23527
25aec47d9671
Disable the MSN blocked text dialog for now because it doesn't always
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
23521
diff
changeset
|
1539 #endif |
20394
4a099e4d0d09
propagate from branch 'im.pidgin.pidgin' (head 98b6b547b29ea1192b73cc4e1de1e674edef4328)
Richard Laager <rlaager@wiktel.com>
parents:
16063
diff
changeset
|
1540 } |
4a099e4d0d09
propagate from branch 'im.pidgin.pidgin' (head 98b6b547b29ea1192b73cc4e1de1e674edef4328)
Richard Laager <rlaager@wiktel.com>
parents:
16063
diff
changeset
|
1541 |
4a099e4d0d09
propagate from branch 'im.pidgin.pidgin' (head 98b6b547b29ea1192b73cc4e1de1e674edef4328)
Richard Laager <rlaager@wiktel.com>
parents:
16063
diff
changeset
|
1542 static void |
4a099e4d0d09
propagate from branch 'im.pidgin.pidgin' (head 98b6b547b29ea1192b73cc4e1de1e674edef4328)
Richard Laager <rlaager@wiktel.com>
parents:
16063
diff
changeset
|
1543 gcf_cmd(MsnCmdProc *cmdproc, MsnCommand *cmd) |
4a099e4d0d09
propagate from branch 'im.pidgin.pidgin' (head 98b6b547b29ea1192b73cc4e1de1e674edef4328)
Richard Laager <rlaager@wiktel.com>
parents:
16063
diff
changeset
|
1544 { |
23519
7bceac816e19
The great MSN debug message cleanup! Threw in a few whitespace fixes,
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
23517
diff
changeset
|
1545 purple_debug_info("msn", "Processing GCF command\n"); |
23514
7e16d193bb57
Get rid of that whole msn_set_payload_len thing and correctly set the
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
23512
diff
changeset
|
1546 |
20394
4a099e4d0d09
propagate from branch 'im.pidgin.pidgin' (head 98b6b547b29ea1192b73cc4e1de1e674edef4328)
Richard Laager <rlaager@wiktel.com>
parents:
16063
diff
changeset
|
1547 cmdproc->last_cmd->payload_cb = gcf_cmd_post; |
23514
7e16d193bb57
Get rid of that whole msn_set_payload_len thing and correctly set the
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
23512
diff
changeset
|
1548 cmd->payload_len = atoi(cmd->params[1]); |
20394
4a099e4d0d09
propagate from branch 'im.pidgin.pidgin' (head 98b6b547b29ea1192b73cc4e1de1e674edef4328)
Richard Laager <rlaager@wiktel.com>
parents:
16063
diff
changeset
|
1549 } |
4a099e4d0d09
propagate from branch 'im.pidgin.pidgin' (head 98b6b547b29ea1192b73cc4e1de1e674edef4328)
Richard Laager <rlaager@wiktel.com>
parents:
16063
diff
changeset
|
1550 |
4a099e4d0d09
propagate from branch 'im.pidgin.pidgin' (head 98b6b547b29ea1192b73cc4e1de1e674edef4328)
Richard Laager <rlaager@wiktel.com>
parents:
16063
diff
changeset
|
1551 static void |
4a099e4d0d09
propagate from branch 'im.pidgin.pidgin' (head 98b6b547b29ea1192b73cc4e1de1e674edef4328)
Richard Laager <rlaager@wiktel.com>
parents:
16063
diff
changeset
|
1552 sbs_cmd(MsnCmdProc *cmdproc, MsnCommand *cmd) |
4a099e4d0d09
propagate from branch 'im.pidgin.pidgin' (head 98b6b547b29ea1192b73cc4e1de1e674edef4328)
Richard Laager <rlaager@wiktel.com>
parents:
16063
diff
changeset
|
1553 { |
23519
7bceac816e19
The great MSN debug message cleanup! Threw in a few whitespace fixes,
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
23517
diff
changeset
|
1554 purple_debug_info("msn", "Processing SBS... \n"); |
20394
4a099e4d0d09
propagate from branch 'im.pidgin.pidgin' (head 98b6b547b29ea1192b73cc4e1de1e674edef4328)
Richard Laager <rlaager@wiktel.com>
parents:
16063
diff
changeset
|
1555 /*get the payload content*/ |
4a099e4d0d09
propagate from branch 'im.pidgin.pidgin' (head 98b6b547b29ea1192b73cc4e1de1e674edef4328)
Richard Laager <rlaager@wiktel.com>
parents:
16063
diff
changeset
|
1556 } |
4a099e4d0d09
propagate from branch 'im.pidgin.pidgin' (head 98b6b547b29ea1192b73cc4e1de1e674edef4328)
Richard Laager <rlaager@wiktel.com>
parents:
16063
diff
changeset
|
1557 |
30665
60688353c010
Attempt to parse any EndpointData out of the UBX payload. This isn't really
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
30663
diff
changeset
|
1558 static void |
60688353c010
Attempt to parse any EndpointData out of the UBX payload. This isn't really
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
30663
diff
changeset
|
1559 parse_user_endpoints(MsnUser *user, xmlnode *payloadNode) |
60688353c010
Attempt to parse any EndpointData out of the UBX payload. This isn't really
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
30663
diff
changeset
|
1560 { |
30991
1546ad4f93b3
Disconnect other endpoints if the MPOP setting is disabled.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
30989
diff
changeset
|
1561 MsnSession *session; |
30665
60688353c010
Attempt to parse any EndpointData out of the UBX payload. This isn't really
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
30663
diff
changeset
|
1562 xmlnode *epNode, *capsNode; |
60688353c010
Attempt to parse any EndpointData out of the UBX payload. This isn't really
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
30663
diff
changeset
|
1563 MsnUserEndpoint data; |
60688353c010
Attempt to parse any EndpointData out of the UBX payload. This isn't really
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
30663
diff
changeset
|
1564 const char *id; |
60688353c010
Attempt to parse any EndpointData out of the UBX payload. This isn't really
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
30663
diff
changeset
|
1565 char *caps, *tmp; |
30991
1546ad4f93b3
Disconnect other endpoints if the MPOP setting is disabled.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
30989
diff
changeset
|
1566 gboolean is_me; |
30665
60688353c010
Attempt to parse any EndpointData out of the UBX payload. This isn't really
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
30663
diff
changeset
|
1567 |
30669
40a3dbdcf958
Add a minor debug log.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
30668
diff
changeset
|
1568 purple_debug_info("msn", "Get EndpointData\n"); |
40a3dbdcf958
Add a minor debug log.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
30668
diff
changeset
|
1569 |
30991
1546ad4f93b3
Disconnect other endpoints if the MPOP setting is disabled.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
30989
diff
changeset
|
1570 session = user->userlist->session; |
1546ad4f93b3
Disconnect other endpoints if the MPOP setting is disabled.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
30989
diff
changeset
|
1571 is_me = (user == session->user); |
1546ad4f93b3
Disconnect other endpoints if the MPOP setting is disabled.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
30989
diff
changeset
|
1572 |
30989
7bf659dbacee
Clear out the old list of endpoints when we receive a new one. This
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
30987
diff
changeset
|
1573 msn_user_clear_endpoints(user); |
30665
60688353c010
Attempt to parse any EndpointData out of the UBX payload. This isn't really
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
30663
diff
changeset
|
1574 for (epNode = xmlnode_get_child(payloadNode, "EndpointData"); |
60688353c010
Attempt to parse any EndpointData out of the UBX payload. This isn't really
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
30663
diff
changeset
|
1575 epNode; |
60688353c010
Attempt to parse any EndpointData out of the UBX payload. This isn't really
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
30663
diff
changeset
|
1576 epNode = xmlnode_get_next_twin(epNode)) { |
60688353c010
Attempt to parse any EndpointData out of the UBX payload. This isn't really
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
30663
diff
changeset
|
1577 id = xmlnode_get_attrib(epNode, "id"); |
60688353c010
Attempt to parse any EndpointData out of the UBX payload. This isn't really
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
30663
diff
changeset
|
1578 capsNode = xmlnode_get_child(epNode, "Capabilities"); |
60688353c010
Attempt to parse any EndpointData out of the UBX payload. This isn't really
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
30663
diff
changeset
|
1579 |
30991
1546ad4f93b3
Disconnect other endpoints if the MPOP setting is disabled.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
30989
diff
changeset
|
1580 /* Disconnect others, if MPOP is disabled */ |
1546ad4f93b3
Disconnect other endpoints if the MPOP setting is disabled.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
30989
diff
changeset
|
1581 if (is_me |
31007
388ca4797d7b
Replace the mpop account setting with a session boolean, because I
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
30991
diff
changeset
|
1582 && !session->enable_mpop |
30991
1546ad4f93b3
Disconnect other endpoints if the MPOP setting is disabled.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
30989
diff
changeset
|
1583 && strncasecmp(id + 1, session->guid, 36) != 0) { |
1546ad4f93b3
Disconnect other endpoints if the MPOP setting is disabled.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
30989
diff
changeset
|
1584 purple_debug_info("msn", "Disconnecting Endpoint %s\n", id); |
1546ad4f93b3
Disconnect other endpoints if the MPOP setting is disabled.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
30989
diff
changeset
|
1585 |
1546ad4f93b3
Disconnect other endpoints if the MPOP setting is disabled.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
30989
diff
changeset
|
1586 tmp = g_strdup_printf("%s;%s", user->passport, id); |
1546ad4f93b3
Disconnect other endpoints if the MPOP setting is disabled.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
30989
diff
changeset
|
1587 msn_notification_send_uun(session, tmp, MSN_UNIFIED_NOTIFICATION_MPOP, "goawyplzthxbye"); |
1546ad4f93b3
Disconnect other endpoints if the MPOP setting is disabled.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
30989
diff
changeset
|
1588 g_free(tmp); |
1546ad4f93b3
Disconnect other endpoints if the MPOP setting is disabled.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
30989
diff
changeset
|
1589 } else { |
1546ad4f93b3
Disconnect other endpoints if the MPOP setting is disabled.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
30989
diff
changeset
|
1590 if (capsNode != NULL) { |
1546ad4f93b3
Disconnect other endpoints if the MPOP setting is disabled.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
30989
diff
changeset
|
1591 caps = xmlnode_get_data(capsNode); |
1546ad4f93b3
Disconnect other endpoints if the MPOP setting is disabled.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
30989
diff
changeset
|
1592 |
1546ad4f93b3
Disconnect other endpoints if the MPOP setting is disabled.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
30989
diff
changeset
|
1593 data.clientid = strtoul(caps, &tmp, 10); |
1546ad4f93b3
Disconnect other endpoints if the MPOP setting is disabled.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
30989
diff
changeset
|
1594 if (tmp && *tmp) |
1546ad4f93b3
Disconnect other endpoints if the MPOP setting is disabled.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
30989
diff
changeset
|
1595 data.extcaps = strtoul(tmp + 1, NULL, 10); |
1546ad4f93b3
Disconnect other endpoints if the MPOP setting is disabled.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
30989
diff
changeset
|
1596 else |
1546ad4f93b3
Disconnect other endpoints if the MPOP setting is disabled.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
30989
diff
changeset
|
1597 data.extcaps = 0; |
1546ad4f93b3
Disconnect other endpoints if the MPOP setting is disabled.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
30989
diff
changeset
|
1598 |
1546ad4f93b3
Disconnect other endpoints if the MPOP setting is disabled.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
30989
diff
changeset
|
1599 g_free(caps); |
1546ad4f93b3
Disconnect other endpoints if the MPOP setting is disabled.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
30989
diff
changeset
|
1600 } else { |
1546ad4f93b3
Disconnect other endpoints if the MPOP setting is disabled.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
30989
diff
changeset
|
1601 data.clientid = 0; |
30665
60688353c010
Attempt to parse any EndpointData out of the UBX payload. This isn't really
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
30663
diff
changeset
|
1602 data.extcaps = 0; |
30991
1546ad4f93b3
Disconnect other endpoints if the MPOP setting is disabled.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
30989
diff
changeset
|
1603 } |
1546ad4f93b3
Disconnect other endpoints if the MPOP setting is disabled.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
30989
diff
changeset
|
1604 |
1546ad4f93b3
Disconnect other endpoints if the MPOP setting is disabled.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
30989
diff
changeset
|
1605 msn_user_set_endpoint_data(user, id, &data); |
30665
60688353c010
Attempt to parse any EndpointData out of the UBX payload. This isn't really
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
30663
diff
changeset
|
1606 } |
60688353c010
Attempt to parse any EndpointData out of the UBX payload. This isn't really
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
30663
diff
changeset
|
1607 } |
30682
f56126c5aa44
Save PrivateEndpointData that we've received. I think this only applies to
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
30671
diff
changeset
|
1608 |
31007
388ca4797d7b
Replace the mpop account setting with a session boolean, because I
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
30991
diff
changeset
|
1609 if (is_me && session->enable_mpop) { |
30682
f56126c5aa44
Save PrivateEndpointData that we've received. I think this only applies to
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
30671
diff
changeset
|
1610 for (epNode = xmlnode_get_child(payloadNode, "PrivateEndpointData"); |
f56126c5aa44
Save PrivateEndpointData that we've received. I think this only applies to
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
30671
diff
changeset
|
1611 epNode; |
f56126c5aa44
Save PrivateEndpointData that we've received. I think this only applies to
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
30671
diff
changeset
|
1612 epNode = xmlnode_get_next_twin(epNode)) { |
f56126c5aa44
Save PrivateEndpointData that we've received. I think this only applies to
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
30671
diff
changeset
|
1613 MsnUserEndpoint *ep; |
f56126c5aa44
Save PrivateEndpointData that we've received. I think this only applies to
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
30671
diff
changeset
|
1614 xmlnode *nameNode, *clientNode; |
f56126c5aa44
Save PrivateEndpointData that we've received. I think this only applies to
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
30671
diff
changeset
|
1615 |
f56126c5aa44
Save PrivateEndpointData that we've received. I think this only applies to
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
30671
diff
changeset
|
1616 /* <PrivateEndpointData id='{GUID}'> |
f56126c5aa44
Save PrivateEndpointData that we've received. I think this only applies to
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
30671
diff
changeset
|
1617 <EpName>Endpoint Name</EpName> |
f56126c5aa44
Save PrivateEndpointData that we've received. I think this only applies to
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
30671
diff
changeset
|
1618 <Idle>true/false</Idle> |
f56126c5aa44
Save PrivateEndpointData that we've received. I think this only applies to
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
30671
diff
changeset
|
1619 <ClientType>1</ClientType> |
f56126c5aa44
Save PrivateEndpointData that we've received. I think this only applies to
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
30671
diff
changeset
|
1620 <State>NLN</State> |
f56126c5aa44
Save PrivateEndpointData that we've received. I think this only applies to
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
30671
diff
changeset
|
1621 </PrivateEndpointData> |
f56126c5aa44
Save PrivateEndpointData that we've received. I think this only applies to
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
30671
diff
changeset
|
1622 */ |
f56126c5aa44
Save PrivateEndpointData that we've received. I think this only applies to
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
30671
diff
changeset
|
1623 id = xmlnode_get_attrib(epNode, "id"); |
f56126c5aa44
Save PrivateEndpointData that we've received. I think this only applies to
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
30671
diff
changeset
|
1624 ep = msn_user_get_endpoint_data(user, id); |
f56126c5aa44
Save PrivateEndpointData that we've received. I think this only applies to
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
30671
diff
changeset
|
1625 |
f56126c5aa44
Save PrivateEndpointData that we've received. I think this only applies to
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
30671
diff
changeset
|
1626 if (ep != NULL) { |
f56126c5aa44
Save PrivateEndpointData that we've received. I think this only applies to
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
30671
diff
changeset
|
1627 nameNode = xmlnode_get_child(epNode, "EpName"); |
f56126c5aa44
Save PrivateEndpointData that we've received. I think this only applies to
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
30671
diff
changeset
|
1628 if (nameNode != NULL) { |
f56126c5aa44
Save PrivateEndpointData that we've received. I think this only applies to
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
30671
diff
changeset
|
1629 g_free(ep->name); |
f56126c5aa44
Save PrivateEndpointData that we've received. I think this only applies to
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
30671
diff
changeset
|
1630 ep->name = xmlnode_get_data(nameNode); |
f56126c5aa44
Save PrivateEndpointData that we've received. I think this only applies to
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
30671
diff
changeset
|
1631 } |
f56126c5aa44
Save PrivateEndpointData that we've received. I think this only applies to
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
30671
diff
changeset
|
1632 |
f56126c5aa44
Save PrivateEndpointData that we've received. I think this only applies to
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
30671
diff
changeset
|
1633 clientNode = xmlnode_get_child(epNode, "ClientType"); |
f56126c5aa44
Save PrivateEndpointData that we've received. I think this only applies to
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
30671
diff
changeset
|
1634 if (clientNode != NULL) { |
f56126c5aa44
Save PrivateEndpointData that we've received. I think this only applies to
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
30671
diff
changeset
|
1635 tmp = xmlnode_get_data(clientNode); |
30683
509c4ffff958
Fix a little argument swapping.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
30682
diff
changeset
|
1636 ep->type = strtoul(tmp, NULL, 10); |
30682
f56126c5aa44
Save PrivateEndpointData that we've received. I think this only applies to
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
30671
diff
changeset
|
1637 g_free(tmp); |
f56126c5aa44
Save PrivateEndpointData that we've received. I think this only applies to
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
30671
diff
changeset
|
1638 } |
f56126c5aa44
Save PrivateEndpointData that we've received. I think this only applies to
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
30671
diff
changeset
|
1639 } |
f56126c5aa44
Save PrivateEndpointData that we've received. I think this only applies to
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
30671
diff
changeset
|
1640 } |
f56126c5aa44
Save PrivateEndpointData that we've received. I think this only applies to
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
30671
diff
changeset
|
1641 } |
30665
60688353c010
Attempt to parse any EndpointData out of the UBX payload. This isn't really
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
30663
diff
changeset
|
1642 } |
60688353c010
Attempt to parse any EndpointData out of the UBX payload. This isn't really
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
30663
diff
changeset
|
1643 |
28978
746bf7d8b34e
Combine the CurrentMedia and MsnUserPhoneInfo structs. This makes
Mark Doliner <mark@kingant.net>
parents:
28961
diff
changeset
|
1644 static void parse_currentmedia(MsnUser *user, const char *cmedia) |
746bf7d8b34e
Combine the CurrentMedia and MsnUserPhoneInfo structs. This makes
Mark Doliner <mark@kingant.net>
parents:
28961
diff
changeset
|
1645 { |
746bf7d8b34e
Combine the CurrentMedia and MsnUserPhoneInfo structs. This makes
Mark Doliner <mark@kingant.net>
parents:
28961
diff
changeset
|
1646 char **cmedia_array; |
746bf7d8b34e
Combine the CurrentMedia and MsnUserPhoneInfo structs. This makes
Mark Doliner <mark@kingant.net>
parents:
28961
diff
changeset
|
1647 int strings = 0; |
746bf7d8b34e
Combine the CurrentMedia and MsnUserPhoneInfo structs. This makes
Mark Doliner <mark@kingant.net>
parents:
28961
diff
changeset
|
1648 |
746bf7d8b34e
Combine the CurrentMedia and MsnUserPhoneInfo structs. This makes
Mark Doliner <mark@kingant.net>
parents:
28961
diff
changeset
|
1649 if (!cmedia || cmedia[0] == '\0') { |
746bf7d8b34e
Combine the CurrentMedia and MsnUserPhoneInfo structs. This makes
Mark Doliner <mark@kingant.net>
parents:
28961
diff
changeset
|
1650 purple_debug_info("msn", "No currentmedia string\n"); |
746bf7d8b34e
Combine the CurrentMedia and MsnUserPhoneInfo structs. This makes
Mark Doliner <mark@kingant.net>
parents:
28961
diff
changeset
|
1651 return; |
746bf7d8b34e
Combine the CurrentMedia and MsnUserPhoneInfo structs. This makes
Mark Doliner <mark@kingant.net>
parents:
28961
diff
changeset
|
1652 } |
746bf7d8b34e
Combine the CurrentMedia and MsnUserPhoneInfo structs. This makes
Mark Doliner <mark@kingant.net>
parents:
28961
diff
changeset
|
1653 |
746bf7d8b34e
Combine the CurrentMedia and MsnUserPhoneInfo structs. This makes
Mark Doliner <mark@kingant.net>
parents:
28961
diff
changeset
|
1654 purple_debug_info("msn", "Parsing currentmedia string: \"%s\"\n", cmedia); |
746bf7d8b34e
Combine the CurrentMedia and MsnUserPhoneInfo structs. This makes
Mark Doliner <mark@kingant.net>
parents:
28961
diff
changeset
|
1655 |
746bf7d8b34e
Combine the CurrentMedia and MsnUserPhoneInfo structs. This makes
Mark Doliner <mark@kingant.net>
parents:
28961
diff
changeset
|
1656 cmedia_array = g_strsplit(cmedia, "\\0", 0); |
746bf7d8b34e
Combine the CurrentMedia and MsnUserPhoneInfo structs. This makes
Mark Doliner <mark@kingant.net>
parents:
28961
diff
changeset
|
1657 |
746bf7d8b34e
Combine the CurrentMedia and MsnUserPhoneInfo structs. This makes
Mark Doliner <mark@kingant.net>
parents:
28961
diff
changeset
|
1658 /* |
746bf7d8b34e
Combine the CurrentMedia and MsnUserPhoneInfo structs. This makes
Mark Doliner <mark@kingant.net>
parents:
28961
diff
changeset
|
1659 * 0: Application |
746bf7d8b34e
Combine the CurrentMedia and MsnUserPhoneInfo structs. This makes
Mark Doliner <mark@kingant.net>
parents:
28961
diff
changeset
|
1660 * 1: 'Music'/'Games'/'Office' |
746bf7d8b34e
Combine the CurrentMedia and MsnUserPhoneInfo structs. This makes
Mark Doliner <mark@kingant.net>
parents:
28961
diff
changeset
|
1661 * 2: '1' if enabled, '0' if not |
746bf7d8b34e
Combine the CurrentMedia and MsnUserPhoneInfo structs. This makes
Mark Doliner <mark@kingant.net>
parents:
28961
diff
changeset
|
1662 * 3: Format (eg. {0} by {1}) |
746bf7d8b34e
Combine the CurrentMedia and MsnUserPhoneInfo structs. This makes
Mark Doliner <mark@kingant.net>
parents:
28961
diff
changeset
|
1663 * 4: Title |
746bf7d8b34e
Combine the CurrentMedia and MsnUserPhoneInfo structs. This makes
Mark Doliner <mark@kingant.net>
parents:
28961
diff
changeset
|
1664 * If 'Music': |
746bf7d8b34e
Combine the CurrentMedia and MsnUserPhoneInfo structs. This makes
Mark Doliner <mark@kingant.net>
parents:
28961
diff
changeset
|
1665 * 5: Artist |
746bf7d8b34e
Combine the CurrentMedia and MsnUserPhoneInfo structs. This makes
Mark Doliner <mark@kingant.net>
parents:
28961
diff
changeset
|
1666 * 6: Album |
746bf7d8b34e
Combine the CurrentMedia and MsnUserPhoneInfo structs. This makes
Mark Doliner <mark@kingant.net>
parents:
28961
diff
changeset
|
1667 * 7: ? |
746bf7d8b34e
Combine the CurrentMedia and MsnUserPhoneInfo structs. This makes
Mark Doliner <mark@kingant.net>
parents:
28961
diff
changeset
|
1668 */ |
746bf7d8b34e
Combine the CurrentMedia and MsnUserPhoneInfo structs. This makes
Mark Doliner <mark@kingant.net>
parents:
28961
diff
changeset
|
1669 strings = g_strv_length(cmedia_array); |
746bf7d8b34e
Combine the CurrentMedia and MsnUserPhoneInfo structs. This makes
Mark Doliner <mark@kingant.net>
parents:
28961
diff
changeset
|
1670 |
746bf7d8b34e
Combine the CurrentMedia and MsnUserPhoneInfo structs. This makes
Mark Doliner <mark@kingant.net>
parents:
28961
diff
changeset
|
1671 if (strings >= 4 && !strcmp(cmedia_array[2], "1")) { |
746bf7d8b34e
Combine the CurrentMedia and MsnUserPhoneInfo structs. This makes
Mark Doliner <mark@kingant.net>
parents:
28961
diff
changeset
|
1672 if (user->extinfo == NULL) |
746bf7d8b34e
Combine the CurrentMedia and MsnUserPhoneInfo structs. This makes
Mark Doliner <mark@kingant.net>
parents:
28961
diff
changeset
|
1673 user->extinfo = g_new0(MsnUserExtendedInfo, 1); |
746bf7d8b34e
Combine the CurrentMedia and MsnUserPhoneInfo structs. This makes
Mark Doliner <mark@kingant.net>
parents:
28961
diff
changeset
|
1674 else { |
746bf7d8b34e
Combine the CurrentMedia and MsnUserPhoneInfo structs. This makes
Mark Doliner <mark@kingant.net>
parents:
28961
diff
changeset
|
1675 g_free(user->extinfo->media_album); |
746bf7d8b34e
Combine the CurrentMedia and MsnUserPhoneInfo structs. This makes
Mark Doliner <mark@kingant.net>
parents:
28961
diff
changeset
|
1676 g_free(user->extinfo->media_artist); |
746bf7d8b34e
Combine the CurrentMedia and MsnUserPhoneInfo structs. This makes
Mark Doliner <mark@kingant.net>
parents:
28961
diff
changeset
|
1677 g_free(user->extinfo->media_title); |
746bf7d8b34e
Combine the CurrentMedia and MsnUserPhoneInfo structs. This makes
Mark Doliner <mark@kingant.net>
parents:
28961
diff
changeset
|
1678 } |
746bf7d8b34e
Combine the CurrentMedia and MsnUserPhoneInfo structs. This makes
Mark Doliner <mark@kingant.net>
parents:
28961
diff
changeset
|
1679 |
746bf7d8b34e
Combine the CurrentMedia and MsnUserPhoneInfo structs. This makes
Mark Doliner <mark@kingant.net>
parents:
28961
diff
changeset
|
1680 if (!strcmp(cmedia_array[1], "Music")) |
746bf7d8b34e
Combine the CurrentMedia and MsnUserPhoneInfo structs. This makes
Mark Doliner <mark@kingant.net>
parents:
28961
diff
changeset
|
1681 user->extinfo->media_type = CURRENT_MEDIA_MUSIC; |
746bf7d8b34e
Combine the CurrentMedia and MsnUserPhoneInfo structs. This makes
Mark Doliner <mark@kingant.net>
parents:
28961
diff
changeset
|
1682 else if (!strcmp(cmedia_array[1], "Games")) |
746bf7d8b34e
Combine the CurrentMedia and MsnUserPhoneInfo structs. This makes
Mark Doliner <mark@kingant.net>
parents:
28961
diff
changeset
|
1683 user->extinfo->media_type = CURRENT_MEDIA_GAMES; |
746bf7d8b34e
Combine the CurrentMedia and MsnUserPhoneInfo structs. This makes
Mark Doliner <mark@kingant.net>
parents:
28961
diff
changeset
|
1684 else if (!strcmp(cmedia_array[1], "Office")) |
746bf7d8b34e
Combine the CurrentMedia and MsnUserPhoneInfo structs. This makes
Mark Doliner <mark@kingant.net>
parents:
28961
diff
changeset
|
1685 user->extinfo->media_type = CURRENT_MEDIA_OFFICE; |
746bf7d8b34e
Combine the CurrentMedia and MsnUserPhoneInfo structs. This makes
Mark Doliner <mark@kingant.net>
parents:
28961
diff
changeset
|
1686 else |
746bf7d8b34e
Combine the CurrentMedia and MsnUserPhoneInfo structs. This makes
Mark Doliner <mark@kingant.net>
parents:
28961
diff
changeset
|
1687 user->extinfo->media_type = CURRENT_MEDIA_UNKNOWN; |
746bf7d8b34e
Combine the CurrentMedia and MsnUserPhoneInfo structs. This makes
Mark Doliner <mark@kingant.net>
parents:
28961
diff
changeset
|
1688 |
746bf7d8b34e
Combine the CurrentMedia and MsnUserPhoneInfo structs. This makes
Mark Doliner <mark@kingant.net>
parents:
28961
diff
changeset
|
1689 user->extinfo->media_title = g_strdup(cmedia_array[strings == 4 ? 3 : 4]); |
746bf7d8b34e
Combine the CurrentMedia and MsnUserPhoneInfo structs. This makes
Mark Doliner <mark@kingant.net>
parents:
28961
diff
changeset
|
1690 user->extinfo->media_artist = strings > 5 ? g_strdup(cmedia_array[5]) : NULL; |
746bf7d8b34e
Combine the CurrentMedia and MsnUserPhoneInfo structs. This makes
Mark Doliner <mark@kingant.net>
parents:
28961
diff
changeset
|
1691 user->extinfo->media_album = strings > 6 ? g_strdup(cmedia_array[6]) : NULL; |
746bf7d8b34e
Combine the CurrentMedia and MsnUserPhoneInfo structs. This makes
Mark Doliner <mark@kingant.net>
parents:
28961
diff
changeset
|
1692 } |
746bf7d8b34e
Combine the CurrentMedia and MsnUserPhoneInfo structs. This makes
Mark Doliner <mark@kingant.net>
parents:
28961
diff
changeset
|
1693 |
746bf7d8b34e
Combine the CurrentMedia and MsnUserPhoneInfo structs. This makes
Mark Doliner <mark@kingant.net>
parents:
28961
diff
changeset
|
1694 g_strfreev(cmedia_array); |
746bf7d8b34e
Combine the CurrentMedia and MsnUserPhoneInfo structs. This makes
Mark Doliner <mark@kingant.net>
parents:
28961
diff
changeset
|
1695 } |
746bf7d8b34e
Combine the CurrentMedia and MsnUserPhoneInfo structs. This makes
Mark Doliner <mark@kingant.net>
parents:
28961
diff
changeset
|
1696 |
20394
4a099e4d0d09
propagate from branch 'im.pidgin.pidgin' (head 98b6b547b29ea1192b73cc4e1de1e674edef4328)
Richard Laager <rlaager@wiktel.com>
parents:
16063
diff
changeset
|
1697 /* |
4a099e4d0d09
propagate from branch 'im.pidgin.pidgin' (head 98b6b547b29ea1192b73cc4e1de1e674edef4328)
Richard Laager <rlaager@wiktel.com>
parents:
16063
diff
changeset
|
1698 * Get the UBX's PSM info |
4a099e4d0d09
propagate from branch 'im.pidgin.pidgin' (head 98b6b547b29ea1192b73cc4e1de1e674edef4328)
Richard Laager <rlaager@wiktel.com>
parents:
16063
diff
changeset
|
1699 * Post it to the User status |
4a099e4d0d09
propagate from branch 'im.pidgin.pidgin' (head 98b6b547b29ea1192b73cc4e1de1e674edef4328)
Richard Laager <rlaager@wiktel.com>
parents:
16063
diff
changeset
|
1700 * Thanks for Chris <ukdrizzle@yahoo.co.uk>'s code |
4a099e4d0d09
propagate from branch 'im.pidgin.pidgin' (head 98b6b547b29ea1192b73cc4e1de1e674edef4328)
Richard Laager <rlaager@wiktel.com>
parents:
16063
diff
changeset
|
1701 */ |
4a099e4d0d09
propagate from branch 'im.pidgin.pidgin' (head 98b6b547b29ea1192b73cc4e1de1e674edef4328)
Richard Laager <rlaager@wiktel.com>
parents:
16063
diff
changeset
|
1702 static void |
4a099e4d0d09
propagate from branch 'im.pidgin.pidgin' (head 98b6b547b29ea1192b73cc4e1de1e674edef4328)
Richard Laager <rlaager@wiktel.com>
parents:
16063
diff
changeset
|
1703 ubx_cmd_post(MsnCmdProc *cmdproc, MsnCommand *cmd, char *payload, |
4a099e4d0d09
propagate from branch 'im.pidgin.pidgin' (head 98b6b547b29ea1192b73cc4e1de1e674edef4328)
Richard Laager <rlaager@wiktel.com>
parents:
16063
diff
changeset
|
1704 size_t len) |
4a099e4d0d09
propagate from branch 'im.pidgin.pidgin' (head 98b6b547b29ea1192b73cc4e1de1e674edef4328)
Richard Laager <rlaager@wiktel.com>
parents:
16063
diff
changeset
|
1705 { |
4a099e4d0d09
propagate from branch 'im.pidgin.pidgin' (head 98b6b547b29ea1192b73cc4e1de1e674edef4328)
Richard Laager <rlaager@wiktel.com>
parents:
16063
diff
changeset
|
1706 MsnSession *session; |
4a099e4d0d09
propagate from branch 'im.pidgin.pidgin' (head 98b6b547b29ea1192b73cc4e1de1e674edef4328)
Richard Laager <rlaager@wiktel.com>
parents:
16063
diff
changeset
|
1707 MsnUser *user; |
4a099e4d0d09
propagate from branch 'im.pidgin.pidgin' (head 98b6b547b29ea1192b73cc4e1de1e674edef4328)
Richard Laager <rlaager@wiktel.com>
parents:
16063
diff
changeset
|
1708 const char *passport; |
30663
3140627b93e7
Avoid calling xmlnode_from_str twice when parsing the UBX data.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
30661
diff
changeset
|
1709 xmlnode *payloadNode; |
20570
5913725cbcd6
Use an independant status type for 'current media' stuff, instead of using
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
20514
diff
changeset
|
1710 char *psm_str, *str; |
20394
4a099e4d0d09
propagate from branch 'im.pidgin.pidgin' (head 98b6b547b29ea1192b73cc4e1de1e674edef4328)
Richard Laager <rlaager@wiktel.com>
parents:
16063
diff
changeset
|
1711 |
4a099e4d0d09
propagate from branch 'im.pidgin.pidgin' (head 98b6b547b29ea1192b73cc4e1de1e674edef4328)
Richard Laager <rlaager@wiktel.com>
parents:
16063
diff
changeset
|
1712 session = cmdproc->session; |
4a099e4d0d09
propagate from branch 'im.pidgin.pidgin' (head 98b6b547b29ea1192b73cc4e1de1e674edef4328)
Richard Laager <rlaager@wiktel.com>
parents:
16063
diff
changeset
|
1713 |
4a099e4d0d09
propagate from branch 'im.pidgin.pidgin' (head 98b6b547b29ea1192b73cc4e1de1e674edef4328)
Richard Laager <rlaager@wiktel.com>
parents:
16063
diff
changeset
|
1714 passport = cmd->params[0]; |
31022
78dccab9824c
Add the session user to the userlist. This reduces the amount of
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
31021
diff
changeset
|
1715 user = msn_userlist_find_user(session->userlist, passport); |
23988
b8d38a11f9c6
prints out the payload to debug log in case we get an invalid UBX command,
Ka-Hing Cheung <khc@hxbc.us>
parents:
23936
diff
changeset
|
1716 if (user == NULL) { |
b8d38a11f9c6
prints out the payload to debug log in case we get an invalid UBX command,
Ka-Hing Cheung <khc@hxbc.us>
parents:
23936
diff
changeset
|
1717 char *str = g_strndup(payload, len); |
26196
399776a9ad98
Add some missing newlines in debug messages.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
25954
diff
changeset
|
1718 purple_debug_info("msn", "unknown user %s, payload is %s\n", |
23988
b8d38a11f9c6
prints out the payload to debug log in case we get an invalid UBX command,
Ka-Hing Cheung <khc@hxbc.us>
parents:
23936
diff
changeset
|
1719 passport, str); |
b8d38a11f9c6
prints out the payload to debug log in case we get an invalid UBX command,
Ka-Hing Cheung <khc@hxbc.us>
parents:
23936
diff
changeset
|
1720 g_free(str); |
b8d38a11f9c6
prints out the payload to debug log in case we get an invalid UBX command,
Ka-Hing Cheung <khc@hxbc.us>
parents:
23936
diff
changeset
|
1721 return; |
b8d38a11f9c6
prints out the payload to debug log in case we get an invalid UBX command,
Ka-Hing Cheung <khc@hxbc.us>
parents:
23936
diff
changeset
|
1722 } |
23298
5cdd93dac7a2
Delete trailing whitespace
Mark Doliner <mark@kingant.net>
parents:
22922
diff
changeset
|
1723 |
28978
746bf7d8b34e
Combine the CurrentMedia and MsnUserPhoneInfo structs. This makes
Mark Doliner <mark@kingant.net>
parents:
28961
diff
changeset
|
1724 /* Free any existing media info for this user */ |
746bf7d8b34e
Combine the CurrentMedia and MsnUserPhoneInfo structs. This makes
Mark Doliner <mark@kingant.net>
parents:
28961
diff
changeset
|
1725 if (user->extinfo) { |
746bf7d8b34e
Combine the CurrentMedia and MsnUserPhoneInfo structs. This makes
Mark Doliner <mark@kingant.net>
parents:
28961
diff
changeset
|
1726 g_free(user->extinfo->media_album); |
746bf7d8b34e
Combine the CurrentMedia and MsnUserPhoneInfo structs. This makes
Mark Doliner <mark@kingant.net>
parents:
28961
diff
changeset
|
1727 g_free(user->extinfo->media_artist); |
746bf7d8b34e
Combine the CurrentMedia and MsnUserPhoneInfo structs. This makes
Mark Doliner <mark@kingant.net>
parents:
28961
diff
changeset
|
1728 g_free(user->extinfo->media_title); |
746bf7d8b34e
Combine the CurrentMedia and MsnUserPhoneInfo structs. This makes
Mark Doliner <mark@kingant.net>
parents:
28961
diff
changeset
|
1729 user->extinfo->media_album = NULL; |
746bf7d8b34e
Combine the CurrentMedia and MsnUserPhoneInfo structs. This makes
Mark Doliner <mark@kingant.net>
parents:
28961
diff
changeset
|
1730 user->extinfo->media_artist = NULL; |
746bf7d8b34e
Combine the CurrentMedia and MsnUserPhoneInfo structs. This makes
Mark Doliner <mark@kingant.net>
parents:
28961
diff
changeset
|
1731 user->extinfo->media_title = NULL; |
30140
137d464440f7
Correctly reset and free user->extinfo when the buddy is not listening to
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
30139
diff
changeset
|
1732 user->extinfo->media_type = CURRENT_MEDIA_UNKNOWN; |
28978
746bf7d8b34e
Combine the CurrentMedia and MsnUserPhoneInfo structs. This makes
Mark Doliner <mark@kingant.net>
parents:
28961
diff
changeset
|
1733 } |
746bf7d8b34e
Combine the CurrentMedia and MsnUserPhoneInfo structs. This makes
Mark Doliner <mark@kingant.net>
parents:
28961
diff
changeset
|
1734 |
25460
11458e8584c2
Set a NULL statusline and CurrentMedia if the UBX returns an empty payload,
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
25400
diff
changeset
|
1735 if (len != 0) { |
30663
3140627b93e7
Avoid calling xmlnode_from_str twice when parsing the UBX data.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
30661
diff
changeset
|
1736 payloadNode = xmlnode_from_str(payload, len); |
3140627b93e7
Avoid calling xmlnode_from_str twice when parsing the UBX data.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
30661
diff
changeset
|
1737 if (!payloadNode) { |
3140627b93e7
Avoid calling xmlnode_from_str twice when parsing the UBX data.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
30661
diff
changeset
|
1738 purple_debug_error("msn", "UBX XML parse Error!\n"); |
3140627b93e7
Avoid calling xmlnode_from_str twice when parsing the UBX data.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
30661
diff
changeset
|
1739 |
3140627b93e7
Avoid calling xmlnode_from_str twice when parsing the UBX data.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
30661
diff
changeset
|
1740 msn_user_set_statusline(user, NULL); |
3140627b93e7
Avoid calling xmlnode_from_str twice when parsing the UBX data.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
30661
diff
changeset
|
1741 |
3140627b93e7
Avoid calling xmlnode_from_str twice when parsing the UBX data.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
30661
diff
changeset
|
1742 msn_user_update(user); |
3140627b93e7
Avoid calling xmlnode_from_str twice when parsing the UBX data.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
30661
diff
changeset
|
1743 return; |
3140627b93e7
Avoid calling xmlnode_from_str twice when parsing the UBX data.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
30661
diff
changeset
|
1744 } |
3140627b93e7
Avoid calling xmlnode_from_str twice when parsing the UBX data.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
30661
diff
changeset
|
1745 |
3140627b93e7
Avoid calling xmlnode_from_str twice when parsing the UBX data.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
30661
diff
changeset
|
1746 psm_str = msn_get_psm(payloadNode); |
25460
11458e8584c2
Set a NULL statusline and CurrentMedia if the UBX returns an empty payload,
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
25400
diff
changeset
|
1747 msn_user_set_statusline(user, psm_str); |
11458e8584c2
Set a NULL statusline and CurrentMedia if the UBX returns an empty payload,
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
25400
diff
changeset
|
1748 g_free(psm_str); |
20570
5913725cbcd6
Use an independant status type for 'current media' stuff, instead of using
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
20514
diff
changeset
|
1749 |
30663
3140627b93e7
Avoid calling xmlnode_from_str twice when parsing the UBX data.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
30661
diff
changeset
|
1750 str = msn_get_currentmedia(payloadNode); |
28978
746bf7d8b34e
Combine the CurrentMedia and MsnUserPhoneInfo structs. This makes
Mark Doliner <mark@kingant.net>
parents:
28961
diff
changeset
|
1751 parse_currentmedia(user, str); |
25460
11458e8584c2
Set a NULL statusline and CurrentMedia if the UBX returns an empty payload,
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
25400
diff
changeset
|
1752 g_free(str); |
11458e8584c2
Set a NULL statusline and CurrentMedia if the UBX returns an empty payload,
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
25400
diff
changeset
|
1753 |
30665
60688353c010
Attempt to parse any EndpointData out of the UBX payload. This isn't really
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
30663
diff
changeset
|
1754 parse_user_endpoints(user, payloadNode); |
30668
1019ec61967a
Call xmlnode_free in the correct location.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
30667
diff
changeset
|
1755 |
1019ec61967a
Call xmlnode_free in the correct location.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
30667
diff
changeset
|
1756 xmlnode_free(payloadNode); |
1019ec61967a
Call xmlnode_free in the correct location.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
30667
diff
changeset
|
1757 |
25460
11458e8584c2
Set a NULL statusline and CurrentMedia if the UBX returns an empty payload,
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
25400
diff
changeset
|
1758 } else { |
11458e8584c2
Set a NULL statusline and CurrentMedia if the UBX returns an empty payload,
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
25400
diff
changeset
|
1759 msn_user_set_statusline(user, NULL); |
11458e8584c2
Set a NULL statusline and CurrentMedia if the UBX returns an empty payload,
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
25400
diff
changeset
|
1760 } |
19843
60bc06498746
Committing khc's msnp14 changes from Trac Ticket #148. --rlaager
Ka-Hing Cheung <khc@hxbc.us>
parents:
16063
diff
changeset
|
1761 |
20394
4a099e4d0d09
propagate from branch 'im.pidgin.pidgin' (head 98b6b547b29ea1192b73cc4e1de1e674edef4328)
Richard Laager <rlaager@wiktel.com>
parents:
16063
diff
changeset
|
1762 msn_user_update(user); |
4a099e4d0d09
propagate from branch 'im.pidgin.pidgin' (head 98b6b547b29ea1192b73cc4e1de1e674edef4328)
Richard Laager <rlaager@wiktel.com>
parents:
16063
diff
changeset
|
1763 } |
4a099e4d0d09
propagate from branch 'im.pidgin.pidgin' (head 98b6b547b29ea1192b73cc4e1de1e674edef4328)
Richard Laager <rlaager@wiktel.com>
parents:
16063
diff
changeset
|
1764 |
4a099e4d0d09
propagate from branch 'im.pidgin.pidgin' (head 98b6b547b29ea1192b73cc4e1de1e674edef4328)
Richard Laager <rlaager@wiktel.com>
parents:
16063
diff
changeset
|
1765 static void |
4a099e4d0d09
propagate from branch 'im.pidgin.pidgin' (head 98b6b547b29ea1192b73cc4e1de1e674edef4328)
Richard Laager <rlaager@wiktel.com>
parents:
16063
diff
changeset
|
1766 ubx_cmd(MsnCmdProc *cmdproc, MsnCommand *cmd) |
4a099e4d0d09
propagate from branch 'im.pidgin.pidgin' (head 98b6b547b29ea1192b73cc4e1de1e674edef4328)
Richard Laager <rlaager@wiktel.com>
parents:
16063
diff
changeset
|
1767 { |
23519
7bceac816e19
The great MSN debug message cleanup! Threw in a few whitespace fixes,
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
23517
diff
changeset
|
1768 purple_debug_misc("msn", "UBX received.\n"); |
20394
4a099e4d0d09
propagate from branch 'im.pidgin.pidgin' (head 98b6b547b29ea1192b73cc4e1de1e674edef4328)
Richard Laager <rlaager@wiktel.com>
parents:
16063
diff
changeset
|
1769 cmdproc->last_cmd->payload_cb = ubx_cmd_post; |
23514
7e16d193bb57
Get rid of that whole msn_set_payload_len thing and correctly set the
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
23512
diff
changeset
|
1770 cmd->payload_len = atoi(cmd->params[2]); |
7e16d193bb57
Get rid of that whole msn_set_payload_len thing and correctly set the
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
23512
diff
changeset
|
1771 } |
7e16d193bb57
Get rid of that whole msn_set_payload_len thing and correctly set the
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
23512
diff
changeset
|
1772 |
7e16d193bb57
Get rid of that whole msn_set_payload_len thing and correctly set the
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
23512
diff
changeset
|
1773 static void |
7e16d193bb57
Get rid of that whole msn_set_payload_len thing and correctly set the
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
23512
diff
changeset
|
1774 uux_cmd_post(MsnCmdProc *cmdproc, MsnCommand *cmd, char *payload, |
7e16d193bb57
Get rid of that whole msn_set_payload_len thing and correctly set the
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
23512
diff
changeset
|
1775 size_t len) |
7e16d193bb57
Get rid of that whole msn_set_payload_len thing and correctly set the
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
23512
diff
changeset
|
1776 { |
7e16d193bb57
Get rid of that whole msn_set_payload_len thing and correctly set the
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
23512
diff
changeset
|
1777 /* Do Nothing, right now. */ |
7e16d193bb57
Get rid of that whole msn_set_payload_len thing and correctly set the
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
23512
diff
changeset
|
1778 if (payload != NULL) |
7e16d193bb57
Get rid of that whole msn_set_payload_len thing and correctly set the
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
23512
diff
changeset
|
1779 purple_debug_info("msn", "UUX payload:\n%s\n", payload); |
20394
4a099e4d0d09
propagate from branch 'im.pidgin.pidgin' (head 98b6b547b29ea1192b73cc4e1de1e674edef4328)
Richard Laager <rlaager@wiktel.com>
parents:
16063
diff
changeset
|
1780 } |
4a099e4d0d09
propagate from branch 'im.pidgin.pidgin' (head 98b6b547b29ea1192b73cc4e1de1e674edef4328)
Richard Laager <rlaager@wiktel.com>
parents:
16063
diff
changeset
|
1781 |
4a099e4d0d09
propagate from branch 'im.pidgin.pidgin' (head 98b6b547b29ea1192b73cc4e1de1e674edef4328)
Richard Laager <rlaager@wiktel.com>
parents:
16063
diff
changeset
|
1782 static void |
4a099e4d0d09
propagate from branch 'im.pidgin.pidgin' (head 98b6b547b29ea1192b73cc4e1de1e674edef4328)
Richard Laager <rlaager@wiktel.com>
parents:
16063
diff
changeset
|
1783 uux_cmd(MsnCmdProc *cmdproc, MsnCommand *cmd) |
4a099e4d0d09
propagate from branch 'im.pidgin.pidgin' (head 98b6b547b29ea1192b73cc4e1de1e674edef4328)
Richard Laager <rlaager@wiktel.com>
parents:
16063
diff
changeset
|
1784 { |
23514
7e16d193bb57
Get rid of that whole msn_set_payload_len thing and correctly set the
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
23512
diff
changeset
|
1785 purple_debug_misc("msn", "UUX received.\n"); |
7e16d193bb57
Get rid of that whole msn_set_payload_len thing and correctly set the
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
23512
diff
changeset
|
1786 cmdproc->last_cmd->payload_cb = uux_cmd_post; |
7e16d193bb57
Get rid of that whole msn_set_payload_len thing and correctly set the
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
23512
diff
changeset
|
1787 cmd->payload_len = atoi(cmd->params[1]); |
20394
4a099e4d0d09
propagate from branch 'im.pidgin.pidgin' (head 98b6b547b29ea1192b73cc4e1de1e674edef4328)
Richard Laager <rlaager@wiktel.com>
parents:
16063
diff
changeset
|
1788 } |
4a099e4d0d09
propagate from branch 'im.pidgin.pidgin' (head 98b6b547b29ea1192b73cc4e1de1e674edef4328)
Richard Laager <rlaager@wiktel.com>
parents:
16063
diff
changeset
|
1789 |
30657
e30865b62859
Initial support for msnp16, based on patch by Masca.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
28668
diff
changeset
|
1790 void |
e30865b62859
Initial support for msnp16, based on patch by Masca.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
28668
diff
changeset
|
1791 msn_notification_send_uux(MsnSession *session, const char *payload) |
e30865b62859
Initial support for msnp16, based on patch by Masca.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
28668
diff
changeset
|
1792 { |
e30865b62859
Initial support for msnp16, based on patch by Masca.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
28668
diff
changeset
|
1793 MsnTransaction *trans; |
e30865b62859
Initial support for msnp16, based on patch by Masca.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
28668
diff
changeset
|
1794 MsnCmdProc *cmdproc; |
e30865b62859
Initial support for msnp16, based on patch by Masca.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
28668
diff
changeset
|
1795 size_t len = strlen(payload); |
e30865b62859
Initial support for msnp16, based on patch by Masca.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
28668
diff
changeset
|
1796 |
e30865b62859
Initial support for msnp16, based on patch by Masca.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
28668
diff
changeset
|
1797 cmdproc = session->notification->cmdproc; |
e30865b62859
Initial support for msnp16, based on patch by Masca.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
28668
diff
changeset
|
1798 purple_debug_misc("msn", "Sending UUX command with payload: %s\n", payload); |
e30865b62859
Initial support for msnp16, based on patch by Masca.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
28668
diff
changeset
|
1799 trans = msn_transaction_new(cmdproc, "UUX", "%" G_GSIZE_FORMAT, len); |
e30865b62859
Initial support for msnp16, based on patch by Masca.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
28668
diff
changeset
|
1800 msn_transaction_set_payload(trans, payload, len); |
e30865b62859
Initial support for msnp16, based on patch by Masca.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
28668
diff
changeset
|
1801 msn_cmdproc_send_trans(cmdproc, trans); |
e30865b62859
Initial support for msnp16, based on patch by Masca.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
28668
diff
changeset
|
1802 } |
e30865b62859
Initial support for msnp16, based on patch by Masca.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
28668
diff
changeset
|
1803 |
e30865b62859
Initial support for msnp16, based on patch by Masca.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
28668
diff
changeset
|
1804 void msn_notification_send_uux_endpointdata(MsnSession *session) |
e30865b62859
Initial support for msnp16, based on patch by Masca.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
28668
diff
changeset
|
1805 { |
e30865b62859
Initial support for msnp16, based on patch by Masca.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
28668
diff
changeset
|
1806 xmlnode *epDataNode; |
e30865b62859
Initial support for msnp16, based on patch by Masca.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
28668
diff
changeset
|
1807 xmlnode *capNode; |
e30865b62859
Initial support for msnp16, based on patch by Masca.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
28668
diff
changeset
|
1808 char *caps; |
e30865b62859
Initial support for msnp16, based on patch by Masca.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
28668
diff
changeset
|
1809 char *payload; |
e30865b62859
Initial support for msnp16, based on patch by Masca.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
28668
diff
changeset
|
1810 int length; |
e30865b62859
Initial support for msnp16, based on patch by Masca.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
28668
diff
changeset
|
1811 |
e30865b62859
Initial support for msnp16, based on patch by Masca.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
28668
diff
changeset
|
1812 epDataNode = xmlnode_new("EndpointData"); |
e30865b62859
Initial support for msnp16, based on patch by Masca.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
28668
diff
changeset
|
1813 |
e30865b62859
Initial support for msnp16, based on patch by Masca.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
28668
diff
changeset
|
1814 capNode = xmlnode_new_child(epDataNode, "Capabilities"); |
30875
c49697f075cf
applied changes from cc2567c1558bffb058fda6a6319faf70206a8c34
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
30874
diff
changeset
|
1815 if (session->protocol_ver >= 16) |
c49697f075cf
applied changes from cc2567c1558bffb058fda6a6319faf70206a8c34
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
30874
diff
changeset
|
1816 caps = g_strdup_printf("%d:%02d", MSN_CLIENT_ID_CAPABILITIES, MSN_CLIENT_ID_EXT_CAPS); |
c49697f075cf
applied changes from cc2567c1558bffb058fda6a6319faf70206a8c34
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
30874
diff
changeset
|
1817 else |
c49697f075cf
applied changes from cc2567c1558bffb058fda6a6319faf70206a8c34
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
30874
diff
changeset
|
1818 caps = g_strdup_printf("%d", MSN_CLIENT_ID_CAPABILITIES); |
30657
e30865b62859
Initial support for msnp16, based on patch by Masca.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
28668
diff
changeset
|
1819 xmlnode_insert_data(capNode, caps, -1); |
e30865b62859
Initial support for msnp16, based on patch by Masca.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
28668
diff
changeset
|
1820 g_free(caps); |
e30865b62859
Initial support for msnp16, based on patch by Masca.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
28668
diff
changeset
|
1821 |
e30865b62859
Initial support for msnp16, based on patch by Masca.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
28668
diff
changeset
|
1822 payload = xmlnode_to_str(epDataNode, &length); |
e30865b62859
Initial support for msnp16, based on patch by Masca.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
28668
diff
changeset
|
1823 |
e30865b62859
Initial support for msnp16, based on patch by Masca.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
28668
diff
changeset
|
1824 msn_notification_send_uux(session, payload); |
e30865b62859
Initial support for msnp16, based on patch by Masca.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
28668
diff
changeset
|
1825 |
e30865b62859
Initial support for msnp16, based on patch by Masca.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
28668
diff
changeset
|
1826 xmlnode_free(epDataNode); |
e30865b62859
Initial support for msnp16, based on patch by Masca.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
28668
diff
changeset
|
1827 g_free(payload); |
e30865b62859
Initial support for msnp16, based on patch by Masca.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
28668
diff
changeset
|
1828 } |
e30865b62859
Initial support for msnp16, based on patch by Masca.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
28668
diff
changeset
|
1829 |
e30865b62859
Initial support for msnp16, based on patch by Masca.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
28668
diff
changeset
|
1830 void msn_notification_send_uux_private_endpointdata(MsnSession *session) |
e30865b62859
Initial support for msnp16, based on patch by Masca.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
28668
diff
changeset
|
1831 { |
e30865b62859
Initial support for msnp16, based on patch by Masca.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
28668
diff
changeset
|
1832 xmlnode *private; |
30685
dd430f788bdc
Allow setting the name of the current location. The default is still Pidgin
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
30684
diff
changeset
|
1833 const char *name; |
30657
e30865b62859
Initial support for msnp16, based on patch by Masca.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
28668
diff
changeset
|
1834 xmlnode *epname; |
e30865b62859
Initial support for msnp16, based on patch by Masca.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
28668
diff
changeset
|
1835 xmlnode *idle; |
30686
c1e44e9a1110
Support sending different client types in PrivateEndpointData.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
30685
diff
changeset
|
1836 GHashTable *ui_info; |
c1e44e9a1110
Support sending different client types in PrivateEndpointData.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
30685
diff
changeset
|
1837 const gchar *ui_type; |
30657
e30865b62859
Initial support for msnp16, based on patch by Masca.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
28668
diff
changeset
|
1838 xmlnode *client_type; |
e30865b62859
Initial support for msnp16, based on patch by Masca.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
28668
diff
changeset
|
1839 xmlnode *state; |
e30865b62859
Initial support for msnp16, based on patch by Masca.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
28668
diff
changeset
|
1840 char *payload; |
e30865b62859
Initial support for msnp16, based on patch by Masca.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
28668
diff
changeset
|
1841 int length; |
e30865b62859
Initial support for msnp16, based on patch by Masca.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
28668
diff
changeset
|
1842 |
30684
b4dc2d27f24e
Fix typo in PrivateEndpointData, resulting in the name of the endpoint
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
30683
diff
changeset
|
1843 private = xmlnode_new("PrivateEndpointData"); |
30657
e30865b62859
Initial support for msnp16, based on patch by Masca.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
28668
diff
changeset
|
1844 |
30685
dd430f788bdc
Allow setting the name of the current location. The default is still Pidgin
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
30684
diff
changeset
|
1845 name = purple_account_get_string(session->account, "endpoint-name", NULL); |
30657
e30865b62859
Initial support for msnp16, based on patch by Masca.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
28668
diff
changeset
|
1846 epname = xmlnode_new_child(private, "EpName"); |
30685
dd430f788bdc
Allow setting the name of the current location. The default is still Pidgin
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
30684
diff
changeset
|
1847 xmlnode_insert_data(epname, name, -1); |
30657
e30865b62859
Initial support for msnp16, based on patch by Masca.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
28668
diff
changeset
|
1848 |
e30865b62859
Initial support for msnp16, based on patch by Masca.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
28668
diff
changeset
|
1849 idle = xmlnode_new_child(private, "Idle"); |
e30865b62859
Initial support for msnp16, based on patch by Masca.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
28668
diff
changeset
|
1850 xmlnode_insert_data(idle, "false", -1); |
e30865b62859
Initial support for msnp16, based on patch by Masca.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
28668
diff
changeset
|
1851 |
e30865b62859
Initial support for msnp16, based on patch by Masca.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
28668
diff
changeset
|
1852 /* ClientType info (from amsn guys): |
e30865b62859
Initial support for msnp16, based on patch by Masca.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
28668
diff
changeset
|
1853 0: None |
e30865b62859
Initial support for msnp16, based on patch by Masca.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
28668
diff
changeset
|
1854 1: Computer |
e30865b62859
Initial support for msnp16, based on patch by Masca.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
28668
diff
changeset
|
1855 2: Website |
e30865b62859
Initial support for msnp16, based on patch by Masca.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
28668
diff
changeset
|
1856 3: Mobile / none |
e30865b62859
Initial support for msnp16, based on patch by Masca.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
28668
diff
changeset
|
1857 4: Xbox / phone /mobile |
e30865b62859
Initial support for msnp16, based on patch by Masca.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
28668
diff
changeset
|
1858 9: MsnGroup |
e30865b62859
Initial support for msnp16, based on patch by Masca.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
28668
diff
changeset
|
1859 32: Email member, currently Yahoo! |
e30865b62859
Initial support for msnp16, based on patch by Masca.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
28668
diff
changeset
|
1860 */ |
e30865b62859
Initial support for msnp16, based on patch by Masca.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
28668
diff
changeset
|
1861 client_type = xmlnode_new_child(private, "ClientType"); |
30686
c1e44e9a1110
Support sending different client types in PrivateEndpointData.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
30685
diff
changeset
|
1862 ui_info = purple_core_get_ui_info(); |
c1e44e9a1110
Support sending different client types in PrivateEndpointData.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
30685
diff
changeset
|
1863 ui_type = ui_info ? g_hash_table_lookup(ui_info, "client_type") : NULL; |
c1e44e9a1110
Support sending different client types in PrivateEndpointData.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
30685
diff
changeset
|
1864 if (ui_type) { |
c1e44e9a1110
Support sending different client types in PrivateEndpointData.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
30685
diff
changeset
|
1865 if (strcmp(ui_type, "pc") == 0) |
c1e44e9a1110
Support sending different client types in PrivateEndpointData.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
30685
diff
changeset
|
1866 xmlnode_insert_data(client_type, "1", -1); |
c1e44e9a1110
Support sending different client types in PrivateEndpointData.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
30685
diff
changeset
|
1867 else if (strcmp(ui_type, "web") == 0) |
c1e44e9a1110
Support sending different client types in PrivateEndpointData.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
30685
diff
changeset
|
1868 xmlnode_insert_data(client_type, "2", -1); |
c1e44e9a1110
Support sending different client types in PrivateEndpointData.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
30685
diff
changeset
|
1869 else if (strcmp(ui_type, "phone") == 0) |
c1e44e9a1110
Support sending different client types in PrivateEndpointData.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
30685
diff
changeset
|
1870 xmlnode_insert_data(client_type, "3", -1); |
c1e44e9a1110
Support sending different client types in PrivateEndpointData.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
30685
diff
changeset
|
1871 else if (strcmp(ui_type, "handheld") == 0) |
c1e44e9a1110
Support sending different client types in PrivateEndpointData.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
30685
diff
changeset
|
1872 xmlnode_insert_data(client_type, "3", -1); |
c1e44e9a1110
Support sending different client types in PrivateEndpointData.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
30685
diff
changeset
|
1873 else |
c1e44e9a1110
Support sending different client types in PrivateEndpointData.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
30685
diff
changeset
|
1874 xmlnode_insert_data(client_type, "1", -1); |
c1e44e9a1110
Support sending different client types in PrivateEndpointData.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
30685
diff
changeset
|
1875 } |
c1e44e9a1110
Support sending different client types in PrivateEndpointData.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
30685
diff
changeset
|
1876 else |
c1e44e9a1110
Support sending different client types in PrivateEndpointData.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
30685
diff
changeset
|
1877 xmlnode_insert_data(client_type, "1", -1); |
30657
e30865b62859
Initial support for msnp16, based on patch by Masca.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
28668
diff
changeset
|
1878 |
e30865b62859
Initial support for msnp16, based on patch by Masca.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
28668
diff
changeset
|
1879 state = xmlnode_new_child(private, "State"); |
e30865b62859
Initial support for msnp16, based on patch by Masca.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
28668
diff
changeset
|
1880 xmlnode_insert_data(state, msn_state_get_text(msn_state_from_account(session->account)), -1); |
e30865b62859
Initial support for msnp16, based on patch by Masca.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
28668
diff
changeset
|
1881 |
e30865b62859
Initial support for msnp16, based on patch by Masca.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
28668
diff
changeset
|
1882 payload = xmlnode_to_str(private, &length); |
e30865b62859
Initial support for msnp16, based on patch by Masca.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
28668
diff
changeset
|
1883 |
e30865b62859
Initial support for msnp16, based on patch by Masca.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
28668
diff
changeset
|
1884 msn_notification_send_uux(session, payload); |
e30865b62859
Initial support for msnp16, based on patch by Masca.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
28668
diff
changeset
|
1885 |
e30865b62859
Initial support for msnp16, based on patch by Masca.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
28668
diff
changeset
|
1886 xmlnode_free(private); |
e30865b62859
Initial support for msnp16, based on patch by Masca.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
28668
diff
changeset
|
1887 g_free(payload); |
e30865b62859
Initial support for msnp16, based on patch by Masca.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
28668
diff
changeset
|
1888 } |
e30865b62859
Initial support for msnp16, based on patch by Masca.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
28668
diff
changeset
|
1889 |
30687
4c8bd8efacb8
Support receiving UBN and sending UUN, which seem to have been added way
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
30686
diff
changeset
|
1890 static void |
4c8bd8efacb8
Support receiving UBN and sending UUN, which seem to have been added way
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
30686
diff
changeset
|
1891 ubn_cmd_post(MsnCmdProc *cmdproc, MsnCommand *cmd, char *payload, |
4c8bd8efacb8
Support receiving UBN and sending UUN, which seem to have been added way
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
30686
diff
changeset
|
1892 size_t len) |
4c8bd8efacb8
Support receiving UBN and sending UUN, which seem to have been added way
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
30686
diff
changeset
|
1893 { |
4c8bd8efacb8
Support receiving UBN and sending UUN, which seem to have been added way
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
30686
diff
changeset
|
1894 /* Do Nothing, right now. */ |
4c8bd8efacb8
Support receiving UBN and sending UUN, which seem to have been added way
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
30686
diff
changeset
|
1895 if (payload != NULL) |
4c8bd8efacb8
Support receiving UBN and sending UUN, which seem to have been added way
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
30686
diff
changeset
|
1896 purple_debug_info("msn", "UBN payload:\n%s\n", payload); |
4c8bd8efacb8
Support receiving UBN and sending UUN, which seem to have been added way
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
30686
diff
changeset
|
1897 } |
4c8bd8efacb8
Support receiving UBN and sending UUN, which seem to have been added way
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
30686
diff
changeset
|
1898 |
4c8bd8efacb8
Support receiving UBN and sending UUN, which seem to have been added way
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
30686
diff
changeset
|
1899 static void |
4c8bd8efacb8
Support receiving UBN and sending UUN, which seem to have been added way
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
30686
diff
changeset
|
1900 ubn_cmd(MsnCmdProc *cmdproc, MsnCommand *cmd) |
4c8bd8efacb8
Support receiving UBN and sending UUN, which seem to have been added way
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
30686
diff
changeset
|
1901 { |
4c8bd8efacb8
Support receiving UBN and sending UUN, which seem to have been added way
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
30686
diff
changeset
|
1902 purple_debug_misc("msn", "UBN received from %s.\n", cmd->params[0]); |
4c8bd8efacb8
Support receiving UBN and sending UUN, which seem to have been added way
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
30686
diff
changeset
|
1903 cmdproc->last_cmd->payload_cb = ubn_cmd_post; |
4c8bd8efacb8
Support receiving UBN and sending UUN, which seem to have been added way
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
30686
diff
changeset
|
1904 cmd->payload_len = atoi(cmd->params[2]); |
4c8bd8efacb8
Support receiving UBN and sending UUN, which seem to have been added way
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
30686
diff
changeset
|
1905 } |
4c8bd8efacb8
Support receiving UBN and sending UUN, which seem to have been added way
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
30686
diff
changeset
|
1906 |
4c8bd8efacb8
Support receiving UBN and sending UUN, which seem to have been added way
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
30686
diff
changeset
|
1907 static void |
4c8bd8efacb8
Support receiving UBN and sending UUN, which seem to have been added way
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
30686
diff
changeset
|
1908 uun_cmd_post(MsnCmdProc *cmdproc, MsnCommand *cmd, char *payload, |
4c8bd8efacb8
Support receiving UBN and sending UUN, which seem to have been added way
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
30686
diff
changeset
|
1909 size_t len) |
4c8bd8efacb8
Support receiving UBN and sending UUN, which seem to have been added way
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
30686
diff
changeset
|
1910 { |
4c8bd8efacb8
Support receiving UBN and sending UUN, which seem to have been added way
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
30686
diff
changeset
|
1911 /* Do Nothing, right now. */ |
4c8bd8efacb8
Support receiving UBN and sending UUN, which seem to have been added way
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
30686
diff
changeset
|
1912 if (payload != NULL) |
4c8bd8efacb8
Support receiving UBN and sending UUN, which seem to have been added way
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
30686
diff
changeset
|
1913 purple_debug_info("msn", "UUN payload:\n%s\n", payload); |
4c8bd8efacb8
Support receiving UBN and sending UUN, which seem to have been added way
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
30686
diff
changeset
|
1914 } |
4c8bd8efacb8
Support receiving UBN and sending UUN, which seem to have been added way
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
30686
diff
changeset
|
1915 |
4c8bd8efacb8
Support receiving UBN and sending UUN, which seem to have been added way
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
30686
diff
changeset
|
1916 static void |
4c8bd8efacb8
Support receiving UBN and sending UUN, which seem to have been added way
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
30686
diff
changeset
|
1917 uun_cmd(MsnCmdProc *cmdproc, MsnCommand *cmd) |
4c8bd8efacb8
Support receiving UBN and sending UUN, which seem to have been added way
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
30686
diff
changeset
|
1918 { |
4c8bd8efacb8
Support receiving UBN and sending UUN, which seem to have been added way
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
30686
diff
changeset
|
1919 if (strcmp(cmd->params[1], "OK") != 0) { |
4c8bd8efacb8
Support receiving UBN and sending UUN, which seem to have been added way
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
30686
diff
changeset
|
1920 purple_debug_misc("msn", "UUN received.\n"); |
4c8bd8efacb8
Support receiving UBN and sending UUN, which seem to have been added way
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
30686
diff
changeset
|
1921 cmdproc->last_cmd->payload_cb = uun_cmd_post; |
4c8bd8efacb8
Support receiving UBN and sending UUN, which seem to have been added way
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
30686
diff
changeset
|
1922 cmd->payload_len = atoi(cmd->params[1]); |
4c8bd8efacb8
Support receiving UBN and sending UUN, which seem to have been added way
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
30686
diff
changeset
|
1923 } |
4c8bd8efacb8
Support receiving UBN and sending UUN, which seem to have been added way
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
30686
diff
changeset
|
1924 else |
4c8bd8efacb8
Support receiving UBN and sending UUN, which seem to have been added way
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
30686
diff
changeset
|
1925 purple_debug_misc("msn", "UUN OK received.\n"); |
4c8bd8efacb8
Support receiving UBN and sending UUN, which seem to have been added way
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
30686
diff
changeset
|
1926 } |
4c8bd8efacb8
Support receiving UBN and sending UUN, which seem to have been added way
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
30686
diff
changeset
|
1927 |
4c8bd8efacb8
Support receiving UBN and sending UUN, which seem to have been added way
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
30686
diff
changeset
|
1928 void |
4c8bd8efacb8
Support receiving UBN and sending UUN, which seem to have been added way
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
30686
diff
changeset
|
1929 msn_notification_send_uun(MsnSession *session, const char *user, |
4c8bd8efacb8
Support receiving UBN and sending UUN, which seem to have been added way
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
30686
diff
changeset
|
1930 MsnUnifiedNotificationType type, const char *payload) |
4c8bd8efacb8
Support receiving UBN and sending UUN, which seem to have been added way
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
30686
diff
changeset
|
1931 { |
4c8bd8efacb8
Support receiving UBN and sending UUN, which seem to have been added way
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
30686
diff
changeset
|
1932 MsnTransaction *trans; |
4c8bd8efacb8
Support receiving UBN and sending UUN, which seem to have been added way
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
30686
diff
changeset
|
1933 MsnCmdProc *cmdproc; |
4c8bd8efacb8
Support receiving UBN and sending UUN, which seem to have been added way
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
30686
diff
changeset
|
1934 size_t len = strlen(payload); |
4c8bd8efacb8
Support receiving UBN and sending UUN, which seem to have been added way
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
30686
diff
changeset
|
1935 |
4c8bd8efacb8
Support receiving UBN and sending UUN, which seem to have been added way
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
30686
diff
changeset
|
1936 cmdproc = session->notification->cmdproc; |
4c8bd8efacb8
Support receiving UBN and sending UUN, which seem to have been added way
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
30686
diff
changeset
|
1937 purple_debug_misc("msn", "Sending UUN command %d to %s with payload: %s\n", |
4c8bd8efacb8
Support receiving UBN and sending UUN, which seem to have been added way
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
30686
diff
changeset
|
1938 type, user, payload); |
4c8bd8efacb8
Support receiving UBN and sending UUN, which seem to have been added way
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
30686
diff
changeset
|
1939 trans = msn_transaction_new(cmdproc, "UUN", "%s %d %" G_GSIZE_FORMAT, |
4c8bd8efacb8
Support receiving UBN and sending UUN, which seem to have been added way
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
30686
diff
changeset
|
1940 user, type, len); |
4c8bd8efacb8
Support receiving UBN and sending UUN, which seem to have been added way
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
30686
diff
changeset
|
1941 msn_transaction_set_payload(trans, payload, len); |
4c8bd8efacb8
Support receiving UBN and sending UUN, which seem to have been added way
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
30686
diff
changeset
|
1942 msn_cmdproc_send_trans(cmdproc, trans); |
4c8bd8efacb8
Support receiving UBN and sending UUN, which seem to have been added way
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
30686
diff
changeset
|
1943 } |
4c8bd8efacb8
Support receiving UBN and sending UUN, which seem to have been added way
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
30686
diff
changeset
|
1944 |
15373
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1945 /************************************************************************** |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1946 * Message Types |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1947 **************************************************************************/ |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1948 |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1949 static void |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1950 profile_msg(MsnCmdProc *cmdproc, MsnMessage *msg) |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1951 { |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1952 MsnSession *session; |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1953 const char *value; |
30430
351d07aefb09
Kill off many dead assignments and any useless remaining variables.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
30424
diff
changeset
|
1954 #ifdef MSN_PARTIAL_LISTS |
20394
4a099e4d0d09
propagate from branch 'im.pidgin.pidgin' (head 98b6b547b29ea1192b73cc4e1de1e674edef4328)
Richard Laager <rlaager@wiktel.com>
parents:
16063
diff
changeset
|
1955 const char *clLastChange; |
30430
351d07aefb09
Kill off many dead assignments and any useless remaining variables.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
30424
diff
changeset
|
1956 #endif |
15373
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1957 |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1958 session = cmdproc->session; |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1959 |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1960 if (strcmp(msg->remote_user, "Hotmail")) |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1961 /* This isn't an official message. */ |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1962 return; |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1963 |
30694
33b4ae796648
Rename "attribute" to "header" in a bunch of places. The SLP protocol
Mark Doliner <mark@kingant.net>
parents:
30692
diff
changeset
|
1964 if ((value = msn_message_get_header_value(msg, "sid")) != NULL) |
15373
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1965 { |
16844
2afea2b41cab
Remove a bunch of unnecessary NULL checking for g_free()
Daniel Atallah <daniel.atallah@gmail.com>
parents:
16843
diff
changeset
|
1966 g_free(session->passport_info.sid); |
15373
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1967 session->passport_info.sid = g_strdup(value); |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1968 } |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1969 |
30694
33b4ae796648
Rename "attribute" to "header" in a bunch of places. The SLP protocol
Mark Doliner <mark@kingant.net>
parents:
30692
diff
changeset
|
1970 if ((value = msn_message_get_header_value(msg, "MSPAuth")) != NULL) |
15373
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1971 { |
16844
2afea2b41cab
Remove a bunch of unnecessary NULL checking for g_free()
Daniel Atallah <daniel.atallah@gmail.com>
parents:
16843
diff
changeset
|
1972 g_free(session->passport_info.mspauth); |
15373
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1973 session->passport_info.mspauth = g_strdup(value); |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1974 } |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1975 |
30694
33b4ae796648
Rename "attribute" to "header" in a bunch of places. The SLP protocol
Mark Doliner <mark@kingant.net>
parents:
30692
diff
changeset
|
1976 if ((value = msn_message_get_header_value(msg, "ClientIP")) != NULL) |
15373
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1977 { |
16844
2afea2b41cab
Remove a bunch of unnecessary NULL checking for g_free()
Daniel Atallah <daniel.atallah@gmail.com>
parents:
16843
diff
changeset
|
1978 g_free(session->passport_info.client_ip); |
15373
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1979 session->passport_info.client_ip = g_strdup(value); |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1980 } |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1981 |
30694
33b4ae796648
Rename "attribute" to "header" in a bunch of places. The SLP protocol
Mark Doliner <mark@kingant.net>
parents:
30692
diff
changeset
|
1982 if ((value = msn_message_get_header_value(msg, "ClientPort")) != NULL) |
20399
6f986caeab59
merge of 'b4911943cba6f29cf0694dfd563cac17612236dc'
Richard Laager <rlaager@wiktel.com>
diff
changeset
|
1983 { |
15373
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1984 session->passport_info.client_port = ntohs(atoi(value)); |
19843
60bc06498746
Committing khc's msnp14 changes from Trac Ticket #148. --rlaager
Ka-Hing Cheung <khc@hxbc.us>
parents:
16063
diff
changeset
|
1985 } |
15373
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1986 |
30694
33b4ae796648
Rename "attribute" to "header" in a bunch of places. The SLP protocol
Mark Doliner <mark@kingant.net>
parents:
30692
diff
changeset
|
1987 if ((value = msn_message_get_header_value(msg, "LoginTime")) != NULL) |
15373
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1988 session->passport_info.sl = atol(value); |
20394
4a099e4d0d09
propagate from branch 'im.pidgin.pidgin' (head 98b6b547b29ea1192b73cc4e1de1e674edef4328)
Richard Laager <rlaager@wiktel.com>
parents:
16063
diff
changeset
|
1989 |
30694
33b4ae796648
Rename "attribute" to "header" in a bunch of places. The SLP protocol
Mark Doliner <mark@kingant.net>
parents:
30692
diff
changeset
|
1990 if ((value = msn_message_get_header_value(msg, "EmailEnabled")) != NULL) |
23611
b2609fca4943
Use "EmailEnabled" from the MSN profile message to determine whether
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
23570
diff
changeset
|
1991 session->passport_info.email_enabled = (gboolean)atol(value); |
b2609fca4943
Use "EmailEnabled" from the MSN profile message to determine whether
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
23570
diff
changeset
|
1992 |
30430
351d07aefb09
Kill off many dead assignments and any useless remaining variables.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
30424
diff
changeset
|
1993 #ifdef MSN_PARTIAL_LISTS |
20394
4a099e4d0d09
propagate from branch 'im.pidgin.pidgin' (head 98b6b547b29ea1192b73cc4e1de1e674edef4328)
Richard Laager <rlaager@wiktel.com>
parents:
16063
diff
changeset
|
1994 /*starting retrieve the contact list*/ |
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
|
1995 clLastChange = purple_account_get_string(session->account, "CLLastChange", NULL); |
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
|
1996 /* msn_userlist_load defeats all attempts at trying to detect blist sync issues */ |
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
|
1997 msn_userlist_load(session); |
23459
69af5301e1a7
killing MsnContact which just wraps MsnSession
Ka-Hing Cheung <khc@hxbc.us>
parents:
23458
diff
changeset
|
1998 msn_get_contact_list(session, MSN_PS_INITIAL, clLastChange); |
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
|
1999 #else |
20439
bee467c81570
A bunch of MSNP14 stuff:
Stu Tomlinson <stu@nosnilmot.com>
parents:
20432
diff
changeset
|
2000 /* always get the full list? */ |
23459
69af5301e1a7
killing MsnContact which just wraps MsnSession
Ka-Hing Cheung <khc@hxbc.us>
parents:
23458
diff
changeset
|
2001 msn_get_contact_list(session, MSN_PS_INITIAL, NULL); |
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
|
2002 #endif |
15373
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2003 } |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2004 |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2005 static void |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2006 initial_email_msg(MsnCmdProc *cmdproc, MsnMessage *msg) |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2007 { |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2008 MsnSession *session; |
15822 | 2009 PurpleConnection *gc; |
15373
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2010 GHashTable *table; |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2011 const char *unread; |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2012 |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2013 session = cmdproc->session; |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2014 gc = session->account->gc; |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2015 |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2016 if (strcmp(msg->remote_user, "Hotmail")) |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2017 /* This isn't an official message. */ |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2018 return; |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2019 |
23612
7f4b697c6947
Use a URL to open MSN Hotmail inbox instead of a temporary file.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
23611
diff
changeset
|
2020 if (session->passport_info.mail_url == NULL) |
15373
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2021 { |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2022 MsnTransaction *trans; |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2023 trans = msn_transaction_new(cmdproc, "URL", "%s", "INBOX"); |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2024 msn_transaction_queue_cmd(trans, msg->cmd); |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2025 |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2026 msn_cmdproc_send_trans(cmdproc, trans); |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2027 |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2028 return; |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2029 } |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2030 |
15822 | 2031 if (!purple_account_get_check_mail(session->account)) |
15373
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2032 return; |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2033 |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2034 table = msn_message_get_hashtable_from_body(msg); |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2035 |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2036 unread = g_hash_table_lookup(table, "Inbox-Unread"); |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2037 |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2038 if (unread != NULL) |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2039 { |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2040 int count = atoi(unread); |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2041 |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2042 if (count > 0) |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2043 { |
25606
2260e5b0ca91
*** Plucked rev f9080d0b (khc@pidgin.im):
Paul Aurich <paul@darkrain42.org>
parents:
25603
diff
changeset
|
2044 const char *passports[2] = { msn_user_get_passport(session->user) }; |
2260e5b0ca91
*** Plucked rev f9080d0b (khc@pidgin.im):
Paul Aurich <paul@darkrain42.org>
parents:
25603
diff
changeset
|
2045 const char *urls[2] = { session->passport_info.mail_url }; |
15373
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2046 |
21767
7ac87187bbec
Don't show a 'you ain't got no new mail' notification.
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
21672
diff
changeset
|
2047 purple_notify_emails(gc, count, FALSE, NULL, NULL, |
25606
2260e5b0ca91
*** Plucked rev f9080d0b (khc@pidgin.im):
Paul Aurich <paul@darkrain42.org>
parents:
25603
diff
changeset
|
2048 passports, urls, NULL, NULL); |
15373
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2049 } |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2050 } |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2051 |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2052 g_hash_table_destroy(table); |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2053 } |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2054 |
20394
4a099e4d0d09
propagate from branch 'im.pidgin.pidgin' (head 98b6b547b29ea1192b73cc4e1de1e674edef4328)
Richard Laager <rlaager@wiktel.com>
parents:
16063
diff
changeset
|
2055 /*offline Message notification process*/ |
4a099e4d0d09
propagate from branch 'im.pidgin.pidgin' (head 98b6b547b29ea1192b73cc4e1de1e674edef4328)
Richard Laager <rlaager@wiktel.com>
parents:
16063
diff
changeset
|
2056 static void |
4a099e4d0d09
propagate from branch 'im.pidgin.pidgin' (head 98b6b547b29ea1192b73cc4e1de1e674edef4328)
Richard Laager <rlaager@wiktel.com>
parents:
16063
diff
changeset
|
2057 initial_mdata_msg(MsnCmdProc *cmdproc, MsnMessage *msg) |
4a099e4d0d09
propagate from branch 'im.pidgin.pidgin' (head 98b6b547b29ea1192b73cc4e1de1e674edef4328)
Richard Laager <rlaager@wiktel.com>
parents:
16063
diff
changeset
|
2058 { |
4a099e4d0d09
propagate from branch 'im.pidgin.pidgin' (head 98b6b547b29ea1192b73cc4e1de1e674edef4328)
Richard Laager <rlaager@wiktel.com>
parents:
16063
diff
changeset
|
2059 MsnSession *session; |
20439
bee467c81570
A bunch of MSNP14 stuff:
Stu Tomlinson <stu@nosnilmot.com>
parents:
20432
diff
changeset
|
2060 PurpleConnection *gc; |
bee467c81570
A bunch of MSNP14 stuff:
Stu Tomlinson <stu@nosnilmot.com>
parents:
20432
diff
changeset
|
2061 GHashTable *table; |
bee467c81570
A bunch of MSNP14 stuff:
Stu Tomlinson <stu@nosnilmot.com>
parents:
20432
diff
changeset
|
2062 const char *mdata, *unread; |
20394
4a099e4d0d09
propagate from branch 'im.pidgin.pidgin' (head 98b6b547b29ea1192b73cc4e1de1e674edef4328)
Richard Laager <rlaager@wiktel.com>
parents:
16063
diff
changeset
|
2063 |
20439
bee467c81570
A bunch of MSNP14 stuff:
Stu Tomlinson <stu@nosnilmot.com>
parents:
20432
diff
changeset
|
2064 session = cmdproc->session; |
bee467c81570
A bunch of MSNP14 stuff:
Stu Tomlinson <stu@nosnilmot.com>
parents:
20432
diff
changeset
|
2065 gc = session->account->gc; |
bee467c81570
A bunch of MSNP14 stuff:
Stu Tomlinson <stu@nosnilmot.com>
parents:
20432
diff
changeset
|
2066 |
bee467c81570
A bunch of MSNP14 stuff:
Stu Tomlinson <stu@nosnilmot.com>
parents:
20432
diff
changeset
|
2067 if (strcmp(msg->remote_user, "Hotmail")) |
bee467c81570
A bunch of MSNP14 stuff:
Stu Tomlinson <stu@nosnilmot.com>
parents:
20432
diff
changeset
|
2068 /* This isn't an official message. */ |
bee467c81570
A bunch of MSNP14 stuff:
Stu Tomlinson <stu@nosnilmot.com>
parents:
20432
diff
changeset
|
2069 return; |
20394
4a099e4d0d09
propagate from branch 'im.pidgin.pidgin' (head 98b6b547b29ea1192b73cc4e1de1e674edef4328)
Richard Laager <rlaager@wiktel.com>
parents:
16063
diff
changeset
|
2070 |
20439
bee467c81570
A bunch of MSNP14 stuff:
Stu Tomlinson <stu@nosnilmot.com>
parents:
20432
diff
changeset
|
2071 table = msn_message_get_hashtable_from_body(msg); |
20394
4a099e4d0d09
propagate from branch 'im.pidgin.pidgin' (head 98b6b547b29ea1192b73cc4e1de1e674edef4328)
Richard Laager <rlaager@wiktel.com>
parents:
16063
diff
changeset
|
2072 |
20439
bee467c81570
A bunch of MSNP14 stuff:
Stu Tomlinson <stu@nosnilmot.com>
parents:
20432
diff
changeset
|
2073 mdata = g_hash_table_lookup(table, "Mail-Data"); |
bee467c81570
A bunch of MSNP14 stuff:
Stu Tomlinson <stu@nosnilmot.com>
parents:
20432
diff
changeset
|
2074 |
bee467c81570
A bunch of MSNP14 stuff:
Stu Tomlinson <stu@nosnilmot.com>
parents:
20432
diff
changeset
|
2075 if (mdata != NULL) |
bee467c81570
A bunch of MSNP14 stuff:
Stu Tomlinson <stu@nosnilmot.com>
parents:
20432
diff
changeset
|
2076 msn_parse_oim_msg(session->oim, mdata); |
20394
4a099e4d0d09
propagate from branch 'im.pidgin.pidgin' (head 98b6b547b29ea1192b73cc4e1de1e674edef4328)
Richard Laager <rlaager@wiktel.com>
parents:
16063
diff
changeset
|
2077 |
20439
bee467c81570
A bunch of MSNP14 stuff:
Stu Tomlinson <stu@nosnilmot.com>
parents:
20432
diff
changeset
|
2078 if (g_hash_table_lookup(table, "Inbox-URL") == NULL) |
bee467c81570
A bunch of MSNP14 stuff:
Stu Tomlinson <stu@nosnilmot.com>
parents:
20432
diff
changeset
|
2079 { |
bee467c81570
A bunch of MSNP14 stuff:
Stu Tomlinson <stu@nosnilmot.com>
parents:
20432
diff
changeset
|
2080 g_hash_table_destroy(table); |
bee467c81570
A bunch of MSNP14 stuff:
Stu Tomlinson <stu@nosnilmot.com>
parents:
20432
diff
changeset
|
2081 return; |
bee467c81570
A bunch of MSNP14 stuff:
Stu Tomlinson <stu@nosnilmot.com>
parents:
20432
diff
changeset
|
2082 } |
20394
4a099e4d0d09
propagate from branch 'im.pidgin.pidgin' (head 98b6b547b29ea1192b73cc4e1de1e674edef4328)
Richard Laager <rlaager@wiktel.com>
parents:
16063
diff
changeset
|
2083 |
23612
7f4b697c6947
Use a URL to open MSN Hotmail inbox instead of a temporary file.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
23611
diff
changeset
|
2084 if (session->passport_info.mail_url == NULL) |
20439
bee467c81570
A bunch of MSNP14 stuff:
Stu Tomlinson <stu@nosnilmot.com>
parents:
20432
diff
changeset
|
2085 { |
bee467c81570
A bunch of MSNP14 stuff:
Stu Tomlinson <stu@nosnilmot.com>
parents:
20432
diff
changeset
|
2086 MsnTransaction *trans; |
bee467c81570
A bunch of MSNP14 stuff:
Stu Tomlinson <stu@nosnilmot.com>
parents:
20432
diff
changeset
|
2087 trans = msn_transaction_new(cmdproc, "URL", "%s", "INBOX"); |
bee467c81570
A bunch of MSNP14 stuff:
Stu Tomlinson <stu@nosnilmot.com>
parents:
20432
diff
changeset
|
2088 msn_transaction_queue_cmd(trans, msg->cmd); |
20394
4a099e4d0d09
propagate from branch 'im.pidgin.pidgin' (head 98b6b547b29ea1192b73cc4e1de1e674edef4328)
Richard Laager <rlaager@wiktel.com>
parents:
16063
diff
changeset
|
2089 |
20439
bee467c81570
A bunch of MSNP14 stuff:
Stu Tomlinson <stu@nosnilmot.com>
parents:
20432
diff
changeset
|
2090 msn_cmdproc_send_trans(cmdproc, trans); |
bee467c81570
A bunch of MSNP14 stuff:
Stu Tomlinson <stu@nosnilmot.com>
parents:
20432
diff
changeset
|
2091 |
bee467c81570
A bunch of MSNP14 stuff:
Stu Tomlinson <stu@nosnilmot.com>
parents:
20432
diff
changeset
|
2092 g_hash_table_destroy(table); |
bee467c81570
A bunch of MSNP14 stuff:
Stu Tomlinson <stu@nosnilmot.com>
parents:
20432
diff
changeset
|
2093 return; |
20394
4a099e4d0d09
propagate from branch 'im.pidgin.pidgin' (head 98b6b547b29ea1192b73cc4e1de1e674edef4328)
Richard Laager <rlaager@wiktel.com>
parents:
16063
diff
changeset
|
2094 } |
4a099e4d0d09
propagate from branch 'im.pidgin.pidgin' (head 98b6b547b29ea1192b73cc4e1de1e674edef4328)
Richard Laager <rlaager@wiktel.com>
parents:
16063
diff
changeset
|
2095 |
20439
bee467c81570
A bunch of MSNP14 stuff:
Stu Tomlinson <stu@nosnilmot.com>
parents:
20432
diff
changeset
|
2096 if (!purple_account_get_check_mail(session->account)) |
bee467c81570
A bunch of MSNP14 stuff:
Stu Tomlinson <stu@nosnilmot.com>
parents:
20432
diff
changeset
|
2097 { |
bee467c81570
A bunch of MSNP14 stuff:
Stu Tomlinson <stu@nosnilmot.com>
parents:
20432
diff
changeset
|
2098 g_hash_table_destroy(table); |
bee467c81570
A bunch of MSNP14 stuff:
Stu Tomlinson <stu@nosnilmot.com>
parents:
20432
diff
changeset
|
2099 return; |
bee467c81570
A bunch of MSNP14 stuff:
Stu Tomlinson <stu@nosnilmot.com>
parents:
20432
diff
changeset
|
2100 } |
bee467c81570
A bunch of MSNP14 stuff:
Stu Tomlinson <stu@nosnilmot.com>
parents:
20432
diff
changeset
|
2101 |
bee467c81570
A bunch of MSNP14 stuff:
Stu Tomlinson <stu@nosnilmot.com>
parents:
20432
diff
changeset
|
2102 unread = g_hash_table_lookup(table, "Inbox-Unread"); |
bee467c81570
A bunch of MSNP14 stuff:
Stu Tomlinson <stu@nosnilmot.com>
parents:
20432
diff
changeset
|
2103 |
bee467c81570
A bunch of MSNP14 stuff:
Stu Tomlinson <stu@nosnilmot.com>
parents:
20432
diff
changeset
|
2104 if (unread != NULL) |
bee467c81570
A bunch of MSNP14 stuff:
Stu Tomlinson <stu@nosnilmot.com>
parents:
20432
diff
changeset
|
2105 { |
bee467c81570
A bunch of MSNP14 stuff:
Stu Tomlinson <stu@nosnilmot.com>
parents:
20432
diff
changeset
|
2106 int count = atoi(unread); |
bee467c81570
A bunch of MSNP14 stuff:
Stu Tomlinson <stu@nosnilmot.com>
parents:
20432
diff
changeset
|
2107 |
bee467c81570
A bunch of MSNP14 stuff:
Stu Tomlinson <stu@nosnilmot.com>
parents:
20432
diff
changeset
|
2108 if (count > 0) |
bee467c81570
A bunch of MSNP14 stuff:
Stu Tomlinson <stu@nosnilmot.com>
parents:
20432
diff
changeset
|
2109 { |
25606
2260e5b0ca91
*** Plucked rev f9080d0b (khc@pidgin.im):
Paul Aurich <paul@darkrain42.org>
parents:
25603
diff
changeset
|
2110 const char *passports[2] = { msn_user_get_passport(session->user) }; |
2260e5b0ca91
*** Plucked rev f9080d0b (khc@pidgin.im):
Paul Aurich <paul@darkrain42.org>
parents:
25603
diff
changeset
|
2111 const char *urls[2] = { session->passport_info.mail_url }; |
20439
bee467c81570
A bunch of MSNP14 stuff:
Stu Tomlinson <stu@nosnilmot.com>
parents:
20432
diff
changeset
|
2112 |
21767
7ac87187bbec
Don't show a 'you ain't got no new mail' notification.
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
21672
diff
changeset
|
2113 purple_notify_emails(gc, count, FALSE, NULL, NULL, |
25606
2260e5b0ca91
*** Plucked rev f9080d0b (khc@pidgin.im):
Paul Aurich <paul@darkrain42.org>
parents:
25603
diff
changeset
|
2114 passports, urls, NULL, NULL); |
20439
bee467c81570
A bunch of MSNP14 stuff:
Stu Tomlinson <stu@nosnilmot.com>
parents:
20432
diff
changeset
|
2115 } |
bee467c81570
A bunch of MSNP14 stuff:
Stu Tomlinson <stu@nosnilmot.com>
parents:
20432
diff
changeset
|
2116 } |
bee467c81570
A bunch of MSNP14 stuff:
Stu Tomlinson <stu@nosnilmot.com>
parents:
20432
diff
changeset
|
2117 |
bee467c81570
A bunch of MSNP14 stuff:
Stu Tomlinson <stu@nosnilmot.com>
parents:
20432
diff
changeset
|
2118 g_hash_table_destroy(table); |
20394
4a099e4d0d09
propagate from branch 'im.pidgin.pidgin' (head 98b6b547b29ea1192b73cc4e1de1e674edef4328)
Richard Laager <rlaager@wiktel.com>
parents:
16063
diff
changeset
|
2119 } |
4a099e4d0d09
propagate from branch 'im.pidgin.pidgin' (head 98b6b547b29ea1192b73cc4e1de1e674edef4328)
Richard Laager <rlaager@wiktel.com>
parents:
16063
diff
changeset
|
2120 |
4a099e4d0d09
propagate from branch 'im.pidgin.pidgin' (head 98b6b547b29ea1192b73cc4e1de1e674edef4328)
Richard Laager <rlaager@wiktel.com>
parents:
16063
diff
changeset
|
2121 /*offline Message Notification*/ |
4a099e4d0d09
propagate from branch 'im.pidgin.pidgin' (head 98b6b547b29ea1192b73cc4e1de1e674edef4328)
Richard Laager <rlaager@wiktel.com>
parents:
16063
diff
changeset
|
2122 static void |
4a099e4d0d09
propagate from branch 'im.pidgin.pidgin' (head 98b6b547b29ea1192b73cc4e1de1e674edef4328)
Richard Laager <rlaager@wiktel.com>
parents:
16063
diff
changeset
|
2123 delete_oim_msg(MsnCmdProc *cmdproc, MsnMessage *msg) |
4a099e4d0d09
propagate from branch 'im.pidgin.pidgin' (head 98b6b547b29ea1192b73cc4e1de1e674edef4328)
Richard Laager <rlaager@wiktel.com>
parents:
16063
diff
changeset
|
2124 { |
23519
7bceac816e19
The great MSN debug message cleanup! Threw in a few whitespace fixes,
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
23517
diff
changeset
|
2125 purple_debug_misc("msn", "Delete OIM message.\n"); |
20394
4a099e4d0d09
propagate from branch 'im.pidgin.pidgin' (head 98b6b547b29ea1192b73cc4e1de1e674edef4328)
Richard Laager <rlaager@wiktel.com>
parents:
16063
diff
changeset
|
2126 } |
4a099e4d0d09
propagate from branch 'im.pidgin.pidgin' (head 98b6b547b29ea1192b73cc4e1de1e674edef4328)
Richard Laager <rlaager@wiktel.com>
parents:
16063
diff
changeset
|
2127 |
15373
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2128 static void |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2129 email_msg(MsnCmdProc *cmdproc, MsnMessage *msg) |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2130 { |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2131 MsnSession *session; |
15822 | 2132 PurpleConnection *gc; |
15373
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2133 GHashTable *table; |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2134 char *from, *subject, *tmp; |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2135 |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2136 session = cmdproc->session; |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2137 gc = session->account->gc; |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2138 |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2139 if (strcmp(msg->remote_user, "Hotmail")) |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2140 /* This isn't an official message. */ |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2141 return; |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2142 |
23612
7f4b697c6947
Use a URL to open MSN Hotmail inbox instead of a temporary file.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
23611
diff
changeset
|
2143 if (session->passport_info.mail_url == NULL) |
15373
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2144 { |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2145 MsnTransaction *trans; |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2146 trans = msn_transaction_new(cmdproc, "URL", "%s", "INBOX"); |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2147 msn_transaction_queue_cmd(trans, msg->cmd); |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2148 |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2149 msn_cmdproc_send_trans(cmdproc, trans); |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2150 |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2151 return; |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2152 } |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2153 |
15822 | 2154 if (!purple_account_get_check_mail(session->account)) |
15373
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2155 return; |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2156 |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2157 table = msn_message_get_hashtable_from_body(msg); |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2158 |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2159 from = subject = NULL; |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2160 |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2161 tmp = g_hash_table_lookup(table, "From"); |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2162 if (tmp != NULL) |
15822 | 2163 from = purple_mime_decode_field(tmp); |
15373
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2164 |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2165 tmp = g_hash_table_lookup(table, "Subject"); |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2166 if (tmp != NULL) |
15822 | 2167 subject = purple_mime_decode_field(tmp); |
15373
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2168 |
15822 | 2169 purple_notify_email(gc, |
15373
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2170 (subject != NULL ? subject : ""), |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2171 (from != NULL ? from : ""), |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2172 msn_user_get_passport(session->user), |
23612
7f4b697c6947
Use a URL to open MSN Hotmail inbox instead of a temporary file.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
23611
diff
changeset
|
2173 session->passport_info.mail_url, NULL, NULL); |
15373
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2174 |
16844
2afea2b41cab
Remove a bunch of unnecessary NULL checking for g_free()
Daniel Atallah <daniel.atallah@gmail.com>
parents:
16843
diff
changeset
|
2175 g_free(from); |
2afea2b41cab
Remove a bunch of unnecessary NULL checking for g_free()
Daniel Atallah <daniel.atallah@gmail.com>
parents:
16843
diff
changeset
|
2176 g_free(subject); |
15373
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2177 |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2178 g_hash_table_destroy(table); |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2179 } |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2180 |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2181 static void |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2182 system_msg(MsnCmdProc *cmdproc, MsnMessage *msg) |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2183 { |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2184 GHashTable *table; |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2185 const char *type_s; |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2186 |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2187 if (strcmp(msg->remote_user, "Hotmail")) |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2188 /* This isn't an official message. */ |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2189 return; |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2190 |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2191 table = msn_message_get_hashtable_from_body(msg); |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2192 |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2193 if ((type_s = g_hash_table_lookup(table, "Type")) != NULL) |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2194 { |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2195 int type = atoi(type_s); |
30424
cb16239deeec
Fix possible garbage value.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
30267
diff
changeset
|
2196 char buf[MSN_BUF_LEN] = ""; |
15373
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2197 int minutes; |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2198 |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2199 switch (type) |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2200 { |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2201 case 1: |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2202 minutes = atoi(g_hash_table_lookup(table, "Arg1")); |
23298
5cdd93dac7a2
Delete trailing whitespace
Mark Doliner <mark@kingant.net>
parents:
22922
diff
changeset
|
2203 g_snprintf(buf, sizeof(buf), dngettext(PACKAGE, |
15373
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2204 "The MSN server will shut down for maintenance " |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2205 "in %d minute. You will automatically be " |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2206 "signed out at that time. Please finish any " |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2207 "conversations in progress.\n\nAfter the " |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2208 "maintenance has been completed, you will be " |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2209 "able to successfully sign in.", |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2210 "The MSN server will shut down for maintenance " |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2211 "in %d minutes. You will automatically be " |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2212 "signed out at that time. Please finish any " |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2213 "conversations in progress.\n\nAfter the " |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2214 "maintenance has been completed, you will be " |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2215 "able to successfully sign in.", minutes), |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2216 minutes); |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2217 default: |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2218 break; |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2219 } |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2220 |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2221 if (*buf != '\0') |
15822 | 2222 purple_notify_info(cmdproc->session->account->gc, NULL, buf, NULL); |
15373
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2223 } |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2224 |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2225 g_hash_table_destroy(table); |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2226 } |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2227 |
25633
c384d62009c0
*** Plucked rev b932d4f94f9c771877b6a8a6a1d7dd3ea9c08005 (qulogic@pidgin.im):
Ka-Hing Cheung <khc@hxbc.us>
parents:
25606
diff
changeset
|
2228 /************************************************************************** |
31086
a8cc50c2279f
Remove trailing whitespace
Richard Laager <rlaager@wiktel.com>
parents:
31038
diff
changeset
|
2229 * Dispatch server list management |
25633
c384d62009c0
*** Plucked rev b932d4f94f9c771877b6a8a6a1d7dd3ea9c08005 (qulogic@pidgin.im):
Ka-Hing Cheung <khc@hxbc.us>
parents:
25606
diff
changeset
|
2230 **************************************************************************/ |
c384d62009c0
*** Plucked rev b932d4f94f9c771877b6a8a6a1d7dd3ea9c08005 (qulogic@pidgin.im):
Ka-Hing Cheung <khc@hxbc.us>
parents:
25606
diff
changeset
|
2231 typedef struct MsnAddRemoveListData { |
c384d62009c0
*** Plucked rev b932d4f94f9c771877b6a8a6a1d7dd3ea9c08005 (qulogic@pidgin.im):
Ka-Hing Cheung <khc@hxbc.us>
parents:
25606
diff
changeset
|
2232 MsnCmdProc *cmdproc; |
c384d62009c0
*** Plucked rev b932d4f94f9c771877b6a8a6a1d7dd3ea9c08005 (qulogic@pidgin.im):
Ka-Hing Cheung <khc@hxbc.us>
parents:
25606
diff
changeset
|
2233 MsnUser *user; |
c384d62009c0
*** Plucked rev b932d4f94f9c771877b6a8a6a1d7dd3ea9c08005 (qulogic@pidgin.im):
Ka-Hing Cheung <khc@hxbc.us>
parents:
25606
diff
changeset
|
2234 MsnListOp list_op; |
c384d62009c0
*** Plucked rev b932d4f94f9c771877b6a8a6a1d7dd3ea9c08005 (qulogic@pidgin.im):
Ka-Hing Cheung <khc@hxbc.us>
parents:
25606
diff
changeset
|
2235 gboolean add; |
c384d62009c0
*** Plucked rev b932d4f94f9c771877b6a8a6a1d7dd3ea9c08005 (qulogic@pidgin.im):
Ka-Hing Cheung <khc@hxbc.us>
parents:
25606
diff
changeset
|
2236 } MsnAddRemoveListData; |
c384d62009c0
*** Plucked rev b932d4f94f9c771877b6a8a6a1d7dd3ea9c08005 (qulogic@pidgin.im):
Ka-Hing Cheung <khc@hxbc.us>
parents:
25606
diff
changeset
|
2237 |
c384d62009c0
*** Plucked rev b932d4f94f9c771877b6a8a6a1d7dd3ea9c08005 (qulogic@pidgin.im):
Ka-Hing Cheung <khc@hxbc.us>
parents:
25606
diff
changeset
|
2238 static void |
c384d62009c0
*** Plucked rev b932d4f94f9c771877b6a8a6a1d7dd3ea9c08005 (qulogic@pidgin.im):
Ka-Hing Cheung <khc@hxbc.us>
parents:
25606
diff
changeset
|
2239 modify_unknown_buddy_on_list(MsnSession *session, const char *passport, |
c384d62009c0
*** Plucked rev b932d4f94f9c771877b6a8a6a1d7dd3ea9c08005 (qulogic@pidgin.im):
Ka-Hing Cheung <khc@hxbc.us>
parents:
25606
diff
changeset
|
2240 MsnNetwork network, gpointer data) |
c384d62009c0
*** Plucked rev b932d4f94f9c771877b6a8a6a1d7dd3ea9c08005 (qulogic@pidgin.im):
Ka-Hing Cheung <khc@hxbc.us>
parents:
25606
diff
changeset
|
2241 { |
c384d62009c0
*** Plucked rev b932d4f94f9c771877b6a8a6a1d7dd3ea9c08005 (qulogic@pidgin.im):
Ka-Hing Cheung <khc@hxbc.us>
parents:
25606
diff
changeset
|
2242 MsnAddRemoveListData *addrem = data; |
c384d62009c0
*** Plucked rev b932d4f94f9c771877b6a8a6a1d7dd3ea9c08005 (qulogic@pidgin.im):
Ka-Hing Cheung <khc@hxbc.us>
parents:
25606
diff
changeset
|
2243 MsnCmdProc *cmdproc; |
c384d62009c0
*** Plucked rev b932d4f94f9c771877b6a8a6a1d7dd3ea9c08005 (qulogic@pidgin.im):
Ka-Hing Cheung <khc@hxbc.us>
parents:
25606
diff
changeset
|
2244 xmlnode *node; |
c384d62009c0
*** Plucked rev b932d4f94f9c771877b6a8a6a1d7dd3ea9c08005 (qulogic@pidgin.im):
Ka-Hing Cheung <khc@hxbc.us>
parents:
25606
diff
changeset
|
2245 char *payload; |
c384d62009c0
*** Plucked rev b932d4f94f9c771877b6a8a6a1d7dd3ea9c08005 (qulogic@pidgin.im):
Ka-Hing Cheung <khc@hxbc.us>
parents:
25606
diff
changeset
|
2246 int payload_len; |
c384d62009c0
*** Plucked rev b932d4f94f9c771877b6a8a6a1d7dd3ea9c08005 (qulogic@pidgin.im):
Ka-Hing Cheung <khc@hxbc.us>
parents:
25606
diff
changeset
|
2247 |
c384d62009c0
*** Plucked rev b932d4f94f9c771877b6a8a6a1d7dd3ea9c08005 (qulogic@pidgin.im):
Ka-Hing Cheung <khc@hxbc.us>
parents:
25606
diff
changeset
|
2248 cmdproc = addrem->cmdproc; |
c384d62009c0
*** Plucked rev b932d4f94f9c771877b6a8a6a1d7dd3ea9c08005 (qulogic@pidgin.im):
Ka-Hing Cheung <khc@hxbc.us>
parents:
25606
diff
changeset
|
2249 |
c384d62009c0
*** Plucked rev b932d4f94f9c771877b6a8a6a1d7dd3ea9c08005 (qulogic@pidgin.im):
Ka-Hing Cheung <khc@hxbc.us>
parents:
25606
diff
changeset
|
2250 /* Update user first */ |
c384d62009c0
*** Plucked rev b932d4f94f9c771877b6a8a6a1d7dd3ea9c08005 (qulogic@pidgin.im):
Ka-Hing Cheung <khc@hxbc.us>
parents:
25606
diff
changeset
|
2251 msn_user_set_network(addrem->user, network); |
c384d62009c0
*** Plucked rev b932d4f94f9c771877b6a8a6a1d7dd3ea9c08005 (qulogic@pidgin.im):
Ka-Hing Cheung <khc@hxbc.us>
parents:
25606
diff
changeset
|
2252 |
c384d62009c0
*** Plucked rev b932d4f94f9c771877b6a8a6a1d7dd3ea9c08005 (qulogic@pidgin.im):
Ka-Hing Cheung <khc@hxbc.us>
parents:
25606
diff
changeset
|
2253 node = xmlnode_new("ml"); |
c384d62009c0
*** Plucked rev b932d4f94f9c771877b6a8a6a1d7dd3ea9c08005 (qulogic@pidgin.im):
Ka-Hing Cheung <khc@hxbc.us>
parents:
25606
diff
changeset
|
2254 node->child = NULL; |
c384d62009c0
*** Plucked rev b932d4f94f9c771877b6a8a6a1d7dd3ea9c08005 (qulogic@pidgin.im):
Ka-Hing Cheung <khc@hxbc.us>
parents:
25606
diff
changeset
|
2255 |
30266
3ff6c193efee
The session parameter appears unused in msn_add_contact_xml.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
30151
diff
changeset
|
2256 msn_add_contact_xml(node, passport, addrem->list_op, network); |
25633
c384d62009c0
*** Plucked rev b932d4f94f9c771877b6a8a6a1d7dd3ea9c08005 (qulogic@pidgin.im):
Ka-Hing Cheung <khc@hxbc.us>
parents:
25606
diff
changeset
|
2257 |
c384d62009c0
*** Plucked rev b932d4f94f9c771877b6a8a6a1d7dd3ea9c08005 (qulogic@pidgin.im):
Ka-Hing Cheung <khc@hxbc.us>
parents:
25606
diff
changeset
|
2258 payload = xmlnode_to_str(node, &payload_len); |
c384d62009c0
*** Plucked rev b932d4f94f9c771877b6a8a6a1d7dd3ea9c08005 (qulogic@pidgin.im):
Ka-Hing Cheung <khc@hxbc.us>
parents:
25606
diff
changeset
|
2259 xmlnode_free(node); |
c384d62009c0
*** Plucked rev b932d4f94f9c771877b6a8a6a1d7dd3ea9c08005 (qulogic@pidgin.im):
Ka-Hing Cheung <khc@hxbc.us>
parents:
25606
diff
changeset
|
2260 |
c384d62009c0
*** Plucked rev b932d4f94f9c771877b6a8a6a1d7dd3ea9c08005 (qulogic@pidgin.im):
Ka-Hing Cheung <khc@hxbc.us>
parents:
25606
diff
changeset
|
2261 if (addrem->add) |
c384d62009c0
*** Plucked rev b932d4f94f9c771877b6a8a6a1d7dd3ea9c08005 (qulogic@pidgin.im):
Ka-Hing Cheung <khc@hxbc.us>
parents:
25606
diff
changeset
|
2262 msn_notification_post_adl(cmdproc, payload, payload_len); |
c384d62009c0
*** Plucked rev b932d4f94f9c771877b6a8a6a1d7dd3ea9c08005 (qulogic@pidgin.im):
Ka-Hing Cheung <khc@hxbc.us>
parents:
25606
diff
changeset
|
2263 else |
c384d62009c0
*** Plucked rev b932d4f94f9c771877b6a8a6a1d7dd3ea9c08005 (qulogic@pidgin.im):
Ka-Hing Cheung <khc@hxbc.us>
parents:
25606
diff
changeset
|
2264 msn_notification_post_rml(cmdproc, payload, payload_len); |
c384d62009c0
*** Plucked rev b932d4f94f9c771877b6a8a6a1d7dd3ea9c08005 (qulogic@pidgin.im):
Ka-Hing Cheung <khc@hxbc.us>
parents:
25606
diff
changeset
|
2265 |
c384d62009c0
*** Plucked rev b932d4f94f9c771877b6a8a6a1d7dd3ea9c08005 (qulogic@pidgin.im):
Ka-Hing Cheung <khc@hxbc.us>
parents:
25606
diff
changeset
|
2266 g_free(payload); |
c384d62009c0
*** Plucked rev b932d4f94f9c771877b6a8a6a1d7dd3ea9c08005 (qulogic@pidgin.im):
Ka-Hing Cheung <khc@hxbc.us>
parents:
25606
diff
changeset
|
2267 g_free(addrem); |
c384d62009c0
*** Plucked rev b932d4f94f9c771877b6a8a6a1d7dd3ea9c08005 (qulogic@pidgin.im):
Ka-Hing Cheung <khc@hxbc.us>
parents:
25606
diff
changeset
|
2268 } |
c384d62009c0
*** Plucked rev b932d4f94f9c771877b6a8a6a1d7dd3ea9c08005 (qulogic@pidgin.im):
Ka-Hing Cheung <khc@hxbc.us>
parents:
25606
diff
changeset
|
2269 |
15373
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2270 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:
20477
diff
changeset
|
2271 msn_notification_add_buddy_to_list(MsnNotification *notification, MsnListId list_id, |
24720
d6de4f9de12d
Make the add/remove buddy from list functions take a MsnUser* instead of the
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
24518
diff
changeset
|
2272 MsnUser *user) |
15373
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2273 { |
25633
c384d62009c0
*** Plucked rev b932d4f94f9c771877b6a8a6a1d7dd3ea9c08005 (qulogic@pidgin.im):
Ka-Hing Cheung <khc@hxbc.us>
parents:
25606
diff
changeset
|
2274 MsnAddRemoveListData *addrem; |
15373
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2275 MsnCmdProc *cmdproc; |
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:
20477
diff
changeset
|
2276 MsnListOp list_op = 1 << list_id; |
20394
4a099e4d0d09
propagate from branch 'im.pidgin.pidgin' (head 98b6b547b29ea1192b73cc4e1de1e674edef4328)
Richard Laager <rlaager@wiktel.com>
parents:
16063
diff
changeset
|
2277 xmlnode *adl_node; |
4a099e4d0d09
propagate from branch 'im.pidgin.pidgin' (head 98b6b547b29ea1192b73cc4e1de1e674edef4328)
Richard Laager <rlaager@wiktel.com>
parents:
16063
diff
changeset
|
2278 char *payload; |
4a099e4d0d09
propagate from branch 'im.pidgin.pidgin' (head 98b6b547b29ea1192b73cc4e1de1e674edef4328)
Richard Laager <rlaager@wiktel.com>
parents:
16063
diff
changeset
|
2279 int payload_len; |
20488 | 2280 |
15373
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2281 cmdproc = notification->servconn->cmdproc; |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2282 |
20394
4a099e4d0d09
propagate from branch 'im.pidgin.pidgin' (head 98b6b547b29ea1192b73cc4e1de1e674edef4328)
Richard Laager <rlaager@wiktel.com>
parents:
16063
diff
changeset
|
2283 adl_node = xmlnode_new("ml"); |
4a099e4d0d09
propagate from branch 'im.pidgin.pidgin' (head 98b6b547b29ea1192b73cc4e1de1e674edef4328)
Richard Laager <rlaager@wiktel.com>
parents:
16063
diff
changeset
|
2284 adl_node->child = NULL; |
4a099e4d0d09
propagate from branch 'im.pidgin.pidgin' (head 98b6b547b29ea1192b73cc4e1de1e674edef4328)
Richard Laager <rlaager@wiktel.com>
parents:
16063
diff
changeset
|
2285 |
30266
3ff6c193efee
The session parameter appears unused in msn_add_contact_xml.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
30151
diff
changeset
|
2286 msn_add_contact_xml(adl_node, user->passport, list_op, user->networkid); |
15373
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2287 |
25633
c384d62009c0
*** Plucked rev b932d4f94f9c771877b6a8a6a1d7dd3ea9c08005 (qulogic@pidgin.im):
Ka-Hing Cheung <khc@hxbc.us>
parents:
25606
diff
changeset
|
2288 payload = xmlnode_to_str(adl_node, &payload_len); |
20394
4a099e4d0d09
propagate from branch 'im.pidgin.pidgin' (head 98b6b547b29ea1192b73cc4e1de1e674edef4328)
Richard Laager <rlaager@wiktel.com>
parents:
16063
diff
changeset
|
2289 xmlnode_free(adl_node); |
23298
5cdd93dac7a2
Delete trailing whitespace
Mark Doliner <mark@kingant.net>
parents:
22922
diff
changeset
|
2290 |
25633
c384d62009c0
*** Plucked rev b932d4f94f9c771877b6a8a6a1d7dd3ea9c08005 (qulogic@pidgin.im):
Ka-Hing Cheung <khc@hxbc.us>
parents:
25606
diff
changeset
|
2291 if (user->networkid != MSN_NETWORK_UNKNOWN) { |
c384d62009c0
*** Plucked rev b932d4f94f9c771877b6a8a6a1d7dd3ea9c08005 (qulogic@pidgin.im):
Ka-Hing Cheung <khc@hxbc.us>
parents:
25606
diff
changeset
|
2292 msn_notification_post_adl(cmdproc, payload, payload_len); |
c384d62009c0
*** Plucked rev b932d4f94f9c771877b6a8a6a1d7dd3ea9c08005 (qulogic@pidgin.im):
Ka-Hing Cheung <khc@hxbc.us>
parents:
25606
diff
changeset
|
2293 |
c384d62009c0
*** Plucked rev b932d4f94f9c771877b6a8a6a1d7dd3ea9c08005 (qulogic@pidgin.im):
Ka-Hing Cheung <khc@hxbc.us>
parents:
25606
diff
changeset
|
2294 } else { |
c384d62009c0
*** Plucked rev b932d4f94f9c771877b6a8a6a1d7dd3ea9c08005 (qulogic@pidgin.im):
Ka-Hing Cheung <khc@hxbc.us>
parents:
25606
diff
changeset
|
2295 addrem = g_new(MsnAddRemoveListData, 1); |
c384d62009c0
*** Plucked rev b932d4f94f9c771877b6a8a6a1d7dd3ea9c08005 (qulogic@pidgin.im):
Ka-Hing Cheung <khc@hxbc.us>
parents:
25606
diff
changeset
|
2296 addrem->cmdproc = cmdproc; |
c384d62009c0
*** Plucked rev b932d4f94f9c771877b6a8a6a1d7dd3ea9c08005 (qulogic@pidgin.im):
Ka-Hing Cheung <khc@hxbc.us>
parents:
25606
diff
changeset
|
2297 addrem->user = user; |
c384d62009c0
*** Plucked rev b932d4f94f9c771877b6a8a6a1d7dd3ea9c08005 (qulogic@pidgin.im):
Ka-Hing Cheung <khc@hxbc.us>
parents:
25606
diff
changeset
|
2298 addrem->list_op = list_op; |
c384d62009c0
*** Plucked rev b932d4f94f9c771877b6a8a6a1d7dd3ea9c08005 (qulogic@pidgin.im):
Ka-Hing Cheung <khc@hxbc.us>
parents:
25606
diff
changeset
|
2299 addrem->add = TRUE; |
c384d62009c0
*** Plucked rev b932d4f94f9c771877b6a8a6a1d7dd3ea9c08005 (qulogic@pidgin.im):
Ka-Hing Cheung <khc@hxbc.us>
parents:
25606
diff
changeset
|
2300 |
c384d62009c0
*** Plucked rev b932d4f94f9c771877b6a8a6a1d7dd3ea9c08005 (qulogic@pidgin.im):
Ka-Hing Cheung <khc@hxbc.us>
parents:
25606
diff
changeset
|
2301 msn_notification_send_fqy(notification->session, payload, payload_len, |
c384d62009c0
*** Plucked rev b932d4f94f9c771877b6a8a6a1d7dd3ea9c08005 (qulogic@pidgin.im):
Ka-Hing Cheung <khc@hxbc.us>
parents:
25606
diff
changeset
|
2302 modify_unknown_buddy_on_list, addrem); |
c384d62009c0
*** Plucked rev b932d4f94f9c771877b6a8a6a1d7dd3ea9c08005 (qulogic@pidgin.im):
Ka-Hing Cheung <khc@hxbc.us>
parents:
25606
diff
changeset
|
2303 } |
c384d62009c0
*** Plucked rev b932d4f94f9c771877b6a8a6a1d7dd3ea9c08005 (qulogic@pidgin.im):
Ka-Hing Cheung <khc@hxbc.us>
parents:
25606
diff
changeset
|
2304 |
20504
d23c3a5884ee
Make the buddylist sync issue a little less worse.
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
20495
diff
changeset
|
2305 g_free(payload); |
15373
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2306 } |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2307 |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2308 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:
20477
diff
changeset
|
2309 msn_notification_rem_buddy_from_list(MsnNotification *notification, MsnListId list_id, |
24720
d6de4f9de12d
Make the add/remove buddy from list functions take a MsnUser* instead of the
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
24518
diff
changeset
|
2310 MsnUser *user) |
15373
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2311 { |
25633
c384d62009c0
*** Plucked rev b932d4f94f9c771877b6a8a6a1d7dd3ea9c08005 (qulogic@pidgin.im):
Ka-Hing Cheung <khc@hxbc.us>
parents:
25606
diff
changeset
|
2312 MsnAddRemoveListData *addrem; |
15373
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2313 MsnCmdProc *cmdproc; |
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:
20477
diff
changeset
|
2314 MsnListOp list_op = 1 << list_id; |
20394
4a099e4d0d09
propagate from branch 'im.pidgin.pidgin' (head 98b6b547b29ea1192b73cc4e1de1e674edef4328)
Richard Laager <rlaager@wiktel.com>
parents:
16063
diff
changeset
|
2315 xmlnode *rml_node; |
4a099e4d0d09
propagate from branch 'im.pidgin.pidgin' (head 98b6b547b29ea1192b73cc4e1de1e674edef4328)
Richard Laager <rlaager@wiktel.com>
parents:
16063
diff
changeset
|
2316 char *payload; |
4a099e4d0d09
propagate from branch 'im.pidgin.pidgin' (head 98b6b547b29ea1192b73cc4e1de1e674edef4328)
Richard Laager <rlaager@wiktel.com>
parents:
16063
diff
changeset
|
2317 int payload_len; |
4a099e4d0d09
propagate from branch 'im.pidgin.pidgin' (head 98b6b547b29ea1192b73cc4e1de1e674edef4328)
Richard Laager <rlaager@wiktel.com>
parents:
16063
diff
changeset
|
2318 |
15373
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2319 cmdproc = notification->servconn->cmdproc; |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2320 |
20394
4a099e4d0d09
propagate from branch 'im.pidgin.pidgin' (head 98b6b547b29ea1192b73cc4e1de1e674edef4328)
Richard Laager <rlaager@wiktel.com>
parents:
16063
diff
changeset
|
2321 rml_node = xmlnode_new("ml"); |
4a099e4d0d09
propagate from branch 'im.pidgin.pidgin' (head 98b6b547b29ea1192b73cc4e1de1e674edef4328)
Richard Laager <rlaager@wiktel.com>
parents:
16063
diff
changeset
|
2322 rml_node->child = NULL; |
4a099e4d0d09
propagate from branch 'im.pidgin.pidgin' (head 98b6b547b29ea1192b73cc4e1de1e674edef4328)
Richard Laager <rlaager@wiktel.com>
parents:
16063
diff
changeset
|
2323 |
30266
3ff6c193efee
The session parameter appears unused in msn_add_contact_xml.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
30151
diff
changeset
|
2324 msn_add_contact_xml(rml_node, user->passport, list_op, user->networkid); |
20394
4a099e4d0d09
propagate from branch 'im.pidgin.pidgin' (head 98b6b547b29ea1192b73cc4e1de1e674edef4328)
Richard Laager <rlaager@wiktel.com>
parents:
16063
diff
changeset
|
2325 |
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:
20477
diff
changeset
|
2326 payload = xmlnode_to_str(rml_node, &payload_len); |
20394
4a099e4d0d09
propagate from branch 'im.pidgin.pidgin' (head 98b6b547b29ea1192b73cc4e1de1e674edef4328)
Richard Laager <rlaager@wiktel.com>
parents:
16063
diff
changeset
|
2327 xmlnode_free(rml_node); |
4a099e4d0d09
propagate from branch 'im.pidgin.pidgin' (head 98b6b547b29ea1192b73cc4e1de1e674edef4328)
Richard Laager <rlaager@wiktel.com>
parents:
16063
diff
changeset
|
2328 |
25633
c384d62009c0
*** Plucked rev b932d4f94f9c771877b6a8a6a1d7dd3ea9c08005 (qulogic@pidgin.im):
Ka-Hing Cheung <khc@hxbc.us>
parents:
25606
diff
changeset
|
2329 if (user->networkid != MSN_NETWORK_UNKNOWN) { |
c384d62009c0
*** Plucked rev b932d4f94f9c771877b6a8a6a1d7dd3ea9c08005 (qulogic@pidgin.im):
Ka-Hing Cheung <khc@hxbc.us>
parents:
25606
diff
changeset
|
2330 msn_notification_post_rml(cmdproc, payload, payload_len); |
c384d62009c0
*** Plucked rev b932d4f94f9c771877b6a8a6a1d7dd3ea9c08005 (qulogic@pidgin.im):
Ka-Hing Cheung <khc@hxbc.us>
parents:
25606
diff
changeset
|
2331 |
c384d62009c0
*** Plucked rev b932d4f94f9c771877b6a8a6a1d7dd3ea9c08005 (qulogic@pidgin.im):
Ka-Hing Cheung <khc@hxbc.us>
parents:
25606
diff
changeset
|
2332 } else { |
c384d62009c0
*** Plucked rev b932d4f94f9c771877b6a8a6a1d7dd3ea9c08005 (qulogic@pidgin.im):
Ka-Hing Cheung <khc@hxbc.us>
parents:
25606
diff
changeset
|
2333 addrem = g_new(MsnAddRemoveListData, 1); |
c384d62009c0
*** Plucked rev b932d4f94f9c771877b6a8a6a1d7dd3ea9c08005 (qulogic@pidgin.im):
Ka-Hing Cheung <khc@hxbc.us>
parents:
25606
diff
changeset
|
2334 addrem->cmdproc = cmdproc; |
c384d62009c0
*** Plucked rev b932d4f94f9c771877b6a8a6a1d7dd3ea9c08005 (qulogic@pidgin.im):
Ka-Hing Cheung <khc@hxbc.us>
parents:
25606
diff
changeset
|
2335 addrem->user = user; |
c384d62009c0
*** Plucked rev b932d4f94f9c771877b6a8a6a1d7dd3ea9c08005 (qulogic@pidgin.im):
Ka-Hing Cheung <khc@hxbc.us>
parents:
25606
diff
changeset
|
2336 addrem->list_op = list_op; |
c384d62009c0
*** Plucked rev b932d4f94f9c771877b6a8a6a1d7dd3ea9c08005 (qulogic@pidgin.im):
Ka-Hing Cheung <khc@hxbc.us>
parents:
25606
diff
changeset
|
2337 addrem->add = FALSE; |
c384d62009c0
*** Plucked rev b932d4f94f9c771877b6a8a6a1d7dd3ea9c08005 (qulogic@pidgin.im):
Ka-Hing Cheung <khc@hxbc.us>
parents:
25606
diff
changeset
|
2338 |
c384d62009c0
*** Plucked rev b932d4f94f9c771877b6a8a6a1d7dd3ea9c08005 (qulogic@pidgin.im):
Ka-Hing Cheung <khc@hxbc.us>
parents:
25606
diff
changeset
|
2339 msn_notification_send_fqy(notification->session, payload, payload_len, |
c384d62009c0
*** Plucked rev b932d4f94f9c771877b6a8a6a1d7dd3ea9c08005 (qulogic@pidgin.im):
Ka-Hing Cheung <khc@hxbc.us>
parents:
25606
diff
changeset
|
2340 modify_unknown_buddy_on_list, addrem); |
c384d62009c0
*** Plucked rev b932d4f94f9c771877b6a8a6a1d7dd3ea9c08005 (qulogic@pidgin.im):
Ka-Hing Cheung <khc@hxbc.us>
parents:
25606
diff
changeset
|
2341 } |
c384d62009c0
*** Plucked rev b932d4f94f9c771877b6a8a6a1d7dd3ea9c08005 (qulogic@pidgin.im):
Ka-Hing Cheung <khc@hxbc.us>
parents:
25606
diff
changeset
|
2342 |
20504
d23c3a5884ee
Make the buddylist sync issue a little less worse.
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
20495
diff
changeset
|
2343 g_free(payload); |
15373
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2344 } |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2345 |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2346 /************************************************************************** |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2347 * Init |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2348 **************************************************************************/ |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2349 void |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2350 msn_notification_init(void) |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2351 { |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2352 cbs_table = msn_table_new(); |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2353 |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2354 /* Synchronous */ |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2355 msn_table_add_cmd(cbs_table, "CHG", "CHG", NULL); |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2356 msn_table_add_cmd(cbs_table, "CHG", "ILN", iln_cmd); |
20394
4a099e4d0d09
propagate from branch 'im.pidgin.pidgin' (head 98b6b547b29ea1192b73cc4e1de1e674edef4328)
Richard Laager <rlaager@wiktel.com>
parents:
16063
diff
changeset
|
2357 msn_table_add_cmd(cbs_table, "ADL", "ILN", iln_cmd); |
15373
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2358 msn_table_add_cmd(cbs_table, "USR", "USR", usr_cmd); |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2359 msn_table_add_cmd(cbs_table, "USR", "XFR", xfr_cmd); |
20394
4a099e4d0d09
propagate from branch 'im.pidgin.pidgin' (head 98b6b547b29ea1192b73cc4e1de1e674edef4328)
Richard Laager <rlaager@wiktel.com>
parents:
16063
diff
changeset
|
2360 msn_table_add_cmd(cbs_table, "USR", "GCF", gcf_cmd); |
15373
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2361 msn_table_add_cmd(cbs_table, "CVR", "CVR", cvr_cmd); |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2362 msn_table_add_cmd(cbs_table, "VER", "VER", ver_cmd); |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2363 msn_table_add_cmd(cbs_table, "PRP", "PRP", prp_cmd); |
20394
4a099e4d0d09
propagate from branch 'im.pidgin.pidgin' (head 98b6b547b29ea1192b73cc4e1de1e674edef4328)
Richard Laager <rlaager@wiktel.com>
parents:
16063
diff
changeset
|
2364 msn_table_add_cmd(cbs_table, "BLP", "BLP", blp_cmd); |
15373
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2365 msn_table_add_cmd(cbs_table, "XFR", "XFR", xfr_cmd); |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2366 |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2367 /* Asynchronous */ |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2368 msn_table_add_cmd(cbs_table, NULL, "IPG", ipg_cmd); |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2369 msn_table_add_cmd(cbs_table, NULL, "MSG", msg_cmd); |
20394
4a099e4d0d09
propagate from branch 'im.pidgin.pidgin' (head 98b6b547b29ea1192b73cc4e1de1e674edef4328)
Richard Laager <rlaager@wiktel.com>
parents:
16063
diff
changeset
|
2370 msn_table_add_cmd(cbs_table, NULL, "UBM", ubm_cmd); |
4a099e4d0d09
propagate from branch 'im.pidgin.pidgin' (head 98b6b547b29ea1192b73cc4e1de1e674edef4328)
Richard Laager <rlaager@wiktel.com>
parents:
16063
diff
changeset
|
2371 msn_table_add_cmd(cbs_table, NULL, "GCF", gcf_cmd); |
4a099e4d0d09
propagate from branch 'im.pidgin.pidgin' (head 98b6b547b29ea1192b73cc4e1de1e674edef4328)
Richard Laager <rlaager@wiktel.com>
parents:
16063
diff
changeset
|
2372 msn_table_add_cmd(cbs_table, NULL, "SBS", sbs_cmd); |
15373
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2373 msn_table_add_cmd(cbs_table, NULL, "NOT", not_cmd); |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2374 |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2375 msn_table_add_cmd(cbs_table, NULL, "CHL", chl_cmd); |
20394
4a099e4d0d09
propagate from branch 'im.pidgin.pidgin' (head 98b6b547b29ea1192b73cc4e1de1e674edef4328)
Richard Laager <rlaager@wiktel.com>
parents:
16063
diff
changeset
|
2376 msn_table_add_cmd(cbs_table, NULL, "RML", rml_cmd); |
4a099e4d0d09
propagate from branch 'im.pidgin.pidgin' (head 98b6b547b29ea1192b73cc4e1de1e674edef4328)
Richard Laager <rlaager@wiktel.com>
parents:
16063
diff
changeset
|
2377 msn_table_add_cmd(cbs_table, NULL, "ADL", adl_cmd); |
4a099e4d0d09
propagate from branch 'im.pidgin.pidgin' (head 98b6b547b29ea1192b73cc4e1de1e674edef4328)
Richard Laager <rlaager@wiktel.com>
parents:
16063
diff
changeset
|
2378 msn_table_add_cmd(cbs_table, NULL, "FQY", fqy_cmd); |
15373
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2379 |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2380 msn_table_add_cmd(cbs_table, NULL, "QRY", NULL); |
17128
3e463ddf18f7
Periodically refresh the authentication info required to automatically log
Stu Tomlinson <stu@nosnilmot.com>
parents:
17105
diff
changeset
|
2381 msn_table_add_cmd(cbs_table, NULL, "QNG", qng_cmd); |
15373
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2382 msn_table_add_cmd(cbs_table, NULL, "FLN", fln_cmd); |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2383 msn_table_add_cmd(cbs_table, NULL, "NLN", nln_cmd); |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2384 msn_table_add_cmd(cbs_table, NULL, "ILN", iln_cmd); |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2385 msn_table_add_cmd(cbs_table, NULL, "OUT", out_cmd); |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2386 msn_table_add_cmd(cbs_table, NULL, "RNG", rng_cmd); |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2387 |
20394
4a099e4d0d09
propagate from branch 'im.pidgin.pidgin' (head 98b6b547b29ea1192b73cc4e1de1e674edef4328)
Richard Laager <rlaager@wiktel.com>
parents:
16063
diff
changeset
|
2388 msn_table_add_cmd(cbs_table, NULL, "UBX", ubx_cmd); |
4a099e4d0d09
propagate from branch 'im.pidgin.pidgin' (head 98b6b547b29ea1192b73cc4e1de1e674edef4328)
Richard Laager <rlaager@wiktel.com>
parents:
16063
diff
changeset
|
2389 msn_table_add_cmd(cbs_table, NULL, "UUX", uux_cmd); |
4a099e4d0d09
propagate from branch 'im.pidgin.pidgin' (head 98b6b547b29ea1192b73cc4e1de1e674edef4328)
Richard Laager <rlaager@wiktel.com>
parents:
16063
diff
changeset
|
2390 |
30687
4c8bd8efacb8
Support receiving UBN and sending UUN, which seem to have been added way
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
30686
diff
changeset
|
2391 msn_table_add_cmd(cbs_table, NULL, "UBN", ubn_cmd); |
4c8bd8efacb8
Support receiving UBN and sending UUN, which seem to have been added way
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
30686
diff
changeset
|
2392 msn_table_add_cmd(cbs_table, NULL, "UUN", uun_cmd); |
4c8bd8efacb8
Support receiving UBN and sending UUN, which seem to have been added way
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
30686
diff
changeset
|
2393 |
15373
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2394 msn_table_add_cmd(cbs_table, NULL, "URL", url_cmd); |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2395 |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2396 msn_table_add_cmd(cbs_table, "fallback", "XFR", xfr_cmd); |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2397 |
20439
bee467c81570
A bunch of MSNP14 stuff:
Stu Tomlinson <stu@nosnilmot.com>
parents:
20432
diff
changeset
|
2398 msn_table_add_error(cbs_table, "ADL", adl_error); |
28467
12bdd930d99c
Add an error handler for the RML command as well.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
28466
diff
changeset
|
2399 msn_table_add_error(cbs_table, "RML", rml_error); |
25601
1a1765a87336
More MSN fixes to go along with f0df27a299120baecf9ea88a9fb24ffe1dbe72fd:
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
25582
diff
changeset
|
2400 msn_table_add_error(cbs_table, "FQY", fqy_error); |
15373
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2401 msn_table_add_error(cbs_table, "USR", usr_error); |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2402 |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2403 msn_table_add_msg_type(cbs_table, |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2404 "text/x-msmsgsprofile", |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2405 profile_msg); |
20394
4a099e4d0d09
propagate from branch 'im.pidgin.pidgin' (head 98b6b547b29ea1192b73cc4e1de1e674edef4328)
Richard Laager <rlaager@wiktel.com>
parents:
16063
diff
changeset
|
2406 /*initial OIM notification*/ |
4a099e4d0d09
propagate from branch 'im.pidgin.pidgin' (head 98b6b547b29ea1192b73cc4e1de1e674edef4328)
Richard Laager <rlaager@wiktel.com>
parents:
16063
diff
changeset
|
2407 msn_table_add_msg_type(cbs_table, |
4a099e4d0d09
propagate from branch 'im.pidgin.pidgin' (head 98b6b547b29ea1192b73cc4e1de1e674edef4328)
Richard Laager <rlaager@wiktel.com>
parents:
16063
diff
changeset
|
2408 "text/x-msmsgsinitialmdatanotification", |
23298
5cdd93dac7a2
Delete trailing whitespace
Mark Doliner <mark@kingant.net>
parents:
22922
diff
changeset
|
2409 initial_mdata_msg); |
20394
4a099e4d0d09
propagate from branch 'im.pidgin.pidgin' (head 98b6b547b29ea1192b73cc4e1de1e674edef4328)
Richard Laager <rlaager@wiktel.com>
parents:
16063
diff
changeset
|
2410 /*OIM notification when user online*/ |
4a099e4d0d09
propagate from branch 'im.pidgin.pidgin' (head 98b6b547b29ea1192b73cc4e1de1e674edef4328)
Richard Laager <rlaager@wiktel.com>
parents:
16063
diff
changeset
|
2411 msn_table_add_msg_type(cbs_table, |
4a099e4d0d09
propagate from branch 'im.pidgin.pidgin' (head 98b6b547b29ea1192b73cc4e1de1e674edef4328)
Richard Laager <rlaager@wiktel.com>
parents:
16063
diff
changeset
|
2412 "text/x-msmsgsoimnotification", |
23298
5cdd93dac7a2
Delete trailing whitespace
Mark Doliner <mark@kingant.net>
parents:
22922
diff
changeset
|
2413 initial_mdata_msg); |
15373
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2414 msn_table_add_msg_type(cbs_table, |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2415 "text/x-msmsgsinitialemailnotification", |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2416 initial_email_msg); |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2417 msn_table_add_msg_type(cbs_table, |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2418 "text/x-msmsgsemailnotification", |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2419 email_msg); |
20394
4a099e4d0d09
propagate from branch 'im.pidgin.pidgin' (head 98b6b547b29ea1192b73cc4e1de1e674edef4328)
Richard Laager <rlaager@wiktel.com>
parents:
16063
diff
changeset
|
2420 /*delete an offline Message notification*/ |
4a099e4d0d09
propagate from branch 'im.pidgin.pidgin' (head 98b6b547b29ea1192b73cc4e1de1e674edef4328)
Richard Laager <rlaager@wiktel.com>
parents:
16063
diff
changeset
|
2421 msn_table_add_msg_type(cbs_table, |
4a099e4d0d09
propagate from branch 'im.pidgin.pidgin' (head 98b6b547b29ea1192b73cc4e1de1e674edef4328)
Richard Laager <rlaager@wiktel.com>
parents:
16063
diff
changeset
|
2422 "text/x-msmsgsactivemailnotification", |
4a099e4d0d09
propagate from branch 'im.pidgin.pidgin' (head 98b6b547b29ea1192b73cc4e1de1e674edef4328)
Richard Laager <rlaager@wiktel.com>
parents:
16063
diff
changeset
|
2423 delete_oim_msg); |
15373
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2424 msn_table_add_msg_type(cbs_table, |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2425 "application/x-msmsgssystemmessage", |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2426 system_msg); |
25400
a214dc3807f8
Setup message handlers on the MSN Notification server so that messages from
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
25394
diff
changeset
|
2427 /* generic message handlers */ |
a214dc3807f8
Setup message handlers on the MSN Notification server so that messages from
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
25394
diff
changeset
|
2428 msn_table_add_msg_type(cbs_table, "text/plain", |
a214dc3807f8
Setup message handlers on the MSN Notification server so that messages from
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
25394
diff
changeset
|
2429 msn_plain_msg); |
a214dc3807f8
Setup message handlers on the MSN Notification server so that messages from
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
25394
diff
changeset
|
2430 msn_table_add_msg_type(cbs_table, "text/x-msmsgscontrol", |
a214dc3807f8
Setup message handlers on the MSN Notification server so that messages from
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
25394
diff
changeset
|
2431 msn_control_msg); |
a214dc3807f8
Setup message handlers on the MSN Notification server so that messages from
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
25394
diff
changeset
|
2432 msn_table_add_msg_type(cbs_table, "text/x-msnmsgr-datacast", |
a214dc3807f8
Setup message handlers on the MSN Notification server so that messages from
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
25394
diff
changeset
|
2433 msn_datacast_msg); |
15373
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2434 } |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2435 |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2436 void |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2437 msn_notification_end(void) |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2438 { |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2439 msn_table_destroy(cbs_table); |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2440 } |
20394
4a099e4d0d09
propagate from branch 'im.pidgin.pidgin' (head 98b6b547b29ea1192b73cc4e1de1e674edef4328)
Richard Laager <rlaager@wiktel.com>
parents:
16063
diff
changeset
|
2441 |