libpurple/protocols/msn/notification.c

Sun, 23 Nov 2008 04:04:57 +0000

author
Elliott Sales de Andrade <qulogic@pidgin.im>
date
Sun, 23 Nov 2008 04:04:57 +0000
changeset 24749
108f5dc3b547
parent 24707
2a6fd0a61c41
child 24750
2e8e1260192b
permissions
-rw-r--r--

disapproval of revision '2a6fd0a61c41b57d9e6681551978e7a247d551e9'

5309
3178acad1449 [gaim-migrate @ 5681]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
1 /**
3178acad1449 [gaim-migrate @ 5681]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
2 * @file notification.c Notification server functions
3178acad1449 [gaim-migrate @ 5681]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
3 *
15884
4de1981757fc sed -ie 's/gaim/purple/g'
Sean Egan <seanegan@pidgin.im>
parents: 15435
diff changeset
4 * purple
5309
3178acad1449 [gaim-migrate @ 5681]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
5 *
15884
4de1981757fc sed -ie 's/gaim/purple/g'
Sean Egan <seanegan@pidgin.im>
parents: 15435
diff changeset
6 * Purple is the legal property of its developers, whose names are too numerous
9198
e8eb6d5eb9eb [gaim-migrate @ 9993]
Christian Hammond <chipx86@chipx86.com>
parents: 9197
diff changeset
7 * to list here. Please refer to the COPYRIGHT file distributed with this
e8eb6d5eb9eb [gaim-migrate @ 9993]
Christian Hammond <chipx86@chipx86.com>
parents: 9197
diff changeset
8 * source distribution.
6701
7e2db9273748 [gaim-migrate @ 7227]
Christian Hammond <chipx86@chipx86.com>
parents: 6695
diff changeset
9 *
5309
3178acad1449 [gaim-migrate @ 5681]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
10 * This program is free software; you can redistribute it and/or modify
3178acad1449 [gaim-migrate @ 5681]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
11 * it under the terms of the GNU General Public License as published by
3178acad1449 [gaim-migrate @ 5681]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
12 * the Free Software Foundation; either version 2 of the License, or
3178acad1449 [gaim-migrate @ 5681]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
13 * (at your option) any later version.
3178acad1449 [gaim-migrate @ 5681]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
14 *
3178acad1449 [gaim-migrate @ 5681]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
15 * This program is distributed in the hope that it will be useful,
3178acad1449 [gaim-migrate @ 5681]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
16 * but WITHOUT ANY WARRANTY; without even the implied warranty of
3178acad1449 [gaim-migrate @ 5681]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
17 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
3178acad1449 [gaim-migrate @ 5681]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
18 * GNU General Public License for more details.
3178acad1449 [gaim-migrate @ 5681]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
19 *
3178acad1449 [gaim-migrate @ 5681]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
20 * You should have received a copy of the GNU General Public License
3178acad1449 [gaim-migrate @ 5681]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
21 * along with this program; if not, write to the Free Software
19859
71d37b57eff2 The FSF changed its address a while ago; our files were out of date.
John Bailey <rekkanoryo@rekkanoryo.org>
parents: 18805
diff changeset
22 * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02111-1301 USA
5309
3178acad1449 [gaim-migrate @ 5681]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
23 */
3178acad1449 [gaim-migrate @ 5681]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
24 #include "msn.h"
3178acad1449 [gaim-migrate @ 5681]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
25 #include "notification.h"
23771
c98f7e879218 killing MsnContact which just wraps MsnSession
Ka-Hing Cheung <khc@pidgin.im>
parents: 23770
diff changeset
26 #include "contact.h"
5361
a964b856e97f [gaim-migrate @ 5737]
Christian Hammond <chipx86@chipx86.com>
parents: 5358
diff changeset
27 #include "state.h"
5309
3178acad1449 [gaim-migrate @ 5681]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
28 #include "error.h"
20475
0b3826f0e687 The first msn-p13-merge-head.diff.gz from SF Patch #1621854 from Ka-Hing Cheung.
Richard Laager <rlaager@pidgin.im>
parents: 20474
diff changeset
29 #include "msnutils.h"
9193
6e76f1367896 [gaim-migrate @ 9988]
Felipe Contreras <felipe.contreras@gmail.com>
parents: 9158
diff changeset
30 #include "page.h"
5518
436fb9490b62 [gaim-migrate @ 5918]
Christian Hammond <chipx86@chipx86.com>
parents: 5509
diff changeset
31
9193
6e76f1367896 [gaim-migrate @ 9988]
Felipe Contreras <felipe.contreras@gmail.com>
parents: 9158
diff changeset
32 #include "userlist.h"
6e76f1367896 [gaim-migrate @ 9988]
Felipe Contreras <felipe.contreras@gmail.com>
parents: 9158
diff changeset
33 #include "sync.h"
10296
9badf1cedc6e [gaim-migrate @ 11476]
Felipe Contreras <felipe.contreras@gmail.com>
parents: 10284
diff changeset
34 #include "slplink.h"
5309
3178acad1449 [gaim-migrate @ 5681]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
35
9193
6e76f1367896 [gaim-migrate @ 9988]
Felipe Contreras <felipe.contreras@gmail.com>
parents: 9158
diff changeset
36 static MsnTable *cbs_table;
5309
3178acad1449 [gaim-migrate @ 5681]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
37
3178acad1449 [gaim-migrate @ 5681]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
38 /**************************************************************************
10463
f2f97738b401 [gaim-migrate @ 11737]
Felipe Contreras <felipe.contreras@gmail.com>
parents: 10452
diff changeset
39 * Main
f2f97738b401 [gaim-migrate @ 11737]
Felipe Contreras <felipe.contreras@gmail.com>
parents: 10452
diff changeset
40 **************************************************************************/
10481
a5d6b8e1717d [gaim-migrate @ 11769]
Felipe Contreras <felipe.contreras@gmail.com>
parents: 10463
diff changeset
41
10463
f2f97738b401 [gaim-migrate @ 11737]
Felipe Contreras <felipe.contreras@gmail.com>
parents: 10452
diff changeset
42 static void
f2f97738b401 [gaim-migrate @ 11737]
Felipe Contreras <felipe.contreras@gmail.com>
parents: 10452
diff changeset
43 destroy_cb(MsnServConn *servconn)
f2f97738b401 [gaim-migrate @ 11737]
Felipe Contreras <felipe.contreras@gmail.com>
parents: 10452
diff changeset
44 {
f2f97738b401 [gaim-migrate @ 11737]
Felipe Contreras <felipe.contreras@gmail.com>
parents: 10452
diff changeset
45 MsnNotification *notification;
f2f97738b401 [gaim-migrate @ 11737]
Felipe Contreras <felipe.contreras@gmail.com>
parents: 10452
diff changeset
46
f2f97738b401 [gaim-migrate @ 11737]
Felipe Contreras <felipe.contreras@gmail.com>
parents: 10452
diff changeset
47 notification = servconn->cmdproc->data;
f2f97738b401 [gaim-migrate @ 11737]
Felipe Contreras <felipe.contreras@gmail.com>
parents: 10452
diff changeset
48 g_return_if_fail(notification != NULL);
f2f97738b401 [gaim-migrate @ 11737]
Felipe Contreras <felipe.contreras@gmail.com>
parents: 10452
diff changeset
49
f2f97738b401 [gaim-migrate @ 11737]
Felipe Contreras <felipe.contreras@gmail.com>
parents: 10452
diff changeset
50 msn_notification_destroy(notification);
f2f97738b401 [gaim-migrate @ 11737]
Felipe Contreras <felipe.contreras@gmail.com>
parents: 10452
diff changeset
51 }
f2f97738b401 [gaim-migrate @ 11737]
Felipe Contreras <felipe.contreras@gmail.com>
parents: 10452
diff changeset
52
f2f97738b401 [gaim-migrate @ 11737]
Felipe Contreras <felipe.contreras@gmail.com>
parents: 10452
diff changeset
53 MsnNotification *
f2f97738b401 [gaim-migrate @ 11737]
Felipe Contreras <felipe.contreras@gmail.com>
parents: 10452
diff changeset
54 msn_notification_new(MsnSession *session)
f2f97738b401 [gaim-migrate @ 11737]
Felipe Contreras <felipe.contreras@gmail.com>
parents: 10452
diff changeset
55 {
f2f97738b401 [gaim-migrate @ 11737]
Felipe Contreras <felipe.contreras@gmail.com>
parents: 10452
diff changeset
56 MsnNotification *notification;
f2f97738b401 [gaim-migrate @ 11737]
Felipe Contreras <felipe.contreras@gmail.com>
parents: 10452
diff changeset
57 MsnServConn *servconn;
f2f97738b401 [gaim-migrate @ 11737]
Felipe Contreras <felipe.contreras@gmail.com>
parents: 10452
diff changeset
58
f2f97738b401 [gaim-migrate @ 11737]
Felipe Contreras <felipe.contreras@gmail.com>
parents: 10452
diff changeset
59 g_return_val_if_fail(session != NULL, NULL);
f2f97738b401 [gaim-migrate @ 11737]
Felipe Contreras <felipe.contreras@gmail.com>
parents: 10452
diff changeset
60
f2f97738b401 [gaim-migrate @ 11737]
Felipe Contreras <felipe.contreras@gmail.com>
parents: 10452
diff changeset
61 notification = g_new0(MsnNotification, 1);
f2f97738b401 [gaim-migrate @ 11737]
Felipe Contreras <felipe.contreras@gmail.com>
parents: 10452
diff changeset
62
f2f97738b401 [gaim-migrate @ 11737]
Felipe Contreras <felipe.contreras@gmail.com>
parents: 10452
diff changeset
63 notification->session = session;
10481
a5d6b8e1717d [gaim-migrate @ 11769]
Felipe Contreras <felipe.contreras@gmail.com>
parents: 10463
diff changeset
64 notification->servconn = servconn = msn_servconn_new(session, MSN_SERVCONN_NS);
10463
f2f97738b401 [gaim-migrate @ 11737]
Felipe Contreras <felipe.contreras@gmail.com>
parents: 10452
diff changeset
65 msn_servconn_set_destroy_cb(servconn, destroy_cb);
f2f97738b401 [gaim-migrate @ 11737]
Felipe Contreras <felipe.contreras@gmail.com>
parents: 10452
diff changeset
66
f2f97738b401 [gaim-migrate @ 11737]
Felipe Contreras <felipe.contreras@gmail.com>
parents: 10452
diff changeset
67 notification->cmdproc = servconn->cmdproc;
f2f97738b401 [gaim-migrate @ 11737]
Felipe Contreras <felipe.contreras@gmail.com>
parents: 10452
diff changeset
68 notification->cmdproc->data = notification;
f2f97738b401 [gaim-migrate @ 11737]
Felipe Contreras <felipe.contreras@gmail.com>
parents: 10452
diff changeset
69 notification->cmdproc->cbs_table = cbs_table;
f2f97738b401 [gaim-migrate @ 11737]
Felipe Contreras <felipe.contreras@gmail.com>
parents: 10452
diff changeset
70
f2f97738b401 [gaim-migrate @ 11737]
Felipe Contreras <felipe.contreras@gmail.com>
parents: 10452
diff changeset
71 return notification;
f2f97738b401 [gaim-migrate @ 11737]
Felipe Contreras <felipe.contreras@gmail.com>
parents: 10452
diff changeset
72 }
f2f97738b401 [gaim-migrate @ 11737]
Felipe Contreras <felipe.contreras@gmail.com>
parents: 10452
diff changeset
73
f2f97738b401 [gaim-migrate @ 11737]
Felipe Contreras <felipe.contreras@gmail.com>
parents: 10452
diff changeset
74 void
f2f97738b401 [gaim-migrate @ 11737]
Felipe Contreras <felipe.contreras@gmail.com>
parents: 10452
diff changeset
75 msn_notification_destroy(MsnNotification *notification)
f2f97738b401 [gaim-migrate @ 11737]
Felipe Contreras <felipe.contreras@gmail.com>
parents: 10452
diff changeset
76 {
10481
a5d6b8e1717d [gaim-migrate @ 11769]
Felipe Contreras <felipe.contreras@gmail.com>
parents: 10463
diff changeset
77 notification->cmdproc->data = NULL;
10463
f2f97738b401 [gaim-migrate @ 11737]
Felipe Contreras <felipe.contreras@gmail.com>
parents: 10452
diff changeset
78
10481
a5d6b8e1717d [gaim-migrate @ 11769]
Felipe Contreras <felipe.contreras@gmail.com>
parents: 10463
diff changeset
79 msn_servconn_set_destroy_cb(notification->servconn, NULL);
10463
f2f97738b401 [gaim-migrate @ 11737]
Felipe Contreras <felipe.contreras@gmail.com>
parents: 10452
diff changeset
80
f2f97738b401 [gaim-migrate @ 11737]
Felipe Contreras <felipe.contreras@gmail.com>
parents: 10452
diff changeset
81 msn_servconn_destroy(notification->servconn);
f2f97738b401 [gaim-migrate @ 11737]
Felipe Contreras <felipe.contreras@gmail.com>
parents: 10452
diff changeset
82
f2f97738b401 [gaim-migrate @ 11737]
Felipe Contreras <felipe.contreras@gmail.com>
parents: 10452
diff changeset
83 g_free(notification);
f2f97738b401 [gaim-migrate @ 11737]
Felipe Contreras <felipe.contreras@gmail.com>
parents: 10452
diff changeset
84 }
f2f97738b401 [gaim-migrate @ 11737]
Felipe Contreras <felipe.contreras@gmail.com>
parents: 10452
diff changeset
85
f2f97738b401 [gaim-migrate @ 11737]
Felipe Contreras <felipe.contreras@gmail.com>
parents: 10452
diff changeset
86 /**************************************************************************
f2f97738b401 [gaim-migrate @ 11737]
Felipe Contreras <felipe.contreras@gmail.com>
parents: 10452
diff changeset
87 * Connect
f2f97738b401 [gaim-migrate @ 11737]
Felipe Contreras <felipe.contreras@gmail.com>
parents: 10452
diff changeset
88 **************************************************************************/
10481
a5d6b8e1717d [gaim-migrate @ 11769]
Felipe Contreras <felipe.contreras@gmail.com>
parents: 10463
diff changeset
89
10463
f2f97738b401 [gaim-migrate @ 11737]
Felipe Contreras <felipe.contreras@gmail.com>
parents: 10452
diff changeset
90 static void
f2f97738b401 [gaim-migrate @ 11737]
Felipe Contreras <felipe.contreras@gmail.com>
parents: 10452
diff changeset
91 connect_cb(MsnServConn *servconn)
f2f97738b401 [gaim-migrate @ 11737]
Felipe Contreras <felipe.contreras@gmail.com>
parents: 10452
diff changeset
92 {
f2f97738b401 [gaim-migrate @ 11737]
Felipe Contreras <felipe.contreras@gmail.com>
parents: 10452
diff changeset
93 MsnCmdProc *cmdproc;
f2f97738b401 [gaim-migrate @ 11737]
Felipe Contreras <felipe.contreras@gmail.com>
parents: 10452
diff changeset
94 MsnSession *session;
15884
4de1981757fc sed -ie 's/gaim/purple/g'
Sean Egan <seanegan@pidgin.im>
parents: 15435
diff changeset
95 PurpleAccount *account;
20733
a179242f6bef Further cleanup of the msn prpl including preventing the authorization request callback from crashing if triggered after the account is disconnected. Also removal of some extraneous debuggery, there is more that needs to be removed.
Daniel Atallah <datallah@pidgin.im>
parents: 20597
diff changeset
96 GString *vers;
a179242f6bef Further cleanup of the msn prpl including preventing the authorization request callback from crashing if triggered after the account is disconnected. Also removal of some extraneous debuggery, there is more that needs to be removed.
Daniel Atallah <datallah@pidgin.im>
parents: 20597
diff changeset
97 const char *ver_str;
10463
f2f97738b401 [gaim-migrate @ 11737]
Felipe Contreras <felipe.contreras@gmail.com>
parents: 10452
diff changeset
98 int i;
f2f97738b401 [gaim-migrate @ 11737]
Felipe Contreras <felipe.contreras@gmail.com>
parents: 10452
diff changeset
99
f2f97738b401 [gaim-migrate @ 11737]
Felipe Contreras <felipe.contreras@gmail.com>
parents: 10452
diff changeset
100 g_return_if_fail(servconn != NULL);
f2f97738b401 [gaim-migrate @ 11737]
Felipe Contreras <felipe.contreras@gmail.com>
parents: 10452
diff changeset
101
f2f97738b401 [gaim-migrate @ 11737]
Felipe Contreras <felipe.contreras@gmail.com>
parents: 10452
diff changeset
102 cmdproc = servconn->cmdproc;
f2f97738b401 [gaim-migrate @ 11737]
Felipe Contreras <felipe.contreras@gmail.com>
parents: 10452
diff changeset
103 session = servconn->session;
f2f97738b401 [gaim-migrate @ 11737]
Felipe Contreras <felipe.contreras@gmail.com>
parents: 10452
diff changeset
104 account = session->account;
f2f97738b401 [gaim-migrate @ 11737]
Felipe Contreras <felipe.contreras@gmail.com>
parents: 10452
diff changeset
105
20733
a179242f6bef Further cleanup of the msn prpl including preventing the authorization request callback from crashing if triggered after the account is disconnected. Also removal of some extraneous debuggery, there is more that needs to be removed.
Daniel Atallah <datallah@pidgin.im>
parents: 20597
diff changeset
106 vers = g_string_new("");
10463
f2f97738b401 [gaim-migrate @ 11737]
Felipe Contreras <felipe.contreras@gmail.com>
parents: 10452
diff changeset
107
13855
24cff9e060d7 [gaim-migrate @ 16507]
Ma Yuan <mayuan2006@gmail.com>
parents: 13854
diff changeset
108 for (i = WLM_MAX_PROTOCOL; i >= WLM_MIN_PROTOCOL; i--)
20733
a179242f6bef Further cleanup of the msn prpl including preventing the authorization request callback from crashing if triggered after the account is disconnected. Also removal of some extraneous debuggery, there is more that needs to be removed.
Daniel Atallah <datallah@pidgin.im>
parents: 20597
diff changeset
109 g_string_append_printf(vers, " MSNP%d", i);
10463
f2f97738b401 [gaim-migrate @ 11737]
Felipe Contreras <felipe.contreras@gmail.com>
parents: 10452
diff changeset
110
20733
a179242f6bef Further cleanup of the msn prpl including preventing the authorization request callback from crashing if triggered after the account is disconnected. Also removal of some extraneous debuggery, there is more that needs to be removed.
Daniel Atallah <datallah@pidgin.im>
parents: 20597
diff changeset
111 g_string_append(vers, " CVR0");
10463
f2f97738b401 [gaim-migrate @ 11737]
Felipe Contreras <felipe.contreras@gmail.com>
parents: 10452
diff changeset
112
10519
80801a34a246 [gaim-migrate @ 11833]
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 10514
diff changeset
113 if (session->login_step == MSN_LOGIN_STEP_START)
80801a34a246 [gaim-migrate @ 11833]
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 10514
diff changeset
114 msn_session_set_login_step(session, MSN_LOGIN_STEP_HANDSHAKE);
80801a34a246 [gaim-migrate @ 11833]
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 10514
diff changeset
115 else
80801a34a246 [gaim-migrate @ 11833]
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 10514
diff changeset
116 msn_session_set_login_step(session, MSN_LOGIN_STEP_HANDSHAKE2);
10514
3d6cb5d53e97 [gaim-migrate @ 11814]
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 10504
diff changeset
117
20733
a179242f6bef Further cleanup of the msn prpl including preventing the authorization request callback from crashing if triggered after the account is disconnected. Also removal of some extraneous debuggery, there is more that needs to be removed.
Daniel Atallah <datallah@pidgin.im>
parents: 20597
diff changeset
118 /* Skip the initial space */
a179242f6bef Further cleanup of the msn prpl including preventing the authorization request callback from crashing if triggered after the account is disconnected. Also removal of some extraneous debuggery, there is more that needs to be removed.
Daniel Atallah <datallah@pidgin.im>
parents: 20597
diff changeset
119 ver_str = (vers->str + 1);
a179242f6bef Further cleanup of the msn prpl including preventing the authorization request callback from crashing if triggered after the account is disconnected. Also removal of some extraneous debuggery, there is more that needs to be removed.
Daniel Atallah <datallah@pidgin.im>
parents: 20597
diff changeset
120 msn_cmdproc_send(cmdproc, "VER", "%s", ver_str);
10463
f2f97738b401 [gaim-migrate @ 11737]
Felipe Contreras <felipe.contreras@gmail.com>
parents: 10452
diff changeset
121
20733
a179242f6bef Further cleanup of the msn prpl including preventing the authorization request callback from crashing if triggered after the account is disconnected. Also removal of some extraneous debuggery, there is more that needs to be removed.
Daniel Atallah <datallah@pidgin.im>
parents: 20597
diff changeset
122 g_string_free(vers, TRUE);
10463
f2f97738b401 [gaim-migrate @ 11737]
Felipe Contreras <felipe.contreras@gmail.com>
parents: 10452
diff changeset
123 }
f2f97738b401 [gaim-migrate @ 11737]
Felipe Contreras <felipe.contreras@gmail.com>
parents: 10452
diff changeset
124
f2f97738b401 [gaim-migrate @ 11737]
Felipe Contreras <felipe.contreras@gmail.com>
parents: 10452
diff changeset
125 gboolean
f2f97738b401 [gaim-migrate @ 11737]
Felipe Contreras <felipe.contreras@gmail.com>
parents: 10452
diff changeset
126 msn_notification_connect(MsnNotification *notification, const char *host, int port)
f2f97738b401 [gaim-migrate @ 11737]
Felipe Contreras <felipe.contreras@gmail.com>
parents: 10452
diff changeset
127 {
f2f97738b401 [gaim-migrate @ 11737]
Felipe Contreras <felipe.contreras@gmail.com>
parents: 10452
diff changeset
128 MsnServConn *servconn;
f2f97738b401 [gaim-migrate @ 11737]
Felipe Contreras <felipe.contreras@gmail.com>
parents: 10452
diff changeset
129
f2f97738b401 [gaim-migrate @ 11737]
Felipe Contreras <felipe.contreras@gmail.com>
parents: 10452
diff changeset
130 g_return_val_if_fail(notification != NULL, FALSE);
f2f97738b401 [gaim-migrate @ 11737]
Felipe Contreras <felipe.contreras@gmail.com>
parents: 10452
diff changeset
131
f2f97738b401 [gaim-migrate @ 11737]
Felipe Contreras <felipe.contreras@gmail.com>
parents: 10452
diff changeset
132 servconn = notification->servconn;
f2f97738b401 [gaim-migrate @ 11737]
Felipe Contreras <felipe.contreras@gmail.com>
parents: 10452
diff changeset
133
f2f97738b401 [gaim-migrate @ 11737]
Felipe Contreras <felipe.contreras@gmail.com>
parents: 10452
diff changeset
134 msn_servconn_set_connect_cb(servconn, connect_cb);
23816
fd601d075bd0 Allow forcing an MSN HTTP connection to connect to a new server. This
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 23814
diff changeset
135 notification->in_use = msn_servconn_connect(servconn, host, port, TRUE);
10463
f2f97738b401 [gaim-migrate @ 11737]
Felipe Contreras <felipe.contreras@gmail.com>
parents: 10452
diff changeset
136
f2f97738b401 [gaim-migrate @ 11737]
Felipe Contreras <felipe.contreras@gmail.com>
parents: 10452
diff changeset
137 return notification->in_use;
f2f97738b401 [gaim-migrate @ 11737]
Felipe Contreras <felipe.contreras@gmail.com>
parents: 10452
diff changeset
138 }
f2f97738b401 [gaim-migrate @ 11737]
Felipe Contreras <felipe.contreras@gmail.com>
parents: 10452
diff changeset
139
f2f97738b401 [gaim-migrate @ 11737]
Felipe Contreras <felipe.contreras@gmail.com>
parents: 10452
diff changeset
140 void
f2f97738b401 [gaim-migrate @ 11737]
Felipe Contreras <felipe.contreras@gmail.com>
parents: 10452
diff changeset
141 msn_notification_disconnect(MsnNotification *notification)
f2f97738b401 [gaim-migrate @ 11737]
Felipe Contreras <felipe.contreras@gmail.com>
parents: 10452
diff changeset
142 {
f2f97738b401 [gaim-migrate @ 11737]
Felipe Contreras <felipe.contreras@gmail.com>
parents: 10452
diff changeset
143 g_return_if_fail(notification != NULL);
f2f97738b401 [gaim-migrate @ 11737]
Felipe Contreras <felipe.contreras@gmail.com>
parents: 10452
diff changeset
144 g_return_if_fail(notification->in_use);
f2f97738b401 [gaim-migrate @ 11737]
Felipe Contreras <felipe.contreras@gmail.com>
parents: 10452
diff changeset
145
f2f97738b401 [gaim-migrate @ 11737]
Felipe Contreras <felipe.contreras@gmail.com>
parents: 10452
diff changeset
146 msn_servconn_disconnect(notification->servconn);
f2f97738b401 [gaim-migrate @ 11737]
Felipe Contreras <felipe.contreras@gmail.com>
parents: 10452
diff changeset
147
f2f97738b401 [gaim-migrate @ 11737]
Felipe Contreras <felipe.contreras@gmail.com>
parents: 10452
diff changeset
148 notification->in_use = FALSE;
f2f97738b401 [gaim-migrate @ 11737]
Felipe Contreras <felipe.contreras@gmail.com>
parents: 10452
diff changeset
149 }
f2f97738b401 [gaim-migrate @ 11737]
Felipe Contreras <felipe.contreras@gmail.com>
parents: 10452
diff changeset
150
f2f97738b401 [gaim-migrate @ 11737]
Felipe Contreras <felipe.contreras@gmail.com>
parents: 10452
diff changeset
151 /**************************************************************************
10451
2df35a139363 [gaim-migrate @ 11717]
Felipe Contreras <felipe.contreras@gmail.com>
parents: 10403
diff changeset
152 * Util
2df35a139363 [gaim-migrate @ 11717]
Felipe Contreras <felipe.contreras@gmail.com>
parents: 10403
diff changeset
153 **************************************************************************/
10481
a5d6b8e1717d [gaim-migrate @ 11769]
Felipe Contreras <felipe.contreras@gmail.com>
parents: 10463
diff changeset
154
10451
2df35a139363 [gaim-migrate @ 11717]
Felipe Contreras <felipe.contreras@gmail.com>
parents: 10403
diff changeset
155 static void
13870
258d48d6ab52 [gaim-migrate @ 16737]
Ma Yuan <mayuan2006@gmail.com>
parents: 13869
diff changeset
156 group_error_helper(MsnSession *session, const char *msg, const char *group_id, int error)
10451
2df35a139363 [gaim-migrate @ 11717]
Felipe Contreras <felipe.contreras@gmail.com>
parents: 10403
diff changeset
157 {
15884
4de1981757fc sed -ie 's/gaim/purple/g'
Sean Egan <seanegan@pidgin.im>
parents: 15435
diff changeset
158 PurpleAccount *account;
4de1981757fc sed -ie 's/gaim/purple/g'
Sean Egan <seanegan@pidgin.im>
parents: 15435
diff changeset
159 PurpleConnection *gc;
10451
2df35a139363 [gaim-migrate @ 11717]
Felipe Contreras <felipe.contreras@gmail.com>
parents: 10403
diff changeset
160 char *reason = NULL;
2df35a139363 [gaim-migrate @ 11717]
Felipe Contreras <felipe.contreras@gmail.com>
parents: 10403
diff changeset
161 char *title = NULL;
2df35a139363 [gaim-migrate @ 11717]
Felipe Contreras <felipe.contreras@gmail.com>
parents: 10403
diff changeset
162
2df35a139363 [gaim-migrate @ 11717]
Felipe Contreras <felipe.contreras@gmail.com>
parents: 10403
diff changeset
163 account = session->account;
15884
4de1981757fc sed -ie 's/gaim/purple/g'
Sean Egan <seanegan@pidgin.im>
parents: 15435
diff changeset
164 gc = purple_account_get_connection(account);
10451
2df35a139363 [gaim-migrate @ 11717]
Felipe Contreras <felipe.contreras@gmail.com>
parents: 10403
diff changeset
165
2df35a139363 [gaim-migrate @ 11717]
Felipe Contreras <felipe.contreras@gmail.com>
parents: 10403
diff changeset
166 if (error == 224)
2df35a139363 [gaim-migrate @ 11717]
Felipe Contreras <felipe.contreras@gmail.com>
parents: 10403
diff changeset
167 {
2df35a139363 [gaim-migrate @ 11717]
Felipe Contreras <felipe.contreras@gmail.com>
parents: 10403
diff changeset
168 if (group_id == 0)
2df35a139363 [gaim-migrate @ 11717]
Felipe Contreras <felipe.contreras@gmail.com>
parents: 10403
diff changeset
169 {
2df35a139363 [gaim-migrate @ 11717]
Felipe Contreras <felipe.contreras@gmail.com>
parents: 10403
diff changeset
170 return;
2df35a139363 [gaim-migrate @ 11717]
Felipe Contreras <felipe.contreras@gmail.com>
parents: 10403
diff changeset
171 }
2df35a139363 [gaim-migrate @ 11717]
Felipe Contreras <felipe.contreras@gmail.com>
parents: 10403
diff changeset
172 else
2df35a139363 [gaim-migrate @ 11717]
Felipe Contreras <felipe.contreras@gmail.com>
parents: 10403
diff changeset
173 {
2df35a139363 [gaim-migrate @ 11717]
Felipe Contreras <felipe.contreras@gmail.com>
parents: 10403
diff changeset
174 const char *group_name;
13855
24cff9e060d7 [gaim-migrate @ 16507]
Ma Yuan <mayuan2006@gmail.com>
parents: 13854
diff changeset
175 group_name = msn_userlist_find_group_name(session->userlist,group_id);
10451
2df35a139363 [gaim-migrate @ 11717]
Felipe Contreras <felipe.contreras@gmail.com>
parents: 10403
diff changeset
176 reason = g_strdup_printf(_("%s is not a valid group."),
20733
a179242f6bef Further cleanup of the msn prpl including preventing the authorization request callback from crashing if triggered after the account is disconnected. Also removal of some extraneous debuggery, there is more that needs to be removed.
Daniel Atallah <datallah@pidgin.im>
parents: 20597
diff changeset
177 group_name ? group_name : "");
10451
2df35a139363 [gaim-migrate @ 11717]
Felipe Contreras <felipe.contreras@gmail.com>
parents: 10403
diff changeset
178 }
2df35a139363 [gaim-migrate @ 11717]
Felipe Contreras <felipe.contreras@gmail.com>
parents: 10403
diff changeset
179 }
2df35a139363 [gaim-migrate @ 11717]
Felipe Contreras <felipe.contreras@gmail.com>
parents: 10403
diff changeset
180 else
2df35a139363 [gaim-migrate @ 11717]
Felipe Contreras <felipe.contreras@gmail.com>
parents: 10403
diff changeset
181 {
2df35a139363 [gaim-migrate @ 11717]
Felipe Contreras <felipe.contreras@gmail.com>
parents: 10403
diff changeset
182 reason = g_strdup(_("Unknown error."));
2df35a139363 [gaim-migrate @ 11717]
Felipe Contreras <felipe.contreras@gmail.com>
parents: 10403
diff changeset
183 }
2df35a139363 [gaim-migrate @ 11717]
Felipe Contreras <felipe.contreras@gmail.com>
parents: 10403
diff changeset
184
2df35a139363 [gaim-migrate @ 11717]
Felipe Contreras <felipe.contreras@gmail.com>
parents: 10403
diff changeset
185 title = g_strdup_printf(_("%s on %s (%s)"), msg,
15884
4de1981757fc sed -ie 's/gaim/purple/g'
Sean Egan <seanegan@pidgin.im>
parents: 15435
diff changeset
186 purple_account_get_username(account),
4de1981757fc sed -ie 's/gaim/purple/g'
Sean Egan <seanegan@pidgin.im>
parents: 15435
diff changeset
187 purple_account_get_protocol_name(account));
4de1981757fc sed -ie 's/gaim/purple/g'
Sean Egan <seanegan@pidgin.im>
parents: 15435
diff changeset
188 purple_notify_error(gc, NULL, title, reason);
10451
2df35a139363 [gaim-migrate @ 11717]
Felipe Contreras <felipe.contreras@gmail.com>
parents: 10403
diff changeset
189 g_free(title);
2df35a139363 [gaim-migrate @ 11717]
Felipe Contreras <felipe.contreras@gmail.com>
parents: 10403
diff changeset
190 g_free(reason);
2df35a139363 [gaim-migrate @ 11717]
Felipe Contreras <felipe.contreras@gmail.com>
parents: 10403
diff changeset
191 }
2df35a139363 [gaim-migrate @ 11717]
Felipe Contreras <felipe.contreras@gmail.com>
parents: 10403
diff changeset
192
2df35a139363 [gaim-migrate @ 11717]
Felipe Contreras <felipe.contreras@gmail.com>
parents: 10403
diff changeset
193 /**************************************************************************
5309
3178acad1449 [gaim-migrate @ 5681]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
194 * Login
3178acad1449 [gaim-migrate @ 5681]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
195 **************************************************************************/
10481
a5d6b8e1717d [gaim-migrate @ 11769]
Felipe Contreras <felipe.contreras@gmail.com>
parents: 10463
diff changeset
196
9193
6e76f1367896 [gaim-migrate @ 9988]
Felipe Contreras <felipe.contreras@gmail.com>
parents: 9158
diff changeset
197 void
23756
1569608cab71 Patch 2 from Qulogic, this one adds SSO authentication
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 23755
diff changeset
198 msn_got_login_params(MsnSession *session, const char *ticket, const char *response)
9193
6e76f1367896 [gaim-migrate @ 9988]
Felipe Contreras <felipe.contreras@gmail.com>
parents: 9158
diff changeset
199 {
6e76f1367896 [gaim-migrate @ 9988]
Felipe Contreras <felipe.contreras@gmail.com>
parents: 9158
diff changeset
200 MsnCmdProc *cmdproc;
6e76f1367896 [gaim-migrate @ 9988]
Felipe Contreras <felipe.contreras@gmail.com>
parents: 9158
diff changeset
201
6e76f1367896 [gaim-migrate @ 9988]
Felipe Contreras <felipe.contreras@gmail.com>
parents: 9158
diff changeset
202 cmdproc = session->notification->cmdproc;
6e76f1367896 [gaim-migrate @ 9988]
Felipe Contreras <felipe.contreras@gmail.com>
parents: 9158
diff changeset
203
10519
80801a34a246 [gaim-migrate @ 11833]
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 10514
diff changeset
204 msn_session_set_login_step(session, MSN_LOGIN_STEP_AUTH_END);
10481
a5d6b8e1717d [gaim-migrate @ 11769]
Felipe Contreras <felipe.contreras@gmail.com>
parents: 10463
diff changeset
205
23756
1569608cab71 Patch 2 from Qulogic, this one adds SSO authentication
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 23755
diff changeset
206 msn_cmdproc_send(cmdproc, "USR", "SSO S %s %s", ticket, response);
9193
6e76f1367896 [gaim-migrate @ 9988]
Felipe Contreras <felipe.contreras@gmail.com>
parents: 9158
diff changeset
207 }
6e76f1367896 [gaim-migrate @ 9988]
Felipe Contreras <felipe.contreras@gmail.com>
parents: 9158
diff changeset
208
8808
1cb5ddf6b625 [gaim-migrate @ 9570]
Felipe Contreras <felipe.contreras@gmail.com>
parents: 8669
diff changeset
209 static void
1cb5ddf6b625 [gaim-migrate @ 9570]
Felipe Contreras <felipe.contreras@gmail.com>
parents: 8669
diff changeset
210 cvr_cmd(MsnCmdProc *cmdproc, MsnCommand *cmd)
5309
3178acad1449 [gaim-migrate @ 5681]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
211 {
15884
4de1981757fc sed -ie 's/gaim/purple/g'
Sean Egan <seanegan@pidgin.im>
parents: 15435
diff changeset
212 PurpleAccount *account;
5309
3178acad1449 [gaim-migrate @ 5681]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
213
8808
1cb5ddf6b625 [gaim-migrate @ 9570]
Felipe Contreras <felipe.contreras@gmail.com>
parents: 8669
diff changeset
214 account = cmdproc->session->account;
23756
1569608cab71 Patch 2 from Qulogic, this one adds SSO authentication
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 23755
diff changeset
215
1569608cab71 Patch 2 from Qulogic, this one adds SSO authentication
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 23755
diff changeset
216 msn_cmdproc_send(cmdproc, "USR", "SSO I %s", purple_account_get_username(account));
5309
3178acad1449 [gaim-migrate @ 5681]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
217 }
3178acad1449 [gaim-migrate @ 5681]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
218
8808
1cb5ddf6b625 [gaim-migrate @ 9570]
Felipe Contreras <felipe.contreras@gmail.com>
parents: 8669
diff changeset
219 static void
1cb5ddf6b625 [gaim-migrate @ 9570]
Felipe Contreras <felipe.contreras@gmail.com>
parents: 8669
diff changeset
220 usr_cmd(MsnCmdProc *cmdproc, MsnCommand *cmd)
5309
3178acad1449 [gaim-migrate @ 5681]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
221 {
8808
1cb5ddf6b625 [gaim-migrate @ 9570]
Felipe Contreras <felipe.contreras@gmail.com>
parents: 8669
diff changeset
222 MsnSession *session;
15884
4de1981757fc sed -ie 's/gaim/purple/g'
Sean Egan <seanegan@pidgin.im>
parents: 15435
diff changeset
223 PurpleAccount *account;
5309
3178acad1449 [gaim-migrate @ 5681]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
224
8808
1cb5ddf6b625 [gaim-migrate @ 9570]
Felipe Contreras <felipe.contreras@gmail.com>
parents: 8669
diff changeset
225 session = cmdproc->session;
1cb5ddf6b625 [gaim-migrate @ 9570]
Felipe Contreras <felipe.contreras@gmail.com>
parents: 8669
diff changeset
226 account = session->account;
1cb5ddf6b625 [gaim-migrate @ 9570]
Felipe Contreras <felipe.contreras@gmail.com>
parents: 8669
diff changeset
227
1cb5ddf6b625 [gaim-migrate @ 9570]
Felipe Contreras <felipe.contreras@gmail.com>
parents: 8669
diff changeset
228 if (!g_ascii_strcasecmp(cmd->params[1], "OK"))
6701
7e2db9273748 [gaim-migrate @ 7227]
Christian Hammond <chipx86@chipx86.com>
parents: 6695
diff changeset
229 {
13853
cccd9dd599eb [gaim-migrate @ 16329]
Ma Yuan <mayuan2006@gmail.com>
parents: 13713
diff changeset
230 /* authenticate OK */
10519
80801a34a246 [gaim-migrate @ 11833]
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 10514
diff changeset
231 msn_session_set_login_step(session, MSN_LOGIN_STEP_SYN);
5309
3178acad1449 [gaim-migrate @ 5681]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
232 }
23756
1569608cab71 Patch 2 from Qulogic, this one adds SSO authentication
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 23755
diff changeset
233 else if (!g_ascii_strcasecmp(cmd->params[1], "SSO"))
6701
7e2db9273748 [gaim-migrate @ 7227]
Christian Hammond <chipx86@chipx86.com>
parents: 6695
diff changeset
234 {
23756
1569608cab71 Patch 2 from Qulogic, this one adds SSO authentication
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 23755
diff changeset
235 /* RPS authentication */
6701
7e2db9273748 [gaim-migrate @ 7227]
Christian Hammond <chipx86@chipx86.com>
parents: 6695
diff changeset
236
8171
c3c43a25caec [gaim-migrate @ 8884]
Felipe Contreras <felipe.contreras@gmail.com>
parents: 8029
diff changeset
237 session->nexus = msn_nexus_new(session);
6701
7e2db9273748 [gaim-migrate @ 7227]
Christian Hammond <chipx86@chipx86.com>
parents: 6695
diff changeset
238
23756
1569608cab71 Patch 2 from Qulogic, this one adds SSO authentication
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 23755
diff changeset
239 session->nexus->policy = g_strdup(cmd->params[3]);
1569608cab71 Patch 2 from Qulogic, this one adds SSO authentication
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 23755
diff changeset
240 session->nexus->nonce = g_strdup(cmd->params[4]);
6701
7e2db9273748 [gaim-migrate @ 7227]
Christian Hammond <chipx86@chipx86.com>
parents: 6695
diff changeset
241
10519
80801a34a246 [gaim-migrate @ 11833]
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 10514
diff changeset
242 msn_session_set_login_step(session, MSN_LOGIN_STEP_AUTH_START);
5309
3178acad1449 [gaim-migrate @ 5681]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
243
10481
a5d6b8e1717d [gaim-migrate @ 11769]
Felipe Contreras <felipe.contreras@gmail.com>
parents: 10463
diff changeset
244 msn_nexus_connect(session->nexus);
5309
3178acad1449 [gaim-migrate @ 5681]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
245 }
3178acad1449 [gaim-migrate @ 5681]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
246 }
3178acad1449 [gaim-migrate @ 5681]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
247
8808
1cb5ddf6b625 [gaim-migrate @ 9570]
Felipe Contreras <felipe.contreras@gmail.com>
parents: 8669
diff changeset
248 static void
10568
15f02c0e7fc1 [gaim-migrate @ 11954]
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 10519
diff changeset
249 usr_error(MsnCmdProc *cmdproc, MsnTransaction *trans, int error)
15f02c0e7fc1 [gaim-migrate @ 11954]
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 10519
diff changeset
250 {
15f02c0e7fc1 [gaim-migrate @ 11954]
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 10519
diff changeset
251 MsnErrorType msnerr = 0;
15f02c0e7fc1 [gaim-migrate @ 11954]
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 10519
diff changeset
252
15f02c0e7fc1 [gaim-migrate @ 11954]
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 10519
diff changeset
253 switch (error)
15f02c0e7fc1 [gaim-migrate @ 11954]
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 10519
diff changeset
254 {
15f02c0e7fc1 [gaim-migrate @ 11954]
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 10519
diff changeset
255 case 500:
15f02c0e7fc1 [gaim-migrate @ 11954]
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 10519
diff changeset
256 case 601:
15f02c0e7fc1 [gaim-migrate @ 11954]
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 10519
diff changeset
257 case 910:
15f02c0e7fc1 [gaim-migrate @ 11954]
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 10519
diff changeset
258 case 921:
15f02c0e7fc1 [gaim-migrate @ 11954]
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 10519
diff changeset
259 msnerr = MSN_ERROR_SERV_UNAVAILABLE;
15f02c0e7fc1 [gaim-migrate @ 11954]
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 10519
diff changeset
260 break;
15f02c0e7fc1 [gaim-migrate @ 11954]
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 10519
diff changeset
261 case 911:
15f02c0e7fc1 [gaim-migrate @ 11954]
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 10519
diff changeset
262 msnerr = MSN_ERROR_AUTH;
15f02c0e7fc1 [gaim-migrate @ 11954]
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 10519
diff changeset
263 break;
15f02c0e7fc1 [gaim-migrate @ 11954]
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 10519
diff changeset
264 default:
15f02c0e7fc1 [gaim-migrate @ 11954]
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 10519
diff changeset
265 return;
15f02c0e7fc1 [gaim-migrate @ 11954]
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 10519
diff changeset
266 break;
15f02c0e7fc1 [gaim-migrate @ 11954]
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 10519
diff changeset
267 }
15f02c0e7fc1 [gaim-migrate @ 11954]
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 10519
diff changeset
268
15f02c0e7fc1 [gaim-migrate @ 11954]
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 10519
diff changeset
269 msn_session_set_error(cmdproc->session, msnerr, NULL);
15f02c0e7fc1 [gaim-migrate @ 11954]
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 10519
diff changeset
270 }
15f02c0e7fc1 [gaim-migrate @ 11954]
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 10519
diff changeset
271
15f02c0e7fc1 [gaim-migrate @ 11954]
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 10519
diff changeset
272 static void
8808
1cb5ddf6b625 [gaim-migrate @ 9570]
Felipe Contreras <felipe.contreras@gmail.com>
parents: 8669
diff changeset
273 ver_cmd(MsnCmdProc *cmdproc, MsnCommand *cmd)
6701
7e2db9273748 [gaim-migrate @ 7227]
Christian Hammond <chipx86@chipx86.com>
parents: 6695
diff changeset
274 {
8808
1cb5ddf6b625 [gaim-migrate @ 9570]
Felipe Contreras <felipe.contreras@gmail.com>
parents: 8669
diff changeset
275 MsnSession *session;
15884
4de1981757fc sed -ie 's/gaim/purple/g'
Sean Egan <seanegan@pidgin.im>
parents: 15435
diff changeset
276 PurpleAccount *account;
6701
7e2db9273748 [gaim-migrate @ 7227]
Christian Hammond <chipx86@chipx86.com>
parents: 6695
diff changeset
277 gboolean protocol_supported = FALSE;
7e2db9273748 [gaim-migrate @ 7227]
Christian Hammond <chipx86@chipx86.com>
parents: 6695
diff changeset
278 char proto_str[8];
7e2db9273748 [gaim-migrate @ 7227]
Christian Hammond <chipx86@chipx86.com>
parents: 6695
diff changeset
279 size_t i;
7e2db9273748 [gaim-migrate @ 7227]
Christian Hammond <chipx86@chipx86.com>
parents: 6695
diff changeset
280
8808
1cb5ddf6b625 [gaim-migrate @ 9570]
Felipe Contreras <felipe.contreras@gmail.com>
parents: 8669
diff changeset
281 session = cmdproc->session;
1cb5ddf6b625 [gaim-migrate @ 9570]
Felipe Contreras <felipe.contreras@gmail.com>
parents: 8669
diff changeset
282 account = session->account;
1cb5ddf6b625 [gaim-migrate @ 9570]
Felipe Contreras <felipe.contreras@gmail.com>
parents: 8669
diff changeset
283
6701
7e2db9273748 [gaim-migrate @ 7227]
Christian Hammond <chipx86@chipx86.com>
parents: 6695
diff changeset
284 g_snprintf(proto_str, sizeof(proto_str), "MSNP%d", session->protocol_ver);
7e2db9273748 [gaim-migrate @ 7227]
Christian Hammond <chipx86@chipx86.com>
parents: 6695
diff changeset
285
8808
1cb5ddf6b625 [gaim-migrate @ 9570]
Felipe Contreras <felipe.contreras@gmail.com>
parents: 8669
diff changeset
286 for (i = 1; i < cmd->param_count; i++)
6701
7e2db9273748 [gaim-migrate @ 7227]
Christian Hammond <chipx86@chipx86.com>
parents: 6695
diff changeset
287 {
8808
1cb5ddf6b625 [gaim-migrate @ 9570]
Felipe Contreras <felipe.contreras@gmail.com>
parents: 8669
diff changeset
288 if (!strcmp(cmd->params[i], proto_str))
6701
7e2db9273748 [gaim-migrate @ 7227]
Christian Hammond <chipx86@chipx86.com>
parents: 6695
diff changeset
289 {
7e2db9273748 [gaim-migrate @ 7227]
Christian Hammond <chipx86@chipx86.com>
parents: 6695
diff changeset
290 protocol_supported = TRUE;
7e2db9273748 [gaim-migrate @ 7227]
Christian Hammond <chipx86@chipx86.com>
parents: 6695
diff changeset
291 break;
7e2db9273748 [gaim-migrate @ 7227]
Christian Hammond <chipx86@chipx86.com>
parents: 6695
diff changeset
292 }
7e2db9273748 [gaim-migrate @ 7227]
Christian Hammond <chipx86@chipx86.com>
parents: 6695
diff changeset
293 }
7e2db9273748 [gaim-migrate @ 7227]
Christian Hammond <chipx86@chipx86.com>
parents: 6695
diff changeset
294
8808
1cb5ddf6b625 [gaim-migrate @ 9570]
Felipe Contreras <felipe.contreras@gmail.com>
parents: 8669
diff changeset
295 if (!protocol_supported)
1cb5ddf6b625 [gaim-migrate @ 9570]
Felipe Contreras <felipe.contreras@gmail.com>
parents: 8669
diff changeset
296 {
10519
80801a34a246 [gaim-migrate @ 11833]
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 10514
diff changeset
297 msn_session_set_error(session, MSN_ERROR_UNSUPPORTED_PROTOCOL,
10481
a5d6b8e1717d [gaim-migrate @ 11769]
Felipe Contreras <felipe.contreras@gmail.com>
parents: 10463
diff changeset
298 NULL);
8808
1cb5ddf6b625 [gaim-migrate @ 9570]
Felipe Contreras <felipe.contreras@gmail.com>
parents: 8669
diff changeset
299 return;
6701
7e2db9273748 [gaim-migrate @ 7227]
Christian Hammond <chipx86@chipx86.com>
parents: 6695
diff changeset
300 }
7e2db9273748 [gaim-migrate @ 7227]
Christian Hammond <chipx86@chipx86.com>
parents: 6695
diff changeset
301
13853
cccd9dd599eb [gaim-migrate @ 16329]
Ma Yuan <mayuan2006@gmail.com>
parents: 13713
diff changeset
302 /*
23776
7c9016406cf1 explicit merge of 'b99873683821d4c450ce32e4a93ba2831d7507cc'
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 23444 23773
diff changeset
303 * Windows Live Messenger 8.5
13853
cccd9dd599eb [gaim-migrate @ 16329]
Ma Yuan <mayuan2006@gmail.com>
parents: 13713
diff changeset
304 * Notice :CVR String discriminate!
13856
a6511183749e [gaim-migrate @ 16546]
Ma Yuan <mayuan2006@gmail.com>
parents: 13855
diff changeset
305 * reference of http://www.microsoft.com/globaldev/reference/oslocversion.mspx
a6511183749e [gaim-migrate @ 16546]
Ma Yuan <mayuan2006@gmail.com>
parents: 13855
diff changeset
306 * to see the Local ID
13853
cccd9dd599eb [gaim-migrate @ 16329]
Ma Yuan <mayuan2006@gmail.com>
parents: 13713
diff changeset
307 */
9193
6e76f1367896 [gaim-migrate @ 9988]
Felipe Contreras <felipe.contreras@gmail.com>
parents: 9158
diff changeset
308 msn_cmdproc_send(cmdproc, "CVR",
24405
426c92d923a3 Update MSN Client Version (CVR) string to match 8.5.1302.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 24404
diff changeset
309 "0x0409 winnt 5.1 i386 MSNMSGR 8.5.1302 BC01 %s",
15884
4de1981757fc sed -ie 's/gaim/purple/g'
Sean Egan <seanegan@pidgin.im>
parents: 15435
diff changeset
310 purple_account_get_username(account));
6701
7e2db9273748 [gaim-migrate @ 7227]
Christian Hammond <chipx86@chipx86.com>
parents: 6695
diff changeset
311 }
7e2db9273748 [gaim-migrate @ 7227]
Christian Hammond <chipx86@chipx86.com>
parents: 6695
diff changeset
312
5309
3178acad1449 [gaim-migrate @ 5681]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
313 /**************************************************************************
3178acad1449 [gaim-migrate @ 5681]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
314 * Log out
3178acad1449 [gaim-migrate @ 5681]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
315 **************************************************************************/
10481
a5d6b8e1717d [gaim-migrate @ 11769]
Felipe Contreras <felipe.contreras@gmail.com>
parents: 10463
diff changeset
316
8808
1cb5ddf6b625 [gaim-migrate @ 9570]
Felipe Contreras <felipe.contreras@gmail.com>
parents: 8669
diff changeset
317 static void
1cb5ddf6b625 [gaim-migrate @ 9570]
Felipe Contreras <felipe.contreras@gmail.com>
parents: 8669
diff changeset
318 out_cmd(MsnCmdProc *cmdproc, MsnCommand *cmd)
5309
3178acad1449 [gaim-migrate @ 5681]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
319 {
23824
6dc2d641cfae When receiving an MSN OUT, don't try to dereference cmd->params when
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 23816
diff changeset
320 if (cmd->param_count == 0)
6dc2d641cfae When receiving an MSN OUT, don't try to dereference cmd->params when
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 23816
diff changeset
321 msn_session_set_error(cmdproc->session, -1, NULL);
6dc2d641cfae When receiving an MSN OUT, don't try to dereference cmd->params when
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 23816
diff changeset
322 else if (!g_ascii_strcasecmp(cmd->params[0], "OTH"))
10481
a5d6b8e1717d [gaim-migrate @ 11769]
Felipe Contreras <felipe.contreras@gmail.com>
parents: 10463
diff changeset
323 msn_session_set_error(cmdproc->session, MSN_ERROR_SIGN_OTHER,
a5d6b8e1717d [gaim-migrate @ 11769]
Felipe Contreras <felipe.contreras@gmail.com>
parents: 10463
diff changeset
324 NULL);
8808
1cb5ddf6b625 [gaim-migrate @ 9570]
Felipe Contreras <felipe.contreras@gmail.com>
parents: 8669
diff changeset
325 else if (!g_ascii_strcasecmp(cmd->params[0], "SSD"))
10481
a5d6b8e1717d [gaim-migrate @ 11769]
Felipe Contreras <felipe.contreras@gmail.com>
parents: 10463
diff changeset
326 msn_session_set_error(cmdproc->session, MSN_ERROR_SERV_DOWN, NULL);
5309
3178acad1449 [gaim-migrate @ 5681]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
327 }
3178acad1449 [gaim-migrate @ 5681]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
328
10463
f2f97738b401 [gaim-migrate @ 11737]
Felipe Contreras <felipe.contreras@gmail.com>
parents: 10452
diff changeset
329 void
f2f97738b401 [gaim-migrate @ 11737]
Felipe Contreras <felipe.contreras@gmail.com>
parents: 10452
diff changeset
330 msn_notification_close(MsnNotification *notification)
f2f97738b401 [gaim-migrate @ 11737]
Felipe Contreras <felipe.contreras@gmail.com>
parents: 10452
diff changeset
331 {
f2f97738b401 [gaim-migrate @ 11737]
Felipe Contreras <felipe.contreras@gmail.com>
parents: 10452
diff changeset
332 g_return_if_fail(notification != NULL);
f2f97738b401 [gaim-migrate @ 11737]
Felipe Contreras <felipe.contreras@gmail.com>
parents: 10452
diff changeset
333
10568
15f02c0e7fc1 [gaim-migrate @ 11954]
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 10519
diff changeset
334 if (!notification->in_use)
15f02c0e7fc1 [gaim-migrate @ 11954]
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 10519
diff changeset
335 return;
15f02c0e7fc1 [gaim-migrate @ 11954]
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 10519
diff changeset
336
10463
f2f97738b401 [gaim-migrate @ 11737]
Felipe Contreras <felipe.contreras@gmail.com>
parents: 10452
diff changeset
337 msn_cmdproc_send_quick(notification->cmdproc, "OUT", NULL, NULL);
f2f97738b401 [gaim-migrate @ 11737]
Felipe Contreras <felipe.contreras@gmail.com>
parents: 10452
diff changeset
338
f2f97738b401 [gaim-migrate @ 11737]
Felipe Contreras <felipe.contreras@gmail.com>
parents: 10452
diff changeset
339 msn_notification_disconnect(notification);
f2f97738b401 [gaim-migrate @ 11737]
Felipe Contreras <felipe.contreras@gmail.com>
parents: 10452
diff changeset
340 }
f2f97738b401 [gaim-migrate @ 11737]
Felipe Contreras <felipe.contreras@gmail.com>
parents: 10452
diff changeset
341
5309
3178acad1449 [gaim-migrate @ 5681]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
342 /**************************************************************************
3178acad1449 [gaim-migrate @ 5681]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
343 * Messages
3178acad1449 [gaim-migrate @ 5681]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
344 **************************************************************************/
10481
a5d6b8e1717d [gaim-migrate @ 11769]
Felipe Contreras <felipe.contreras@gmail.com>
parents: 10463
diff changeset
345
8646
74d0e7406e3b [gaim-migrate @ 9398]
Felipe Contreras <felipe.contreras@gmail.com>
parents: 8614
diff changeset
346 static void
9193
6e76f1367896 [gaim-migrate @ 9988]
Felipe Contreras <felipe.contreras@gmail.com>
parents: 9158
diff changeset
347 msg_cmd_post(MsnCmdProc *cmdproc, MsnCommand *cmd, char *payload,
6e76f1367896 [gaim-migrate @ 9988]
Felipe Contreras <felipe.contreras@gmail.com>
parents: 9158
diff changeset
348 size_t len)
8646
74d0e7406e3b [gaim-migrate @ 9398]
Felipe Contreras <felipe.contreras@gmail.com>
parents: 8614
diff changeset
349 {
8808
1cb5ddf6b625 [gaim-migrate @ 9570]
Felipe Contreras <felipe.contreras@gmail.com>
parents: 8669
diff changeset
350 MsnMessage *msg;
8646
74d0e7406e3b [gaim-migrate @ 9398]
Felipe Contreras <felipe.contreras@gmail.com>
parents: 8614
diff changeset
351
9193
6e76f1367896 [gaim-migrate @ 9988]
Felipe Contreras <felipe.contreras@gmail.com>
parents: 9158
diff changeset
352 msg = msn_message_new_from_cmd(cmdproc->session, cmd);
8646
74d0e7406e3b [gaim-migrate @ 9398]
Felipe Contreras <felipe.contreras@gmail.com>
parents: 8614
diff changeset
353
23814
a35ff14f5fa7 Remove some MSN code duplication in processing messages from Yahoo
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 23810
diff changeset
354 msn_message_parse_payload(msg, payload, len, MSG_LINE_DEM, MSG_BODY_DEM);
11321
a93121c0ea16 [gaim-migrate @ 13525]
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 11183
diff changeset
355 #ifdef MSN_DEBUG_NS
a93121c0ea16 [gaim-migrate @ 13525]
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 11183
diff changeset
356 msn_message_show_readable(msg, "Notification", TRUE);
a93121c0ea16 [gaim-migrate @ 13525]
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 11183
diff changeset
357 #endif
8646
74d0e7406e3b [gaim-migrate @ 9398]
Felipe Contreras <felipe.contreras@gmail.com>
parents: 8614
diff changeset
358
8808
1cb5ddf6b625 [gaim-migrate @ 9570]
Felipe Contreras <felipe.contreras@gmail.com>
parents: 8669
diff changeset
359 msn_cmdproc_process_msg(cmdproc, msg);
8646
74d0e7406e3b [gaim-migrate @ 9398]
Felipe Contreras <felipe.contreras@gmail.com>
parents: 8614
diff changeset
360
74d0e7406e3b [gaim-migrate @ 9398]
Felipe Contreras <felipe.contreras@gmail.com>
parents: 8614
diff changeset
361 msn_message_destroy(msg);
74d0e7406e3b [gaim-migrate @ 9398]
Felipe Contreras <felipe.contreras@gmail.com>
parents: 8614
diff changeset
362 }
74d0e7406e3b [gaim-migrate @ 9398]
Felipe Contreras <felipe.contreras@gmail.com>
parents: 8614
diff changeset
363
8808
1cb5ddf6b625 [gaim-migrate @ 9570]
Felipe Contreras <felipe.contreras@gmail.com>
parents: 8669
diff changeset
364 static void
1cb5ddf6b625 [gaim-migrate @ 9570]
Felipe Contreras <felipe.contreras@gmail.com>
parents: 8669
diff changeset
365 msg_cmd(MsnCmdProc *cmdproc, MsnCommand *cmd)
5309
3178acad1449 [gaim-migrate @ 5681]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
366 {
23830
1436e3de5d6c The great MSN debug message cleanup! Threw in a few whitespace fixes,
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 23828
diff changeset
367 purple_debug_info("msn", "Processing MSG... \n");
23826
3eeaac42358f Get rid of that whole msn_set_payload_len thing and correctly set the
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 23824
diff changeset
368
9193
6e76f1367896 [gaim-migrate @ 9988]
Felipe Contreras <felipe.contreras@gmail.com>
parents: 9158
diff changeset
369 /* NOTE: cmd is not always cmdproc->last_cmd, sometimes cmd is a queued
6e76f1367896 [gaim-migrate @ 9988]
Felipe Contreras <felipe.contreras@gmail.com>
parents: 9158
diff changeset
370 * command and we are processing it */
23814
a35ff14f5fa7 Remove some MSN code duplication in processing messages from Yahoo
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 23810
diff changeset
371 if (cmd->payload == NULL) {
9193
6e76f1367896 [gaim-migrate @ 9988]
Felipe Contreras <felipe.contreras@gmail.com>
parents: 9158
diff changeset
372 cmdproc->last_cmd->payload_cb = msg_cmd_post;
23826
3eeaac42358f Get rid of that whole msn_set_payload_len thing and correctly set the
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 23824
diff changeset
373 cmd->payload_len = atoi(cmd->params[2]);
23814
a35ff14f5fa7 Remove some MSN code duplication in processing messages from Yahoo
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 23810
diff changeset
374
a35ff14f5fa7 Remove some MSN code duplication in processing messages from Yahoo
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 23810
diff changeset
375 } else {
9193
6e76f1367896 [gaim-migrate @ 9988]
Felipe Contreras <felipe.contreras@gmail.com>
parents: 9158
diff changeset
376 g_return_if_fail(cmd->payload_cb != NULL);
6e76f1367896 [gaim-migrate @ 9988]
Felipe Contreras <felipe.contreras@gmail.com>
parents: 9158
diff changeset
377
22981
b83a23981419 Fix a number of leaks. As far as I can tell, MSNP14 now logs in without
Daniel Atallah <datallah@pidgin.im>
parents: 22969
diff changeset
378 #if 0 /* glib on win32 doesn't correctly support precision modifiers for a string */
23830
1436e3de5d6c The great MSN debug message cleanup! Threw in a few whitespace fixes,
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 23828
diff changeset
379 purple_debug_info("msn", "MSG payload:{%.*s}\n", cmd->payload_len, cmd->payload);
22981
b83a23981419 Fix a number of leaks. As far as I can tell, MSNP14 now logs in without
Daniel Atallah <datallah@pidgin.im>
parents: 22969
diff changeset
380 #endif
9193
6e76f1367896 [gaim-migrate @ 9988]
Felipe Contreras <felipe.contreras@gmail.com>
parents: 9158
diff changeset
381 cmd->payload_cb(cmdproc, cmd, cmd->payload, cmd->payload_len);
6e76f1367896 [gaim-migrate @ 9988]
Felipe Contreras <felipe.contreras@gmail.com>
parents: 9158
diff changeset
382 }
5309
3178acad1449 [gaim-migrate @ 5681]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
383 }
3178acad1449 [gaim-migrate @ 5681]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
384
13870
258d48d6ab52 [gaim-migrate @ 16737]
Ma Yuan <mayuan2006@gmail.com>
parents: 13869
diff changeset
385 /*send Message to Yahoo Messenger*/
258d48d6ab52 [gaim-migrate @ 16737]
Ma Yuan <mayuan2006@gmail.com>
parents: 13869
diff changeset
386 void
258d48d6ab52 [gaim-migrate @ 16737]
Ma Yuan <mayuan2006@gmail.com>
parents: 13869
diff changeset
387 uum_send_msg(MsnSession *session,MsnMessage *msg)
258d48d6ab52 [gaim-migrate @ 16737]
Ma Yuan <mayuan2006@gmail.com>
parents: 13869
diff changeset
388 {
258d48d6ab52 [gaim-migrate @ 16737]
Ma Yuan <mayuan2006@gmail.com>
parents: 13869
diff changeset
389 MsnCmdProc *cmdproc;
258d48d6ab52 [gaim-migrate @ 16737]
Ma Yuan <mayuan2006@gmail.com>
parents: 13869
diff changeset
390 MsnTransaction *trans;
258d48d6ab52 [gaim-migrate @ 16737]
Ma Yuan <mayuan2006@gmail.com>
parents: 13869
diff changeset
391 char *payload;
258d48d6ab52 [gaim-migrate @ 16737]
Ma Yuan <mayuan2006@gmail.com>
parents: 13869
diff changeset
392 gsize payload_len;
258d48d6ab52 [gaim-migrate @ 16737]
Ma Yuan <mayuan2006@gmail.com>
parents: 13869
diff changeset
393 int type;
23441
fd45c23a3eb2 Delete trailing whitespace
Mark Doliner <markdoliner@pidgin.im>
parents: 23085
diff changeset
394
13870
258d48d6ab52 [gaim-migrate @ 16737]
Ma Yuan <mayuan2006@gmail.com>
parents: 13869
diff changeset
395 cmdproc = session->notification->cmdproc;
258d48d6ab52 [gaim-migrate @ 16737]
Ma Yuan <mayuan2006@gmail.com>
parents: 13869
diff changeset
396 g_return_if_fail(msg != NULL);
258d48d6ab52 [gaim-migrate @ 16737]
Ma Yuan <mayuan2006@gmail.com>
parents: 13869
diff changeset
397 payload = msn_message_gen_payload(msg, &payload_len);
23830
1436e3de5d6c The great MSN debug message cleanup! Threw in a few whitespace fixes,
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 23828
diff changeset
398 purple_debug_info("msn",
22969
51f5e7777915 This cleans up a bunch of warnings that stem from the fact that size_t and
John Bailey <rekkanoryo@rekkanoryo.org>
parents: 22711
diff changeset
399 "send UUM, payload{%s}, strlen:%" G_GSIZE_FORMAT ", len:%" G_GSIZE_FORMAT "\n",
51f5e7777915 This cleans up a bunch of warnings that stem from the fact that size_t and
John Bailey <rekkanoryo@rekkanoryo.org>
parents: 22711
diff changeset
400 payload, strlen(payload), payload_len);
13870
258d48d6ab52 [gaim-migrate @ 16737]
Ma Yuan <mayuan2006@gmail.com>
parents: 13869
diff changeset
401 type = msg->type;
22969
51f5e7777915 This cleans up a bunch of warnings that stem from the fact that size_t and
John Bailey <rekkanoryo@rekkanoryo.org>
parents: 22711
diff changeset
402 trans = msn_transaction_new(cmdproc, "UUM", "%s 32 %d %" G_GSIZE_FORMAT,
51f5e7777915 This cleans up a bunch of warnings that stem from the fact that size_t and
John Bailey <rekkanoryo@rekkanoryo.org>
parents: 22711
diff changeset
403 msg->remote_user, type, payload_len);
13887
fa2dcbed264d [gaim-migrate @ 16979]
Ma Yuan <mayuan2006@gmail.com>
parents: 13886
diff changeset
404 msn_transaction_set_payload(trans, payload, strlen(payload));
13870
258d48d6ab52 [gaim-migrate @ 16737]
Ma Yuan <mayuan2006@gmail.com>
parents: 13869
diff changeset
405 msn_cmdproc_send_trans(cmdproc, trans);
258d48d6ab52 [gaim-migrate @ 16737]
Ma Yuan <mayuan2006@gmail.com>
parents: 13869
diff changeset
406 }
258d48d6ab52 [gaim-migrate @ 16737]
Ma Yuan <mayuan2006@gmail.com>
parents: 13869
diff changeset
407
23814
a35ff14f5fa7 Remove some MSN code duplication in processing messages from Yahoo
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 23810
diff changeset
408 #if 0
13870
258d48d6ab52 [gaim-migrate @ 16737]
Ma Yuan <mayuan2006@gmail.com>
parents: 13869
diff changeset
409 static void
258d48d6ab52 [gaim-migrate @ 16737]
Ma Yuan <mayuan2006@gmail.com>
parents: 13869
diff changeset
410 ubm_cmd_post(MsnCmdProc *cmdproc, MsnCommand *cmd, char *payload,
258d48d6ab52 [gaim-migrate @ 16737]
Ma Yuan <mayuan2006@gmail.com>
parents: 13869
diff changeset
411 size_t len)
258d48d6ab52 [gaim-migrate @ 16737]
Ma Yuan <mayuan2006@gmail.com>
parents: 13869
diff changeset
412 {
258d48d6ab52 [gaim-migrate @ 16737]
Ma Yuan <mayuan2006@gmail.com>
parents: 13869
diff changeset
413 MsnMessage *msg;
20478
46933dc62880 propagate from branch 'im.pidgin.pidgin' (head 88b7040408c88e4516c008f4eac579f98ef53e85)
Richard Laager <rlaager@pidgin.im>
parents: 20476 16124
diff changeset
414 PurpleConnection *gc;
13871
db7573a9b767 [gaim-migrate @ 16758]
Ma Yuan <mayuan2006@gmail.com>
parents: 13870
diff changeset
415 const char *passport;
db7573a9b767 [gaim-migrate @ 16758]
Ma Yuan <mayuan2006@gmail.com>
parents: 13870
diff changeset
416 const char *content_type;
13870
258d48d6ab52 [gaim-migrate @ 16737]
Ma Yuan <mayuan2006@gmail.com>
parents: 13869
diff changeset
417
23830
1436e3de5d6c The great MSN debug message cleanup! Threw in a few whitespace fixes,
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 23828
diff changeset
418 purple_debug_info("msn", "Process UBM payload:%.*s\n", (guint)len, payload);
13870
258d48d6ab52 [gaim-migrate @ 16737]
Ma Yuan <mayuan2006@gmail.com>
parents: 13869
diff changeset
419 msg = msn_message_new_from_cmd(cmdproc->session, cmd);
258d48d6ab52 [gaim-migrate @ 16737]
Ma Yuan <mayuan2006@gmail.com>
parents: 13869
diff changeset
420
13886
e1d21534ecff [gaim-migrate @ 16973]
Ma Yuan <mayuan2006@gmail.com>
parents: 13881
diff changeset
421 msn_message_parse_payload(msg, payload, len,MSG_LINE_DEM,MSG_BODY_DEM);
13870
258d48d6ab52 [gaim-migrate @ 16737]
Ma Yuan <mayuan2006@gmail.com>
parents: 13869
diff changeset
422 #ifdef MSN_DEBUG_NS
258d48d6ab52 [gaim-migrate @ 16737]
Ma Yuan <mayuan2006@gmail.com>
parents: 13869
diff changeset
423 msn_message_show_readable(msg, "Notification", TRUE);
258d48d6ab52 [gaim-migrate @ 16737]
Ma Yuan <mayuan2006@gmail.com>
parents: 13869
diff changeset
424 #endif
258d48d6ab52 [gaim-migrate @ 16737]
Ma Yuan <mayuan2006@gmail.com>
parents: 13869
diff changeset
425
13871
db7573a9b767 [gaim-migrate @ 16758]
Ma Yuan <mayuan2006@gmail.com>
parents: 13870
diff changeset
426 gc = cmdproc->session->account->gc;
db7573a9b767 [gaim-migrate @ 16758]
Ma Yuan <mayuan2006@gmail.com>
parents: 13870
diff changeset
427 passport = msg->remote_user;
db7573a9b767 [gaim-migrate @ 16758]
Ma Yuan <mayuan2006@gmail.com>
parents: 13870
diff changeset
428
db7573a9b767 [gaim-migrate @ 16758]
Ma Yuan <mayuan2006@gmail.com>
parents: 13870
diff changeset
429 content_type = msn_message_get_content_type(msg);
23830
1436e3de5d6c The great MSN debug message cleanup! Threw in a few whitespace fixes,
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 23828
diff changeset
430 purple_debug_info("msn", "type:%s\n", content_type);
13871
db7573a9b767 [gaim-migrate @ 16758]
Ma Yuan <mayuan2006@gmail.com>
parents: 13870
diff changeset
431 if(!strcmp(content_type,"text/plain")){
13870
258d48d6ab52 [gaim-migrate @ 16737]
Ma Yuan <mayuan2006@gmail.com>
parents: 13869
diff changeset
432 const char *value;
258d48d6ab52 [gaim-migrate @ 16737]
Ma Yuan <mayuan2006@gmail.com>
parents: 13869
diff changeset
433 const char *body;
258d48d6ab52 [gaim-migrate @ 16737]
Ma Yuan <mayuan2006@gmail.com>
parents: 13869
diff changeset
434 char *body_enc;
13873
3c20f5d70d1d [gaim-migrate @ 16772]
Ma Yuan <mayuan2006@gmail.com>
parents: 13871
diff changeset
435 char *body_final = NULL;
13870
258d48d6ab52 [gaim-migrate @ 16737]
Ma Yuan <mayuan2006@gmail.com>
parents: 13869
diff changeset
436 size_t body_len;
258d48d6ab52 [gaim-migrate @ 16737]
Ma Yuan <mayuan2006@gmail.com>
parents: 13869
diff changeset
437
258d48d6ab52 [gaim-migrate @ 16737]
Ma Yuan <mayuan2006@gmail.com>
parents: 13869
diff changeset
438 body = msn_message_get_bin_data(msg, &body_len);
21065
8bbf0f6700ed Fix some leaks and prevent some unnecessary allocations and frees.
Daniel Atallah <datallah@pidgin.im>
parents: 21055
diff changeset
439 body_enc = g_markup_escape_text(body, body_len);
13870
258d48d6ab52 [gaim-migrate @ 16737]
Ma Yuan <mayuan2006@gmail.com>
parents: 13869
diff changeset
440
13871
db7573a9b767 [gaim-migrate @ 16758]
Ma Yuan <mayuan2006@gmail.com>
parents: 13870
diff changeset
441 if ((value = msn_message_get_attr(msg, "X-MMS-IM-Format")) != NULL) {
db7573a9b767 [gaim-migrate @ 16758]
Ma Yuan <mayuan2006@gmail.com>
parents: 13870
diff changeset
442 char *pre, *post;
13870
258d48d6ab52 [gaim-migrate @ 16737]
Ma Yuan <mayuan2006@gmail.com>
parents: 13869
diff changeset
443
13871
db7573a9b767 [gaim-migrate @ 16758]
Ma Yuan <mayuan2006@gmail.com>
parents: 13870
diff changeset
444 msn_parse_format(value, &pre, &post);
db7573a9b767 [gaim-migrate @ 16758]
Ma Yuan <mayuan2006@gmail.com>
parents: 13870
diff changeset
445 body_final = g_strdup_printf("%s%s%s", pre ? pre : "",
db7573a9b767 [gaim-migrate @ 16758]
Ma Yuan <mayuan2006@gmail.com>
parents: 13870
diff changeset
446 body_enc ? body_enc : "", post ? post : "");
db7573a9b767 [gaim-migrate @ 16758]
Ma Yuan <mayuan2006@gmail.com>
parents: 13870
diff changeset
447 g_free(pre);
db7573a9b767 [gaim-migrate @ 16758]
Ma Yuan <mayuan2006@gmail.com>
parents: 13870
diff changeset
448 g_free(post);
13870
258d48d6ab52 [gaim-migrate @ 16737]
Ma Yuan <mayuan2006@gmail.com>
parents: 13869
diff changeset
449 }
20577
f24d1c68f2a4 Plug memory leaks.
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents: 20571
diff changeset
450 g_free(body_enc);
13870
258d48d6ab52 [gaim-migrate @ 16737]
Ma Yuan <mayuan2006@gmail.com>
parents: 13869
diff changeset
451 serv_got_im(gc, passport, body_final, 0, time(NULL));
21065
8bbf0f6700ed Fix some leaks and prevent some unnecessary allocations and frees.
Daniel Atallah <datallah@pidgin.im>
parents: 21055
diff changeset
452 g_free(body_final);
13870
258d48d6ab52 [gaim-migrate @ 16737]
Ma Yuan <mayuan2006@gmail.com>
parents: 13869
diff changeset
453 }
13871
db7573a9b767 [gaim-migrate @ 16758]
Ma Yuan <mayuan2006@gmail.com>
parents: 13870
diff changeset
454 if(!strcmp(content_type,"text/x-msmsgscontrol")){
db7573a9b767 [gaim-migrate @ 16758]
Ma Yuan <mayuan2006@gmail.com>
parents: 13870
diff changeset
455 if(msn_message_get_attr(msg, "TypingUser") != NULL){
db7573a9b767 [gaim-migrate @ 16758]
Ma Yuan <mayuan2006@gmail.com>
parents: 13870
diff changeset
456 serv_got_typing(gc, passport, MSN_TYPING_RECV_TIMEOUT,
20478
46933dc62880 propagate from branch 'im.pidgin.pidgin' (head 88b7040408c88e4516c008f4eac579f98ef53e85)
Richard Laager <rlaager@pidgin.im>
parents: 20476 16124
diff changeset
457 PURPLE_TYPING);
13871
db7573a9b767 [gaim-migrate @ 16758]
Ma Yuan <mayuan2006@gmail.com>
parents: 13870
diff changeset
458 }
db7573a9b767 [gaim-migrate @ 16758]
Ma Yuan <mayuan2006@gmail.com>
parents: 13870
diff changeset
459 }
db7573a9b767 [gaim-migrate @ 16758]
Ma Yuan <mayuan2006@gmail.com>
parents: 13870
diff changeset
460 if(!strcmp(content_type,"text/x-msnmsgr-datacast")){
db7573a9b767 [gaim-migrate @ 16758]
Ma Yuan <mayuan2006@gmail.com>
parents: 13870
diff changeset
461 char *username, *str;
20478
46933dc62880 propagate from branch 'im.pidgin.pidgin' (head 88b7040408c88e4516c008f4eac579f98ef53e85)
Richard Laager <rlaager@pidgin.im>
parents: 20476 16124
diff changeset
462 PurpleAccount *account;
46933dc62880 propagate from branch 'im.pidgin.pidgin' (head 88b7040408c88e4516c008f4eac579f98ef53e85)
Richard Laager <rlaager@pidgin.im>
parents: 20476 16124
diff changeset
463 PurpleBuddy *buddy;
13871
db7573a9b767 [gaim-migrate @ 16758]
Ma Yuan <mayuan2006@gmail.com>
parents: 13870
diff changeset
464 const char *user;
db7573a9b767 [gaim-migrate @ 16758]
Ma Yuan <mayuan2006@gmail.com>
parents: 13870
diff changeset
465
db7573a9b767 [gaim-migrate @ 16758]
Ma Yuan <mayuan2006@gmail.com>
parents: 13870
diff changeset
466 account = cmdproc->session->account;
db7573a9b767 [gaim-migrate @ 16758]
Ma Yuan <mayuan2006@gmail.com>
parents: 13870
diff changeset
467 user = msg->remote_user;
db7573a9b767 [gaim-migrate @ 16758]
Ma Yuan <mayuan2006@gmail.com>
parents: 13870
diff changeset
468
20478
46933dc62880 propagate from branch 'im.pidgin.pidgin' (head 88b7040408c88e4516c008f4eac579f98ef53e85)
Richard Laager <rlaager@pidgin.im>
parents: 20476 16124
diff changeset
469 if ((buddy = purple_find_buddy(account, user)) != NULL){
46933dc62880 propagate from branch 'im.pidgin.pidgin' (head 88b7040408c88e4516c008f4eac579f98ef53e85)
Richard Laager <rlaager@pidgin.im>
parents: 20476 16124
diff changeset
470 username = g_markup_escape_text(purple_buddy_get_alias(buddy), -1);
13871
db7573a9b767 [gaim-migrate @ 16758]
Ma Yuan <mayuan2006@gmail.com>
parents: 13870
diff changeset
471 }else{
db7573a9b767 [gaim-migrate @ 16758]
Ma Yuan <mayuan2006@gmail.com>
parents: 13870
diff changeset
472 username = g_markup_escape_text(user, -1);
db7573a9b767 [gaim-migrate @ 16758]
Ma Yuan <mayuan2006@gmail.com>
parents: 13870
diff changeset
473 }
db7573a9b767 [gaim-migrate @ 16758]
Ma Yuan <mayuan2006@gmail.com>
parents: 13870
diff changeset
474
db7573a9b767 [gaim-migrate @ 16758]
Ma Yuan <mayuan2006@gmail.com>
parents: 13870
diff changeset
475 str = g_strdup_printf(_("%s just sent you a Nudge!"), username);
db7573a9b767 [gaim-migrate @ 16758]
Ma Yuan <mayuan2006@gmail.com>
parents: 13870
diff changeset
476 g_free(username);
20478
46933dc62880 propagate from branch 'im.pidgin.pidgin' (head 88b7040408c88e4516c008f4eac579f98ef53e85)
Richard Laager <rlaager@pidgin.im>
parents: 20476 16124
diff changeset
477 msn_session_report_user(cmdproc->session,user,str,PURPLE_MESSAGE_SYSTEM);
13871
db7573a9b767 [gaim-migrate @ 16758]
Ma Yuan <mayuan2006@gmail.com>
parents: 13870
diff changeset
478 g_free(str);
db7573a9b767 [gaim-migrate @ 16758]
Ma Yuan <mayuan2006@gmail.com>
parents: 13870
diff changeset
479 }
13870
258d48d6ab52 [gaim-migrate @ 16737]
Ma Yuan <mayuan2006@gmail.com>
parents: 13869
diff changeset
480 msn_message_destroy(msg);
258d48d6ab52 [gaim-migrate @ 16737]
Ma Yuan <mayuan2006@gmail.com>
parents: 13869
diff changeset
481 }
23814
a35ff14f5fa7 Remove some MSN code duplication in processing messages from Yahoo
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 23810
diff changeset
482 #endif
13870
258d48d6ab52 [gaim-migrate @ 16737]
Ma Yuan <mayuan2006@gmail.com>
parents: 13869
diff changeset
483
258d48d6ab52 [gaim-migrate @ 16737]
Ma Yuan <mayuan2006@gmail.com>
parents: 13869
diff changeset
484 /*Yahoo msg process*/
258d48d6ab52 [gaim-migrate @ 16737]
Ma Yuan <mayuan2006@gmail.com>
parents: 13869
diff changeset
485 static void
258d48d6ab52 [gaim-migrate @ 16737]
Ma Yuan <mayuan2006@gmail.com>
parents: 13869
diff changeset
486 ubm_cmd(MsnCmdProc *cmdproc, MsnCommand *cmd)
258d48d6ab52 [gaim-migrate @ 16737]
Ma Yuan <mayuan2006@gmail.com>
parents: 13869
diff changeset
487 {
23830
1436e3de5d6c The great MSN debug message cleanup! Threw in a few whitespace fixes,
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 23828
diff changeset
488 purple_debug_info("msn", "Processing UBM... \n");
23826
3eeaac42358f Get rid of that whole msn_set_payload_len thing and correctly set the
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 23824
diff changeset
489
13870
258d48d6ab52 [gaim-migrate @ 16737]
Ma Yuan <mayuan2006@gmail.com>
parents: 13869
diff changeset
490 /* NOTE: cmd is not always cmdproc->last_cmd, sometimes cmd is a queued
258d48d6ab52 [gaim-migrate @ 16737]
Ma Yuan <mayuan2006@gmail.com>
parents: 13869
diff changeset
491 * command and we are processing it */
23826
3eeaac42358f Get rid of that whole msn_set_payload_len thing and correctly set the
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 23824
diff changeset
492 if (cmd->payload == NULL) {
3eeaac42358f Get rid of that whole msn_set_payload_len thing and correctly set the
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 23824
diff changeset
493 cmdproc->last_cmd->payload_cb = msg_cmd_post;
24749
108f5dc3b547 disapproval of revision '2a6fd0a61c41b57d9e6681551978e7a247d551e9'
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 24707
diff changeset
494 cmd->payload_len = atoi(cmd->params[4]);
23814
a35ff14f5fa7 Remove some MSN code duplication in processing messages from Yahoo
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 23810
diff changeset
495 } else {
13870
258d48d6ab52 [gaim-migrate @ 16737]
Ma Yuan <mayuan2006@gmail.com>
parents: 13869
diff changeset
496 g_return_if_fail(cmd->payload_cb != NULL);
258d48d6ab52 [gaim-migrate @ 16737]
Ma Yuan <mayuan2006@gmail.com>
parents: 13869
diff changeset
497
23830
1436e3de5d6c The great MSN debug message cleanup! Threw in a few whitespace fixes,
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 23828
diff changeset
498 purple_debug_info("msn", "UBM payload:{%.*s}\n", (guint)(cmd->payload_len), cmd->payload);
23814
a35ff14f5fa7 Remove some MSN code duplication in processing messages from Yahoo
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 23810
diff changeset
499 msg_cmd_post(cmdproc, cmd, cmd->payload, cmd->payload_len);
13870
258d48d6ab52 [gaim-migrate @ 16737]
Ma Yuan <mayuan2006@gmail.com>
parents: 13869
diff changeset
500 }
258d48d6ab52 [gaim-migrate @ 16737]
Ma Yuan <mayuan2006@gmail.com>
parents: 13869
diff changeset
501 }
258d48d6ab52 [gaim-migrate @ 16737]
Ma Yuan <mayuan2006@gmail.com>
parents: 13869
diff changeset
502
5309
3178acad1449 [gaim-migrate @ 5681]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
503 /**************************************************************************
3178acad1449 [gaim-migrate @ 5681]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
504 * Challenges
20508
a8855578906a Revert a bunch of whitespace changes so reviewing a diff against
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 20505
diff changeset
505 * we use MD5 to caculate the Challenges
5309
3178acad1449 [gaim-migrate @ 5681]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
506 **************************************************************************/
8808
1cb5ddf6b625 [gaim-migrate @ 9570]
Felipe Contreras <felipe.contreras@gmail.com>
parents: 8669
diff changeset
507 static void
1cb5ddf6b625 [gaim-migrate @ 9570]
Felipe Contreras <felipe.contreras@gmail.com>
parents: 8669
diff changeset
508 chl_cmd(MsnCmdProc *cmdproc, MsnCommand *cmd)
5309
3178acad1449 [gaim-migrate @ 5681]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
509 {
8808
1cb5ddf6b625 [gaim-migrate @ 9570]
Felipe Contreras <felipe.contreras@gmail.com>
parents: 8669
diff changeset
510 MsnTransaction *trans;
9158
f8dab42adeaf [gaim-migrate @ 9942]
Felipe Contreras <felipe.contreras@gmail.com>
parents: 8926
diff changeset
511 char buf[33];
5309
3178acad1449 [gaim-migrate @ 5681]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
512
13855
24cff9e060d7 [gaim-migrate @ 16507]
Ma Yuan <mayuan2006@gmail.com>
parents: 13854
diff changeset
513 msn_handle_chl(cmd->params[1], buf);
23755
6b2413139fae Patch 1 from Qulogic, this one mostly updates the version sent by pidgin
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 21905
diff changeset
514 trans = msn_transaction_new(cmdproc, "QRY", "%s 32", MSNP15_WLM_PRODUCT_ID);
5309
3178acad1449 [gaim-migrate @ 5681]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
515
8808
1cb5ddf6b625 [gaim-migrate @ 9570]
Felipe Contreras <felipe.contreras@gmail.com>
parents: 8669
diff changeset
516 msn_transaction_set_payload(trans, buf, 32);
5309
3178acad1449 [gaim-migrate @ 5681]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
517
8808
1cb5ddf6b625 [gaim-migrate @ 9570]
Felipe Contreras <felipe.contreras@gmail.com>
parents: 8669
diff changeset
518 msn_cmdproc_send_trans(cmdproc, trans);
5309
3178acad1449 [gaim-migrate @ 5681]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
519 }
3178acad1449 [gaim-migrate @ 5681]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
520
3178acad1449 [gaim-migrate @ 5681]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
521 /**************************************************************************
3178acad1449 [gaim-migrate @ 5681]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
522 * Buddy Lists
3178acad1449 [gaim-migrate @ 5681]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
523 **************************************************************************/
13866
b6a2c8d390ef [gaim-migrate @ 16716]
Ma Yuan <mayuan2006@gmail.com>
parents: 13865
diff changeset
524 /* add contact to xmlnode */
20530
0178f0d66bf0 Add Pending list to recognized lists during contact list parsing
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 20529
diff changeset
525 static void
23790
eb49b07a62d6 Modifications to the MSN code for some stuff I'll be doing in later
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 23789
diff changeset
526 msn_add_contact_xml(MsnSession *session, xmlnode *mlNode,const char *passport, MsnListOp list_op, MsnNetwork networkId)
13866
b6a2c8d390ef [gaim-migrate @ 16716]
Ma Yuan <mayuan2006@gmail.com>
parents: 13865
diff changeset
527 {
b6a2c8d390ef [gaim-migrate @ 16716]
Ma Yuan <mayuan2006@gmail.com>
parents: 13865
diff changeset
528 xmlnode *d_node,*c_node;
b6a2c8d390ef [gaim-migrate @ 16716]
Ma Yuan <mayuan2006@gmail.com>
parents: 13865
diff changeset
529 char **tokens;
20733
a179242f6bef Further cleanup of the msn prpl including preventing the authorization request callback from crashing if triggered after the account is disconnected. Also removal of some extraneous debuggery, there is more that needs to be removed.
Daniel Atallah <datallah@pidgin.im>
parents: 20597
diff changeset
530 const char *email,*domain;
a179242f6bef Further cleanup of the msn prpl including preventing the authorization request callback from crashing if triggered after the account is disconnected. Also removal of some extraneous debuggery, there is more that needs to be removed.
Daniel Atallah <datallah@pidgin.im>
parents: 20597
diff changeset
531 char fmt_str[3];
a179242f6bef Further cleanup of the msn prpl including preventing the authorization request callback from crashing if triggered after the account is disconnected. Also removal of some extraneous debuggery, there is more that needs to be removed.
Daniel Atallah <datallah@pidgin.im>
parents: 20597
diff changeset
532
a179242f6bef Further cleanup of the msn prpl including preventing the authorization request callback from crashing if triggered after the account is disconnected. Also removal of some extraneous debuggery, there is more that needs to be removed.
Daniel Atallah <datallah@pidgin.im>
parents: 20597
diff changeset
533 g_return_if_fail(passport != NULL);
13866
b6a2c8d390ef [gaim-migrate @ 16716]
Ma Yuan <mayuan2006@gmail.com>
parents: 13865
diff changeset
534
23830
1436e3de5d6c The great MSN debug message cleanup! Threw in a few whitespace fixes,
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 23828
diff changeset
535 purple_debug_info("msn", "Passport: %s, type: %d\n", passport, networkId);
13866
b6a2c8d390ef [gaim-migrate @ 16716]
Ma Yuan <mayuan2006@gmail.com>
parents: 13865
diff changeset
536 tokens = g_strsplit(passport, "@", 2);
b6a2c8d390ef [gaim-migrate @ 16716]
Ma Yuan <mayuan2006@gmail.com>
parents: 13865
diff changeset
537 email = tokens[0];
b6a2c8d390ef [gaim-migrate @ 16716]
Ma Yuan <mayuan2006@gmail.com>
parents: 13865
diff changeset
538 domain = tokens[1];
b6a2c8d390ef [gaim-migrate @ 16716]
Ma Yuan <mayuan2006@gmail.com>
parents: 13865
diff changeset
539
20733
a179242f6bef Further cleanup of the msn prpl including preventing the authorization request callback from crashing if triggered after the account is disconnected. Also removal of some extraneous debuggery, there is more that needs to be removed.
Daniel Atallah <datallah@pidgin.im>
parents: 20597
diff changeset
540 if (email == NULL || domain == NULL) {
a179242f6bef Further cleanup of the msn prpl including preventing the authorization request callback from crashing if triggered after the account is disconnected. Also removal of some extraneous debuggery, there is more that needs to be removed.
Daniel Atallah <datallah@pidgin.im>
parents: 20597
diff changeset
541 purple_debug_error("msn", "Invalid passport (%s) specified to add to contact xml.\n", passport);
a179242f6bef Further cleanup of the msn prpl including preventing the authorization request callback from crashing if triggered after the account is disconnected. Also removal of some extraneous debuggery, there is more that needs to be removed.
Daniel Atallah <datallah@pidgin.im>
parents: 20597
diff changeset
542 g_strfreev(tokens);
a179242f6bef Further cleanup of the msn prpl including preventing the authorization request callback from crashing if triggered after the account is disconnected. Also removal of some extraneous debuggery, there is more that needs to be removed.
Daniel Atallah <datallah@pidgin.im>
parents: 20597
diff changeset
543 g_return_if_reached();
a179242f6bef Further cleanup of the msn prpl including preventing the authorization request callback from crashing if triggered after the account is disconnected. Also removal of some extraneous debuggery, there is more that needs to be removed.
Daniel Atallah <datallah@pidgin.im>
parents: 20597
diff changeset
544 }
a179242f6bef Further cleanup of the msn prpl including preventing the authorization request callback from crashing if triggered after the account is disconnected. Also removal of some extraneous debuggery, there is more that needs to be removed.
Daniel Atallah <datallah@pidgin.im>
parents: 20597
diff changeset
545
13866
b6a2c8d390ef [gaim-migrate @ 16716]
Ma Yuan <mayuan2006@gmail.com>
parents: 13865
diff changeset
546 /*find a domain Node*/
20522
177cad886d4c A bunch of MSNP14 stuff:
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 20515
diff changeset
547 for(d_node = xmlnode_get_child(mlNode,"d"); d_node; d_node = xmlnode_get_next_twin(d_node))
177cad886d4c A bunch of MSNP14 stuff:
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 20515
diff changeset
548 {
20733
a179242f6bef Further cleanup of the msn prpl including preventing the authorization request callback from crashing if triggered after the account is disconnected. Also removal of some extraneous debuggery, there is more that needs to be removed.
Daniel Atallah <datallah@pidgin.im>
parents: 20597
diff changeset
549 const char *attr = xmlnode_get_attrib(d_node,"n");
a179242f6bef Further cleanup of the msn prpl including preventing the authorization request callback from crashing if triggered after the account is disconnected. Also removal of some extraneous debuggery, there is more that needs to be removed.
Daniel Atallah <datallah@pidgin.im>
parents: 20597
diff changeset
550 if (attr == NULL)
13866
b6a2c8d390ef [gaim-migrate @ 16716]
Ma Yuan <mayuan2006@gmail.com>
parents: 13865
diff changeset
551 continue;
20733
a179242f6bef Further cleanup of the msn prpl including preventing the authorization request callback from crashing if triggered after the account is disconnected. Also removal of some extraneous debuggery, there is more that needs to be removed.
Daniel Atallah <datallah@pidgin.im>
parents: 20597
diff changeset
552 if (!strcmp(attr,domain))
13866
b6a2c8d390ef [gaim-migrate @ 16716]
Ma Yuan <mayuan2006@gmail.com>
parents: 13865
diff changeset
553 break;
b6a2c8d390ef [gaim-migrate @ 16716]
Ma Yuan <mayuan2006@gmail.com>
parents: 13865
diff changeset
554 }
20733
a179242f6bef Further cleanup of the msn prpl including preventing the authorization request callback from crashing if triggered after the account is disconnected. Also removal of some extraneous debuggery, there is more that needs to be removed.
Daniel Atallah <datallah@pidgin.im>
parents: 20597
diff changeset
555
20522
177cad886d4c A bunch of MSNP14 stuff:
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 20515
diff changeset
556 if(d_node == NULL)
177cad886d4c A bunch of MSNP14 stuff:
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 20515
diff changeset
557 {
13866
b6a2c8d390ef [gaim-migrate @ 16716]
Ma Yuan <mayuan2006@gmail.com>
parents: 13865
diff changeset
558 /*domain not found, create a new domain Node*/
20733
a179242f6bef Further cleanup of the msn prpl including preventing the authorization request callback from crashing if triggered after the account is disconnected. Also removal of some extraneous debuggery, there is more that needs to be removed.
Daniel Atallah <datallah@pidgin.im>
parents: 20597
diff changeset
559 purple_debug_info("msn", "Didn't find existing domain node, adding one.\n");
13866
b6a2c8d390ef [gaim-migrate @ 16716]
Ma Yuan <mayuan2006@gmail.com>
parents: 13865
diff changeset
560 d_node = xmlnode_new("d");
20733
a179242f6bef Further cleanup of the msn prpl including preventing the authorization request callback from crashing if triggered after the account is disconnected. Also removal of some extraneous debuggery, there is more that needs to be removed.
Daniel Atallah <datallah@pidgin.im>
parents: 20597
diff changeset
561 xmlnode_set_attrib(d_node, "n", domain);
a179242f6bef Further cleanup of the msn prpl including preventing the authorization request callback from crashing if triggered after the account is disconnected. Also removal of some extraneous debuggery, there is more that needs to be removed.
Daniel Atallah <datallah@pidgin.im>
parents: 20597
diff changeset
562 xmlnode_insert_child(mlNode, d_node);
13866
b6a2c8d390ef [gaim-migrate @ 16716]
Ma Yuan <mayuan2006@gmail.com>
parents: 13865
diff changeset
563 }
b6a2c8d390ef [gaim-migrate @ 16716]
Ma Yuan <mayuan2006@gmail.com>
parents: 13865
diff changeset
564
b6a2c8d390ef [gaim-migrate @ 16716]
Ma Yuan <mayuan2006@gmail.com>
parents: 13865
diff changeset
565 /*create contact node*/
b6a2c8d390ef [gaim-migrate @ 16716]
Ma Yuan <mayuan2006@gmail.com>
parents: 13865
diff changeset
566 c_node = xmlnode_new("c");
20733
a179242f6bef Further cleanup of the msn prpl including preventing the authorization request callback from crashing if triggered after the account is disconnected. Also removal of some extraneous debuggery, there is more that needs to be removed.
Daniel Atallah <datallah@pidgin.im>
parents: 20597
diff changeset
567 xmlnode_set_attrib(c_node, "n", email);
13866
b6a2c8d390ef [gaim-migrate @ 16716]
Ma Yuan <mayuan2006@gmail.com>
parents: 13865
diff changeset
568
23830
1436e3de5d6c The great MSN debug message cleanup! Threw in a few whitespace fixes,
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 23828
diff changeset
569 purple_debug_info("msn", "list_op: %d\n", list_op);
20733
a179242f6bef Further cleanup of the msn prpl including preventing the authorization request callback from crashing if triggered after the account is disconnected. Also removal of some extraneous debuggery, there is more that needs to be removed.
Daniel Atallah <datallah@pidgin.im>
parents: 20597
diff changeset
570 g_snprintf(fmt_str, sizeof(fmt_str), "%d", list_op);
a179242f6bef Further cleanup of the msn prpl including preventing the authorization request callback from crashing if triggered after the account is disconnected. Also removal of some extraneous debuggery, there is more that needs to be removed.
Daniel Atallah <datallah@pidgin.im>
parents: 20597
diff changeset
571 xmlnode_set_attrib(c_node, "l", fmt_str);
20530
0178f0d66bf0 Add Pending list to recognized lists during contact list parsing
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 20529
diff changeset
572
23790
eb49b07a62d6 Modifications to the MSN code for some stuff I'll be doing in later
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 23789
diff changeset
573 if (networkId != MSN_NETWORK_UNKNOWN)
eb49b07a62d6 Modifications to the MSN code for some stuff I'll be doing in later
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 23789
diff changeset
574 g_snprintf(fmt_str, sizeof(fmt_str), "%d", networkId);
20733
a179242f6bef Further cleanup of the msn prpl including preventing the authorization request callback from crashing if triggered after the account is disconnected. Also removal of some extraneous debuggery, there is more that needs to be removed.
Daniel Atallah <datallah@pidgin.im>
parents: 20597
diff changeset
575 else if (msn_user_is_yahoo(session->account, passport))
23790
eb49b07a62d6 Modifications to the MSN code for some stuff I'll be doing in later
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 23789
diff changeset
576 g_snprintf(fmt_str, sizeof(fmt_str), "%d", MSN_NETWORK_YAHOO);
20733
a179242f6bef Further cleanup of the msn prpl including preventing the authorization request callback from crashing if triggered after the account is disconnected. Also removal of some extraneous debuggery, there is more that needs to be removed.
Daniel Atallah <datallah@pidgin.im>
parents: 20597
diff changeset
577 else
23790
eb49b07a62d6 Modifications to the MSN code for some stuff I'll be doing in later
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 23789
diff changeset
578 g_snprintf(fmt_str, sizeof(fmt_str), "%d", MSN_NETWORK_PASSPORT);
20733
a179242f6bef Further cleanup of the msn prpl including preventing the authorization request callback from crashing if triggered after the account is disconnected. Also removal of some extraneous debuggery, there is more that needs to be removed.
Daniel Atallah <datallah@pidgin.im>
parents: 20597
diff changeset
579
13869
4c7168c14431 [gaim-migrate @ 16733]
Ma Yuan <mayuan2006@gmail.com>
parents: 13868
diff changeset
580 /*mobile*/
24570
328a7b5211ba Kill some // comments. Sigh.
Richard Laager <rlaager@pidgin.im>
parents: 24486
diff changeset
581 /*type_str = g_strdup_printf("4");*/
20733
a179242f6bef Further cleanup of the msn prpl including preventing the authorization request callback from crashing if triggered after the account is disconnected. Also removal of some extraneous debuggery, there is more that needs to be removed.
Daniel Atallah <datallah@pidgin.im>
parents: 20597
diff changeset
582 xmlnode_set_attrib(c_node, "t", fmt_str);
20530
0178f0d66bf0 Add Pending list to recognized lists during contact list parsing
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 20529
diff changeset
583
13866
b6a2c8d390ef [gaim-migrate @ 16716]
Ma Yuan <mayuan2006@gmail.com>
parents: 13865
diff changeset
584 xmlnode_insert_child(d_node, c_node);
13873
3c20f5d70d1d [gaim-migrate @ 16772]
Ma Yuan <mayuan2006@gmail.com>
parents: 13871
diff changeset
585
20522
177cad886d4c A bunch of MSNP14 stuff:
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 20515
diff changeset
586 g_strfreev(tokens);
13873
3c20f5d70d1d [gaim-migrate @ 16772]
Ma Yuan <mayuan2006@gmail.com>
parents: 13871
diff changeset
587 }
10481
a5d6b8e1717d [gaim-migrate @ 11769]
Felipe Contreras <felipe.contreras@gmail.com>
parents: 10463
diff changeset
588
8808
1cb5ddf6b625 [gaim-migrate @ 9570]
Felipe Contreras <felipe.contreras@gmail.com>
parents: 8669
diff changeset
589 static void
20497
6dd1c3f1e2f8 fixes #971, we can only ADL 150 contacts at a time or the notification
Ka-Hing Cheung <khc@pidgin.im>
parents: 20493
diff changeset
590 msn_notification_post_adl(MsnCmdProc *cmdproc, const char *payload, int payload_len)
5309
3178acad1449 [gaim-migrate @ 5681]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
591 {
13873
3c20f5d70d1d [gaim-migrate @ 16772]
Ma Yuan <mayuan2006@gmail.com>
parents: 13871
diff changeset
592 MsnTransaction *trans;
23830
1436e3de5d6c The great MSN debug message cleanup! Threw in a few whitespace fixes,
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 23828
diff changeset
593 purple_debug_info("msn", "Sending ADL with payload: %s\n", payload);
23777
cc39907f15b9 Fix up some merge errors in MSN's notification.c. Darn meld...
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 23776
diff changeset
594 trans = msn_transaction_new(cmdproc, "ADL", "%i", payload_len);
22981
b83a23981419 Fix a number of leaks. As far as I can tell, MSNP14 now logs in without
Daniel Atallah <datallah@pidgin.im>
parents: 22969
diff changeset
595 msn_transaction_set_payload(trans, payload, payload_len);
13873
3c20f5d70d1d [gaim-migrate @ 16772]
Ma Yuan <mayuan2006@gmail.com>
parents: 13871
diff changeset
596 msn_cmdproc_send_trans(cmdproc, trans);
13866
b6a2c8d390ef [gaim-migrate @ 16716]
Ma Yuan <mayuan2006@gmail.com>
parents: 13865
diff changeset
597 }
b6a2c8d390ef [gaim-migrate @ 16716]
Ma Yuan <mayuan2006@gmail.com>
parents: 13865
diff changeset
598
b6a2c8d390ef [gaim-migrate @ 16716]
Ma Yuan <mayuan2006@gmail.com>
parents: 13865
diff changeset
599 /*dump contact info to NS*/
13855
24cff9e060d7 [gaim-migrate @ 16507]
Ma Yuan <mayuan2006@gmail.com>
parents: 13854
diff changeset
600 void
13866
b6a2c8d390ef [gaim-migrate @ 16716]
Ma Yuan <mayuan2006@gmail.com>
parents: 13865
diff changeset
601 msn_notification_dump_contact(MsnSession *session)
13855
24cff9e060d7 [gaim-migrate @ 16507]
Ma Yuan <mayuan2006@gmail.com>
parents: 13854
diff changeset
602 {
5457
586285a6ff22 [gaim-migrate @ 5845]
Christian Hammond <chipx86@chipx86.com>
parents: 5456
diff changeset
603 MsnUser *user;
13855
24cff9e060d7 [gaim-migrate @ 16507]
Ma Yuan <mayuan2006@gmail.com>
parents: 13854
diff changeset
604 GList *l;
13866
b6a2c8d390ef [gaim-migrate @ 16716]
Ma Yuan <mayuan2006@gmail.com>
parents: 13865
diff changeset
605 xmlnode *adl_node;
13856
a6511183749e [gaim-migrate @ 16546]
Ma Yuan <mayuan2006@gmail.com>
parents: 13855
diff changeset
606 char *payload;
13855
24cff9e060d7 [gaim-migrate @ 16507]
Ma Yuan <mayuan2006@gmail.com>
parents: 13854
diff changeset
607 int payload_len;
20497
6dd1c3f1e2f8 fixes #971, we can only ADL 150 contacts at a time or the notification
Ka-Hing Cheung <khc@pidgin.im>
parents: 20493
diff changeset
608 int adl_count = 0;
20476
198222e01a7d The second msn-p13-merge-head.diff.gz from SF Patch #162854 from Ka-Hing Cheung.
Richard Laager <rlaager@pidgin.im>
parents: 20475
diff changeset
609 const char *display_name;
13855
24cff9e060d7 [gaim-migrate @ 16507]
Ma Yuan <mayuan2006@gmail.com>
parents: 13854
diff changeset
610
24cff9e060d7 [gaim-migrate @ 16507]
Ma Yuan <mayuan2006@gmail.com>
parents: 13854
diff changeset
611 adl_node = xmlnode_new("ml");
24cff9e060d7 [gaim-migrate @ 16507]
Ma Yuan <mayuan2006@gmail.com>
parents: 13854
diff changeset
612 adl_node->child = NULL;
24cff9e060d7 [gaim-migrate @ 16507]
Ma Yuan <mayuan2006@gmail.com>
parents: 13854
diff changeset
613 xmlnode_set_attrib(adl_node, "l", "1");
20560
79e9c94c34db Add the possibility to create an Address Book, useful for newly registered MSN users.
Carlos Silva <typ0@pidgin.im>
parents: 20557
diff changeset
614
13855
24cff9e060d7 [gaim-migrate @ 16507]
Ma Yuan <mayuan2006@gmail.com>
parents: 13854
diff changeset
615 /*get the userlist*/
24381
88dab4cf9381 disapproval of revision 'af8f652c2701290deb59c2fa53e0decf168b815d'
Ka-Hing Cheung <khc@pidgin.im>
parents: 24380
diff changeset
616 for (l = session->userlist->users; l != NULL; l = l->next) {
13855
24cff9e060d7 [gaim-migrate @ 16507]
Ma Yuan <mayuan2006@gmail.com>
parents: 13854
diff changeset
617 user = l->data;
20530
0178f0d66bf0 Add Pending list to recognized lists during contact list parsing
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 20529
diff changeset
618
0178f0d66bf0 Add Pending list to recognized lists during contact list parsing
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 20529
diff changeset
619 /* skip RL & PL during initial dump */
0178f0d66bf0 Add Pending list to recognized lists during contact list parsing
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 20529
diff changeset
620 if (!(user->list_op & MSN_LIST_OP_MASK))
0178f0d66bf0 Add Pending list to recognized lists during contact list parsing
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 20529
diff changeset
621 continue;
0178f0d66bf0 Add Pending list to recognized lists during contact list parsing
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 20529
diff changeset
622
24445
4f53fbf6f709 References #6907, wrap a NULL check
Ka-Hing Cheung <khc@pidgin.im>
parents: 24444
diff changeset
623 if (user->passport && !strcmp(user->passport, "messenger@microsoft.com"))
24381
88dab4cf9381 disapproval of revision 'af8f652c2701290deb59c2fa53e0decf168b815d'
Ka-Hing Cheung <khc@pidgin.im>
parents: 24380
diff changeset
624 continue;
88dab4cf9381 disapproval of revision 'af8f652c2701290deb59c2fa53e0decf168b815d'
Ka-Hing Cheung <khc@pidgin.im>
parents: 24380
diff changeset
625
20530
0178f0d66bf0 Add Pending list to recognized lists during contact list parsing
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 20529
diff changeset
626 msn_add_contact_xml(session, adl_node, user->passport,
23790
eb49b07a62d6 Modifications to the MSN code for some stuff I'll be doing in later
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 23789
diff changeset
627 user->list_op & MSN_LIST_OP_MASK, user->networkid);
20497
6dd1c3f1e2f8 fixes #971, we can only ADL 150 contacts at a time or the notification
Ka-Hing Cheung <khc@pidgin.im>
parents: 20493
diff changeset
628
6dd1c3f1e2f8 fixes #971, we can only ADL 150 contacts at a time or the notification
Ka-Hing Cheung <khc@pidgin.im>
parents: 20493
diff changeset
629 /* each ADL command may contain up to 150 contacts */
6dd1c3f1e2f8 fixes #971, we can only ADL 150 contacts at a time or the notification
Ka-Hing Cheung <khc@pidgin.im>
parents: 20493
diff changeset
630 if (++adl_count % 150 == 0 || l->next == NULL) {
6dd1c3f1e2f8 fixes #971, we can only ADL 150 contacts at a time or the notification
Ka-Hing Cheung <khc@pidgin.im>
parents: 20493
diff changeset
631 payload = xmlnode_to_str(adl_node,&payload_len);
6dd1c3f1e2f8 fixes #971, we can only ADL 150 contacts at a time or the notification
Ka-Hing Cheung <khc@pidgin.im>
parents: 20493
diff changeset
632
6dd1c3f1e2f8 fixes #971, we can only ADL 150 contacts at a time or the notification
Ka-Hing Cheung <khc@pidgin.im>
parents: 20493
diff changeset
633 msn_notification_post_adl(session->notification->cmdproc,
6dd1c3f1e2f8 fixes #971, we can only ADL 150 contacts at a time or the notification
Ka-Hing Cheung <khc@pidgin.im>
parents: 20493
diff changeset
634 payload, payload_len);
6dd1c3f1e2f8 fixes #971, we can only ADL 150 contacts at a time or the notification
Ka-Hing Cheung <khc@pidgin.im>
parents: 20493
diff changeset
635
6dd1c3f1e2f8 fixes #971, we can only ADL 150 contacts at a time or the notification
Ka-Hing Cheung <khc@pidgin.im>
parents: 20493
diff changeset
636 g_free(payload);
6dd1c3f1e2f8 fixes #971, we can only ADL 150 contacts at a time or the notification
Ka-Hing Cheung <khc@pidgin.im>
parents: 20493
diff changeset
637 xmlnode_free(adl_node);
6dd1c3f1e2f8 fixes #971, we can only ADL 150 contacts at a time or the notification
Ka-Hing Cheung <khc@pidgin.im>
parents: 20493
diff changeset
638
6dd1c3f1e2f8 fixes #971, we can only ADL 150 contacts at a time or the notification
Ka-Hing Cheung <khc@pidgin.im>
parents: 20493
diff changeset
639 if (l->next) {
6dd1c3f1e2f8 fixes #971, we can only ADL 150 contacts at a time or the notification
Ka-Hing Cheung <khc@pidgin.im>
parents: 20493
diff changeset
640 adl_node = xmlnode_new("ml");
6dd1c3f1e2f8 fixes #971, we can only ADL 150 contacts at a time or the notification
Ka-Hing Cheung <khc@pidgin.im>
parents: 20493
diff changeset
641 adl_node->child = NULL;
6dd1c3f1e2f8 fixes #971, we can only ADL 150 contacts at a time or the notification
Ka-Hing Cheung <khc@pidgin.im>
parents: 20493
diff changeset
642 xmlnode_set_attrib(adl_node, "l", "1");
6dd1c3f1e2f8 fixes #971, we can only ADL 150 contacts at a time or the notification
Ka-Hing Cheung <khc@pidgin.im>
parents: 20493
diff changeset
643 }
6dd1c3f1e2f8 fixes #971, we can only ADL 150 contacts at a time or the notification
Ka-Hing Cheung <khc@pidgin.im>
parents: 20493
diff changeset
644 }
13855
24cff9e060d7 [gaim-migrate @ 16507]
Ma Yuan <mayuan2006@gmail.com>
parents: 13854
diff changeset
645 }
20564
35675dd4a44d Make buddy and group management actually work, add some SOAP templates, redesign some parts of code and separate some bigger functions into its smaller tasks which are completely unrelated to each other
Carlos Silva <typ0@pidgin.im>
parents: 20560
diff changeset
646
35675dd4a44d Make buddy and group management actually work, add some SOAP templates, redesign some parts of code and separate some bigger functions into its smaller tasks which are completely unrelated to each other
Carlos Silva <typ0@pidgin.im>
parents: 20560
diff changeset
647 if (adl_count == 0) {
35675dd4a44d Make buddy and group management actually work, add some SOAP templates, redesign some parts of code and separate some bigger functions into its smaller tasks which are completely unrelated to each other
Carlos Silva <typ0@pidgin.im>
parents: 20560
diff changeset
648 payload = xmlnode_to_str(adl_node,&payload_len);
35675dd4a44d Make buddy and group management actually work, add some SOAP templates, redesign some parts of code and separate some bigger functions into its smaller tasks which are completely unrelated to each other
Carlos Silva <typ0@pidgin.im>
parents: 20560
diff changeset
649
35675dd4a44d Make buddy and group management actually work, add some SOAP templates, redesign some parts of code and separate some bigger functions into its smaller tasks which are completely unrelated to each other
Carlos Silva <typ0@pidgin.im>
parents: 20560
diff changeset
650 msn_notification_post_adl(session->notification->cmdproc, payload, payload_len);
35675dd4a44d Make buddy and group management actually work, add some SOAP templates, redesign some parts of code and separate some bigger functions into its smaller tasks which are completely unrelated to each other
Carlos Silva <typ0@pidgin.im>
parents: 20560
diff changeset
651
35675dd4a44d Make buddy and group management actually work, add some SOAP templates, redesign some parts of code and separate some bigger functions into its smaller tasks which are completely unrelated to each other
Carlos Silva <typ0@pidgin.im>
parents: 20560
diff changeset
652 g_free(payload);
35675dd4a44d Make buddy and group management actually work, add some SOAP templates, redesign some parts of code and separate some bigger functions into its smaller tasks which are completely unrelated to each other
Carlos Silva <typ0@pidgin.im>
parents: 20560
diff changeset
653 xmlnode_free(adl_node);
20560
79e9c94c34db Add the possibility to create an Address Book, useful for newly registered MSN users.
Carlos Silva <typ0@pidgin.im>
parents: 20557
diff changeset
654 }
20476
198222e01a7d The second msn-p13-merge-head.diff.gz from SF Patch #162854 from Ka-Hing Cheung.
Richard Laager <rlaager@pidgin.im>
parents: 20475
diff changeset
655
20478
46933dc62880 propagate from branch 'im.pidgin.pidgin' (head 88b7040408c88e4516c008f4eac579f98ef53e85)
Richard Laager <rlaager@pidgin.im>
parents: 20476 16124
diff changeset
656 display_name = purple_connection_get_display_name(session->account->gc);
23441
fd45c23a3eb2 Delete trailing whitespace
Mark Doliner <markdoliner@pidgin.im>
parents: 23085
diff changeset
657 if (display_name
fd45c23a3eb2 Delete trailing whitespace
Mark Doliner <markdoliner@pidgin.im>
parents: 23085
diff changeset
658 && strcmp(display_name,
20560
79e9c94c34db Add the possibility to create an Address Book, useful for newly registered MSN users.
Carlos Silva <typ0@pidgin.im>
parents: 20557
diff changeset
659 purple_account_get_username(session->account))) {
20476
198222e01a7d The second msn-p13-merge-head.diff.gz from SF Patch #162854 from Ka-Hing Cheung.
Richard Laager <rlaager@pidgin.im>
parents: 20475
diff changeset
660 msn_act_id(session->account->gc, display_name);
198222e01a7d The second msn-p13-merge-head.diff.gz from SF Patch #162854 from Ka-Hing Cheung.
Richard Laager <rlaager@pidgin.im>
parents: 20475
diff changeset
661 }
198222e01a7d The second msn-p13-merge-head.diff.gz from SF Patch #162854 from Ka-Hing Cheung.
Richard Laager <rlaager@pidgin.im>
parents: 20475
diff changeset
662
13873
3c20f5d70d1d [gaim-migrate @ 16772]
Ma Yuan <mayuan2006@gmail.com>
parents: 13871
diff changeset
663 }
5518
436fb9490b62 [gaim-migrate @ 5918]
Christian Hammond <chipx86@chipx86.com>
parents: 5509
diff changeset
664
13873
3c20f5d70d1d [gaim-migrate @ 16772]
Ma Yuan <mayuan2006@gmail.com>
parents: 13871
diff changeset
665 /*Post FQY to NS,Inform add a Yahoo User*/
20564
35675dd4a44d Make buddy and group management actually work, add some SOAP templates, redesign some parts of code and separate some bigger functions into its smaller tasks which are completely unrelated to each other
Carlos Silva <typ0@pidgin.im>
parents: 20560
diff changeset
666 void
35675dd4a44d Make buddy and group management actually work, add some SOAP templates, redesign some parts of code and separate some bigger functions into its smaller tasks which are completely unrelated to each other
Carlos Silva <typ0@pidgin.im>
parents: 20560
diff changeset
667 msn_notification_send_fqy(MsnSession *session, const char *passport)
13873
3c20f5d70d1d [gaim-migrate @ 16772]
Ma Yuan <mayuan2006@gmail.com>
parents: 13871
diff changeset
668 {
3c20f5d70d1d [gaim-migrate @ 16772]
Ma Yuan <mayuan2006@gmail.com>
parents: 13871
diff changeset
669 MsnTransaction *trans;
3c20f5d70d1d [gaim-migrate @ 16772]
Ma Yuan <mayuan2006@gmail.com>
parents: 13871
diff changeset
670 MsnCmdProc *cmdproc;
3c20f5d70d1d [gaim-migrate @ 16772]
Ma Yuan <mayuan2006@gmail.com>
parents: 13871
diff changeset
671 char* email,*domain,*payload;
3c20f5d70d1d [gaim-migrate @ 16772]
Ma Yuan <mayuan2006@gmail.com>
parents: 13871
diff changeset
672 char **tokens;
5457
586285a6ff22 [gaim-migrate @ 5845]
Christian Hammond <chipx86@chipx86.com>
parents: 5456
diff changeset
673
13873
3c20f5d70d1d [gaim-migrate @ 16772]
Ma Yuan <mayuan2006@gmail.com>
parents: 13871
diff changeset
674 cmdproc = session->notification->cmdproc;
5309
3178acad1449 [gaim-migrate @ 5681]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
675
13873
3c20f5d70d1d [gaim-migrate @ 16772]
Ma Yuan <mayuan2006@gmail.com>
parents: 13871
diff changeset
676 tokens = g_strsplit(passport, "@", 2);
3c20f5d70d1d [gaim-migrate @ 16772]
Ma Yuan <mayuan2006@gmail.com>
parents: 13871
diff changeset
677 email = tokens[0];
3c20f5d70d1d [gaim-migrate @ 16772]
Ma Yuan <mayuan2006@gmail.com>
parents: 13871
diff changeset
678 domain = tokens[1];
3c20f5d70d1d [gaim-migrate @ 16772]
Ma Yuan <mayuan2006@gmail.com>
parents: 13871
diff changeset
679
20564
35675dd4a44d Make buddy and group management actually work, add some SOAP templates, redesign some parts of code and separate some bigger functions into its smaller tasks which are completely unrelated to each other
Carlos Silva <typ0@pidgin.im>
parents: 20560
diff changeset
680 payload = g_strdup_printf("<ml><d n=\"%s\"><c n=\"%s\"/></d></ml>", domain, email);
22969
51f5e7777915 This cleans up a bunch of warnings that stem from the fact that size_t and
John Bailey <rekkanoryo@rekkanoryo.org>
parents: 22711
diff changeset
681 trans = msn_transaction_new(cmdproc, "FQY","%" G_GSIZE_FORMAT, strlen(payload));
13855
24cff9e060d7 [gaim-migrate @ 16507]
Ma Yuan <mayuan2006@gmail.com>
parents: 13854
diff changeset
682 msn_transaction_set_payload(trans, payload, strlen(payload));
24cff9e060d7 [gaim-migrate @ 16507]
Ma Yuan <mayuan2006@gmail.com>
parents: 13854
diff changeset
683 msn_cmdproc_send_trans(cmdproc, trans);
13873
3c20f5d70d1d [gaim-migrate @ 16772]
Ma Yuan <mayuan2006@gmail.com>
parents: 13871
diff changeset
684
3c20f5d70d1d [gaim-migrate @ 16772]
Ma Yuan <mayuan2006@gmail.com>
parents: 13871
diff changeset
685 g_free(payload);
21010
2bd8577a08e5 Fix some leaks.
Daniel Atallah <datallah@pidgin.im>
parents: 20935
diff changeset
686 g_strfreev(tokens);
13855
24cff9e060d7 [gaim-migrate @ 16507]
Ma Yuan <mayuan2006@gmail.com>
parents: 13854
diff changeset
687 }
10481
a5d6b8e1717d [gaim-migrate @ 11769]
Felipe Contreras <felipe.contreras@gmail.com>
parents: 10463
diff changeset
688
8808
1cb5ddf6b625 [gaim-migrate @ 9570]
Felipe Contreras <felipe.contreras@gmail.com>
parents: 8669
diff changeset
689 static void
13856
a6511183749e [gaim-migrate @ 16546]
Ma Yuan <mayuan2006@gmail.com>
parents: 13855
diff changeset
690 blp_cmd(MsnCmdProc *cmdproc, MsnCommand *cmd)
a6511183749e [gaim-migrate @ 16546]
Ma Yuan <mayuan2006@gmail.com>
parents: 13855
diff changeset
691 {
a6511183749e [gaim-migrate @ 16546]
Ma Yuan <mayuan2006@gmail.com>
parents: 13855
diff changeset
692 }
a6511183749e [gaim-migrate @ 16546]
Ma Yuan <mayuan2006@gmail.com>
parents: 13855
diff changeset
693
a6511183749e [gaim-migrate @ 16546]
Ma Yuan <mayuan2006@gmail.com>
parents: 13855
diff changeset
694 static void
20567
2417aff6ff3b Handle special cases in buddy/group management (wrt MSN_INDIVIDUALS_GROUP and MSN_NON_IM_GROUP).
Carlos Silva <typ0@pidgin.im>
parents: 20564
diff changeset
695 adl_cmd_parse(MsnCmdProc *cmdproc, MsnCommand *cmd, char *payload,
2417aff6ff3b Handle special cases in buddy/group management (wrt MSN_INDIVIDUALS_GROUP and MSN_NON_IM_GROUP).
Carlos Silva <typ0@pidgin.im>
parents: 20564
diff changeset
696 size_t len)
2417aff6ff3b Handle special cases in buddy/group management (wrt MSN_INDIVIDUALS_GROUP and MSN_NON_IM_GROUP).
Carlos Silva <typ0@pidgin.im>
parents: 20564
diff changeset
697 {
2417aff6ff3b Handle special cases in buddy/group management (wrt MSN_INDIVIDUALS_GROUP and MSN_NON_IM_GROUP).
Carlos Silva <typ0@pidgin.im>
parents: 20564
diff changeset
698 xmlnode *root, *domain_node;
2417aff6ff3b Handle special cases in buddy/group management (wrt MSN_INDIVIDUALS_GROUP and MSN_NON_IM_GROUP).
Carlos Silva <typ0@pidgin.im>
parents: 20564
diff changeset
699
23830
1436e3de5d6c The great MSN debug message cleanup! Threw in a few whitespace fixes,
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 23828
diff changeset
700 purple_debug_misc("msn", "Parsing received ADL XML data\n");
20567
2417aff6ff3b Handle special cases in buddy/group management (wrt MSN_INDIVIDUALS_GROUP and MSN_NON_IM_GROUP).
Carlos Silva <typ0@pidgin.im>
parents: 20564
diff changeset
701
2417aff6ff3b Handle special cases in buddy/group management (wrt MSN_INDIVIDUALS_GROUP and MSN_NON_IM_GROUP).
Carlos Silva <typ0@pidgin.im>
parents: 20564
diff changeset
702 g_return_if_fail(payload != NULL);
23441
fd45c23a3eb2 Delete trailing whitespace
Mark Doliner <markdoliner@pidgin.im>
parents: 23085
diff changeset
703
20567
2417aff6ff3b Handle special cases in buddy/group management (wrt MSN_INDIVIDUALS_GROUP and MSN_NON_IM_GROUP).
Carlos Silva <typ0@pidgin.im>
parents: 20564
diff changeset
704 root = xmlnode_from_str(payload, (gssize) len);
23441
fd45c23a3eb2 Delete trailing whitespace
Mark Doliner <markdoliner@pidgin.im>
parents: 23085
diff changeset
705
20567
2417aff6ff3b Handle special cases in buddy/group management (wrt MSN_INDIVIDUALS_GROUP and MSN_NON_IM_GROUP).
Carlos Silva <typ0@pidgin.im>
parents: 20564
diff changeset
706 if (root == NULL) {
23830
1436e3de5d6c The great MSN debug message cleanup! Threw in a few whitespace fixes,
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 23828
diff changeset
707 purple_debug_info("msn", "Invalid XML in ADL!\n");
20567
2417aff6ff3b Handle special cases in buddy/group management (wrt MSN_INDIVIDUALS_GROUP and MSN_NON_IM_GROUP).
Carlos Silva <typ0@pidgin.im>
parents: 20564
diff changeset
708 return;
2417aff6ff3b Handle special cases in buddy/group management (wrt MSN_INDIVIDUALS_GROUP and MSN_NON_IM_GROUP).
Carlos Silva <typ0@pidgin.im>
parents: 20564
diff changeset
709 }
2417aff6ff3b Handle special cases in buddy/group management (wrt MSN_INDIVIDUALS_GROUP and MSN_NON_IM_GROUP).
Carlos Silva <typ0@pidgin.im>
parents: 20564
diff changeset
710 for (domain_node = xmlnode_get_child(root, "d"); domain_node; domain_node = xmlnode_get_next_twin(domain_node)) {
23441
fd45c23a3eb2 Delete trailing whitespace
Mark Doliner <markdoliner@pidgin.im>
parents: 23085
diff changeset
711 const gchar * domain = NULL;
20567
2417aff6ff3b Handle special cases in buddy/group management (wrt MSN_INDIVIDUALS_GROUP and MSN_NON_IM_GROUP).
Carlos Silva <typ0@pidgin.im>
parents: 20564
diff changeset
712 xmlnode *contact_node = NULL;
2417aff6ff3b Handle special cases in buddy/group management (wrt MSN_INDIVIDUALS_GROUP and MSN_NON_IM_GROUP).
Carlos Silva <typ0@pidgin.im>
parents: 20564
diff changeset
713
2417aff6ff3b Handle special cases in buddy/group management (wrt MSN_INDIVIDUALS_GROUP and MSN_NON_IM_GROUP).
Carlos Silva <typ0@pidgin.im>
parents: 20564
diff changeset
714 domain = xmlnode_get_attrib(domain_node, "n");
2417aff6ff3b Handle special cases in buddy/group management (wrt MSN_INDIVIDUALS_GROUP and MSN_NON_IM_GROUP).
Carlos Silva <typ0@pidgin.im>
parents: 20564
diff changeset
715
2417aff6ff3b Handle special cases in buddy/group management (wrt MSN_INDIVIDUALS_GROUP and MSN_NON_IM_GROUP).
Carlos Silva <typ0@pidgin.im>
parents: 20564
diff changeset
716 for (contact_node = xmlnode_get_child(domain_node, "c"); contact_node; contact_node = xmlnode_get_next_twin(contact_node)) {
2417aff6ff3b Handle special cases in buddy/group management (wrt MSN_INDIVIDUALS_GROUP and MSN_NON_IM_GROUP).
Carlos Silva <typ0@pidgin.im>
parents: 20564
diff changeset
717 const gchar *list;
2417aff6ff3b Handle special cases in buddy/group management (wrt MSN_INDIVIDUALS_GROUP and MSN_NON_IM_GROUP).
Carlos Silva <typ0@pidgin.im>
parents: 20564
diff changeset
718 gint list_op = 0;
2417aff6ff3b Handle special cases in buddy/group management (wrt MSN_INDIVIDUALS_GROUP and MSN_NON_IM_GROUP).
Carlos Silva <typ0@pidgin.im>
parents: 20564
diff changeset
719
2417aff6ff3b Handle special cases in buddy/group management (wrt MSN_INDIVIDUALS_GROUP and MSN_NON_IM_GROUP).
Carlos Silva <typ0@pidgin.im>
parents: 20564
diff changeset
720 list = xmlnode_get_attrib(contact_node, "l");
2417aff6ff3b Handle special cases in buddy/group management (wrt MSN_INDIVIDUALS_GROUP and MSN_NON_IM_GROUP).
Carlos Silva <typ0@pidgin.im>
parents: 20564
diff changeset
721 if (list != NULL) {
2417aff6ff3b Handle special cases in buddy/group management (wrt MSN_INDIVIDUALS_GROUP and MSN_NON_IM_GROUP).
Carlos Silva <typ0@pidgin.im>
parents: 20564
diff changeset
722 list_op = atoi(list);
2417aff6ff3b Handle special cases in buddy/group management (wrt MSN_INDIVIDUALS_GROUP and MSN_NON_IM_GROUP).
Carlos Silva <typ0@pidgin.im>
parents: 20564
diff changeset
723 }
2417aff6ff3b Handle special cases in buddy/group management (wrt MSN_INDIVIDUALS_GROUP and MSN_NON_IM_GROUP).
Carlos Silva <typ0@pidgin.im>
parents: 20564
diff changeset
724
2417aff6ff3b Handle special cases in buddy/group management (wrt MSN_INDIVIDUALS_GROUP and MSN_NON_IM_GROUP).
Carlos Silva <typ0@pidgin.im>
parents: 20564
diff changeset
725 if (list_op & MSN_LIST_RL_OP) {
2417aff6ff3b Handle special cases in buddy/group management (wrt MSN_INDIVIDUALS_GROUP and MSN_NON_IM_GROUP).
Carlos Silva <typ0@pidgin.im>
parents: 20564
diff changeset
726 /* someone is adding us */
23771
c98f7e879218 killing MsnContact which just wraps MsnSession
Ka-Hing Cheung <khc@pidgin.im>
parents: 23770
diff changeset
727 msn_get_contact_list(cmdproc->session, MSN_PS_PENDING_LIST, NULL);
20567
2417aff6ff3b Handle special cases in buddy/group management (wrt MSN_INDIVIDUALS_GROUP and MSN_NON_IM_GROUP).
Carlos Silva <typ0@pidgin.im>
parents: 20564
diff changeset
728 }
2417aff6ff3b Handle special cases in buddy/group management (wrt MSN_INDIVIDUALS_GROUP and MSN_NON_IM_GROUP).
Carlos Silva <typ0@pidgin.im>
parents: 20564
diff changeset
729 }
2417aff6ff3b Handle special cases in buddy/group management (wrt MSN_INDIVIDUALS_GROUP and MSN_NON_IM_GROUP).
Carlos Silva <typ0@pidgin.im>
parents: 20564
diff changeset
730 }
2417aff6ff3b Handle special cases in buddy/group management (wrt MSN_INDIVIDUALS_GROUP and MSN_NON_IM_GROUP).
Carlos Silva <typ0@pidgin.im>
parents: 20564
diff changeset
731
2417aff6ff3b Handle special cases in buddy/group management (wrt MSN_INDIVIDUALS_GROUP and MSN_NON_IM_GROUP).
Carlos Silva <typ0@pidgin.im>
parents: 20564
diff changeset
732 xmlnode_free(root);
2417aff6ff3b Handle special cases in buddy/group management (wrt MSN_INDIVIDUALS_GROUP and MSN_NON_IM_GROUP).
Carlos Silva <typ0@pidgin.im>
parents: 20564
diff changeset
733 }
2417aff6ff3b Handle special cases in buddy/group management (wrt MSN_INDIVIDUALS_GROUP and MSN_NON_IM_GROUP).
Carlos Silva <typ0@pidgin.im>
parents: 20564
diff changeset
734
2417aff6ff3b Handle special cases in buddy/group management (wrt MSN_INDIVIDUALS_GROUP and MSN_NON_IM_GROUP).
Carlos Silva <typ0@pidgin.im>
parents: 20564
diff changeset
735 static void
13855
24cff9e060d7 [gaim-migrate @ 16507]
Ma Yuan <mayuan2006@gmail.com>
parents: 13854
diff changeset
736 adl_cmd(MsnCmdProc *cmdproc, MsnCommand *cmd)
5309
3178acad1449 [gaim-migrate @ 5681]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
737 {
8808
1cb5ddf6b625 [gaim-migrate @ 9570]
Felipe Contreras <felipe.contreras@gmail.com>
parents: 8669
diff changeset
738 MsnSession *session;
5309
3178acad1449 [gaim-migrate @ 5681]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
739
20567
2417aff6ff3b Handle special cases in buddy/group management (wrt MSN_INDIVIDUALS_GROUP and MSN_NON_IM_GROUP).
Carlos Silva <typ0@pidgin.im>
parents: 20564
diff changeset
740 g_return_if_fail(cmdproc != NULL);
2417aff6ff3b Handle special cases in buddy/group management (wrt MSN_INDIVIDUALS_GROUP and MSN_NON_IM_GROUP).
Carlos Silva <typ0@pidgin.im>
parents: 20564
diff changeset
741 g_return_if_fail(cmdproc->session != NULL);
2417aff6ff3b Handle special cases in buddy/group management (wrt MSN_INDIVIDUALS_GROUP and MSN_NON_IM_GROUP).
Carlos Silva <typ0@pidgin.im>
parents: 20564
diff changeset
742 g_return_if_fail(cmdproc->last_cmd != NULL);
2417aff6ff3b Handle special cases in buddy/group management (wrt MSN_INDIVIDUALS_GROUP and MSN_NON_IM_GROUP).
Carlos Silva <typ0@pidgin.im>
parents: 20564
diff changeset
743 g_return_if_fail(cmd != NULL);
5518
436fb9490b62 [gaim-migrate @ 5918]
Christian Hammond <chipx86@chipx86.com>
parents: 5509
diff changeset
744
9193
6e76f1367896 [gaim-migrate @ 9988]
Felipe Contreras <felipe.contreras@gmail.com>
parents: 9158
diff changeset
745 session = cmdproc->session;
5457
586285a6ff22 [gaim-migrate @ 5845]
Christian Hammond <chipx86@chipx86.com>
parents: 5456
diff changeset
746
23826
3eeaac42358f Get rid of that whole msn_set_payload_len thing and correctly set the
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 23824
diff changeset
747 if (!strcmp(cmd->params[1], "OK")) {
20567
2417aff6ff3b Handle special cases in buddy/group management (wrt MSN_INDIVIDUALS_GROUP and MSN_NON_IM_GROUP).
Carlos Silva <typ0@pidgin.im>
parents: 20564
diff changeset
748 /* ADL ack */
2417aff6ff3b Handle special cases in buddy/group management (wrt MSN_INDIVIDUALS_GROUP and MSN_NON_IM_GROUP).
Carlos Silva <typ0@pidgin.im>
parents: 20564
diff changeset
749 msn_session_finish_login(session);
2417aff6ff3b Handle special cases in buddy/group management (wrt MSN_INDIVIDUALS_GROUP and MSN_NON_IM_GROUP).
Carlos Silva <typ0@pidgin.im>
parents: 20564
diff changeset
750 } else {
2417aff6ff3b Handle special cases in buddy/group management (wrt MSN_INDIVIDUALS_GROUP and MSN_NON_IM_GROUP).
Carlos Silva <typ0@pidgin.im>
parents: 20564
diff changeset
751 cmdproc->last_cmd->payload_cb = adl_cmd_parse;
23826
3eeaac42358f Get rid of that whole msn_set_payload_len thing and correctly set the
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 23824
diff changeset
752 cmd->payload_len = atoi(cmd->params[1]);
20567
2417aff6ff3b Handle special cases in buddy/group management (wrt MSN_INDIVIDUALS_GROUP and MSN_NON_IM_GROUP).
Carlos Silva <typ0@pidgin.im>
parents: 20564
diff changeset
753 }
20560
79e9c94c34db Add the possibility to create an Address Book, useful for newly registered MSN users.
Carlos Silva <typ0@pidgin.im>
parents: 20557
diff changeset
754
79e9c94c34db Add the possibility to create an Address Book, useful for newly registered MSN users.
Carlos Silva <typ0@pidgin.im>
parents: 20557
diff changeset
755 return;
13855
24cff9e060d7 [gaim-migrate @ 16507]
Ma Yuan <mayuan2006@gmail.com>
parents: 13854
diff changeset
756 }
5309
3178acad1449 [gaim-migrate @ 5681]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
757
13855
24cff9e060d7 [gaim-migrate @ 16507]
Ma Yuan <mayuan2006@gmail.com>
parents: 13854
diff changeset
758 static void
24438
f516df0c0926 Apply khc's patch for ADL error 205, with a few changes to get around
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 24405
diff changeset
759 adl_error_parse(MsnCmdProc *cmdproc, MsnCommand *cmd, char *payload, size_t len)
f516df0c0926 Apply khc's patch for ADL error 205, with a few changes to get around
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 24405
diff changeset
760 {
f516df0c0926 Apply khc's patch for ADL error 205, with a few changes to get around
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 24405
diff changeset
761 MsnSession *session;
f516df0c0926 Apply khc's patch for ADL error 205, with a few changes to get around
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 24405
diff changeset
762 PurpleAccount *account;
f516df0c0926 Apply khc's patch for ADL error 205, with a few changes to get around
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 24405
diff changeset
763 PurpleConnection *gc;
f516df0c0926 Apply khc's patch for ADL error 205, with a few changes to get around
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 24405
diff changeset
764 /*char *adl = g_strndup(payload, len);*/
f516df0c0926 Apply khc's patch for ADL error 205, with a few changes to get around
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 24405
diff changeset
765 char *reason = g_strdup_printf(_("Unknown error (%d)"),
f516df0c0926 Apply khc's patch for ADL error 205, with a few changes to get around
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 24405
diff changeset
766 GPOINTER_TO_INT(cmd->payload_cbdata)/*, adl*/);
f516df0c0926 Apply khc's patch for ADL error 205, with a few changes to get around
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 24405
diff changeset
767 /*g_free(adl);*/
f516df0c0926 Apply khc's patch for ADL error 205, with a few changes to get around
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 24405
diff changeset
768
f516df0c0926 Apply khc's patch for ADL error 205, with a few changes to get around
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 24405
diff changeset
769 session = cmdproc->session;
f516df0c0926 Apply khc's patch for ADL error 205, with a few changes to get around
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 24405
diff changeset
770 account = session->account;
f516df0c0926 Apply khc's patch for ADL error 205, with a few changes to get around
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 24405
diff changeset
771 gc = purple_account_get_connection(account);
f516df0c0926 Apply khc's patch for ADL error 205, with a few changes to get around
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 24405
diff changeset
772
f516df0c0926 Apply khc's patch for ADL error 205, with a few changes to get around
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 24405
diff changeset
773 purple_notify_error(gc, NULL, _("Unable to add user"), reason);
f516df0c0926 Apply khc's patch for ADL error 205, with a few changes to get around
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 24405
diff changeset
774 g_free(reason);
f516df0c0926 Apply khc's patch for ADL error 205, with a few changes to get around
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 24405
diff changeset
775 }
f516df0c0926 Apply khc's patch for ADL error 205, with a few changes to get around
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 24405
diff changeset
776
f516df0c0926 Apply khc's patch for ADL error 205, with a few changes to get around
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 24405
diff changeset
777 static void
20522
177cad886d4c A bunch of MSNP14 stuff:
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 20515
diff changeset
778 adl_error(MsnCmdProc *cmdproc, MsnTransaction *trans, int error)
5309
3178acad1449 [gaim-migrate @ 5681]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
779 {
8808
1cb5ddf6b625 [gaim-migrate @ 9570]
Felipe Contreras <felipe.contreras@gmail.com>
parents: 8669
diff changeset
780 MsnSession *session;
20522
177cad886d4c A bunch of MSNP14 stuff:
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 20515
diff changeset
781 PurpleAccount *account;
177cad886d4c A bunch of MSNP14 stuff:
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 20515
diff changeset
782 PurpleConnection *gc;
24438
f516df0c0926 Apply khc's patch for ADL error 205, with a few changes to get around
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 24405
diff changeset
783 MsnCommand *cmd = cmdproc->last_cmd;
5518
436fb9490b62 [gaim-migrate @ 5918]
Christian Hammond <chipx86@chipx86.com>
parents: 5509
diff changeset
784
9193
6e76f1367896 [gaim-migrate @ 9988]
Felipe Contreras <felipe.contreras@gmail.com>
parents: 9158
diff changeset
785 session = cmdproc->session;
20522
177cad886d4c A bunch of MSNP14 stuff:
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 20515
diff changeset
786 account = session->account;
177cad886d4c A bunch of MSNP14 stuff:
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 20515
diff changeset
787 gc = purple_account_get_connection(account);
5457
586285a6ff22 [gaim-migrate @ 5845]
Christian Hammond <chipx86@chipx86.com>
parents: 5456
diff changeset
788
23830
1436e3de5d6c The great MSN debug message cleanup! Threw in a few whitespace fixes,
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 23828
diff changeset
789 purple_debug_error("msn", "ADL error\n");
24438
f516df0c0926 Apply khc's patch for ADL error 205, with a few changes to get around
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 24405
diff changeset
790 if (cmd->param_count > 1) {
f516df0c0926 Apply khc's patch for ADL error 205, with a few changes to get around
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 24405
diff changeset
791 cmd->payload_cb = adl_error_parse;
f516df0c0926 Apply khc's patch for ADL error 205, with a few changes to get around
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 24405
diff changeset
792 cmd->payload_len = atoi(cmd->params[1]);
f516df0c0926 Apply khc's patch for ADL error 205, with a few changes to get around
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 24405
diff changeset
793 cmd->payload_cbdata = GINT_TO_POINTER(error);
f516df0c0926 Apply khc's patch for ADL error 205, with a few changes to get around
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 24405
diff changeset
794 } else {
f516df0c0926 Apply khc's patch for ADL error 205, with a few changes to get around
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 24405
diff changeset
795 char *reason = g_strdup_printf(_("Unknown error (%d)"), error);
f516df0c0926 Apply khc's patch for ADL error 205, with a few changes to get around
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 24405
diff changeset
796 purple_notify_error(gc, NULL, _("Unable to add user"), reason);
f516df0c0926 Apply khc's patch for ADL error 205, with a few changes to get around
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 24405
diff changeset
797 g_free(reason);
f516df0c0926 Apply khc's patch for ADL error 205, with a few changes to get around
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 24405
diff changeset
798 }
20522
177cad886d4c A bunch of MSNP14 stuff:
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 20515
diff changeset
799 }
5457
586285a6ff22 [gaim-migrate @ 5845]
Christian Hammond <chipx86@chipx86.com>
parents: 5456
diff changeset
800
20522
177cad886d4c A bunch of MSNP14 stuff:
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 20515
diff changeset
801 static void
24383
47b92be772ce Apply khc's patch for 241 error. Tested it out myself. Cleaned up the
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 24382
diff changeset
802 adl_241_error_cmd_post(MsnCmdProc *cmdproc, MsnCommand *cmd, char *payload,
47b92be772ce Apply khc's patch for 241 error. Tested it out myself. Cleaned up the
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 24382
diff changeset
803 size_t len)
47b92be772ce Apply khc's patch for 241 error. Tested it out myself. Cleaned up the
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 24382
diff changeset
804 {
47b92be772ce Apply khc's patch for 241 error. Tested it out myself. Cleaned up the
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 24382
diff changeset
805 /* khc: some googling suggests that error 241 means the buddy is somehow
47b92be772ce Apply khc's patch for 241 error. Tested it out myself. Cleaned up the
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 24382
diff changeset
806 in the local list, but not the server list, and that we should add
47b92be772ce Apply khc's patch for 241 error. Tested it out myself. Cleaned up the
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 24382
diff changeset
807 those buddies to the addressbook. For now I will just notify the user
47b92be772ce Apply khc's patch for 241 error. Tested it out myself. Cleaned up the
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 24382
diff changeset
808 about the raw payload, because I am lazy */
47b92be772ce Apply khc's patch for 241 error. Tested it out myself. Cleaned up the
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 24382
diff changeset
809 MsnSession *session;
47b92be772ce Apply khc's patch for 241 error. Tested it out myself. Cleaned up the
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 24382
diff changeset
810 PurpleAccount *account;
47b92be772ce Apply khc's patch for 241 error. Tested it out myself. Cleaned up the
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 24382
diff changeset
811 PurpleConnection *gc;
47b92be772ce Apply khc's patch for 241 error. Tested it out myself. Cleaned up the
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 24382
diff changeset
812 xmlnode *adl;
47b92be772ce Apply khc's patch for 241 error. Tested it out myself. Cleaned up the
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 24382
diff changeset
813 xmlnode *domain;
47b92be772ce Apply khc's patch for 241 error. Tested it out myself. Cleaned up the
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 24382
diff changeset
814 GString *emails;
47b92be772ce Apply khc's patch for 241 error. Tested it out myself. Cleaned up the
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 24382
diff changeset
815
47b92be772ce Apply khc's patch for 241 error. Tested it out myself. Cleaned up the
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 24382
diff changeset
816 session = cmdproc->session;
47b92be772ce Apply khc's patch for 241 error. Tested it out myself. Cleaned up the
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 24382
diff changeset
817 account = session->account;
47b92be772ce Apply khc's patch for 241 error. Tested it out myself. Cleaned up the
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 24382
diff changeset
818 gc = purple_account_get_connection(account);
47b92be772ce Apply khc's patch for 241 error. Tested it out myself. Cleaned up the
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 24382
diff changeset
819
47b92be772ce Apply khc's patch for 241 error. Tested it out myself. Cleaned up the
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 24382
diff changeset
820 adl = xmlnode_from_str(payload, len);
47b92be772ce Apply khc's patch for 241 error. Tested it out myself. Cleaned up the
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 24382
diff changeset
821 emails = g_string_new(NULL);
47b92be772ce Apply khc's patch for 241 error. Tested it out myself. Cleaned up the
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 24382
diff changeset
822
47b92be772ce Apply khc's patch for 241 error. Tested it out myself. Cleaned up the
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 24382
diff changeset
823 domain = xmlnode_get_child(adl, "d");
47b92be772ce Apply khc's patch for 241 error. Tested it out myself. Cleaned up the
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 24382
diff changeset
824 while (domain) {
47b92be772ce Apply khc's patch for 241 error. Tested it out myself. Cleaned up the
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 24382
diff changeset
825 const char *domain_str = xmlnode_get_attrib(domain, "n");
47b92be772ce Apply khc's patch for 241 error. Tested it out myself. Cleaned up the
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 24382
diff changeset
826 xmlnode *contact = xmlnode_get_child(domain, "c");
47b92be772ce Apply khc's patch for 241 error. Tested it out myself. Cleaned up the
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 24382
diff changeset
827 while (contact) {
47b92be772ce Apply khc's patch for 241 error. Tested it out myself. Cleaned up the
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 24382
diff changeset
828 g_string_append_printf(emails, "%s@%s\n",
47b92be772ce Apply khc's patch for 241 error. Tested it out myself. Cleaned up the
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 24382
diff changeset
829 xmlnode_get_attrib(contact, "n"), domain_str);
47b92be772ce Apply khc's patch for 241 error. Tested it out myself. Cleaned up the
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 24382
diff changeset
830 contact = xmlnode_get_next_twin(contact);
47b92be772ce Apply khc's patch for 241 error. Tested it out myself. Cleaned up the
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 24382
diff changeset
831 }
47b92be772ce Apply khc's patch for 241 error. Tested it out myself. Cleaned up the
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 24382
diff changeset
832 domain = xmlnode_get_next_twin(domain);
47b92be772ce Apply khc's patch for 241 error. Tested it out myself. Cleaned up the
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 24382
diff changeset
833 }
47b92be772ce Apply khc's patch for 241 error. Tested it out myself. Cleaned up the
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 24382
diff changeset
834
47b92be772ce Apply khc's patch for 241 error. Tested it out myself. Cleaned up the
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 24382
diff changeset
835 purple_notify_error(gc, NULL,
47b92be772ce Apply khc's patch for 241 error. Tested it out myself. Cleaned up the
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 24382
diff changeset
836 _("The following users are missing from your addressbook"), emails->str);
47b92be772ce Apply khc's patch for 241 error. Tested it out myself. Cleaned up the
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 24382
diff changeset
837 g_string_free(emails, TRUE);
47b92be772ce Apply khc's patch for 241 error. Tested it out myself. Cleaned up the
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 24382
diff changeset
838 xmlnode_free(adl);
47b92be772ce Apply khc's patch for 241 error. Tested it out myself. Cleaned up the
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 24382
diff changeset
839 }
47b92be772ce Apply khc's patch for 241 error. Tested it out myself. Cleaned up the
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 24382
diff changeset
840
47b92be772ce Apply khc's patch for 241 error. Tested it out myself. Cleaned up the
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 24382
diff changeset
841 static void
47b92be772ce Apply khc's patch for 241 error. Tested it out myself. Cleaned up the
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 24382
diff changeset
842 adl_241_error_cmd(MsnCmdProc *cmdproc, MsnCommand *cmd)
47b92be772ce Apply khc's patch for 241 error. Tested it out myself. Cleaned up the
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 24382
diff changeset
843 {
47b92be772ce Apply khc's patch for 241 error. Tested it out myself. Cleaned up the
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 24382
diff changeset
844 cmdproc->last_cmd->payload_cb = adl_241_error_cmd_post;
47b92be772ce Apply khc's patch for 241 error. Tested it out myself. Cleaned up the
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 24382
diff changeset
845 cmd->payload_len = atoi(cmd->params[1]);
47b92be772ce Apply khc's patch for 241 error. Tested it out myself. Cleaned up the
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 24382
diff changeset
846 }
47b92be772ce Apply khc's patch for 241 error. Tested it out myself. Cleaned up the
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 24382
diff changeset
847
47b92be772ce Apply khc's patch for 241 error. Tested it out myself. Cleaned up the
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 24382
diff changeset
848 static void
13873
3c20f5d70d1d [gaim-migrate @ 16772]
Ma Yuan <mayuan2006@gmail.com>
parents: 13871
diff changeset
849 fqy_cmd_post(MsnCmdProc *cmdproc, MsnCommand *cmd, char *payload,
3c20f5d70d1d [gaim-migrate @ 16772]
Ma Yuan <mayuan2006@gmail.com>
parents: 13871
diff changeset
850 size_t len)
3c20f5d70d1d [gaim-migrate @ 16772]
Ma Yuan <mayuan2006@gmail.com>
parents: 13871
diff changeset
851 {
23830
1436e3de5d6c The great MSN debug message cleanup! Threw in a few whitespace fixes,
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 23828
diff changeset
852 purple_debug_info("msn", "FQY payload:\n%s\n", payload);
20564
35675dd4a44d Make buddy and group management actually work, add some SOAP templates, redesign some parts of code and separate some bigger functions into its smaller tasks which are completely unrelated to each other
Carlos Silva <typ0@pidgin.im>
parents: 20560
diff changeset
853 g_return_if_fail(cmdproc->session != NULL);
23833
1a4c1d44858d Take care of more cleanup in the MSN code.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 23832
diff changeset
854 /* msn_notification_post_adl(cmdproc, payload, len); */
1a4c1d44858d Take care of more cleanup in the MSN code.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 23832
diff changeset
855 /* msn_get_address_book(cmdproc->session, MSN_AB_SAVE_CONTACT, NULL, NULL); */
13873
3c20f5d70d1d [gaim-migrate @ 16772]
Ma Yuan <mayuan2006@gmail.com>
parents: 13871
diff changeset
856 }
9197
3c9b907b45a7 [gaim-migrate @ 9992]
Christian Hammond <chipx86@chipx86.com>
parents: 9194
diff changeset
857
13873
3c20f5d70d1d [gaim-migrate @ 16772]
Ma Yuan <mayuan2006@gmail.com>
parents: 13871
diff changeset
858 static void
3c20f5d70d1d [gaim-migrate @ 16772]
Ma Yuan <mayuan2006@gmail.com>
parents: 13871
diff changeset
859 fqy_cmd(MsnCmdProc *cmdproc, MsnCommand *cmd)
3c20f5d70d1d [gaim-migrate @ 16772]
Ma Yuan <mayuan2006@gmail.com>
parents: 13871
diff changeset
860 {
23830
1436e3de5d6c The great MSN debug message cleanup! Threw in a few whitespace fixes,
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 23828
diff changeset
861 purple_debug_info("msn", "Process FQY\n");
20564
35675dd4a44d Make buddy and group management actually work, add some SOAP templates, redesign some parts of code and separate some bigger functions into its smaller tasks which are completely unrelated to each other
Carlos Silva <typ0@pidgin.im>
parents: 20560
diff changeset
862 cmdproc->last_cmd->payload_cb = fqy_cmd_post;
23826
3eeaac42358f Get rid of that whole msn_set_payload_len thing and correctly set the
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 23824
diff changeset
863 cmd->payload_len = atoi(cmd->params[1]);
3eeaac42358f Get rid of that whole msn_set_payload_len thing and correctly set the
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 23824
diff changeset
864 }
3eeaac42358f Get rid of that whole msn_set_payload_len thing and correctly set the
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 23824
diff changeset
865
3eeaac42358f Get rid of that whole msn_set_payload_len thing and correctly set the
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 23824
diff changeset
866 static void
3eeaac42358f Get rid of that whole msn_set_payload_len thing and correctly set the
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 23824
diff changeset
867 rml_cmd_post(MsnCmdProc *cmdproc, MsnCommand *cmd, char *payload,
3eeaac42358f Get rid of that whole msn_set_payload_len thing and correctly set the
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 23824
diff changeset
868 size_t len)
3eeaac42358f Get rid of that whole msn_set_payload_len thing and correctly set the
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 23824
diff changeset
869 {
3eeaac42358f Get rid of that whole msn_set_payload_len thing and correctly set the
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 23824
diff changeset
870 if (payload != NULL)
3eeaac42358f Get rid of that whole msn_set_payload_len thing and correctly set the
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 23824
diff changeset
871 purple_debug_info("msn", "Received RML:\n%s\n", payload);
13873
3c20f5d70d1d [gaim-migrate @ 16772]
Ma Yuan <mayuan2006@gmail.com>
parents: 13871
diff changeset
872 }
5309
3178acad1449 [gaim-migrate @ 5681]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
873
13873
3c20f5d70d1d [gaim-migrate @ 16772]
Ma Yuan <mayuan2006@gmail.com>
parents: 13871
diff changeset
874 static void
13855
24cff9e060d7 [gaim-migrate @ 16507]
Ma Yuan <mayuan2006@gmail.com>
parents: 13854
diff changeset
875 rml_cmd(MsnCmdProc *cmdproc, MsnCommand *cmd)
24cff9e060d7 [gaim-migrate @ 16507]
Ma Yuan <mayuan2006@gmail.com>
parents: 13854
diff changeset
876 {
23830
1436e3de5d6c The great MSN debug message cleanup! Threw in a few whitespace fixes,
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 23828
diff changeset
877 purple_debug_info("msn", "Process RML\n");
23826
3eeaac42358f Get rid of that whole msn_set_payload_len thing and correctly set the
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 23824
diff changeset
878 cmd->payload_len = atoi(cmd->params[1]);
3eeaac42358f Get rid of that whole msn_set_payload_len thing and correctly set the
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 23824
diff changeset
879 cmdproc->last_cmd->payload_cb = rml_cmd_post;
5309
3178acad1449 [gaim-migrate @ 5681]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
880 }
3178acad1449 [gaim-migrate @ 5681]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
881
8808
1cb5ddf6b625 [gaim-migrate @ 9570]
Felipe Contreras <felipe.contreras@gmail.com>
parents: 8669
diff changeset
882 static void
1cb5ddf6b625 [gaim-migrate @ 9570]
Felipe Contreras <felipe.contreras@gmail.com>
parents: 8669
diff changeset
883 add_error(MsnCmdProc *cmdproc, MsnTransaction *trans, int error)
1cb5ddf6b625 [gaim-migrate @ 9570]
Felipe Contreras <felipe.contreras@gmail.com>
parents: 8669
diff changeset
884 {
1cb5ddf6b625 [gaim-migrate @ 9570]
Felipe Contreras <felipe.contreras@gmail.com>
parents: 8669
diff changeset
885 MsnSession *session;
15884
4de1981757fc sed -ie 's/gaim/purple/g'
Sean Egan <seanegan@pidgin.im>
parents: 15435
diff changeset
886 PurpleAccount *account;
4de1981757fc sed -ie 's/gaim/purple/g'
Sean Egan <seanegan@pidgin.im>
parents: 15435
diff changeset
887 PurpleConnection *gc;
8808
1cb5ddf6b625 [gaim-migrate @ 9570]
Felipe Contreras <felipe.contreras@gmail.com>
parents: 8669
diff changeset
888 const char *list, *passport;
9897
28ae043d7cda [gaim-migrate @ 10786]
Felipe Contreras <felipe.contreras@gmail.com>
parents: 9859
diff changeset
889 char *reason = NULL;
8808
1cb5ddf6b625 [gaim-migrate @ 9570]
Felipe Contreras <felipe.contreras@gmail.com>
parents: 8669
diff changeset
890 char *msg = NULL;
1cb5ddf6b625 [gaim-migrate @ 9570]
Felipe Contreras <felipe.contreras@gmail.com>
parents: 8669
diff changeset
891 char **params;
1cb5ddf6b625 [gaim-migrate @ 9570]
Felipe Contreras <felipe.contreras@gmail.com>
parents: 8669
diff changeset
892
1cb5ddf6b625 [gaim-migrate @ 9570]
Felipe Contreras <felipe.contreras@gmail.com>
parents: 8669
diff changeset
893 session = cmdproc->session;
1cb5ddf6b625 [gaim-migrate @ 9570]
Felipe Contreras <felipe.contreras@gmail.com>
parents: 8669
diff changeset
894 account = session->account;
15884
4de1981757fc sed -ie 's/gaim/purple/g'
Sean Egan <seanegan@pidgin.im>
parents: 15435
diff changeset
895 gc = purple_account_get_connection(account);
8808
1cb5ddf6b625 [gaim-migrate @ 9570]
Felipe Contreras <felipe.contreras@gmail.com>
parents: 8669
diff changeset
896 params = g_strsplit(trans->params, " ", 0);
1cb5ddf6b625 [gaim-migrate @ 9570]
Felipe Contreras <felipe.contreras@gmail.com>
parents: 8669
diff changeset
897
1cb5ddf6b625 [gaim-migrate @ 9570]
Felipe Contreras <felipe.contreras@gmail.com>
parents: 8669
diff changeset
898 list = params[0];
1cb5ddf6b625 [gaim-migrate @ 9570]
Felipe Contreras <felipe.contreras@gmail.com>
parents: 8669
diff changeset
899 passport = params[1];
1cb5ddf6b625 [gaim-migrate @ 9570]
Felipe Contreras <felipe.contreras@gmail.com>
parents: 8669
diff changeset
900
1cb5ddf6b625 [gaim-migrate @ 9570]
Felipe Contreras <felipe.contreras@gmail.com>
parents: 8669
diff changeset
901 if (!strcmp(list, "FL"))
10451
2df35a139363 [gaim-migrate @ 11717]
Felipe Contreras <felipe.contreras@gmail.com>
parents: 10403
diff changeset
902 msg = g_strdup_printf(_("Unable to add user on %s (%s)"),
15884
4de1981757fc sed -ie 's/gaim/purple/g'
Sean Egan <seanegan@pidgin.im>
parents: 15435
diff changeset
903 purple_account_get_username(account),
4de1981757fc sed -ie 's/gaim/purple/g'
Sean Egan <seanegan@pidgin.im>
parents: 15435
diff changeset
904 purple_account_get_protocol_name(account));
8808
1cb5ddf6b625 [gaim-migrate @ 9570]
Felipe Contreras <felipe.contreras@gmail.com>
parents: 8669
diff changeset
905 else if (!strcmp(list, "BL"))
10451
2df35a139363 [gaim-migrate @ 11717]
Felipe Contreras <felipe.contreras@gmail.com>
parents: 10403
diff changeset
906 msg = g_strdup_printf(_("Unable to block user on %s (%s)"),
15884
4de1981757fc sed -ie 's/gaim/purple/g'
Sean Egan <seanegan@pidgin.im>
parents: 15435
diff changeset
907 purple_account_get_username(account),
4de1981757fc sed -ie 's/gaim/purple/g'
Sean Egan <seanegan@pidgin.im>
parents: 15435
diff changeset
908 purple_account_get_protocol_name(account));
8808
1cb5ddf6b625 [gaim-migrate @ 9570]
Felipe Contreras <felipe.contreras@gmail.com>
parents: 8669
diff changeset
909 else if (!strcmp(list, "AL"))
10451
2df35a139363 [gaim-migrate @ 11717]
Felipe Contreras <felipe.contreras@gmail.com>
parents: 10403
diff changeset
910 msg = g_strdup_printf(_("Unable to permit user on %s (%s)"),
15884
4de1981757fc sed -ie 's/gaim/purple/g'
Sean Egan <seanegan@pidgin.im>
parents: 15435
diff changeset
911 purple_account_get_username(account),
4de1981757fc sed -ie 's/gaim/purple/g'
Sean Egan <seanegan@pidgin.im>
parents: 15435
diff changeset
912 purple_account_get_protocol_name(account));
8808
1cb5ddf6b625 [gaim-migrate @ 9570]
Felipe Contreras <felipe.contreras@gmail.com>
parents: 8669
diff changeset
913
1cb5ddf6b625 [gaim-migrate @ 9570]
Felipe Contreras <felipe.contreras@gmail.com>
parents: 8669
diff changeset
914 if (!strcmp(list, "FL"))
1cb5ddf6b625 [gaim-migrate @ 9570]
Felipe Contreras <felipe.contreras@gmail.com>
parents: 8669
diff changeset
915 {
9900
fc219ee81de6 [gaim-migrate @ 10791]
Mark Doliner <markdoliner@pidgin.im>
parents: 9897
diff changeset
916 if (error == 210)
9897
28ae043d7cda [gaim-migrate @ 10786]
Felipe Contreras <felipe.contreras@gmail.com>
parents: 9859
diff changeset
917 {
10451
2df35a139363 [gaim-migrate @ 11717]
Felipe Contreras <felipe.contreras@gmail.com>
parents: 10403
diff changeset
918 reason = g_strdup_printf(_("%s could not be added because "
2df35a139363 [gaim-migrate @ 11717]
Felipe Contreras <felipe.contreras@gmail.com>
parents: 10403
diff changeset
919 "your buddy list is full."), passport);
9897
28ae043d7cda [gaim-migrate @ 10786]
Felipe Contreras <felipe.contreras@gmail.com>
parents: 9859
diff changeset
920 }
8808
1cb5ddf6b625 [gaim-migrate @ 9570]
Felipe Contreras <felipe.contreras@gmail.com>
parents: 8669
diff changeset
921 }
9897
28ae043d7cda [gaim-migrate @ 10786]
Felipe Contreras <felipe.contreras@gmail.com>
parents: 9859
diff changeset
922
28ae043d7cda [gaim-migrate @ 10786]
Felipe Contreras <felipe.contreras@gmail.com>
parents: 9859
diff changeset
923 if (reason == NULL)
8808
1cb5ddf6b625 [gaim-migrate @ 9570]
Felipe Contreras <felipe.contreras@gmail.com>
parents: 8669
diff changeset
924 {
9897
28ae043d7cda [gaim-migrate @ 10786]
Felipe Contreras <felipe.contreras@gmail.com>
parents: 9859
diff changeset
925 if (error == 208)
28ae043d7cda [gaim-migrate @ 10786]
Felipe Contreras <felipe.contreras@gmail.com>
parents: 9859
diff changeset
926 {
10451
2df35a139363 [gaim-migrate @ 11717]
Felipe Contreras <felipe.contreras@gmail.com>
parents: 10403
diff changeset
927 reason = g_strdup_printf(_("%s is not a valid passport account."),
9897
28ae043d7cda [gaim-migrate @ 10786]
Felipe Contreras <felipe.contreras@gmail.com>
parents: 9859
diff changeset
928 passport);
28ae043d7cda [gaim-migrate @ 10786]
Felipe Contreras <felipe.contreras@gmail.com>
parents: 9859
diff changeset
929 }
11862
5d4bc6d54688 [gaim-migrate @ 14153]
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 11819
diff changeset
930 else if (error == 500)
5d4bc6d54688 [gaim-migrate @ 14153]
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 11819
diff changeset
931 {
5d4bc6d54688 [gaim-migrate @ 14153]
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 11819
diff changeset
932 reason = g_strdup(_("Service Temporarily Unavailable."));
5d4bc6d54688 [gaim-migrate @ 14153]
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 11819
diff changeset
933 }
9897
28ae043d7cda [gaim-migrate @ 10786]
Felipe Contreras <felipe.contreras@gmail.com>
parents: 9859
diff changeset
934 else
28ae043d7cda [gaim-migrate @ 10786]
Felipe Contreras <felipe.contreras@gmail.com>
parents: 9859
diff changeset
935 {
11862
5d4bc6d54688 [gaim-migrate @ 14153]
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 11819
diff changeset
936 reason = g_strdup(_("Unknown error."));
9897
28ae043d7cda [gaim-migrate @ 10786]
Felipe Contreras <felipe.contreras@gmail.com>
parents: 9859
diff changeset
937 }
8808
1cb5ddf6b625 [gaim-migrate @ 9570]
Felipe Contreras <felipe.contreras@gmail.com>
parents: 8669
diff changeset
938 }
1cb5ddf6b625 [gaim-migrate @ 9570]
Felipe Contreras <felipe.contreras@gmail.com>
parents: 8669
diff changeset
939
1cb5ddf6b625 [gaim-migrate @ 9570]
Felipe Contreras <felipe.contreras@gmail.com>
parents: 8669
diff changeset
940 if (msg != NULL)
1cb5ddf6b625 [gaim-migrate @ 9570]
Felipe Contreras <felipe.contreras@gmail.com>
parents: 8669
diff changeset
941 {
15884
4de1981757fc sed -ie 's/gaim/purple/g'
Sean Egan <seanegan@pidgin.im>
parents: 15435
diff changeset
942 purple_notify_error(gc, NULL, msg, reason);
8808
1cb5ddf6b625 [gaim-migrate @ 9570]
Felipe Contreras <felipe.contreras@gmail.com>
parents: 8669
diff changeset
943 g_free(msg);
1cb5ddf6b625 [gaim-migrate @ 9570]
Felipe Contreras <felipe.contreras@gmail.com>
parents: 8669
diff changeset
944 }
1cb5ddf6b625 [gaim-migrate @ 9570]
Felipe Contreras <felipe.contreras@gmail.com>
parents: 8669
diff changeset
945
1cb5ddf6b625 [gaim-migrate @ 9570]
Felipe Contreras <felipe.contreras@gmail.com>
parents: 8669
diff changeset
946 if (!strcmp(list, "FL"))
1cb5ddf6b625 [gaim-migrate @ 9570]
Felipe Contreras <felipe.contreras@gmail.com>
parents: 8669
diff changeset
947 {
15884
4de1981757fc sed -ie 's/gaim/purple/g'
Sean Egan <seanegan@pidgin.im>
parents: 15435
diff changeset
948 PurpleBuddy *buddy;
8808
1cb5ddf6b625 [gaim-migrate @ 9570]
Felipe Contreras <felipe.contreras@gmail.com>
parents: 8669
diff changeset
949
15884
4de1981757fc sed -ie 's/gaim/purple/g'
Sean Egan <seanegan@pidgin.im>
parents: 15435
diff changeset
950 buddy = purple_find_buddy(account, passport);
8808
1cb5ddf6b625 [gaim-migrate @ 9570]
Felipe Contreras <felipe.contreras@gmail.com>
parents: 8669
diff changeset
951
1cb5ddf6b625 [gaim-migrate @ 9570]
Felipe Contreras <felipe.contreras@gmail.com>
parents: 8669
diff changeset
952 if (buddy != NULL)
15884
4de1981757fc sed -ie 's/gaim/purple/g'
Sean Egan <seanegan@pidgin.im>
parents: 15435
diff changeset
953 purple_blist_remove_buddy(buddy);
8808
1cb5ddf6b625 [gaim-migrate @ 9570]
Felipe Contreras <felipe.contreras@gmail.com>
parents: 8669
diff changeset
954 }
1cb5ddf6b625 [gaim-migrate @ 9570]
Felipe Contreras <felipe.contreras@gmail.com>
parents: 8669
diff changeset
955
1cb5ddf6b625 [gaim-migrate @ 9570]
Felipe Contreras <felipe.contreras@gmail.com>
parents: 8669
diff changeset
956 g_free(reason);
1cb5ddf6b625 [gaim-migrate @ 9570]
Felipe Contreras <felipe.contreras@gmail.com>
parents: 8669
diff changeset
957
1cb5ddf6b625 [gaim-migrate @ 9570]
Felipe Contreras <felipe.contreras@gmail.com>
parents: 8669
diff changeset
958 g_strfreev(params);
1cb5ddf6b625 [gaim-migrate @ 9570]
Felipe Contreras <felipe.contreras@gmail.com>
parents: 8669
diff changeset
959 }
1cb5ddf6b625 [gaim-migrate @ 9570]
Felipe Contreras <felipe.contreras@gmail.com>
parents: 8669
diff changeset
960
1cb5ddf6b625 [gaim-migrate @ 9570]
Felipe Contreras <felipe.contreras@gmail.com>
parents: 8669
diff changeset
961 static void
1cb5ddf6b625 [gaim-migrate @ 9570]
Felipe Contreras <felipe.contreras@gmail.com>
parents: 8669
diff changeset
962 adg_cmd(MsnCmdProc *cmdproc, MsnCommand *cmd)
5322
782746a9bfdd [gaim-migrate @ 5694]
Christian Hammond <chipx86@chipx86.com>
parents: 5318
diff changeset
963 {
8808
1cb5ddf6b625 [gaim-migrate @ 9570]
Felipe Contreras <felipe.contreras@gmail.com>
parents: 8669
diff changeset
964 MsnSession *session;
5518
436fb9490b62 [gaim-migrate @ 5918]
Christian Hammond <chipx86@chipx86.com>
parents: 5509
diff changeset
965 gint group_id;
7162
dfd30c70acde [gaim-migrate @ 7729]
Nathan Walp <nwalp@pidgin.im>
parents: 7134
diff changeset
966 const char *group_name;
5322
782746a9bfdd [gaim-migrate @ 5694]
Christian Hammond <chipx86@chipx86.com>
parents: 5318
diff changeset
967
8808
1cb5ddf6b625 [gaim-migrate @ 9570]
Felipe Contreras <felipe.contreras@gmail.com>
parents: 8669
diff changeset
968 session = cmdproc->session;
5322
782746a9bfdd [gaim-migrate @ 5694]
Christian Hammond <chipx86@chipx86.com>
parents: 5318
diff changeset
969
8808
1cb5ddf6b625 [gaim-migrate @ 9570]
Felipe Contreras <felipe.contreras@gmail.com>
parents: 8669
diff changeset
970 group_id = atoi(cmd->params[3]);
1cb5ddf6b625 [gaim-migrate @ 9570]
Felipe Contreras <felipe.contreras@gmail.com>
parents: 8669
diff changeset
971
15884
4de1981757fc sed -ie 's/gaim/purple/g'
Sean Egan <seanegan@pidgin.im>
parents: 15435
diff changeset
972 group_name = purple_url_decode(cmd->params[2]);
5322
782746a9bfdd [gaim-migrate @ 5694]
Christian Hammond <chipx86@chipx86.com>
parents: 5318
diff changeset
973
20474
b0ef257ef8d4 The second msn.tgz from SF Patch #1621854 from Ka-Hing Cheung.
Ka-Hing Cheung <khc@pidgin.im>
parents: 20472
diff changeset
974 msn_group_new(session->userlist, cmd->params[3], group_name);
6701
7e2db9273748 [gaim-migrate @ 7227]
Christian Hammond <chipx86@chipx86.com>
parents: 6695
diff changeset
975
20564
35675dd4a44d Make buddy and group management actually work, add some SOAP templates, redesign some parts of code and separate some bigger functions into its smaller tasks which are completely unrelated to each other
Carlos Silva <typ0@pidgin.im>
parents: 20560
diff changeset
976 /* There is a user that must be moved to this group */
9193
6e76f1367896 [gaim-migrate @ 9988]
Felipe Contreras <felipe.contreras@gmail.com>
parents: 9158
diff changeset
977 if (cmd->trans->data)
8808
1cb5ddf6b625 [gaim-migrate @ 9570]
Felipe Contreras <felipe.contreras@gmail.com>
parents: 8669
diff changeset
978 {
9193
6e76f1367896 [gaim-migrate @ 9988]
Felipe Contreras <felipe.contreras@gmail.com>
parents: 9158
diff changeset
979 /* msn_userlist_move_buddy(); */
6e76f1367896 [gaim-migrate @ 9988]
Felipe Contreras <felipe.contreras@gmail.com>
parents: 9158
diff changeset
980 MsnUserList *userlist = cmdproc->session->userlist;
20564
35675dd4a44d Make buddy and group management actually work, add some SOAP templates, redesign some parts of code and separate some bigger functions into its smaller tasks which are completely unrelated to each other
Carlos Silva <typ0@pidgin.im>
parents: 20560
diff changeset
981 MsnCallbackState *data = cmd->trans->data;
5309
3178acad1449 [gaim-migrate @ 5681]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
982
9193
6e76f1367896 [gaim-migrate @ 9988]
Felipe Contreras <felipe.contreras@gmail.com>
parents: 9158
diff changeset
983 if (data->old_group_name != NULL)
6e76f1367896 [gaim-migrate @ 9988]
Felipe Contreras <felipe.contreras@gmail.com>
parents: 9158
diff changeset
984 {
20564
35675dd4a44d Make buddy and group management actually work, add some SOAP templates, redesign some parts of code and separate some bigger functions into its smaller tasks which are completely unrelated to each other
Carlos Silva <typ0@pidgin.im>
parents: 20560
diff changeset
985 msn_userlist_move_buddy(userlist, data->who, data->old_group_name, group_name);
9193
6e76f1367896 [gaim-migrate @ 9988]
Felipe Contreras <felipe.contreras@gmail.com>
parents: 9158
diff changeset
986 g_free(data->old_group_name);
20564
35675dd4a44d Make buddy and group management actually work, add some SOAP templates, redesign some parts of code and separate some bigger functions into its smaller tasks which are completely unrelated to each other
Carlos Silva <typ0@pidgin.im>
parents: 20560
diff changeset
987 } else {
23833
1a4c1d44858d Take care of more cleanup in the MSN code.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 23832
diff changeset
988 /* msn_add_contact_to_group(userlist, data, data->who, group_name); */
9193
6e76f1367896 [gaim-migrate @ 9988]
Felipe Contreras <felipe.contreras@gmail.com>
parents: 9158
diff changeset
989 }
5361
a964b856e97f [gaim-migrate @ 5737]
Christian Hammond <chipx86@chipx86.com>
parents: 5358
diff changeset
990 }
a964b856e97f [gaim-migrate @ 5737]
Christian Hammond <chipx86@chipx86.com>
parents: 5358
diff changeset
991 }
a964b856e97f [gaim-migrate @ 5737]
Christian Hammond <chipx86@chipx86.com>
parents: 5358
diff changeset
992
8808
1cb5ddf6b625 [gaim-migrate @ 9570]
Felipe Contreras <felipe.contreras@gmail.com>
parents: 8669
diff changeset
993 static void
17202
32ab8bec7403 Periodically refresh the authentication info required to automatically log
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 17178
diff changeset
994 qng_cmd(MsnCmdProc *cmdproc, MsnCommand *cmd)
32ab8bec7403 Periodically refresh the authentication info required to automatically log
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 17178
diff changeset
995 {
23866
6926fed80ff1 Fixup MSN mailbox handling based on a patch from Felipe, plus various
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 23840
diff changeset
996 /* TODO: Call PNG after the timeout specified. */
17202
32ab8bec7403 Periodically refresh the authentication info required to automatically log
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 17178
diff changeset
997 }
32ab8bec7403 Periodically refresh the authentication info required to automatically log
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 17178
diff changeset
998
32ab8bec7403 Periodically refresh the authentication info required to automatically log
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 17178
diff changeset
999
32ab8bec7403 Periodically refresh the authentication info required to automatically log
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 17178
diff changeset
1000 static void
8808
1cb5ddf6b625 [gaim-migrate @ 9570]
Felipe Contreras <felipe.contreras@gmail.com>
parents: 8669
diff changeset
1001 fln_cmd(MsnCmdProc *cmdproc, MsnCommand *cmd)
5309
3178acad1449 [gaim-migrate @ 5681]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
1002 {
10296
9badf1cedc6e [gaim-migrate @ 11476]
Felipe Contreras <felipe.contreras@gmail.com>
parents: 10284
diff changeset
1003 MsnSlpLink *slplink;
10451
2df35a139363 [gaim-migrate @ 11717]
Felipe Contreras <felipe.contreras@gmail.com>
parents: 10403
diff changeset
1004 MsnUser *user;
10296
9badf1cedc6e [gaim-migrate @ 11476]
Felipe Contreras <felipe.contreras@gmail.com>
parents: 10284
diff changeset
1005
23448
5c570209a293 Add a few bits of documentation
Mark Doliner <markdoliner@pidgin.im>
parents: 23444
diff changeset
1006 /* Tell libpurple that the user has signed off */
10451
2df35a139363 [gaim-migrate @ 11717]
Felipe Contreras <felipe.contreras@gmail.com>
parents: 10403
diff changeset
1007 user = msn_userlist_find_user(cmdproc->session->userlist, cmd->params[0]);
23810
55d608317926 A patch from felipec to consistently use NULL for the status of offline
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 23808
diff changeset
1008 msn_user_set_state(user, NULL);
10451
2df35a139363 [gaim-migrate @ 11717]
Felipe Contreras <felipe.contreras@gmail.com>
parents: 10403
diff changeset
1009 msn_user_update(user);
10296
9badf1cedc6e [gaim-migrate @ 11476]
Felipe Contreras <felipe.contreras@gmail.com>
parents: 10284
diff changeset
1010
23448
5c570209a293 Add a few bits of documentation
Mark Doliner <markdoliner@pidgin.im>
parents: 23444
diff changeset
1011 /* If we have an open MsnSlpLink with the user then close it */
10296
9badf1cedc6e [gaim-migrate @ 11476]
Felipe Contreras <felipe.contreras@gmail.com>
parents: 10284
diff changeset
1012 slplink = msn_session_find_slplink(cmdproc->session, cmd->params[0]);
9badf1cedc6e [gaim-migrate @ 11476]
Felipe Contreras <felipe.contreras@gmail.com>
parents: 10284
diff changeset
1013 if (slplink != NULL)
9badf1cedc6e [gaim-migrate @ 11476]
Felipe Contreras <felipe.contreras@gmail.com>
parents: 10284
diff changeset
1014 msn_slplink_destroy(slplink);
9badf1cedc6e [gaim-migrate @ 11476]
Felipe Contreras <felipe.contreras@gmail.com>
parents: 10284
diff changeset
1015
5309
3178acad1449 [gaim-migrate @ 5681]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
1016 }
3178acad1449 [gaim-migrate @ 5681]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
1017
8808
1cb5ddf6b625 [gaim-migrate @ 9570]
Felipe Contreras <felipe.contreras@gmail.com>
parents: 8669
diff changeset
1018 static void
1cb5ddf6b625 [gaim-migrate @ 9570]
Felipe Contreras <felipe.contreras@gmail.com>
parents: 8669
diff changeset
1019 iln_cmd(MsnCmdProc *cmdproc, MsnCommand *cmd)
5309
3178acad1449 [gaim-migrate @ 5681]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
1020 {
8808
1cb5ddf6b625 [gaim-migrate @ 9570]
Felipe Contreras <felipe.contreras@gmail.com>
parents: 8669
diff changeset
1021 MsnSession *session;
15884
4de1981757fc sed -ie 's/gaim/purple/g'
Sean Egan <seanegan@pidgin.im>
parents: 15435
diff changeset
1022 PurpleAccount *account;
4de1981757fc sed -ie 's/gaim/purple/g'
Sean Egan <seanegan@pidgin.im>
parents: 15435
diff changeset
1023 PurpleConnection *gc;
6800
8f99c220b503 [gaim-migrate @ 7340]
Christian Hammond <chipx86@chipx86.com>
parents: 6779
diff changeset
1024 MsnUser *user;
24143
0c8b37e7b0c1 Support some older versions of the ILN command. Apparently some IM
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 24142
diff changeset
1025 MsnObject *msnobj = NULL;
22711
16e50aae4932 some other mobile stuff that Maiku fixed, fixes #2359
Ka-Hing Cheung <khc@pidgin.im>
parents: 22671
diff changeset
1026 unsigned long clientid;
24143
0c8b37e7b0c1 Support some older versions of the ILN command. Apparently some IM
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 24142
diff changeset
1027 int networkid = 0;
0c8b37e7b0c1 Support some older versions of the ILN command. Apparently some IM
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 24142
diff changeset
1028 const char *state, *passport;
0c8b37e7b0c1 Support some older versions of the ILN command. Apparently some IM
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 24142
diff changeset
1029 char *friendly;
5309
3178acad1449 [gaim-migrate @ 5681]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
1030
8808
1cb5ddf6b625 [gaim-migrate @ 9570]
Felipe Contreras <felipe.contreras@gmail.com>
parents: 8669
diff changeset
1031 session = cmdproc->session;
10010
d9ee01f0659a [gaim-migrate @ 10927]
Mark Doliner <markdoliner@pidgin.im>
parents: 9967
diff changeset
1032 account = session->account;
15884
4de1981757fc sed -ie 's/gaim/purple/g'
Sean Egan <seanegan@pidgin.im>
parents: 15435
diff changeset
1033 gc = purple_account_get_connection(account);
8808
1cb5ddf6b625 [gaim-migrate @ 9570]
Felipe Contreras <felipe.contreras@gmail.com>
parents: 8669
diff changeset
1034
1cb5ddf6b625 [gaim-migrate @ 9570]
Felipe Contreras <felipe.contreras@gmail.com>
parents: 8669
diff changeset
1035 state = cmd->params[1];
1cb5ddf6b625 [gaim-migrate @ 9570]
Felipe Contreras <felipe.contreras@gmail.com>
parents: 8669
diff changeset
1036 passport = cmd->params[2];
5309
3178acad1449 [gaim-migrate @ 5681]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
1037
9193
6e76f1367896 [gaim-migrate @ 9988]
Felipe Contreras <felipe.contreras@gmail.com>
parents: 9158
diff changeset
1038 user = msn_userlist_find_user(session->userlist, passport);
24143
0c8b37e7b0c1 Support some older versions of the ILN command. Apparently some IM
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 24142
diff changeset
1039 if (user == NULL)
0c8b37e7b0c1 Support some older versions of the ILN command. Apparently some IM
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 24142
diff changeset
1040 /* Where'd this come from? */
0c8b37e7b0c1 Support some older versions of the ILN command. Apparently some IM
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 24142
diff changeset
1041 return;
0c8b37e7b0c1 Support some older versions of the ILN command. Apparently some IM
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 24142
diff changeset
1042
0c8b37e7b0c1 Support some older versions of the ILN command. Apparently some IM
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 24142
diff changeset
1043 if (cmd->param_count == 7) {
0c8b37e7b0c1 Support some older versions of the ILN command. Apparently some IM
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 24142
diff changeset
1044 /* MSNP14+ with Display Picture object */
0c8b37e7b0c1 Support some older versions of the ILN command. Apparently some IM
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 24142
diff changeset
1045 networkid = atoi(cmd->params[3]);
0c8b37e7b0c1 Support some older versions of the ILN command. Apparently some IM
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 24142
diff changeset
1046 friendly = g_strdup(purple_url_decode(cmd->params[4]));
0c8b37e7b0c1 Support some older versions of the ILN command. Apparently some IM
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 24142
diff changeset
1047 clientid = strtoul(cmd->params[5], NULL, 10);
0c8b37e7b0c1 Support some older versions of the ILN command. Apparently some IM
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 24142
diff changeset
1048 msnobj = msn_object_new_from_string(purple_url_decode(cmd->params[6]));
0c8b37e7b0c1 Support some older versions of the ILN command. Apparently some IM
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 24142
diff changeset
1049 } else if (cmd->param_count == 6) {
0c8b37e7b0c1 Support some older versions of the ILN command. Apparently some IM
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 24142
diff changeset
1050 /* Yes, this is 5. The friendly name could start with a number,
0c8b37e7b0c1 Support some older versions of the ILN command. Apparently some IM
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 24142
diff changeset
1051 but the display picture object can't... */
0c8b37e7b0c1 Support some older versions of the ILN command. Apparently some IM
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 24142
diff changeset
1052 if (isdigit(cmd->params[5][0])) {
0c8b37e7b0c1 Support some older versions of the ILN command. Apparently some IM
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 24142
diff changeset
1053 /* MSNP14 without Display Picture object */
0c8b37e7b0c1 Support some older versions of the ILN command. Apparently some IM
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 24142
diff changeset
1054 networkid = atoi(cmd->params[3]);
0c8b37e7b0c1 Support some older versions of the ILN command. Apparently some IM
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 24142
diff changeset
1055 friendly = g_strdup(purple_url_decode(cmd->params[4]));
0c8b37e7b0c1 Support some older versions of the ILN command. Apparently some IM
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 24142
diff changeset
1056 clientid = strtoul(cmd->params[5], NULL, 10);
0c8b37e7b0c1 Support some older versions of the ILN command. Apparently some IM
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 24142
diff changeset
1057 } else {
0c8b37e7b0c1 Support some older versions of the ILN command. Apparently some IM
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 24142
diff changeset
1058 /* MSNP8+ with Display Picture object */
0c8b37e7b0c1 Support some older versions of the ILN command. Apparently some IM
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 24142
diff changeset
1059 friendly = g_strdup(purple_url_decode(cmd->params[3]));
0c8b37e7b0c1 Support some older versions of the ILN command. Apparently some IM
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 24142
diff changeset
1060 clientid = strtoul(cmd->params[4], NULL, 10);
0c8b37e7b0c1 Support some older versions of the ILN command. Apparently some IM
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 24142
diff changeset
1061 msnobj = msn_object_new_from_string(purple_url_decode(cmd->params[5]));
0c8b37e7b0c1 Support some older versions of the ILN command. Apparently some IM
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 24142
diff changeset
1062 }
0c8b37e7b0c1 Support some older versions of the ILN command. Apparently some IM
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 24142
diff changeset
1063 } else if (cmd->param_count == 5) {
0c8b37e7b0c1 Support some older versions of the ILN command. Apparently some IM
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 24142
diff changeset
1064 /* MSNP8+ without Display Picture object */
0c8b37e7b0c1 Support some older versions of the ILN command. Apparently some IM
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 24142
diff changeset
1065 friendly = g_strdup(purple_url_decode(cmd->params[3]));
0c8b37e7b0c1 Support some older versions of the ILN command. Apparently some IM
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 24142
diff changeset
1066 clientid = strtoul(cmd->params[4], NULL, 10);
0c8b37e7b0c1 Support some older versions of the ILN command. Apparently some IM
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 24142
diff changeset
1067 } else {
0c8b37e7b0c1 Support some older versions of the ILN command. Apparently some IM
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 24142
diff changeset
1068 purple_debug_warning("msn", "Received ILN with unknown number of parameters.\n");
0c8b37e7b0c1 Support some older versions of the ILN command. Apparently some IM
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 24142
diff changeset
1069 return;
0c8b37e7b0c1 Support some older versions of the ILN command. Apparently some IM
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 24142
diff changeset
1070 }
6858
a367cfd3e75f [gaim-migrate @ 7403]
Christian Hammond <chipx86@chipx86.com>
parents: 6833
diff changeset
1071
9193
6e76f1367896 [gaim-migrate @ 9988]
Felipe Contreras <felipe.contreras@gmail.com>
parents: 9158
diff changeset
1072 serv_got_alias(gc, passport, friendly);
6e76f1367896 [gaim-migrate @ 9988]
Felipe Contreras <felipe.contreras@gmail.com>
parents: 9158
diff changeset
1073 msn_user_set_friendly_name(user, friendly);
24143
0c8b37e7b0c1 Support some older versions of the ILN command. Apparently some IM
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 24142
diff changeset
1074 g_free(friendly);
6858
a367cfd3e75f [gaim-migrate @ 7403]
Christian Hammond <chipx86@chipx86.com>
parents: 6833
diff changeset
1075
24143
0c8b37e7b0c1 Support some older versions of the ILN command. Apparently some IM
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 24142
diff changeset
1076 msn_user_set_object(user, msnobj);
6800
8f99c220b503 [gaim-migrate @ 7340]
Christian Hammond <chipx86@chipx86.com>
parents: 6779
diff changeset
1077
22711
16e50aae4932 some other mobile stuff that Maiku fixed, fixes #2359
Ka-Hing Cheung <khc@pidgin.im>
parents: 22671
diff changeset
1078 user->mobile = (clientid & MSN_CLIENT_CAP_MSNMOBILE) || (user->phone.mobile && user->phone.mobile[0] == '+');
23790
eb49b07a62d6 Modifications to the MSN code for some stuff I'll be doing in later
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 23789
diff changeset
1079 msn_user_set_clientid(user, clientid);
eb49b07a62d6 Modifications to the MSN code for some stuff I'll be doing in later
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 23789
diff changeset
1080 msn_user_set_network(user, networkid);
22711
16e50aae4932 some other mobile stuff that Maiku fixed, fixes #2359
Ka-Hing Cheung <khc@pidgin.im>
parents: 22671
diff changeset
1081
10451
2df35a139363 [gaim-migrate @ 11717]
Felipe Contreras <felipe.contreras@gmail.com>
parents: 10403
diff changeset
1082 msn_user_set_state(user, state);
2df35a139363 [gaim-migrate @ 11717]
Felipe Contreras <felipe.contreras@gmail.com>
parents: 10403
diff changeset
1083 msn_user_update(user);
9193
6e76f1367896 [gaim-migrate @ 9988]
Felipe Contreras <felipe.contreras@gmail.com>
parents: 9158
diff changeset
1084 }
6e76f1367896 [gaim-migrate @ 9988]
Felipe Contreras <felipe.contreras@gmail.com>
parents: 9158
diff changeset
1085
6e76f1367896 [gaim-migrate @ 9988]
Felipe Contreras <felipe.contreras@gmail.com>
parents: 9158
diff changeset
1086 static void
6e76f1367896 [gaim-migrate @ 9988]
Felipe Contreras <felipe.contreras@gmail.com>
parents: 9158
diff changeset
1087 ipg_cmd_post(MsnCmdProc *cmdproc, MsnCommand *cmd, char *payload, size_t len)
6e76f1367896 [gaim-migrate @ 9988]
Felipe Contreras <felipe.contreras@gmail.com>
parents: 9158
diff changeset
1088 {
22671
1be93db097eb another patch from Maiku, this time handling IPG so we can receive paging.
Ka-Hing Cheung <khc@pidgin.im>
parents: 22670
diff changeset
1089 PurpleConnection *gc;
1be93db097eb another patch from Maiku, this time handling IPG so we can receive paging.
Ka-Hing Cheung <khc@pidgin.im>
parents: 22670
diff changeset
1090 MsnUserList *userlist;
24404
dfdee4a5b58b Fix a possible xmlnode leak and an extra g_strdup when processing
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 24384
diff changeset
1091 const char *who = NULL;
dfdee4a5b58b Fix a possible xmlnode leak and an extra g_strdup when processing
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 24384
diff changeset
1092 char *text = NULL;
23874
211838741c15 Report an error when an MSN Mobile message was not sent because it was
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 23866
diff changeset
1093 const char *id = NULL;
211838741c15 Report an error when an MSN Mobile message was not sent because it was
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 23866
diff changeset
1094 xmlnode *payloadNode, *from, *msg, *textNode;
22671
1be93db097eb another patch from Maiku, this time handling IPG so we can receive paging.
Ka-Hing Cheung <khc@pidgin.im>
parents: 22670
diff changeset
1095
15884
4de1981757fc sed -ie 's/gaim/purple/g'
Sean Egan <seanegan@pidgin.im>
parents: 15435
diff changeset
1096 purple_debug_misc("msn", "Incoming Page: {%s}\n", payload);
22671
1be93db097eb another patch from Maiku, this time handling IPG so we can receive paging.
Ka-Hing Cheung <khc@pidgin.im>
parents: 22670
diff changeset
1097
1be93db097eb another patch from Maiku, this time handling IPG so we can receive paging.
Ka-Hing Cheung <khc@pidgin.im>
parents: 22670
diff changeset
1098 userlist = cmdproc->session->userlist;
1be93db097eb another patch from Maiku, this time handling IPG so we can receive paging.
Ka-Hing Cheung <khc@pidgin.im>
parents: 22670
diff changeset
1099 gc = purple_account_get_connection(cmdproc->session->account);
1be93db097eb another patch from Maiku, this time handling IPG so we can receive paging.
Ka-Hing Cheung <khc@pidgin.im>
parents: 22670
diff changeset
1100
1be93db097eb another patch from Maiku, this time handling IPG so we can receive paging.
Ka-Hing Cheung <khc@pidgin.im>
parents: 22670
diff changeset
1101 /* payload looks like this:
1be93db097eb another patch from Maiku, this time handling IPG so we can receive paging.
Ka-Hing Cheung <khc@pidgin.im>
parents: 22670
diff changeset
1102 <?xml version="1.0"?>
1be93db097eb another patch from Maiku, this time handling IPG so we can receive paging.
Ka-Hing Cheung <khc@pidgin.im>
parents: 22670
diff changeset
1103 <NOTIFICATION id="0" siteid="111100400" siteurl="http://mobile.msn.com/">
1be93db097eb another patch from Maiku, this time handling IPG so we can receive paging.
Ka-Hing Cheung <khc@pidgin.im>
parents: 22670
diff changeset
1104 <TO name="passport@example.com">
1be93db097eb another patch from Maiku, this time handling IPG so we can receive paging.
Ka-Hing Cheung <khc@pidgin.im>
parents: 22670
diff changeset
1105 <VIA agent="mobile"/>
1be93db097eb another patch from Maiku, this time handling IPG so we can receive paging.
Ka-Hing Cheung <khc@pidgin.im>
parents: 22670
diff changeset
1106 </TO>
1be93db097eb another patch from Maiku, this time handling IPG so we can receive paging.
Ka-Hing Cheung <khc@pidgin.im>
parents: 22670
diff changeset
1107 <FROM name="tel:+XXXXXXXXXXX"/>
1be93db097eb another patch from Maiku, this time handling IPG so we can receive paging.
Ka-Hing Cheung <khc@pidgin.im>
parents: 22670
diff changeset
1108 <MSG pri="1" id="1">
1be93db097eb another patch from Maiku, this time handling IPG so we can receive paging.
Ka-Hing Cheung <khc@pidgin.im>
parents: 22670
diff changeset
1109 <CAT Id="110110001"/>
1be93db097eb another patch from Maiku, this time handling IPG so we can receive paging.
Ka-Hing Cheung <khc@pidgin.im>
parents: 22670
diff changeset
1110 <ACTION url="2wayIM.asp"/>
1be93db097eb another patch from Maiku, this time handling IPG so we can receive paging.
Ka-Hing Cheung <khc@pidgin.im>
parents: 22670
diff changeset
1111 <SUBSCR url="2wayIM.asp"/>
1be93db097eb another patch from Maiku, this time handling IPG so we can receive paging.
Ka-Hing Cheung <khc@pidgin.im>
parents: 22670
diff changeset
1112 <BODY lcid="1033">
1be93db097eb another patch from Maiku, this time handling IPG so we can receive paging.
Ka-Hing Cheung <khc@pidgin.im>
parents: 22670
diff changeset
1113 <TEXT>Message was here</TEXT>
1be93db097eb another patch from Maiku, this time handling IPG so we can receive paging.
Ka-Hing Cheung <khc@pidgin.im>
parents: 22670
diff changeset
1114 </BODY>
1be93db097eb another patch from Maiku, this time handling IPG so we can receive paging.
Ka-Hing Cheung <khc@pidgin.im>
parents: 22670
diff changeset
1115 </MSG>
1be93db097eb another patch from Maiku, this time handling IPG so we can receive paging.
Ka-Hing Cheung <khc@pidgin.im>
parents: 22670
diff changeset
1116 </NOTIFICATION>
1be93db097eb another patch from Maiku, this time handling IPG so we can receive paging.
Ka-Hing Cheung <khc@pidgin.im>
parents: 22670
diff changeset
1117 */
1be93db097eb another patch from Maiku, this time handling IPG so we can receive paging.
Ka-Hing Cheung <khc@pidgin.im>
parents: 22670
diff changeset
1118
23874
211838741c15 Report an error when an MSN Mobile message was not sent because it was
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 23866
diff changeset
1119 /* This is the payload if your message was too long:
211838741c15 Report an error when an MSN Mobile message was not sent because it was
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 23866
diff changeset
1120 <NOTIFICATION id="TrID" siteid="111100400" siteurl="http://mobile.msn.com/">
211838741c15 Report an error when an MSN Mobile message was not sent because it was
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 23866
diff changeset
1121 <TO name="passport@example.com">
211838741c15 Report an error when an MSN Mobile message was not sent because it was
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 23866
diff changeset
1122 <VIA agent="mobile"/>
211838741c15 Report an error when an MSN Mobile message was not sent because it was
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 23866
diff changeset
1123 </TO>
211838741c15 Report an error when an MSN Mobile message was not sent because it was
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 23866
diff changeset
1124 <FROM name="tel:+XXXXXXXXXXX"/>
211838741c15 Report an error when an MSN Mobile message was not sent because it was
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 23866
diff changeset
1125 <MSG pri="1" id="407">
211838741c15 Report an error when an MSN Mobile message was not sent because it was
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 23866
diff changeset
1126 <CAT Id="110110001"/>
211838741c15 Report an error when an MSN Mobile message was not sent because it was
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 23866
diff changeset
1127 <ACTION url="2wayIM.asp"/>
211838741c15 Report an error when an MSN Mobile message was not sent because it was
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 23866
diff changeset
1128 <SUBSCR url="2wayIM.asp"/>
211838741c15 Report an error when an MSN Mobile message was not sent because it was
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 23866
diff changeset
1129 <BODY lcid="1033">
211838741c15 Report an error when an MSN Mobile message was not sent because it was
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 23866
diff changeset
1130 <TEXT></TEXT>
211838741c15 Report an error when an MSN Mobile message was not sent because it was
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 23866
diff changeset
1131 </BODY>
211838741c15 Report an error when an MSN Mobile message was not sent because it was
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 23866
diff changeset
1132 </MSG>
211838741c15 Report an error when an MSN Mobile message was not sent because it was
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 23866
diff changeset
1133 </NOTIFICATION>
211838741c15 Report an error when an MSN Mobile message was not sent because it was
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 23866
diff changeset
1134 */
211838741c15 Report an error when an MSN Mobile message was not sent because it was
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 23866
diff changeset
1135
24404
dfdee4a5b58b Fix a possible xmlnode leak and an extra g_strdup when processing
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 24384
diff changeset
1136 payloadNode = xmlnode_from_str(payload, len);
dfdee4a5b58b Fix a possible xmlnode leak and an extra g_strdup when processing
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 24384
diff changeset
1137 if (!payloadNode)
22671
1be93db097eb another patch from Maiku, this time handling IPG so we can receive paging.
Ka-Hing Cheung <khc@pidgin.im>
parents: 22670
diff changeset
1138 return;
1be93db097eb another patch from Maiku, this time handling IPG so we can receive paging.
Ka-Hing Cheung <khc@pidgin.im>
parents: 22670
diff changeset
1139
24404
dfdee4a5b58b Fix a possible xmlnode leak and an extra g_strdup when processing
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 24384
diff changeset
1140 if (!(from = xmlnode_get_child(payloadNode, "FROM")) ||
dfdee4a5b58b Fix a possible xmlnode leak and an extra g_strdup when processing
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 24384
diff changeset
1141 !(msg = xmlnode_get_child(payloadNode, "MSG")) ||
dfdee4a5b58b Fix a possible xmlnode leak and an extra g_strdup when processing
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 24384
diff changeset
1142 !(textNode = xmlnode_get_child(msg, "BODY/TEXT"))) {
dfdee4a5b58b Fix a possible xmlnode leak and an extra g_strdup when processing
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 24384
diff changeset
1143 xmlnode_free(payloadNode);
dfdee4a5b58b Fix a possible xmlnode leak and an extra g_strdup when processing
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 24384
diff changeset
1144 return;
dfdee4a5b58b Fix a possible xmlnode leak and an extra g_strdup when processing
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 24384
diff changeset
1145 }
dfdee4a5b58b Fix a possible xmlnode leak and an extra g_strdup when processing
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 24384
diff changeset
1146
dfdee4a5b58b Fix a possible xmlnode leak and an extra g_strdup when processing
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 24384
diff changeset
1147 who = xmlnode_get_attrib(from, "name");
22671
1be93db097eb another patch from Maiku, this time handling IPG so we can receive paging.
Ka-Hing Cheung <khc@pidgin.im>
parents: 22670
diff changeset
1148 if (!who) return;
1be93db097eb another patch from Maiku, this time handling IPG so we can receive paging.
Ka-Hing Cheung <khc@pidgin.im>
parents: 22670
diff changeset
1149
1be93db097eb another patch from Maiku, this time handling IPG so we can receive paging.
Ka-Hing Cheung <khc@pidgin.im>
parents: 22670
diff changeset
1150 text = xmlnode_get_data(textNode);
1be93db097eb another patch from Maiku, this time handling IPG so we can receive paging.
Ka-Hing Cheung <khc@pidgin.im>
parents: 22670
diff changeset
1151
1be93db097eb another patch from Maiku, this time handling IPG so we can receive paging.
Ka-Hing Cheung <khc@pidgin.im>
parents: 22670
diff changeset
1152 /* Match number to user's mobile number, FROM is a phone number if the
1be93db097eb another patch from Maiku, this time handling IPG so we can receive paging.
Ka-Hing Cheung <khc@pidgin.im>
parents: 22670
diff changeset
1153 other side page you using your phone number */
23874
211838741c15 Report an error when an MSN Mobile message was not sent because it was
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 23866
diff changeset
1154 if (!strncmp(who, "tel:+", 5)) {
22671
1be93db097eb another patch from Maiku, this time handling IPG so we can receive paging.
Ka-Hing Cheung <khc@pidgin.im>
parents: 22670
diff changeset
1155 MsnUser *user =
1be93db097eb another patch from Maiku, this time handling IPG so we can receive paging.
Ka-Hing Cheung <khc@pidgin.im>
parents: 22670
diff changeset
1156 msn_userlist_find_user_with_mobile_phone(userlist, who + 4);
1be93db097eb another patch from Maiku, this time handling IPG so we can receive paging.
Ka-Hing Cheung <khc@pidgin.im>
parents: 22670
diff changeset
1157
24404
dfdee4a5b58b Fix a possible xmlnode leak and an extra g_strdup when processing
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 24384
diff changeset
1158 if (user && user->passport)
dfdee4a5b58b Fix a possible xmlnode leak and an extra g_strdup when processing
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 24384
diff changeset
1159 who = user->passport;
22671
1be93db097eb another patch from Maiku, this time handling IPG so we can receive paging.
Ka-Hing Cheung <khc@pidgin.im>
parents: 22670
diff changeset
1160 }
1be93db097eb another patch from Maiku, this time handling IPG so we can receive paging.
Ka-Hing Cheung <khc@pidgin.im>
parents: 22670
diff changeset
1161
23874
211838741c15 Report an error when an MSN Mobile message was not sent because it was
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 23866
diff changeset
1162 id = xmlnode_get_attrib(msg, "id");
211838741c15 Report an error when an MSN Mobile message was not sent because it was
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 23866
diff changeset
1163
211838741c15 Report an error when an MSN Mobile message was not sent because it was
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 23866
diff changeset
1164 if (id && !strcmp(id, "407")) {
211838741c15 Report an error when an MSN Mobile message was not sent because it was
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 23866
diff changeset
1165 /* TODO: Use this to NAK the transaction, maybe print the text, too.
211838741c15 Report an error when an MSN Mobile message was not sent because it was
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 23866
diff changeset
1166 unsigned int trId;
211838741c15 Report an error when an MSN Mobile message was not sent because it was
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 23866
diff changeset
1167 id = xmlnode_get_attrib(payloadNode, "id");
211838741c15 Report an error when an MSN Mobile message was not sent because it was
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 23866
diff changeset
1168 trId = atol(id);
211838741c15 Report an error when an MSN Mobile message was not sent because it was
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 23866
diff changeset
1169 */
211838741c15 Report an error when an MSN Mobile message was not sent because it was
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 23866
diff changeset
1170 purple_conv_present_error(who, gc->account,
211838741c15 Report an error when an MSN Mobile message was not sent because it was
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 23866
diff changeset
1171 _("Mobile message was not sent because it was too long."));
211838741c15 Report an error when an MSN Mobile message was not sent because it was
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 23866
diff changeset
1172
211838741c15 Report an error when an MSN Mobile message was not sent because it was
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 23866
diff changeset
1173 } else {
211838741c15 Report an error when an MSN Mobile message was not sent because it was
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 23866
diff changeset
1174 serv_got_im(gc, who, text, 0, time(NULL));
211838741c15 Report an error when an MSN Mobile message was not sent because it was
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 23866
diff changeset
1175 }
22671
1be93db097eb another patch from Maiku, this time handling IPG so we can receive paging.
Ka-Hing Cheung <khc@pidgin.im>
parents: 22670
diff changeset
1176
1be93db097eb another patch from Maiku, this time handling IPG so we can receive paging.
Ka-Hing Cheung <khc@pidgin.im>
parents: 22670
diff changeset
1177 g_free(text);
1be93db097eb another patch from Maiku, this time handling IPG so we can receive paging.
Ka-Hing Cheung <khc@pidgin.im>
parents: 22670
diff changeset
1178 xmlnode_free(payloadNode);
5309
3178acad1449 [gaim-migrate @ 5681]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
1179 }
3178acad1449 [gaim-migrate @ 5681]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
1180
8808
1cb5ddf6b625 [gaim-migrate @ 9570]
Felipe Contreras <felipe.contreras@gmail.com>
parents: 8669
diff changeset
1181 static void
1cb5ddf6b625 [gaim-migrate @ 9570]
Felipe Contreras <felipe.contreras@gmail.com>
parents: 8669
diff changeset
1182 ipg_cmd(MsnCmdProc *cmdproc, MsnCommand *cmd)
5960
cd797d042726 [gaim-migrate @ 6407]
Christian Hammond <chipx86@chipx86.com>
parents: 5933
diff changeset
1183 {
23826
3eeaac42358f Get rid of that whole msn_set_payload_len thing and correctly set the
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 23824
diff changeset
1184 cmd->payload_len = atoi(cmd->params[0]);
9193
6e76f1367896 [gaim-migrate @ 9988]
Felipe Contreras <felipe.contreras@gmail.com>
parents: 9158
diff changeset
1185 cmdproc->last_cmd->payload_cb = ipg_cmd_post;
5309
3178acad1449 [gaim-migrate @ 5681]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
1186 }
3178acad1449 [gaim-migrate @ 5681]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
1187
8808
1cb5ddf6b625 [gaim-migrate @ 9570]
Felipe Contreras <felipe.contreras@gmail.com>
parents: 8669
diff changeset
1188 static void
1cb5ddf6b625 [gaim-migrate @ 9570]
Felipe Contreras <felipe.contreras@gmail.com>
parents: 8669
diff changeset
1189 nln_cmd(MsnCmdProc *cmdproc, MsnCommand *cmd)
5309
3178acad1449 [gaim-migrate @ 5681]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
1190 {
8808
1cb5ddf6b625 [gaim-migrate @ 9570]
Felipe Contreras <felipe.contreras@gmail.com>
parents: 8669
diff changeset
1191 MsnSession *session;
15884
4de1981757fc sed -ie 's/gaim/purple/g'
Sean Egan <seanegan@pidgin.im>
parents: 15435
diff changeset
1192 PurpleAccount *account;
4de1981757fc sed -ie 's/gaim/purple/g'
Sean Egan <seanegan@pidgin.im>
parents: 15435
diff changeset
1193 PurpleConnection *gc;
6829
233441b74cf9 [gaim-migrate @ 7374]
Christian Hammond <chipx86@chipx86.com>
parents: 6828
diff changeset
1194 MsnUser *user;
233441b74cf9 [gaim-migrate @ 7374]
Christian Hammond <chipx86@chipx86.com>
parents: 6828
diff changeset
1195 MsnObject *msnobj;
22478
bd66c165dcad Patch from Jorge Villaseñor, treat the client id as unsigned so 0x80000000
Ka-Hing Cheung <khc@pidgin.im>
parents: 21905
diff changeset
1196 unsigned long clientid;
23790
eb49b07a62d6 Modifications to the MSN code for some stuff I'll be doing in later
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 23789
diff changeset
1197 int networkid;
14546
290281d3e65e [gaim-migrate @ 17203]
Richard Nelson <wabz@pidgin.im>
parents: 14254
diff changeset
1198 const char *state, *passport, *friendly, *old_friendly;
5309
3178acad1449 [gaim-migrate @ 5681]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
1199
8808
1cb5ddf6b625 [gaim-migrate @ 9570]
Felipe Contreras <felipe.contreras@gmail.com>
parents: 8669
diff changeset
1200 session = cmdproc->session;
10010
d9ee01f0659a [gaim-migrate @ 10927]
Mark Doliner <markdoliner@pidgin.im>
parents: 9967
diff changeset
1201 account = session->account;
15884
4de1981757fc sed -ie 's/gaim/purple/g'
Sean Egan <seanegan@pidgin.im>
parents: 15435
diff changeset
1202 gc = purple_account_get_connection(account);
8808
1cb5ddf6b625 [gaim-migrate @ 9570]
Felipe Contreras <felipe.contreras@gmail.com>
parents: 8669
diff changeset
1203
1cb5ddf6b625 [gaim-migrate @ 9570]
Felipe Contreras <felipe.contreras@gmail.com>
parents: 8669
diff changeset
1204 state = cmd->params[0];
1cb5ddf6b625 [gaim-migrate @ 9570]
Felipe Contreras <felipe.contreras@gmail.com>
parents: 8669
diff changeset
1205 passport = cmd->params[1];
23790
eb49b07a62d6 Modifications to the MSN code for some stuff I'll be doing in later
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 23789
diff changeset
1206 networkid = atoi(cmd->params[2]);
20478
46933dc62880 propagate from branch 'im.pidgin.pidgin' (head 88b7040408c88e4516c008f4eac579f98ef53e85)
Richard Laager <rlaager@pidgin.im>
parents: 20476 16124
diff changeset
1207 friendly = purple_url_decode(cmd->params[3]);
5309
3178acad1449 [gaim-migrate @ 5681]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
1208
9193
6e76f1367896 [gaim-migrate @ 9988]
Felipe Contreras <felipe.contreras@gmail.com>
parents: 9158
diff changeset
1209 user = msn_userlist_find_user(session->userlist, passport);
24331
24bb08b3a018 don't crash if we get a NLN command from someone not on the blist
Ka-Hing Cheung <khc@pidgin.im>
parents: 24183
diff changeset
1210 if (user == NULL) return;
6858
a367cfd3e75f [gaim-migrate @ 7403]
Christian Hammond <chipx86@chipx86.com>
parents: 6833
diff changeset
1211
14546
290281d3e65e [gaim-migrate @ 17203]
Richard Nelson <wabz@pidgin.im>
parents: 14254
diff changeset
1212 old_friendly = msn_user_get_friendly_name(user);
18805
776844ef91d8 cmd->params[2] could be NULL, or purple_url_decode() could return NULL. Don't pass a potential NULL to strcmp().
Evan Schoenberg <evands@pidgin.im>
parents: 17686
diff changeset
1213 if (!old_friendly || (old_friendly && (!friendly || strcmp(old_friendly, friendly))))
14546
290281d3e65e [gaim-migrate @ 17203]
Richard Nelson <wabz@pidgin.im>
parents: 14254
diff changeset
1214 {
290281d3e65e [gaim-migrate @ 17203]
Richard Nelson <wabz@pidgin.im>
parents: 14254
diff changeset
1215 serv_got_alias(gc, passport, friendly);
290281d3e65e [gaim-migrate @ 17203]
Richard Nelson <wabz@pidgin.im>
parents: 14254
diff changeset
1216 msn_user_set_friendly_name(user, friendly);
290281d3e65e [gaim-migrate @ 17203]
Richard Nelson <wabz@pidgin.im>
parents: 14254
diff changeset
1217 }
6858
a367cfd3e75f [gaim-migrate @ 7403]
Christian Hammond <chipx86@chipx86.com>
parents: 6833
diff changeset
1218
23828
435f787db3f8 Fix updating the MSN buddy icon, which was probably broken by the
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 23826
diff changeset
1219 if (cmd->param_count == 6)
6829
233441b74cf9 [gaim-migrate @ 7374]
Christian Hammond <chipx86@chipx86.com>
parents: 6828
diff changeset
1220 {
23793
b53a513626da Remove some checks for MSN protocol_ver < 15. Those versions are
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 23790
diff changeset
1221 msnobj = msn_object_new_from_string(purple_url_decode(cmd->params[5]));
b53a513626da Remove some checks for MSN protocol_ver < 15. Those versions are
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 23790
diff changeset
1222 msn_user_set_object(user, msnobj);
b53a513626da Remove some checks for MSN protocol_ver < 15. Those versions are
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 23790
diff changeset
1223 }
b53a513626da Remove some checks for MSN protocol_ver < 15. Those versions are
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 23790
diff changeset
1224 else
b53a513626da Remove some checks for MSN protocol_ver < 15. Those versions are
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 23790
diff changeset
1225 {
b53a513626da Remove some checks for MSN protocol_ver < 15. Those versions are
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 23790
diff changeset
1226 msn_user_set_object(user, NULL);
6829
233441b74cf9 [gaim-migrate @ 7374]
Christian Hammond <chipx86@chipx86.com>
parents: 6828
diff changeset
1227 }
233441b74cf9 [gaim-migrate @ 7374]
Christian Hammond <chipx86@chipx86.com>
parents: 6828
diff changeset
1228
22480
71b9bf3f70a2 Specify the base to convert from to prevent interpreting 0-prefixed client
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 22478
diff changeset
1229 clientid = strtoul(cmd->params[4], NULL, 10);
22711
16e50aae4932 some other mobile stuff that Maiku fixed, fixes #2359
Ka-Hing Cheung <khc@pidgin.im>
parents: 22671
diff changeset
1230 user->mobile = (clientid & MSN_CLIENT_CAP_MSNMOBILE) || (user->phone.mobile && user->phone.mobile[0] == '+');
11819
ed7eacf30277 [gaim-migrate @ 14110]
David Fiander
parents: 11321
diff changeset
1231
23790
eb49b07a62d6 Modifications to the MSN code for some stuff I'll be doing in later
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 23789
diff changeset
1232 msn_user_set_clientid(user, clientid);
eb49b07a62d6 Modifications to the MSN code for some stuff I'll be doing in later
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 23789
diff changeset
1233 msn_user_set_network(user, networkid);
eb49b07a62d6 Modifications to the MSN code for some stuff I'll be doing in later
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 23789
diff changeset
1234
10451
2df35a139363 [gaim-migrate @ 11717]
Felipe Contreras <felipe.contreras@gmail.com>
parents: 10403
diff changeset
1235 msn_user_set_state(user, state);
2df35a139363 [gaim-migrate @ 11717]
Felipe Contreras <felipe.contreras@gmail.com>
parents: 10403
diff changeset
1236 msn_user_update(user);
9158
f8dab42adeaf [gaim-migrate @ 9942]
Felipe Contreras <felipe.contreras@gmail.com>
parents: 8926
diff changeset
1237 }
f8dab42adeaf [gaim-migrate @ 9942]
Felipe Contreras <felipe.contreras@gmail.com>
parents: 8926
diff changeset
1238
11992
906176cc9b22 [gaim-migrate @ 14285]
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 11862
diff changeset
1239 #if 0
9158
f8dab42adeaf [gaim-migrate @ 9942]
Felipe Contreras <felipe.contreras@gmail.com>
parents: 8926
diff changeset
1240 static void
9193
6e76f1367896 [gaim-migrate @ 9988]
Felipe Contreras <felipe.contreras@gmail.com>
parents: 9158
diff changeset
1241 chg_cmd(MsnCmdProc *cmdproc, MsnCommand *cmd)
6e76f1367896 [gaim-migrate @ 9988]
Felipe Contreras <felipe.contreras@gmail.com>
parents: 9158
diff changeset
1242 {
6e76f1367896 [gaim-migrate @ 9988]
Felipe Contreras <felipe.contreras@gmail.com>
parents: 9158
diff changeset
1243 char *state = cmd->params[1];
6e76f1367896 [gaim-migrate @ 9988]
Felipe Contreras <felipe.contreras@gmail.com>
parents: 9158
diff changeset
1244 int state_id = 0;
6e76f1367896 [gaim-migrate @ 9988]
Felipe Contreras <felipe.contreras@gmail.com>
parents: 9158
diff changeset
1245
6e76f1367896 [gaim-migrate @ 9988]
Felipe Contreras <felipe.contreras@gmail.com>
parents: 9158
diff changeset
1246 if (!strcmp(state, "NLN"))
6e76f1367896 [gaim-migrate @ 9988]
Felipe Contreras <felipe.contreras@gmail.com>
parents: 9158
diff changeset
1247 state_id = MSN_ONLINE;
6e76f1367896 [gaim-migrate @ 9988]
Felipe Contreras <felipe.contreras@gmail.com>
parents: 9158
diff changeset
1248 else if (!strcmp(state, "BSY"))
6e76f1367896 [gaim-migrate @ 9988]
Felipe Contreras <felipe.contreras@gmail.com>
parents: 9158
diff changeset
1249 state_id = MSN_BUSY;
6e76f1367896 [gaim-migrate @ 9988]
Felipe Contreras <felipe.contreras@gmail.com>
parents: 9158
diff changeset
1250 else if (!strcmp(state, "IDL"))
6e76f1367896 [gaim-migrate @ 9988]
Felipe Contreras <felipe.contreras@gmail.com>
parents: 9158
diff changeset
1251 state_id = MSN_IDLE;
6e76f1367896 [gaim-migrate @ 9988]
Felipe Contreras <felipe.contreras@gmail.com>
parents: 9158
diff changeset
1252 else if (!strcmp(state, "BRB"))
6e76f1367896 [gaim-migrate @ 9988]
Felipe Contreras <felipe.contreras@gmail.com>
parents: 9158
diff changeset
1253 state_id = MSN_BRB;
6e76f1367896 [gaim-migrate @ 9988]
Felipe Contreras <felipe.contreras@gmail.com>
parents: 9158
diff changeset
1254 else if (!strcmp(state, "AWY"))
6e76f1367896 [gaim-migrate @ 9988]
Felipe Contreras <felipe.contreras@gmail.com>
parents: 9158
diff changeset
1255 state_id = MSN_AWAY;
6e76f1367896 [gaim-migrate @ 9988]
Felipe Contreras <felipe.contreras@gmail.com>
parents: 9158
diff changeset
1256 else if (!strcmp(state, "PHN"))
6e76f1367896 [gaim-migrate @ 9988]
Felipe Contreras <felipe.contreras@gmail.com>
parents: 9158
diff changeset
1257 state_id = MSN_PHONE;
6e76f1367896 [gaim-migrate @ 9988]
Felipe Contreras <felipe.contreras@gmail.com>
parents: 9158
diff changeset
1258 else if (!strcmp(state, "LUN"))
6e76f1367896 [gaim-migrate @ 9988]
Felipe Contreras <felipe.contreras@gmail.com>
parents: 9158
diff changeset
1259 state_id = MSN_LUNCH;
6e76f1367896 [gaim-migrate @ 9988]
Felipe Contreras <felipe.contreras@gmail.com>
parents: 9158
diff changeset
1260 else if (!strcmp(state, "HDN"))
6e76f1367896 [gaim-migrate @ 9988]
Felipe Contreras <felipe.contreras@gmail.com>
parents: 9158
diff changeset
1261 state_id = MSN_HIDDEN;
6e76f1367896 [gaim-migrate @ 9988]
Felipe Contreras <felipe.contreras@gmail.com>
parents: 9158
diff changeset
1262
6e76f1367896 [gaim-migrate @ 9988]
Felipe Contreras <felipe.contreras@gmail.com>
parents: 9158
diff changeset
1263 cmdproc->session->state = state_id;
6e76f1367896 [gaim-migrate @ 9988]
Felipe Contreras <felipe.contreras@gmail.com>
parents: 9158
diff changeset
1264 }
11992
906176cc9b22 [gaim-migrate @ 14285]
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 11862
diff changeset
1265 #endif
9193
6e76f1367896 [gaim-migrate @ 9988]
Felipe Contreras <felipe.contreras@gmail.com>
parents: 9158
diff changeset
1266
6e76f1367896 [gaim-migrate @ 9988]
Felipe Contreras <felipe.contreras@gmail.com>
parents: 9158
diff changeset
1267
6e76f1367896 [gaim-migrate @ 9988]
Felipe Contreras <felipe.contreras@gmail.com>
parents: 9158
diff changeset
1268 static void
6e76f1367896 [gaim-migrate @ 9988]
Felipe Contreras <felipe.contreras@gmail.com>
parents: 9158
diff changeset
1269 not_cmd_post(MsnCmdProc *cmdproc, MsnCommand *cmd, char *payload, size_t len)
9158
f8dab42adeaf [gaim-migrate @ 9942]
Felipe Contreras <felipe.contreras@gmail.com>
parents: 8926
diff changeset
1270 {
f8dab42adeaf [gaim-migrate @ 9942]
Felipe Contreras <felipe.contreras@gmail.com>
parents: 8926
diff changeset
1271 #if 0
9193
6e76f1367896 [gaim-migrate @ 9988]
Felipe Contreras <felipe.contreras@gmail.com>
parents: 9158
diff changeset
1272 MSN_SET_PARAMS("NOT %d\r\n%s", cmdproc->servconn->payload, payload);
24100
df97a93113c3 Turn off those MSN NOTification debug messages. It should work now, and
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 24008
diff changeset
1273 purple_debug_misc("msn", "Notification: {%s}\n", payload);
24008
8cbd0a6ea528 Correctly save the payload_len of a MSN notification command. Also,
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 24002
diff changeset
1274 #endif
8808
1cb5ddf6b625 [gaim-migrate @ 9570]
Felipe Contreras <felipe.contreras@gmail.com>
parents: 8669
diff changeset
1275 }
5309
3178acad1449 [gaim-migrate @ 5681]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
1276
8808
1cb5ddf6b625 [gaim-migrate @ 9570]
Felipe Contreras <felipe.contreras@gmail.com>
parents: 8669
diff changeset
1277 static void
1cb5ddf6b625 [gaim-migrate @ 9570]
Felipe Contreras <felipe.contreras@gmail.com>
parents: 8669
diff changeset
1278 not_cmd(MsnCmdProc *cmdproc, MsnCommand *cmd)
1cb5ddf6b625 [gaim-migrate @ 9570]
Felipe Contreras <felipe.contreras@gmail.com>
parents: 8669
diff changeset
1279 {
24008
8cbd0a6ea528 Correctly save the payload_len of a MSN notification command. Also,
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 24002
diff changeset
1280 cmd->payload_len = atoi(cmd->params[0]);
9193
6e76f1367896 [gaim-migrate @ 9988]
Felipe Contreras <felipe.contreras@gmail.com>
parents: 9158
diff changeset
1281 cmdproc->last_cmd->payload_cb = not_cmd_post;
5363
b6e28be0c9bd [gaim-migrate @ 5739]
Christian Hammond <chipx86@chipx86.com>
parents: 5361
diff changeset
1282 }
b6e28be0c9bd [gaim-migrate @ 5739]
Christian Hammond <chipx86@chipx86.com>
parents: 5361
diff changeset
1283
8808
1cb5ddf6b625 [gaim-migrate @ 9570]
Felipe Contreras <felipe.contreras@gmail.com>
parents: 8669
diff changeset
1284 static void
10833
62d8c516b51b [gaim-migrate @ 12503]
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 10816
diff changeset
1285 prp_cmd(MsnCmdProc *cmdproc, MsnCommand *cmd)
62d8c516b51b [gaim-migrate @ 12503]
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 10816
diff changeset
1286 {
62d8c516b51b [gaim-migrate @ 12503]
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 10816
diff changeset
1287 MsnSession *session = cmdproc->session;
20560
79e9c94c34db Add the possibility to create an Address Book, useful for newly registered MSN users.
Carlos Silva <typ0@pidgin.im>
parents: 20557
diff changeset
1288 const char *type, *value, *friendlyname;
79e9c94c34db Add the possibility to create an Address Book, useful for newly registered MSN users.
Carlos Silva <typ0@pidgin.im>
parents: 20557
diff changeset
1289
10833
62d8c516b51b [gaim-migrate @ 12503]
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 10816
diff changeset
1290 g_return_if_fail(cmd->param_count >= 3);
62d8c516b51b [gaim-migrate @ 12503]
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 10816
diff changeset
1291
62d8c516b51b [gaim-migrate @ 12503]
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 10816
diff changeset
1292 type = cmd->params[2];
62d8c516b51b [gaim-migrate @ 12503]
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 10816
diff changeset
1293
62d8c516b51b [gaim-migrate @ 12503]
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 10816
diff changeset
1294 if (cmd->param_count == 4)
62d8c516b51b [gaim-migrate @ 12503]
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 10816
diff changeset
1295 {
62d8c516b51b [gaim-migrate @ 12503]
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 10816
diff changeset
1296 value = cmd->params[3];
62d8c516b51b [gaim-migrate @ 12503]
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 10816
diff changeset
1297 if (!strcmp(type, "PHH"))
15884
4de1981757fc sed -ie 's/gaim/purple/g'
Sean Egan <seanegan@pidgin.im>
parents: 15435
diff changeset
1298 msn_user_set_home_phone(session->user, purple_url_decode(value));
10833
62d8c516b51b [gaim-migrate @ 12503]
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 10816
diff changeset
1299 else if (!strcmp(type, "PHW"))
15884
4de1981757fc sed -ie 's/gaim/purple/g'
Sean Egan <seanegan@pidgin.im>
parents: 15435
diff changeset
1300 msn_user_set_work_phone(session->user, purple_url_decode(value));
10833
62d8c516b51b [gaim-migrate @ 12503]
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 10816
diff changeset
1301 else if (!strcmp(type, "PHM"))
15884
4de1981757fc sed -ie 's/gaim/purple/g'
Sean Egan <seanegan@pidgin.im>
parents: 15435
diff changeset
1302 msn_user_set_mobile_phone(session->user, purple_url_decode(value));
10833
62d8c516b51b [gaim-migrate @ 12503]
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 10816
diff changeset
1303 }
62d8c516b51b [gaim-migrate @ 12503]
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 10816
diff changeset
1304 else
62d8c516b51b [gaim-migrate @ 12503]
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 10816
diff changeset
1305 {
62d8c516b51b [gaim-migrate @ 12503]
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 10816
diff changeset
1306 if (!strcmp(type, "PHH"))
62d8c516b51b [gaim-migrate @ 12503]
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 10816
diff changeset
1307 msn_user_set_home_phone(session->user, NULL);
62d8c516b51b [gaim-migrate @ 12503]
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 10816
diff changeset
1308 else if (!strcmp(type, "PHW"))
62d8c516b51b [gaim-migrate @ 12503]
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 10816
diff changeset
1309 msn_user_set_work_phone(session->user, NULL);
62d8c516b51b [gaim-migrate @ 12503]
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 10816
diff changeset
1310 else if (!strcmp(type, "PHM"))
62d8c516b51b [gaim-migrate @ 12503]
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 10816
diff changeset
1311 msn_user_set_mobile_phone(session->user, NULL);
20556
4979b6dae2f0 oops, not only did I typo'ed MFN, I also did a comparison before I update
Ka-Hing Cheung <khc@pidgin.im>
parents: 20543
diff changeset
1312 else {
20474
b0ef257ef8d4 The second msn.tgz from SF Patch #1621854 from Ka-Hing Cheung.
Ka-Hing Cheung <khc@pidgin.im>
parents: 20472
diff changeset
1313 type = cmd->params[1];
20556
4979b6dae2f0 oops, not only did I typo'ed MFN, I also did a comparison before I update
Ka-Hing Cheung <khc@pidgin.im>
parents: 20543
diff changeset
1314 if (!strcmp(type, "MFN")) {
20560
79e9c94c34db Add the possibility to create an Address Book, useful for newly registered MSN users.
Carlos Silva <typ0@pidgin.im>
parents: 20557
diff changeset
1315 friendlyname = purple_url_decode(cmd->params[2]);
23441
fd45c23a3eb2 Delete trailing whitespace
Mark Doliner <markdoliner@pidgin.im>
parents: 23085
diff changeset
1316
23784
f09ed4e732df Add real server-side aliasing to MSN.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 23777
diff changeset
1317 msn_update_contact(session, "Me", MSN_UPDATE_DISPLAY, friendlyname);
20556
4979b6dae2f0 oops, not only did I typo'ed MFN, I also did a comparison before I update
Ka-Hing Cheung <khc@pidgin.im>
parents: 20543
diff changeset
1318
4979b6dae2f0 oops, not only did I typo'ed MFN, I also did a comparison before I update
Ka-Hing Cheung <khc@pidgin.im>
parents: 20543
diff changeset
1319 purple_connection_set_display_name(
4979b6dae2f0 oops, not only did I typo'ed MFN, I also did a comparison before I update
Ka-Hing Cheung <khc@pidgin.im>
parents: 20543
diff changeset
1320 purple_account_get_connection(session->account),
20560
79e9c94c34db Add the possibility to create an Address Book, useful for newly registered MSN users.
Carlos Silva <typ0@pidgin.im>
parents: 20557
diff changeset
1321 friendlyname);
20556
4979b6dae2f0 oops, not only did I typo'ed MFN, I also did a comparison before I update
Ka-Hing Cheung <khc@pidgin.im>
parents: 20543
diff changeset
1322 }
20474
b0ef257ef8d4 The second msn.tgz from SF Patch #1621854 from Ka-Hing Cheung.
Ka-Hing Cheung <khc@pidgin.im>
parents: 20472
diff changeset
1323 }
10833
62d8c516b51b [gaim-migrate @ 12503]
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 10816
diff changeset
1324 }
62d8c516b51b [gaim-migrate @ 12503]
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 10816
diff changeset
1325 }
62d8c516b51b [gaim-migrate @ 12503]
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 10816
diff changeset
1326
62d8c516b51b [gaim-migrate @ 12503]
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 10816
diff changeset
1327 static void
8808
1cb5ddf6b625 [gaim-migrate @ 9570]
Felipe Contreras <felipe.contreras@gmail.com>
parents: 8669
diff changeset
1328 reg_cmd(MsnCmdProc *cmdproc, MsnCommand *cmd)
5318
2073a19f4217 [gaim-migrate @ 5690]
Christian Hammond <chipx86@chipx86.com>
parents: 5312
diff changeset
1329 {
8808
1cb5ddf6b625 [gaim-migrate @ 9570]
Felipe Contreras <felipe.contreras@gmail.com>
parents: 8669
diff changeset
1330 MsnSession *session;
20474
b0ef257ef8d4 The second msn.tgz from SF Patch #1621854 from Ka-Hing Cheung.
Ka-Hing Cheung <khc@pidgin.im>
parents: 20472
diff changeset
1331 const char *group_id, *group_name;
5318
2073a19f4217 [gaim-migrate @ 5690]
Christian Hammond <chipx86@chipx86.com>
parents: 5312
diff changeset
1332
8808
1cb5ddf6b625 [gaim-migrate @ 9570]
Felipe Contreras <felipe.contreras@gmail.com>
parents: 8669
diff changeset
1333 session = cmdproc->session;
20474
b0ef257ef8d4 The second msn.tgz from SF Patch #1621854 from Ka-Hing Cheung.
Ka-Hing Cheung <khc@pidgin.im>
parents: 20472
diff changeset
1334 group_id = cmd->params[2];
15884
4de1981757fc sed -ie 's/gaim/purple/g'
Sean Egan <seanegan@pidgin.im>
parents: 15435
diff changeset
1335 group_name = purple_url_decode(cmd->params[3]);
5318
2073a19f4217 [gaim-migrate @ 5690]
Christian Hammond <chipx86@chipx86.com>
parents: 5312
diff changeset
1336
9193
6e76f1367896 [gaim-migrate @ 9988]
Felipe Contreras <felipe.contreras@gmail.com>
parents: 9158
diff changeset
1337 msn_userlist_rename_group_id(session->userlist, group_id, group_name);
5318
2073a19f4217 [gaim-migrate @ 5690]
Christian Hammond <chipx86@chipx86.com>
parents: 5312
diff changeset
1338 }
2073a19f4217 [gaim-migrate @ 5690]
Christian Hammond <chipx86@chipx86.com>
parents: 5312
diff changeset
1339
8808
1cb5ddf6b625 [gaim-migrate @ 9570]
Felipe Contreras <felipe.contreras@gmail.com>
parents: 8669
diff changeset
1340 static void
10451
2df35a139363 [gaim-migrate @ 11717]
Felipe Contreras <felipe.contreras@gmail.com>
parents: 10403
diff changeset
1341 reg_error(MsnCmdProc *cmdproc, MsnTransaction *trans, int error)
2df35a139363 [gaim-migrate @ 11717]
Felipe Contreras <felipe.contreras@gmail.com>
parents: 10403
diff changeset
1342 {
13870
258d48d6ab52 [gaim-migrate @ 16737]
Ma Yuan <mayuan2006@gmail.com>
parents: 13869
diff changeset
1343 const char * group_id;
10451
2df35a139363 [gaim-migrate @ 11717]
Felipe Contreras <felipe.contreras@gmail.com>
parents: 10403
diff changeset
1344 char **params;
2df35a139363 [gaim-migrate @ 11717]
Felipe Contreras <felipe.contreras@gmail.com>
parents: 10403
diff changeset
1345
2df35a139363 [gaim-migrate @ 11717]
Felipe Contreras <felipe.contreras@gmail.com>
parents: 10403
diff changeset
1346 params = g_strsplit(trans->params, " ", 0);
2df35a139363 [gaim-migrate @ 11717]
Felipe Contreras <felipe.contreras@gmail.com>
parents: 10403
diff changeset
1347
13870
258d48d6ab52 [gaim-migrate @ 16737]
Ma Yuan <mayuan2006@gmail.com>
parents: 13869
diff changeset
1348 group_id = params[0];
10451
2df35a139363 [gaim-migrate @ 11717]
Felipe Contreras <felipe.contreras@gmail.com>
parents: 10403
diff changeset
1349
2df35a139363 [gaim-migrate @ 11717]
Felipe Contreras <felipe.contreras@gmail.com>
parents: 10403
diff changeset
1350 group_error_helper(cmdproc->session, _("Unable to rename group"), group_id, error);
2df35a139363 [gaim-migrate @ 11717]
Felipe Contreras <felipe.contreras@gmail.com>
parents: 10403
diff changeset
1351
2df35a139363 [gaim-migrate @ 11717]
Felipe Contreras <felipe.contreras@gmail.com>
parents: 10403
diff changeset
1352 g_strfreev(params);
2df35a139363 [gaim-migrate @ 11717]
Felipe Contreras <felipe.contreras@gmail.com>
parents: 10403
diff changeset
1353 }
2df35a139363 [gaim-migrate @ 11717]
Felipe Contreras <felipe.contreras@gmail.com>
parents: 10403
diff changeset
1354
8808
1cb5ddf6b625 [gaim-migrate @ 9570]
Felipe Contreras <felipe.contreras@gmail.com>
parents: 8669
diff changeset
1355 static void
1cb5ddf6b625 [gaim-migrate @ 9570]
Felipe Contreras <felipe.contreras@gmail.com>
parents: 8669
diff changeset
1356 rmg_cmd(MsnCmdProc *cmdproc, MsnCommand *cmd)
5518
436fb9490b62 [gaim-migrate @ 5918]
Christian Hammond <chipx86@chipx86.com>
parents: 5509
diff changeset
1357 {
8808
1cb5ddf6b625 [gaim-migrate @ 9570]
Felipe Contreras <felipe.contreras@gmail.com>
parents: 8669
diff changeset
1358 MsnSession *session;
20474
b0ef257ef8d4 The second msn.tgz from SF Patch #1621854 from Ka-Hing Cheung.
Ka-Hing Cheung <khc@pidgin.im>
parents: 20472
diff changeset
1359 const char *group_id;
5518
436fb9490b62 [gaim-migrate @ 5918]
Christian Hammond <chipx86@chipx86.com>
parents: 5509
diff changeset
1360
8808
1cb5ddf6b625 [gaim-migrate @ 9570]
Felipe Contreras <felipe.contreras@gmail.com>
parents: 8669
diff changeset
1361 session = cmdproc->session;
20474
b0ef257ef8d4 The second msn.tgz from SF Patch #1621854 from Ka-Hing Cheung.
Ka-Hing Cheung <khc@pidgin.im>
parents: 20472
diff changeset
1362 group_id = cmd->params[2];
5518
436fb9490b62 [gaim-migrate @ 5918]
Christian Hammond <chipx86@chipx86.com>
parents: 5509
diff changeset
1363
9193
6e76f1367896 [gaim-migrate @ 9988]
Felipe Contreras <felipe.contreras@gmail.com>
parents: 9158
diff changeset
1364 msn_userlist_remove_group_id(session->userlist, group_id);
5518
436fb9490b62 [gaim-migrate @ 5918]
Christian Hammond <chipx86@chipx86.com>
parents: 5509
diff changeset
1365 }
436fb9490b62 [gaim-migrate @ 5918]
Christian Hammond <chipx86@chipx86.com>
parents: 5509
diff changeset
1366
8808
1cb5ddf6b625 [gaim-migrate @ 9570]
Felipe Contreras <felipe.contreras@gmail.com>
parents: 8669
diff changeset
1367 static void
10451
2df35a139363 [gaim-migrate @ 11717]
Felipe Contreras <felipe.contreras@gmail.com>
parents: 10403
diff changeset
1368 rmg_error(MsnCmdProc *cmdproc, MsnTransaction *trans, int error)
2df35a139363 [gaim-migrate @ 11717]
Felipe Contreras <felipe.contreras@gmail.com>
parents: 10403
diff changeset
1369 {
20474
b0ef257ef8d4 The second msn.tgz from SF Patch #1621854 from Ka-Hing Cheung.
Ka-Hing Cheung <khc@pidgin.im>
parents: 20472
diff changeset
1370 const char *group_id;
10451
2df35a139363 [gaim-migrate @ 11717]
Felipe Contreras <felipe.contreras@gmail.com>
parents: 10403
diff changeset
1371 char **params;
2df35a139363 [gaim-migrate @ 11717]
Felipe Contreras <felipe.contreras@gmail.com>
parents: 10403
diff changeset
1372
2df35a139363 [gaim-migrate @ 11717]
Felipe Contreras <felipe.contreras@gmail.com>
parents: 10403
diff changeset
1373 params = g_strsplit(trans->params, " ", 0);
2df35a139363 [gaim-migrate @ 11717]
Felipe Contreras <felipe.contreras@gmail.com>
parents: 10403
diff changeset
1374
20511
52917f6794f0 Fix a compile warning, rmg_error had not been fully updated for the
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 20508
diff changeset
1375 group_id = params[0];
10451
2df35a139363 [gaim-migrate @ 11717]
Felipe Contreras <felipe.contreras@gmail.com>
parents: 10403
diff changeset
1376
10452
f29b5d423600 [gaim-migrate @ 11719]
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 10451
diff changeset
1377 group_error_helper(cmdproc->session, _("Unable to delete group"), group_id, error);
10451
2df35a139363 [gaim-migrate @ 11717]
Felipe Contreras <felipe.contreras@gmail.com>
parents: 10403
diff changeset
1378
2df35a139363 [gaim-migrate @ 11717]
Felipe Contreras <felipe.contreras@gmail.com>
parents: 10403
diff changeset
1379 g_strfreev(params);
2df35a139363 [gaim-migrate @ 11717]
Felipe Contreras <felipe.contreras@gmail.com>
parents: 10403
diff changeset
1380 }
2df35a139363 [gaim-migrate @ 11717]
Felipe Contreras <felipe.contreras@gmail.com>
parents: 10403
diff changeset
1381
5309
3178acad1449 [gaim-migrate @ 5681]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
1382 /**************************************************************************
3178acad1449 [gaim-migrate @ 5681]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
1383 * Misc commands
3178acad1449 [gaim-migrate @ 5681]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
1384 **************************************************************************/
10481
a5d6b8e1717d [gaim-migrate @ 11769]
Felipe Contreras <felipe.contreras@gmail.com>
parents: 10463
diff changeset
1385
8808
1cb5ddf6b625 [gaim-migrate @ 9570]
Felipe Contreras <felipe.contreras@gmail.com>
parents: 8669
diff changeset
1386 static void
1cb5ddf6b625 [gaim-migrate @ 9570]
Felipe Contreras <felipe.contreras@gmail.com>
parents: 8669
diff changeset
1387 url_cmd(MsnCmdProc *cmdproc, MsnCommand *cmd)
5309
3178acad1449 [gaim-migrate @ 5681]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
1388 {
8808
1cb5ddf6b625 [gaim-migrate @ 9570]
Felipe Contreras <felipe.contreras@gmail.com>
parents: 8669
diff changeset
1389 MsnSession *session;
23866
6926fed80ff1 Fixup MSN mailbox handling based on a patch from Felipe, plus various
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 23840
diff changeset
1390 PurpleConnection *gc;
15884
4de1981757fc sed -ie 's/gaim/purple/g'
Sean Egan <seanegan@pidgin.im>
parents: 15435
diff changeset
1391 PurpleAccount *account;
5309
3178acad1449 [gaim-migrate @ 5681]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
1392 const char *rru;
3178acad1449 [gaim-migrate @ 5681]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
1393 const char *url;
23866
6926fed80ff1 Fixup MSN mailbox handling based on a patch from Felipe, plus various
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 23840
diff changeset
1394 PurpleCipherContext *cipher;
24001
c069392f646e Fix up the MSN Inbox URL. There was a typo that caused a use-after-free
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 23924
diff changeset
1395 gchar creds[33];
11164
4396374c0cd9 [gaim-migrate @ 13265]
Mark Doliner <markdoliner@pidgin.im>
parents: 10833
diff changeset
1396 char *buf;
23866
6926fed80ff1 Fixup MSN mailbox handling based on a patch from Felipe, plus various
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 23840
diff changeset
1397
6926fed80ff1 Fixup MSN mailbox handling based on a patch from Felipe, plus various
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 23840
diff changeset
1398 gulong tmp_timestamp;
5309
3178acad1449 [gaim-migrate @ 5681]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
1399
8808
1cb5ddf6b625 [gaim-migrate @ 9570]
Felipe Contreras <felipe.contreras@gmail.com>
parents: 8669
diff changeset
1400 session = cmdproc->session;
1cb5ddf6b625 [gaim-migrate @ 9570]
Felipe Contreras <felipe.contreras@gmail.com>
parents: 8669
diff changeset
1401 account = session->account;
23866
6926fed80ff1 Fixup MSN mailbox handling based on a patch from Felipe, plus various
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 23840
diff changeset
1402 gc = account->gc;
8808
1cb5ddf6b625 [gaim-migrate @ 9570]
Felipe Contreras <felipe.contreras@gmail.com>
parents: 8669
diff changeset
1403
1cb5ddf6b625 [gaim-migrate @ 9570]
Felipe Contreras <felipe.contreras@gmail.com>
parents: 8669
diff changeset
1404 rru = cmd->params[1];
1cb5ddf6b625 [gaim-migrate @ 9570]
Felipe Contreras <felipe.contreras@gmail.com>
parents: 8669
diff changeset
1405 url = cmd->params[2];
5309
3178acad1449 [gaim-migrate @ 5681]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
1406
23866
6926fed80ff1 Fixup MSN mailbox handling based on a patch from Felipe, plus various
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 23840
diff changeset
1407 session->passport_info.mail_timestamp = time(NULL);
6926fed80ff1 Fixup MSN mailbox handling based on a patch from Felipe, plus various
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 23840
diff changeset
1408 tmp_timestamp = session->passport_info.mail_timestamp - session->passport_info.sl;
6926fed80ff1 Fixup MSN mailbox handling based on a patch from Felipe, plus various
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 23840
diff changeset
1409
11164
4396374c0cd9 [gaim-migrate @ 13265]
Mark Doliner <markdoliner@pidgin.im>
parents: 10833
diff changeset
1410 buf = g_strdup_printf("%s%lu%s",
24002
1998a5bb6e5d Some whitespace changes to make code from that previous commit look better.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 24001
diff changeset
1411 session->passport_info.mspauth ? session->passport_info.mspauth : "BOGUS",
1998a5bb6e5d Some whitespace changes to make code from that previous commit look better.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 24001
diff changeset
1412 tmp_timestamp,
1998a5bb6e5d Some whitespace changes to make code from that previous commit look better.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 24001
diff changeset
1413 purple_connection_get_password(gc));
5309
3178acad1449 [gaim-migrate @ 5681]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
1414
23866
6926fed80ff1 Fixup MSN mailbox handling based on a patch from Felipe, plus various
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 23840
diff changeset
1415 cipher = purple_cipher_context_new_by_name("md5", NULL);
6926fed80ff1 Fixup MSN mailbox handling based on a patch from Felipe, plus various
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 23840
diff changeset
1416 purple_cipher_context_append(cipher, (const guchar *)buf, strlen(buf));
24001
c069392f646e Fix up the MSN Inbox URL. There was a typo that caused a use-after-free
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 23924
diff changeset
1417 purple_cipher_context_digest_to_str(cipher, sizeof(creds), creds, NULL);
23866
6926fed80ff1 Fixup MSN mailbox handling based on a patch from Felipe, plus various
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 23840
diff changeset
1418 purple_cipher_context_destroy(cipher);
11164
4396374c0cd9 [gaim-migrate @ 13265]
Mark Doliner <markdoliner@pidgin.im>
parents: 10833
diff changeset
1419 g_free(buf);
4396374c0cd9 [gaim-migrate @ 13265]
Mark Doliner <markdoliner@pidgin.im>
parents: 10833
diff changeset
1420
23924
1f8e75759bf3 Use a URL to open MSN Hotmail inbox instead of a temporary file.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 23923
diff changeset
1421 g_free(session->passport_info.mail_url);
24002
1998a5bb6e5d Some whitespace changes to make code from that previous commit look better.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 24001
diff changeset
1422 session->passport_info.mail_url =
1998a5bb6e5d Some whitespace changes to make code from that previous commit look better.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 24001
diff changeset
1423 g_strdup_printf("%s&auth=%s&creds=%s&sl=%ld&username=%s&mode=ttl&sid=%s&id=2&rru=%s&svc=mail&js=yes",
1998a5bb6e5d Some whitespace changes to make code from that previous commit look better.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 24001
diff changeset
1424 url,
1998a5bb6e5d Some whitespace changes to make code from that previous commit look better.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 24001
diff changeset
1425 session->passport_info.mspauth ? purple_url_encode(session->passport_info.mspauth) : "BOGUS",
1998a5bb6e5d Some whitespace changes to make code from that previous commit look better.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 24001
diff changeset
1426 creds,
1998a5bb6e5d Some whitespace changes to make code from that previous commit look better.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 24001
diff changeset
1427 tmp_timestamp,
1998a5bb6e5d Some whitespace changes to make code from that previous commit look better.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 24001
diff changeset
1428 msn_user_get_passport(session->user),
1998a5bb6e5d Some whitespace changes to make code from that previous commit look better.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 24001
diff changeset
1429 session->passport_info.sid,
1998a5bb6e5d Some whitespace changes to make code from that previous commit look better.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 24001
diff changeset
1430 rru);
5309
3178acad1449 [gaim-migrate @ 5681]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
1431
23924
1f8e75759bf3 Use a URL to open MSN Hotmail inbox instead of a temporary file.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 23923
diff changeset
1432 /* The user wants to check his or her email */
1f8e75759bf3 Use a URL to open MSN Hotmail inbox instead of a temporary file.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 23923
diff changeset
1433 if (cmd->trans && cmd->trans->data)
1f8e75759bf3 Use a URL to open MSN Hotmail inbox instead of a temporary file.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 23923
diff changeset
1434 purple_notify_uri(purple_account_get_connection(account), session->passport_info.mail_url);
5309
3178acad1449 [gaim-migrate @ 5681]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
1435 }
3178acad1449 [gaim-migrate @ 5681]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
1436 /**************************************************************************
3178acad1449 [gaim-migrate @ 5681]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
1437 * Switchboards
3178acad1449 [gaim-migrate @ 5681]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
1438 **************************************************************************/
10481
a5d6b8e1717d [gaim-migrate @ 11769]
Felipe Contreras <felipe.contreras@gmail.com>
parents: 10463
diff changeset
1439
8808
1cb5ddf6b625 [gaim-migrate @ 9570]
Felipe Contreras <felipe.contreras@gmail.com>
parents: 8669
diff changeset
1440 static void
1cb5ddf6b625 [gaim-migrate @ 9570]
Felipe Contreras <felipe.contreras@gmail.com>
parents: 8669
diff changeset
1441 rng_cmd(MsnCmdProc *cmdproc, MsnCommand *cmd)
5309
3178acad1449 [gaim-migrate @ 5681]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
1442 {
8808
1cb5ddf6b625 [gaim-migrate @ 9570]
Felipe Contreras <felipe.contreras@gmail.com>
parents: 8669
diff changeset
1443 MsnSession *session;
5309
3178acad1449 [gaim-migrate @ 5681]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
1444 MsnSwitchBoard *swboard;
3178acad1449 [gaim-migrate @ 5681]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
1445 const char *session_id;
9193
6e76f1367896 [gaim-migrate @ 9988]
Felipe Contreras <felipe.contreras@gmail.com>
parents: 9158
diff changeset
1446 char *host;
5309
3178acad1449 [gaim-migrate @ 5681]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
1447 int port;
3178acad1449 [gaim-migrate @ 5681]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
1448
8808
1cb5ddf6b625 [gaim-migrate @ 9570]
Felipe Contreras <felipe.contreras@gmail.com>
parents: 8669
diff changeset
1449 session = cmdproc->session;
1cb5ddf6b625 [gaim-migrate @ 9570]
Felipe Contreras <felipe.contreras@gmail.com>
parents: 8669
diff changeset
1450 session_id = cmd->params[0];
5309
3178acad1449 [gaim-migrate @ 5681]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
1451
9193
6e76f1367896 [gaim-migrate @ 9988]
Felipe Contreras <felipe.contreras@gmail.com>
parents: 9158
diff changeset
1452 msn_parse_socket(cmd->params[1], &host, &port);
5309
3178acad1449 [gaim-migrate @ 5681]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
1453
7288
486e8b44a14b [gaim-migrate @ 7869]
Christian Hammond <chipx86@chipx86.com>
parents: 7274
diff changeset
1454 if (session->http_method)
486e8b44a14b [gaim-migrate @ 7869]
Christian Hammond <chipx86@chipx86.com>
parents: 7274
diff changeset
1455 port = 80;
486e8b44a14b [gaim-migrate @ 7869]
Christian Hammond <chipx86@chipx86.com>
parents: 7274
diff changeset
1456
5309
3178acad1449 [gaim-migrate @ 5681]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
1457 swboard = msn_switchboard_new(session);
3178acad1449 [gaim-migrate @ 5681]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
1458
3178acad1449 [gaim-migrate @ 5681]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
1459 msn_switchboard_set_invited(swboard, TRUE);
8808
1cb5ddf6b625 [gaim-migrate @ 9570]
Felipe Contreras <felipe.contreras@gmail.com>
parents: 8669
diff changeset
1460 msn_switchboard_set_session_id(swboard, cmd->params[0]);
1cb5ddf6b625 [gaim-migrate @ 9570]
Felipe Contreras <felipe.contreras@gmail.com>
parents: 8669
diff changeset
1461 msn_switchboard_set_auth_key(swboard, cmd->params[3]);
9193
6e76f1367896 [gaim-migrate @ 9988]
Felipe Contreras <felipe.contreras@gmail.com>
parents: 9158
diff changeset
1462 swboard->im_user = g_strdup(cmd->params[4]);
6e76f1367896 [gaim-migrate @ 9988]
Felipe Contreras <felipe.contreras@gmail.com>
parents: 9158
diff changeset
1463 /* msn_switchboard_add_user(swboard, cmd->params[4]); */
5309
3178acad1449 [gaim-migrate @ 5681]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
1464
10568
15f02c0e7fc1 [gaim-migrate @ 11954]
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 10519
diff changeset
1465 if (!msn_switchboard_connect(swboard, host, port))
15f02c0e7fc1 [gaim-migrate @ 11954]
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 10519
diff changeset
1466 msn_switchboard_destroy(swboard);
5309
3178acad1449 [gaim-migrate @ 5681]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
1467
3178acad1449 [gaim-migrate @ 5681]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
1468 g_free(host);
3178acad1449 [gaim-migrate @ 5681]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
1469 }
3178acad1449 [gaim-migrate @ 5681]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
1470
8808
1cb5ddf6b625 [gaim-migrate @ 9570]
Felipe Contreras <felipe.contreras@gmail.com>
parents: 8669
diff changeset
1471 static void
1cb5ddf6b625 [gaim-migrate @ 9570]
Felipe Contreras <felipe.contreras@gmail.com>
parents: 8669
diff changeset
1472 xfr_cmd(MsnCmdProc *cmdproc, MsnCommand *cmd)
5309
3178acad1449 [gaim-migrate @ 5681]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
1473 {
3178acad1449 [gaim-migrate @ 5681]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
1474 char *host;
3178acad1449 [gaim-migrate @ 5681]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
1475 int port;
3178acad1449 [gaim-migrate @ 5681]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
1476
8808
1cb5ddf6b625 [gaim-migrate @ 9570]
Felipe Contreras <felipe.contreras@gmail.com>
parents: 8669
diff changeset
1477 if (strcmp(cmd->params[1], "SB") && strcmp(cmd->params[1], "NS"))
1cb5ddf6b625 [gaim-migrate @ 9570]
Felipe Contreras <felipe.contreras@gmail.com>
parents: 8669
diff changeset
1478 {
10481
a5d6b8e1717d [gaim-migrate @ 11769]
Felipe Contreras <felipe.contreras@gmail.com>
parents: 10463
diff changeset
1479 /* Maybe we can have a generic bad command error. */
15884
4de1981757fc sed -ie 's/gaim/purple/g'
Sean Egan <seanegan@pidgin.im>
parents: 15435
diff changeset
1480 purple_debug_error("msn", "Bad XFR command (%s)\n", cmd->params[1]);
8808
1cb5ddf6b625 [gaim-migrate @ 9570]
Felipe Contreras <felipe.contreras@gmail.com>
parents: 8669
diff changeset
1481 return;
5309
3178acad1449 [gaim-migrate @ 5681]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
1482 }
3178acad1449 [gaim-migrate @ 5681]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
1483
9193
6e76f1367896 [gaim-migrate @ 9988]
Felipe Contreras <felipe.contreras@gmail.com>
parents: 9158
diff changeset
1484 msn_parse_socket(cmd->params[2], &host, &port);
5309
3178acad1449 [gaim-migrate @ 5681]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
1485
8808
1cb5ddf6b625 [gaim-migrate @ 9570]
Felipe Contreras <felipe.contreras@gmail.com>
parents: 8669
diff changeset
1486 if (!strcmp(cmd->params[1], "SB"))
1cb5ddf6b625 [gaim-migrate @ 9570]
Felipe Contreras <felipe.contreras@gmail.com>
parents: 8669
diff changeset
1487 {
15884
4de1981757fc sed -ie 's/gaim/purple/g'
Sean Egan <seanegan@pidgin.im>
parents: 15435
diff changeset
1488 purple_debug_error("msn", "This shouldn't be handled here.\n");
5385
12f55f3be43e [gaim-migrate @ 5761]
Christian Hammond <chipx86@chipx86.com>
parents: 5375
diff changeset
1489 }
8808
1cb5ddf6b625 [gaim-migrate @ 9570]
Felipe Contreras <felipe.contreras@gmail.com>
parents: 8669
diff changeset
1490 else if (!strcmp(cmd->params[1], "NS"))
1cb5ddf6b625 [gaim-migrate @ 9570]
Felipe Contreras <felipe.contreras@gmail.com>
parents: 8669
diff changeset
1491 {
9193
6e76f1367896 [gaim-migrate @ 9988]
Felipe Contreras <felipe.contreras@gmail.com>
parents: 9158
diff changeset
1492 MsnSession *session;
8646
74d0e7406e3b [gaim-migrate @ 9398]
Felipe Contreras <felipe.contreras@gmail.com>
parents: 8614
diff changeset
1493
9193
6e76f1367896 [gaim-migrate @ 9988]
Felipe Contreras <felipe.contreras@gmail.com>
parents: 9158
diff changeset
1494 session = cmdproc->session;
5309
3178acad1449 [gaim-migrate @ 5681]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
1495
10519
80801a34a246 [gaim-migrate @ 11833]
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 10514
diff changeset
1496 msn_session_set_login_step(session, MSN_LOGIN_STEP_TRANSFER);
10481
a5d6b8e1717d [gaim-migrate @ 11769]
Felipe Contreras <felipe.contreras@gmail.com>
parents: 10463
diff changeset
1497
9193
6e76f1367896 [gaim-migrate @ 9988]
Felipe Contreras <felipe.contreras@gmail.com>
parents: 9158
diff changeset
1498 msn_notification_connect(session->notification, host, port);
5309
3178acad1449 [gaim-migrate @ 5681]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
1499 }
3178acad1449 [gaim-migrate @ 5681]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
1500
3178acad1449 [gaim-migrate @ 5681]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
1501 g_free(host);
3178acad1449 [gaim-migrate @ 5681]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
1502 }
3178acad1449 [gaim-migrate @ 5681]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
1503
13853
cccd9dd599eb [gaim-migrate @ 16329]
Ma Yuan <mayuan2006@gmail.com>
parents: 13713
diff changeset
1504 static void
13867
98600e8943dd [gaim-migrate @ 16721]
Ma Yuan <mayuan2006@gmail.com>
parents: 13866
diff changeset
1505 gcf_cmd_post(MsnCmdProc *cmdproc, MsnCommand *cmd, char *payload,
98600e8943dd [gaim-migrate @ 16721]
Ma Yuan <mayuan2006@gmail.com>
parents: 13866
diff changeset
1506 size_t len)
98600e8943dd [gaim-migrate @ 16721]
Ma Yuan <mayuan2006@gmail.com>
parents: 13866
diff changeset
1507 {
23839
7351d841f0b5 Disable the MSN blocked text dialog for now because it doesn't always
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 23833
diff changeset
1508 /* QuLogic: Disabled until confirmed correct. */
7351d841f0b5 Disable the MSN blocked text dialog for now because it doesn't always
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 23833
diff changeset
1509 #if 0
23789
3ef57c5a8d9c Properly parse (most of) the MSN GCF command. Provides a
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 23787
diff changeset
1510 xmlnode *root;
3ef57c5a8d9c Properly parse (most of) the MSN GCF command. Provides a
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 23787
diff changeset
1511 xmlnode *policy;
20547
35cff3479def Print the policies sent by the server (GCF command) in a human-readable way.
Carlos Silva <typ0@pidgin.im>
parents: 20546
diff changeset
1512
35cff3479def Print the policies sent by the server (GCF command) in a human-readable way.
Carlos Silva <typ0@pidgin.im>
parents: 20546
diff changeset
1513 g_return_if_fail(cmd->payload != NULL);
35cff3479def Print the policies sent by the server (GCF command) in a human-readable way.
Carlos Silva <typ0@pidgin.im>
parents: 20546
diff changeset
1514
35cff3479def Print the policies sent by the server (GCF command) in a human-readable way.
Carlos Silva <typ0@pidgin.im>
parents: 20546
diff changeset
1515 if ( (root = xmlnode_from_str(cmd->payload, cmd->payload_len)) == NULL)
35cff3479def Print the policies sent by the server (GCF command) in a human-readable way.
Carlos Silva <typ0@pidgin.im>
parents: 20546
diff changeset
1516 {
23830
1436e3de5d6c The great MSN debug message cleanup! Threw in a few whitespace fixes,
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 23828
diff changeset
1517 purple_debug_error("msn", "Unable to parse GCF payload into a XML tree");
20547
35cff3479def Print the policies sent by the server (GCF command) in a human-readable way.
Carlos Silva <typ0@pidgin.im>
parents: 20546
diff changeset
1518 return;
35cff3479def Print the policies sent by the server (GCF command) in a human-readable way.
Carlos Silva <typ0@pidgin.im>
parents: 20546
diff changeset
1519 }
23441
fd45c23a3eb2 Delete trailing whitespace
Mark Doliner <markdoliner@pidgin.im>
parents: 23085
diff changeset
1520
23789
3ef57c5a8d9c Properly parse (most of) the MSN GCF command. Provides a
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 23787
diff changeset
1521
3ef57c5a8d9c Properly parse (most of) the MSN GCF command. Provides a
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 23787
diff changeset
1522 g_free(cmdproc->session->blocked_text);
3ef57c5a8d9c Properly parse (most of) the MSN GCF command. Provides a
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 23787
diff changeset
1523 cmdproc->session->blocked_text = NULL;
3ef57c5a8d9c Properly parse (most of) the MSN GCF command. Provides a
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 23787
diff changeset
1524
3ef57c5a8d9c Properly parse (most of) the MSN GCF command. Provides a
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 23787
diff changeset
1525 /* We need a get_child with attrib... */
3ef57c5a8d9c Properly parse (most of) the MSN GCF command. Provides a
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 23787
diff changeset
1526 policy = xmlnode_get_child(root, "Policy");
3ef57c5a8d9c Properly parse (most of) the MSN GCF command. Provides a
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 23787
diff changeset
1527 while (policy) {
3ef57c5a8d9c Properly parse (most of) the MSN GCF command. Provides a
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 23787
diff changeset
1528 if (g_str_equal(xmlnode_get_attrib(policy, "type"), "SHIELDS"))
3ef57c5a8d9c Properly parse (most of) the MSN GCF command. Provides a
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 23787
diff changeset
1529 break;
3ef57c5a8d9c Properly parse (most of) the MSN GCF command. Provides a
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 23787
diff changeset
1530 policy = xmlnode_get_next_twin(policy);
3ef57c5a8d9c Properly parse (most of) the MSN GCF command. Provides a
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 23787
diff changeset
1531 }
20547
35cff3479def Print the policies sent by the server (GCF command) in a human-readable way.
Carlos Silva <typ0@pidgin.im>
parents: 20546
diff changeset
1532
23789
3ef57c5a8d9c Properly parse (most of) the MSN GCF command. Provides a
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 23787
diff changeset
1533 if (policy) {
3ef57c5a8d9c Properly parse (most of) the MSN GCF command. Provides a
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 23787
diff changeset
1534 GString *blocked = g_string_new(NULL);
3ef57c5a8d9c Properly parse (most of) the MSN GCF command. Provides a
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 23787
diff changeset
1535 xmlnode *imtext = xmlnode_get_child(policy,
3ef57c5a8d9c Properly parse (most of) the MSN GCF command. Provides a
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 23787
diff changeset
1536 "config/block/regexp/imtext");
3ef57c5a8d9c Properly parse (most of) the MSN GCF command. Provides a
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 23787
diff changeset
1537 while (imtext) {
3ef57c5a8d9c Properly parse (most of) the MSN GCF command. Provides a
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 23787
diff changeset
1538 const char *value = xmlnode_get_attrib(imtext, "value");
3ef57c5a8d9c Properly parse (most of) the MSN GCF command. Provides a
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 23787
diff changeset
1539 g_string_append_printf(blocked, "%s<br/>\n",
3ef57c5a8d9c Properly parse (most of) the MSN GCF command. Provides a
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 23787
diff changeset
1540 purple_base64_decode(value, NULL));
3ef57c5a8d9c Properly parse (most of) the MSN GCF command. Provides a
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 23787
diff changeset
1541 imtext = xmlnode_get_next_twin(imtext);
3ef57c5a8d9c Properly parse (most of) the MSN GCF command. Provides a
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 23787
diff changeset
1542 }
23441
fd45c23a3eb2 Delete trailing whitespace
Mark Doliner <markdoliner@pidgin.im>
parents: 23085
diff changeset
1543
23789
3ef57c5a8d9c Properly parse (most of) the MSN GCF command. Provides a
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 23787
diff changeset
1544 cmdproc->session->blocked_text = g_string_free(blocked, FALSE);
3ef57c5a8d9c Properly parse (most of) the MSN GCF command. Provides a
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 23787
diff changeset
1545 }
3ef57c5a8d9c Properly parse (most of) the MSN GCF command. Provides a
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 23787
diff changeset
1546
20547
35cff3479def Print the policies sent by the server (GCF command) in a human-readable way.
Carlos Silva <typ0@pidgin.im>
parents: 20546
diff changeset
1547 xmlnode_free(root);
23839
7351d841f0b5 Disable the MSN blocked text dialog for now because it doesn't always
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 23833
diff changeset
1548 #endif
13867
98600e8943dd [gaim-migrate @ 16721]
Ma Yuan <mayuan2006@gmail.com>
parents: 13866
diff changeset
1549 }
98600e8943dd [gaim-migrate @ 16721]
Ma Yuan <mayuan2006@gmail.com>
parents: 13866
diff changeset
1550
98600e8943dd [gaim-migrate @ 16721]
Ma Yuan <mayuan2006@gmail.com>
parents: 13866
diff changeset
1551 static void
13853
cccd9dd599eb [gaim-migrate @ 16329]
Ma Yuan <mayuan2006@gmail.com>
parents: 13713
diff changeset
1552 gcf_cmd(MsnCmdProc *cmdproc, MsnCommand *cmd)
cccd9dd599eb [gaim-migrate @ 16329]
Ma Yuan <mayuan2006@gmail.com>
parents: 13713
diff changeset
1553 {
23830
1436e3de5d6c The great MSN debug message cleanup! Threw in a few whitespace fixes,
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 23828
diff changeset
1554 purple_debug_info("msn", "Processing GCF command\n");
23826
3eeaac42358f Get rid of that whole msn_set_payload_len thing and correctly set the
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 23824
diff changeset
1555
13867
98600e8943dd [gaim-migrate @ 16721]
Ma Yuan <mayuan2006@gmail.com>
parents: 13866
diff changeset
1556 cmdproc->last_cmd->payload_cb = gcf_cmd_post;
23826
3eeaac42358f Get rid of that whole msn_set_payload_len thing and correctly set the
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 23824
diff changeset
1557 cmd->payload_len = atoi(cmd->params[1]);
13853
cccd9dd599eb [gaim-migrate @ 16329]
Ma Yuan <mayuan2006@gmail.com>
parents: 13713
diff changeset
1558 }
cccd9dd599eb [gaim-migrate @ 16329]
Ma Yuan <mayuan2006@gmail.com>
parents: 13713
diff changeset
1559
cccd9dd599eb [gaim-migrate @ 16329]
Ma Yuan <mayuan2006@gmail.com>
parents: 13713
diff changeset
1560 static void
cccd9dd599eb [gaim-migrate @ 16329]
Ma Yuan <mayuan2006@gmail.com>
parents: 13713
diff changeset
1561 sbs_cmd(MsnCmdProc *cmdproc, MsnCommand *cmd)
cccd9dd599eb [gaim-migrate @ 16329]
Ma Yuan <mayuan2006@gmail.com>
parents: 13713
diff changeset
1562 {
23830
1436e3de5d6c The great MSN debug message cleanup! Threw in a few whitespace fixes,
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 23828
diff changeset
1563 purple_debug_info("msn", "Processing SBS... \n");
13853
cccd9dd599eb [gaim-migrate @ 16329]
Ma Yuan <mayuan2006@gmail.com>
parents: 13713
diff changeset
1564 /*get the payload content*/
cccd9dd599eb [gaim-migrate @ 16329]
Ma Yuan <mayuan2006@gmail.com>
parents: 13713
diff changeset
1565 }
cccd9dd599eb [gaim-migrate @ 16329]
Ma Yuan <mayuan2006@gmail.com>
parents: 13713
diff changeset
1566
13888
bda6f562e1e6 [gaim-migrate @ 17003]
Ma Yuan <mayuan2006@gmail.com>
parents: 13887
diff changeset
1567 /*
bda6f562e1e6 [gaim-migrate @ 17003]
Ma Yuan <mayuan2006@gmail.com>
parents: 13887
diff changeset
1568 * Get the UBX's PSM info
bda6f562e1e6 [gaim-migrate @ 17003]
Ma Yuan <mayuan2006@gmail.com>
parents: 13887
diff changeset
1569 * Post it to the User status
bda6f562e1e6 [gaim-migrate @ 17003]
Ma Yuan <mayuan2006@gmail.com>
parents: 13887
diff changeset
1570 * Thanks for Chris <ukdrizzle@yahoo.co.uk>'s code
bda6f562e1e6 [gaim-migrate @ 17003]
Ma Yuan <mayuan2006@gmail.com>
parents: 13887
diff changeset
1571 */
13856
a6511183749e [gaim-migrate @ 16546]
Ma Yuan <mayuan2006@gmail.com>
parents: 13855
diff changeset
1572 static void
13873
3c20f5d70d1d [gaim-migrate @ 16772]
Ma Yuan <mayuan2006@gmail.com>
parents: 13871
diff changeset
1573 ubx_cmd_post(MsnCmdProc *cmdproc, MsnCommand *cmd, char *payload,
3c20f5d70d1d [gaim-migrate @ 16772]
Ma Yuan <mayuan2006@gmail.com>
parents: 13871
diff changeset
1574 size_t len)
3c20f5d70d1d [gaim-migrate @ 16772]
Ma Yuan <mayuan2006@gmail.com>
parents: 13871
diff changeset
1575 {
13888
bda6f562e1e6 [gaim-migrate @ 17003]
Ma Yuan <mayuan2006@gmail.com>
parents: 13887
diff changeset
1576 MsnSession *session;
20478
46933dc62880 propagate from branch 'im.pidgin.pidgin' (head 88b7040408c88e4516c008f4eac579f98ef53e85)
Richard Laager <rlaager@pidgin.im>
parents: 20476 16124
diff changeset
1577 PurpleAccount *account;
13888
bda6f562e1e6 [gaim-migrate @ 17003]
Ma Yuan <mayuan2006@gmail.com>
parents: 13887
diff changeset
1578 MsnUser *user;
20474
b0ef257ef8d4 The second msn.tgz from SF Patch #1621854 from Ka-Hing Cheung.
Ka-Hing Cheung <khc@pidgin.im>
parents: 20472
diff changeset
1579 const char *passport;
21193
e918a1846d03 Use an independant status type for 'current media' stuff, instead of using
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents: 20597
diff changeset
1580 char *psm_str, *str;
e918a1846d03 Use an independant status type for 'current media' stuff, instead of using
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents: 20597
diff changeset
1581 CurrentMedia media = {NULL, NULL, NULL};
13888
bda6f562e1e6 [gaim-migrate @ 17003]
Ma Yuan <mayuan2006@gmail.com>
parents: 13887
diff changeset
1582
bda6f562e1e6 [gaim-migrate @ 17003]
Ma Yuan <mayuan2006@gmail.com>
parents: 13887
diff changeset
1583 session = cmdproc->session;
bda6f562e1e6 [gaim-migrate @ 17003]
Ma Yuan <mayuan2006@gmail.com>
parents: 13887
diff changeset
1584 account = session->account;
bda6f562e1e6 [gaim-migrate @ 17003]
Ma Yuan <mayuan2006@gmail.com>
parents: 13887
diff changeset
1585
bda6f562e1e6 [gaim-migrate @ 17003]
Ma Yuan <mayuan2006@gmail.com>
parents: 13887
diff changeset
1586 passport = cmd->params[0];
bda6f562e1e6 [gaim-migrate @ 17003]
Ma Yuan <mayuan2006@gmail.com>
parents: 13887
diff changeset
1587 user = msn_userlist_find_user(session->userlist, passport);
24183
8949a1157a43 prints out the payload to debug log in case we get an invalid UBX command,
Ka-Hing Cheung <khc@pidgin.im>
parents: 24143
diff changeset
1588 if (user == NULL) {
8949a1157a43 prints out the payload to debug log in case we get an invalid UBX command,
Ka-Hing Cheung <khc@pidgin.im>
parents: 24143
diff changeset
1589 char *str = g_strndup(payload, len);
8949a1157a43 prints out the payload to debug log in case we get an invalid UBX command,
Ka-Hing Cheung <khc@pidgin.im>
parents: 24143
diff changeset
1590 purple_debug_info("msn", "unknown user %s, payload is %s",
8949a1157a43 prints out the payload to debug log in case we get an invalid UBX command,
Ka-Hing Cheung <khc@pidgin.im>
parents: 24143
diff changeset
1591 passport, str);
8949a1157a43 prints out the payload to debug log in case we get an invalid UBX command,
Ka-Hing Cheung <khc@pidgin.im>
parents: 24143
diff changeset
1592 g_free(str);
8949a1157a43 prints out the payload to debug log in case we get an invalid UBX command,
Ka-Hing Cheung <khc@pidgin.im>
parents: 24143
diff changeset
1593 return;
8949a1157a43 prints out the payload to debug log in case we get an invalid UBX command,
Ka-Hing Cheung <khc@pidgin.im>
parents: 24143
diff changeset
1594 }
23441
fd45c23a3eb2 Delete trailing whitespace
Mark Doliner <markdoliner@pidgin.im>
parents: 23085
diff changeset
1595
13888
bda6f562e1e6 [gaim-migrate @ 17003]
Ma Yuan <mayuan2006@gmail.com>
parents: 13887
diff changeset
1596 psm_str = msn_get_psm(cmd->payload,len);
21193
e918a1846d03 Use an independant status type for 'current media' stuff, instead of using
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents: 20597
diff changeset
1597 msn_user_set_statusline(user, psm_str);
e918a1846d03 Use an independant status type for 'current media' stuff, instead of using
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents: 20597
diff changeset
1598 g_free(psm_str);
e918a1846d03 Use an independant status type for 'current media' stuff, instead of using
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents: 20597
diff changeset
1599
e918a1846d03 Use an independant status type for 'current media' stuff, instead of using
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents: 20597
diff changeset
1600 str = msn_get_currentmedia(cmd->payload, len);
e918a1846d03 Use an independant status type for 'current media' stuff, instead of using
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents: 20597
diff changeset
1601 if (msn_parse_currentmedia(str, &media))
e918a1846d03 Use an independant status type for 'current media' stuff, instead of using
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents: 20597
diff changeset
1602 msn_user_set_currentmedia(user, &media);
e918a1846d03 Use an independant status type for 'current media' stuff, instead of using
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents: 20597
diff changeset
1603 else
e918a1846d03 Use an independant status type for 'current media' stuff, instead of using
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents: 20597
diff changeset
1604 msn_user_set_currentmedia(user, NULL);
22981
b83a23981419 Fix a number of leaks. As far as I can tell, MSNP14 now logs in without
Daniel Atallah <datallah@pidgin.im>
parents: 22969
diff changeset
1605 g_free(media.title);
b83a23981419 Fix a number of leaks. As far as I can tell, MSNP14 now logs in without
Daniel Atallah <datallah@pidgin.im>
parents: 22969
diff changeset
1606 g_free(media.album);
b83a23981419 Fix a number of leaks. As far as I can tell, MSNP14 now logs in without
Daniel Atallah <datallah@pidgin.im>
parents: 22969
diff changeset
1607 g_free(media.artist);
20578
82571739414b Fix some memory leaks. Free xmlnodes properly using xmlnode_free instead of
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents: 20577
diff changeset
1608 g_free(str);
16183
92409c474659 Committing khc's msnp14 changes from Trac Ticket #148. --rlaager
Ka-Hing Cheung <khc@pidgin.im>
parents: 16124
diff changeset
1609
13888
bda6f562e1e6 [gaim-migrate @ 17003]
Ma Yuan <mayuan2006@gmail.com>
parents: 13887
diff changeset
1610 msn_user_update(user);
13873
3c20f5d70d1d [gaim-migrate @ 16772]
Ma Yuan <mayuan2006@gmail.com>
parents: 13871
diff changeset
1611 }
3c20f5d70d1d [gaim-migrate @ 16772]
Ma Yuan <mayuan2006@gmail.com>
parents: 13871
diff changeset
1612
3c20f5d70d1d [gaim-migrate @ 16772]
Ma Yuan <mayuan2006@gmail.com>
parents: 13871
diff changeset
1613 static void
13856
a6511183749e [gaim-migrate @ 16546]
Ma Yuan <mayuan2006@gmail.com>
parents: 13855
diff changeset
1614 ubx_cmd(MsnCmdProc *cmdproc, MsnCommand *cmd)
a6511183749e [gaim-migrate @ 16546]
Ma Yuan <mayuan2006@gmail.com>
parents: 13855
diff changeset
1615 {
23830
1436e3de5d6c The great MSN debug message cleanup! Threw in a few whitespace fixes,
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 23828
diff changeset
1616 purple_debug_misc("msn", "UBX received.\n");
13873
3c20f5d70d1d [gaim-migrate @ 16772]
Ma Yuan <mayuan2006@gmail.com>
parents: 13871
diff changeset
1617 cmdproc->last_cmd->payload_cb = ubx_cmd_post;
23826
3eeaac42358f Get rid of that whole msn_set_payload_len thing and correctly set the
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 23824
diff changeset
1618 cmd->payload_len = atoi(cmd->params[2]);
3eeaac42358f Get rid of that whole msn_set_payload_len thing and correctly set the
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 23824
diff changeset
1619 }
3eeaac42358f Get rid of that whole msn_set_payload_len thing and correctly set the
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 23824
diff changeset
1620
3eeaac42358f Get rid of that whole msn_set_payload_len thing and correctly set the
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 23824
diff changeset
1621 static void
3eeaac42358f Get rid of that whole msn_set_payload_len thing and correctly set the
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 23824
diff changeset
1622 uux_cmd_post(MsnCmdProc *cmdproc, MsnCommand *cmd, char *payload,
3eeaac42358f Get rid of that whole msn_set_payload_len thing and correctly set the
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 23824
diff changeset
1623 size_t len)
3eeaac42358f Get rid of that whole msn_set_payload_len thing and correctly set the
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 23824
diff changeset
1624 {
3eeaac42358f Get rid of that whole msn_set_payload_len thing and correctly set the
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 23824
diff changeset
1625 /* Do Nothing, right now. */
3eeaac42358f Get rid of that whole msn_set_payload_len thing and correctly set the
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 23824
diff changeset
1626 if (payload != NULL)
3eeaac42358f Get rid of that whole msn_set_payload_len thing and correctly set the
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 23824
diff changeset
1627 purple_debug_info("msn", "UUX payload:\n%s\n", payload);
13856
a6511183749e [gaim-migrate @ 16546]
Ma Yuan <mayuan2006@gmail.com>
parents: 13855
diff changeset
1628 }
a6511183749e [gaim-migrate @ 16546]
Ma Yuan <mayuan2006@gmail.com>
parents: 13855
diff changeset
1629
a6511183749e [gaim-migrate @ 16546]
Ma Yuan <mayuan2006@gmail.com>
parents: 13855
diff changeset
1630 static void
a6511183749e [gaim-migrate @ 16546]
Ma Yuan <mayuan2006@gmail.com>
parents: 13855
diff changeset
1631 uux_cmd(MsnCmdProc *cmdproc, MsnCommand *cmd)
a6511183749e [gaim-migrate @ 16546]
Ma Yuan <mayuan2006@gmail.com>
parents: 13855
diff changeset
1632 {
23826
3eeaac42358f Get rid of that whole msn_set_payload_len thing and correctly set the
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 23824
diff changeset
1633 purple_debug_misc("msn", "UUX received.\n");
3eeaac42358f Get rid of that whole msn_set_payload_len thing and correctly set the
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 23824
diff changeset
1634 cmdproc->last_cmd->payload_cb = uux_cmd_post;
3eeaac42358f Get rid of that whole msn_set_payload_len thing and correctly set the
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 23824
diff changeset
1635 cmd->payload_len = atoi(cmd->params[1]);
13856
a6511183749e [gaim-migrate @ 16546]
Ma Yuan <mayuan2006@gmail.com>
parents: 13855
diff changeset
1636 }
a6511183749e [gaim-migrate @ 16546]
Ma Yuan <mayuan2006@gmail.com>
parents: 13855
diff changeset
1637
5309
3178acad1449 [gaim-migrate @ 5681]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
1638 /**************************************************************************
3178acad1449 [gaim-migrate @ 5681]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
1639 * Message Types
3178acad1449 [gaim-migrate @ 5681]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
1640 **************************************************************************/
10481
a5d6b8e1717d [gaim-migrate @ 11769]
Felipe Contreras <felipe.contreras@gmail.com>
parents: 10463
diff changeset
1641
8808
1cb5ddf6b625 [gaim-migrate @ 9570]
Felipe Contreras <felipe.contreras@gmail.com>
parents: 8669
diff changeset
1642 static void
1cb5ddf6b625 [gaim-migrate @ 9570]
Felipe Contreras <felipe.contreras@gmail.com>
parents: 8669
diff changeset
1643 profile_msg(MsnCmdProc *cmdproc, MsnMessage *msg)
5309
3178acad1449 [gaim-migrate @ 5681]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
1644 {
8808
1cb5ddf6b625 [gaim-migrate @ 9570]
Felipe Contreras <felipe.contreras@gmail.com>
parents: 8669
diff changeset
1645 MsnSession *session;
5309
3178acad1449 [gaim-migrate @ 5681]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
1646 const char *value;
13910
fb8f57c2b934 [gaim-migrate @ 17481]
Ma Yuan <mayuan2006@gmail.com>
parents: 13902
diff changeset
1647 const char *clLastChange;
5309
3178acad1449 [gaim-migrate @ 5681]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
1648
8808
1cb5ddf6b625 [gaim-migrate @ 9570]
Felipe Contreras <felipe.contreras@gmail.com>
parents: 8669
diff changeset
1649 session = cmdproc->session;
1cb5ddf6b625 [gaim-migrate @ 9570]
Felipe Contreras <felipe.contreras@gmail.com>
parents: 8669
diff changeset
1650
9193
6e76f1367896 [gaim-migrate @ 9988]
Felipe Contreras <felipe.contreras@gmail.com>
parents: 9158
diff changeset
1651 if (strcmp(msg->remote_user, "Hotmail"))
5333
e1ae88905e28 [gaim-migrate @ 5708]
Christian Hammond <chipx86@chipx86.com>
parents: 5327
diff changeset
1652 /* This isn't an official message. */
8808
1cb5ddf6b625 [gaim-migrate @ 9570]
Felipe Contreras <felipe.contreras@gmail.com>
parents: 8669
diff changeset
1653 return;
5333
e1ae88905e28 [gaim-migrate @ 5708]
Christian Hammond <chipx86@chipx86.com>
parents: 5327
diff changeset
1654
5309
3178acad1449 [gaim-migrate @ 5681]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
1655 if ((value = msn_message_get_attr(msg, "kv")) != NULL)
10284
257978b5df5b [gaim-migrate @ 11454]
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 10275
diff changeset
1656 {
16896
cadacef82ac3 Remove a bunch of unnecessary NULL checking for g_free()
Daniel Atallah <datallah@pidgin.im>
parents: 16895
diff changeset
1657 g_free(session->passport_info.kv);
5309
3178acad1449 [gaim-migrate @ 5681]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
1658 session->passport_info.kv = g_strdup(value);
10284
257978b5df5b [gaim-migrate @ 11454]
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 10275
diff changeset
1659 }
5309
3178acad1449 [gaim-migrate @ 5681]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
1660
3178acad1449 [gaim-migrate @ 5681]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
1661 if ((value = msn_message_get_attr(msg, "sid")) != NULL)
10284
257978b5df5b [gaim-migrate @ 11454]
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 10275
diff changeset
1662 {
16896
cadacef82ac3 Remove a bunch of unnecessary NULL checking for g_free()
Daniel Atallah <datallah@pidgin.im>
parents: 16895
diff changeset
1663 g_free(session->passport_info.sid);
5309
3178acad1449 [gaim-migrate @ 5681]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
1664 session->passport_info.sid = g_strdup(value);
10284
257978b5df5b [gaim-migrate @ 11454]
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 10275
diff changeset
1665 }
5309
3178acad1449 [gaim-migrate @ 5681]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
1666
3178acad1449 [gaim-migrate @ 5681]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
1667 if ((value = msn_message_get_attr(msg, "MSPAuth")) != NULL)
10284
257978b5df5b [gaim-migrate @ 11454]
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 10275
diff changeset
1668 {
16896
cadacef82ac3 Remove a bunch of unnecessary NULL checking for g_free()
Daniel Atallah <datallah@pidgin.im>
parents: 16895
diff changeset
1669 g_free(session->passport_info.mspauth);
5309
3178acad1449 [gaim-migrate @ 5681]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
1670 session->passport_info.mspauth = g_strdup(value);
10284
257978b5df5b [gaim-migrate @ 11454]
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 10275
diff changeset
1671 }
5309
3178acad1449 [gaim-migrate @ 5681]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
1672
6701
7e2db9273748 [gaim-migrate @ 7227]
Christian Hammond <chipx86@chipx86.com>
parents: 6695
diff changeset
1673 if ((value = msn_message_get_attr(msg, "ClientIP")) != NULL)
10284
257978b5df5b [gaim-migrate @ 11454]
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 10275
diff changeset
1674 {
16896
cadacef82ac3 Remove a bunch of unnecessary NULL checking for g_free()
Daniel Atallah <datallah@pidgin.im>
parents: 16895
diff changeset
1675 g_free(session->passport_info.client_ip);
6701
7e2db9273748 [gaim-migrate @ 7227]
Christian Hammond <chipx86@chipx86.com>
parents: 6695
diff changeset
1676 session->passport_info.client_ip = g_strdup(value);
10284
257978b5df5b [gaim-migrate @ 11454]
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 10275
diff changeset
1677 }
6701
7e2db9273748 [gaim-migrate @ 7227]
Christian Hammond <chipx86@chipx86.com>
parents: 6695
diff changeset
1678
7e2db9273748 [gaim-migrate @ 7227]
Christian Hammond <chipx86@chipx86.com>
parents: 6695
diff changeset
1679 if ((value = msn_message_get_attr(msg, "ClientPort")) != NULL)
20482
a706f6c3c75c merge of '92409c474659cace8004653f67cb9eba62ef7f93'
Richard Laager <rlaager@pidgin.im>
parents: 16183 20481
diff changeset
1680 {
6701
7e2db9273748 [gaim-migrate @ 7227]
Christian Hammond <chipx86@chipx86.com>
parents: 6695
diff changeset
1681 session->passport_info.client_port = ntohs(atoi(value));
16183
92409c474659 Committing khc's msnp14 changes from Trac Ticket #148. --rlaager
Ka-Hing Cheung <khc@pidgin.im>
parents: 16124
diff changeset
1682 }
10275
186d84a66cc3 [gaim-migrate @ 11428]
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 10269
diff changeset
1683
186d84a66cc3 [gaim-migrate @ 11428]
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 10269
diff changeset
1684 if ((value = msn_message_get_attr(msg, "LoginTime")) != NULL)
186d84a66cc3 [gaim-migrate @ 11428]
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 10269
diff changeset
1685 session->passport_info.sl = atol(value);
13854
ab947cf0c2bb [gaim-migrate @ 16473]
Ma Yuan <mayuan2006@gmail.com>
parents: 13853
diff changeset
1686
23923
79bcb6763b5c Use "EmailEnabled" from the MSN profile message to determine whether
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 23874
diff changeset
1687 if ((value = msn_message_get_attr(msg, "EmailEnabled")) != NULL)
79bcb6763b5c Use "EmailEnabled" from the MSN profile message to determine whether
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 23874
diff changeset
1688 session->passport_info.email_enabled = (gboolean)atol(value);
79bcb6763b5c Use "EmailEnabled" from the MSN profile message to determine whether
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 23874
diff changeset
1689
13854
ab947cf0c2bb [gaim-migrate @ 16473]
Ma Yuan <mayuan2006@gmail.com>
parents: 13853
diff changeset
1690 /*starting retrieve the contact list*/
20523
b627a3a41970 Always get the full contact list too, as we need it for the reverse list
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 20522
diff changeset
1691 clLastChange = purple_account_get_string(session->account, "CLLastChange", NULL);
b627a3a41970 Always get the full contact list too, as we need it for the reverse list
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 20522
diff changeset
1692 #ifdef MSN_PARTIAL_LISTS
b627a3a41970 Always get the full contact list too, as we need it for the reverse list
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 20522
diff changeset
1693 /* msn_userlist_load defeats all attempts at trying to detect blist sync issues */
b627a3a41970 Always get the full contact list too, as we need it for the reverse list
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 20522
diff changeset
1694 msn_userlist_load(session);
23771
c98f7e879218 killing MsnContact which just wraps MsnSession
Ka-Hing Cheung <khc@pidgin.im>
parents: 23770
diff changeset
1695 msn_get_contact_list(session, MSN_PS_INITIAL, clLastChange);
20523
b627a3a41970 Always get the full contact list too, as we need it for the reverse list
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 20522
diff changeset
1696 #else
20522
177cad886d4c A bunch of MSNP14 stuff:
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 20515
diff changeset
1697 /* always get the full list? */
23771
c98f7e879218 killing MsnContact which just wraps MsnSession
Ka-Hing Cheung <khc@pidgin.im>
parents: 23770
diff changeset
1698 msn_get_contact_list(session, MSN_PS_INITIAL, NULL);
20523
b627a3a41970 Always get the full contact list too, as we need it for the reverse list
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 20522
diff changeset
1699 #endif
b627a3a41970 Always get the full contact list too, as we need it for the reverse list
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 20522
diff changeset
1700 #if 0
23771
c98f7e879218 killing MsnContact which just wraps MsnSession
Ka-Hing Cheung <khc@pidgin.im>
parents: 23770
diff changeset
1701 msn_contact_connect(session);
20522
177cad886d4c A bunch of MSNP14 stuff:
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 20515
diff changeset
1702 #endif
5309
3178acad1449 [gaim-migrate @ 5681]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
1703 }
3178acad1449 [gaim-migrate @ 5681]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
1704
8808
1cb5ddf6b625 [gaim-migrate @ 9570]
Felipe Contreras <felipe.contreras@gmail.com>
parents: 8669
diff changeset
1705 static void
1cb5ddf6b625 [gaim-migrate @ 9570]
Felipe Contreras <felipe.contreras@gmail.com>
parents: 8669
diff changeset
1706 initial_email_msg(MsnCmdProc *cmdproc, MsnMessage *msg)
5309
3178acad1449 [gaim-migrate @ 5681]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
1707 {
8808
1cb5ddf6b625 [gaim-migrate @ 9570]
Felipe Contreras <felipe.contreras@gmail.com>
parents: 8669
diff changeset
1708 MsnSession *session;
15884
4de1981757fc sed -ie 's/gaim/purple/g'
Sean Egan <seanegan@pidgin.im>
parents: 15435
diff changeset
1709 PurpleConnection *gc;
5309
3178acad1449 [gaim-migrate @ 5681]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
1710 GHashTable *table;
3178acad1449 [gaim-migrate @ 5681]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
1711 const char *unread;
3178acad1449 [gaim-migrate @ 5681]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
1712
8808
1cb5ddf6b625 [gaim-migrate @ 9570]
Felipe Contreras <felipe.contreras@gmail.com>
parents: 8669
diff changeset
1713 session = cmdproc->session;
1cb5ddf6b625 [gaim-migrate @ 9570]
Felipe Contreras <felipe.contreras@gmail.com>
parents: 8669
diff changeset
1714 gc = session->account->gc;
1cb5ddf6b625 [gaim-migrate @ 9570]
Felipe Contreras <felipe.contreras@gmail.com>
parents: 8669
diff changeset
1715
9193
6e76f1367896 [gaim-migrate @ 9988]
Felipe Contreras <felipe.contreras@gmail.com>
parents: 9158
diff changeset
1716 if (strcmp(msg->remote_user, "Hotmail"))
5333
e1ae88905e28 [gaim-migrate @ 5708]
Christian Hammond <chipx86@chipx86.com>
parents: 5327
diff changeset
1717 /* This isn't an official message. */
8808
1cb5ddf6b625 [gaim-migrate @ 9570]
Felipe Contreras <felipe.contreras@gmail.com>
parents: 8669
diff changeset
1718 return;
5333
e1ae88905e28 [gaim-migrate @ 5708]
Christian Hammond <chipx86@chipx86.com>
parents: 5327
diff changeset
1719
23924
1f8e75759bf3 Use a URL to open MSN Hotmail inbox instead of a temporary file.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 23923
diff changeset
1720 if (session->passport_info.mail_url == NULL)
8808
1cb5ddf6b625 [gaim-migrate @ 9570]
Felipe Contreras <felipe.contreras@gmail.com>
parents: 8669
diff changeset
1721 {
9193
6e76f1367896 [gaim-migrate @ 9988]
Felipe Contreras <felipe.contreras@gmail.com>
parents: 9158
diff changeset
1722 MsnTransaction *trans;
10225
0dfea1bc8695 [gaim-migrate @ 11357]
Felipe Contreras <felipe.contreras@gmail.com>
parents: 10203
diff changeset
1723 trans = msn_transaction_new(cmdproc, "URL", "%s", "INBOX");
9193
6e76f1367896 [gaim-migrate @ 9988]
Felipe Contreras <felipe.contreras@gmail.com>
parents: 9158
diff changeset
1724 msn_transaction_queue_cmd(trans, msg->cmd);
5506
b53a1acacefe [gaim-migrate @ 5905]
Christian Hammond <chipx86@chipx86.com>
parents: 5498
diff changeset
1725
9193
6e76f1367896 [gaim-migrate @ 9988]
Felipe Contreras <felipe.contreras@gmail.com>
parents: 9158
diff changeset
1726 msn_cmdproc_send_trans(cmdproc, trans);
5506
b53a1acacefe [gaim-migrate @ 5905]
Christian Hammond <chipx86@chipx86.com>
parents: 5498
diff changeset
1727
8808
1cb5ddf6b625 [gaim-migrate @ 9570]
Felipe Contreras <felipe.contreras@gmail.com>
parents: 8669
diff changeset
1728 return;
5358
efa9128e93fe [gaim-migrate @ 5734]
Christian Hammond <chipx86@chipx86.com>
parents: 5353
diff changeset
1729 }
efa9128e93fe [gaim-migrate @ 5734]
Christian Hammond <chipx86@chipx86.com>
parents: 5353
diff changeset
1730
15884
4de1981757fc sed -ie 's/gaim/purple/g'
Sean Egan <seanegan@pidgin.im>
parents: 15435
diff changeset
1731 if (!purple_account_get_check_mail(session->account))
11321
a93121c0ea16 [gaim-migrate @ 13525]
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 11183
diff changeset
1732 return;
a93121c0ea16 [gaim-migrate @ 13525]
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 11183
diff changeset
1733
5309
3178acad1449 [gaim-migrate @ 5681]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
1734 table = msn_message_get_hashtable_from_body(msg);
3178acad1449 [gaim-migrate @ 5681]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
1735
3178acad1449 [gaim-migrate @ 5681]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
1736 unread = g_hash_table_lookup(table, "Inbox-Unread");
3178acad1449 [gaim-migrate @ 5681]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
1737
8808
1cb5ddf6b625 [gaim-migrate @ 9570]
Felipe Contreras <felipe.contreras@gmail.com>
parents: 8669
diff changeset
1738 if (unread != NULL)
1cb5ddf6b625 [gaim-migrate @ 9570]
Felipe Contreras <felipe.contreras@gmail.com>
parents: 8669
diff changeset
1739 {
7190
53b81e545762 [gaim-migrate @ 7759]
Christian Hammond <chipx86@chipx86.com>
parents: 7188
diff changeset
1740 int count = atoi(unread);
53b81e545762 [gaim-migrate @ 7759]
Christian Hammond <chipx86@chipx86.com>
parents: 7188
diff changeset
1741
9193
6e76f1367896 [gaim-migrate @ 9988]
Felipe Contreras <felipe.contreras@gmail.com>
parents: 9158
diff changeset
1742 if (count > 0)
7190
53b81e545762 [gaim-migrate @ 7759]
Christian Hammond <chipx86@chipx86.com>
parents: 7188
diff changeset
1743 {
9158
f8dab42adeaf [gaim-migrate @ 9942]
Felipe Contreras <felipe.contreras@gmail.com>
parents: 8926
diff changeset
1744 const char *passport;
9193
6e76f1367896 [gaim-migrate @ 9988]
Felipe Contreras <felipe.contreras@gmail.com>
parents: 9158
diff changeset
1745 const char *url;
9158
f8dab42adeaf [gaim-migrate @ 9942]
Felipe Contreras <felipe.contreras@gmail.com>
parents: 8926
diff changeset
1746
f8dab42adeaf [gaim-migrate @ 9942]
Felipe Contreras <felipe.contreras@gmail.com>
parents: 8926
diff changeset
1747 passport = msn_user_get_passport(session->user);
23924
1f8e75759bf3 Use a URL to open MSN Hotmail inbox instead of a temporary file.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 23923
diff changeset
1748 url = session->passport_info.mail_url;
9193
6e76f1367896 [gaim-migrate @ 9988]
Felipe Contreras <felipe.contreras@gmail.com>
parents: 9158
diff changeset
1749
21886
be9880b42bd2 Don't show a 'you ain't got no new mail' notification.
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents: 21720
diff changeset
1750 purple_notify_emails(gc, count, FALSE, NULL, NULL,
9193
6e76f1367896 [gaim-migrate @ 9988]
Felipe Contreras <felipe.contreras@gmail.com>
parents: 9158
diff changeset
1751 &passport, &url, NULL, NULL);
7190
53b81e545762 [gaim-migrate @ 7759]
Christian Hammond <chipx86@chipx86.com>
parents: 7188
diff changeset
1752 }
5520
d49ba63410e3 [gaim-migrate @ 5920]
Christian Hammond <chipx86@chipx86.com>
parents: 5518
diff changeset
1753 }
5309
3178acad1449 [gaim-migrate @ 5681]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
1754
3178acad1449 [gaim-migrate @ 5681]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
1755 g_hash_table_destroy(table);
3178acad1449 [gaim-migrate @ 5681]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
1756 }
3178acad1449 [gaim-migrate @ 5681]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
1757
13861
dc0021ad2b73 [gaim-migrate @ 16653]
Ma Yuan <mayuan2006@gmail.com>
parents: 13859
diff changeset
1758 /*offline Message notification process*/
8808
1cb5ddf6b625 [gaim-migrate @ 9570]
Felipe Contreras <felipe.contreras@gmail.com>
parents: 8669
diff changeset
1759 static void
13855
24cff9e060d7 [gaim-migrate @ 16507]
Ma Yuan <mayuan2006@gmail.com>
parents: 13854
diff changeset
1760 initial_mdata_msg(MsnCmdProc *cmdproc, MsnMessage *msg)
24cff9e060d7 [gaim-migrate @ 16507]
Ma Yuan <mayuan2006@gmail.com>
parents: 13854
diff changeset
1761 {
13858
fe1fbb9cc42b [gaim-migrate @ 16600]
Ma Yuan <mayuan2006@gmail.com>
parents: 13857
diff changeset
1762 MsnSession *session;
20522
177cad886d4c A bunch of MSNP14 stuff:
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 20515
diff changeset
1763 PurpleConnection *gc;
177cad886d4c A bunch of MSNP14 stuff:
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 20515
diff changeset
1764 GHashTable *table;
177cad886d4c A bunch of MSNP14 stuff:
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 20515
diff changeset
1765 const char *mdata, *unread;
13858
fe1fbb9cc42b [gaim-migrate @ 16600]
Ma Yuan <mayuan2006@gmail.com>
parents: 13857
diff changeset
1766
20522
177cad886d4c A bunch of MSNP14 stuff:
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 20515
diff changeset
1767 session = cmdproc->session;
177cad886d4c A bunch of MSNP14 stuff:
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 20515
diff changeset
1768 gc = session->account->gc;
177cad886d4c A bunch of MSNP14 stuff:
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 20515
diff changeset
1769
177cad886d4c A bunch of MSNP14 stuff:
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 20515
diff changeset
1770 if (strcmp(msg->remote_user, "Hotmail"))
177cad886d4c A bunch of MSNP14 stuff:
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 20515
diff changeset
1771 /* This isn't an official message. */
177cad886d4c A bunch of MSNP14 stuff:
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 20515
diff changeset
1772 return;
13864
97babffb505d [gaim-migrate @ 16684]
Ma Yuan <mayuan2006@gmail.com>
parents: 13861
diff changeset
1773
20522
177cad886d4c A bunch of MSNP14 stuff:
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 20515
diff changeset
1774 table = msn_message_get_hashtable_from_body(msg);
13858
fe1fbb9cc42b [gaim-migrate @ 16600]
Ma Yuan <mayuan2006@gmail.com>
parents: 13857
diff changeset
1775
20522
177cad886d4c A bunch of MSNP14 stuff:
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 20515
diff changeset
1776 mdata = g_hash_table_lookup(table, "Mail-Data");
177cad886d4c A bunch of MSNP14 stuff:
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 20515
diff changeset
1777
177cad886d4c A bunch of MSNP14 stuff:
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 20515
diff changeset
1778 if (mdata != NULL)
177cad886d4c A bunch of MSNP14 stuff:
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 20515
diff changeset
1779 msn_parse_oim_msg(session->oim, mdata);
13858
fe1fbb9cc42b [gaim-migrate @ 16600]
Ma Yuan <mayuan2006@gmail.com>
parents: 13857
diff changeset
1780
20522
177cad886d4c A bunch of MSNP14 stuff:
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 20515
diff changeset
1781 if (g_hash_table_lookup(table, "Inbox-URL") == NULL)
177cad886d4c A bunch of MSNP14 stuff:
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 20515
diff changeset
1782 {
177cad886d4c A bunch of MSNP14 stuff:
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 20515
diff changeset
1783 g_hash_table_destroy(table);
177cad886d4c A bunch of MSNP14 stuff:
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 20515
diff changeset
1784 return;
177cad886d4c A bunch of MSNP14 stuff:
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 20515
diff changeset
1785 }
13858
fe1fbb9cc42b [gaim-migrate @ 16600]
Ma Yuan <mayuan2006@gmail.com>
parents: 13857
diff changeset
1786
23924
1f8e75759bf3 Use a URL to open MSN Hotmail inbox instead of a temporary file.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 23923
diff changeset
1787 if (session->passport_info.mail_url == NULL)
20522
177cad886d4c A bunch of MSNP14 stuff:
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 20515
diff changeset
1788 {
177cad886d4c A bunch of MSNP14 stuff:
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 20515
diff changeset
1789 MsnTransaction *trans;
177cad886d4c A bunch of MSNP14 stuff:
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 20515
diff changeset
1790 trans = msn_transaction_new(cmdproc, "URL", "%s", "INBOX");
177cad886d4c A bunch of MSNP14 stuff:
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 20515
diff changeset
1791 msn_transaction_queue_cmd(trans, msg->cmd);
13858
fe1fbb9cc42b [gaim-migrate @ 16600]
Ma Yuan <mayuan2006@gmail.com>
parents: 13857
diff changeset
1792
20522
177cad886d4c A bunch of MSNP14 stuff:
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 20515
diff changeset
1793 msn_cmdproc_send_trans(cmdproc, trans);
177cad886d4c A bunch of MSNP14 stuff:
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 20515
diff changeset
1794
177cad886d4c A bunch of MSNP14 stuff:
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 20515
diff changeset
1795 g_hash_table_destroy(table);
177cad886d4c A bunch of MSNP14 stuff:
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 20515
diff changeset
1796 return;
13858
fe1fbb9cc42b [gaim-migrate @ 16600]
Ma Yuan <mayuan2006@gmail.com>
parents: 13857
diff changeset
1797 }
fe1fbb9cc42b [gaim-migrate @ 16600]
Ma Yuan <mayuan2006@gmail.com>
parents: 13857
diff changeset
1798
20522
177cad886d4c A bunch of MSNP14 stuff:
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 20515
diff changeset
1799 if (!purple_account_get_check_mail(session->account))
177cad886d4c A bunch of MSNP14 stuff:
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 20515
diff changeset
1800 {
177cad886d4c A bunch of MSNP14 stuff:
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 20515
diff changeset
1801 g_hash_table_destroy(table);
177cad886d4c A bunch of MSNP14 stuff:
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 20515
diff changeset
1802 return;
177cad886d4c A bunch of MSNP14 stuff:
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 20515
diff changeset
1803 }
177cad886d4c A bunch of MSNP14 stuff:
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 20515
diff changeset
1804
177cad886d4c A bunch of MSNP14 stuff:
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 20515
diff changeset
1805 unread = g_hash_table_lookup(table, "Inbox-Unread");
177cad886d4c A bunch of MSNP14 stuff:
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 20515
diff changeset
1806
177cad886d4c A bunch of MSNP14 stuff:
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 20515
diff changeset
1807 if (unread != NULL)
177cad886d4c A bunch of MSNP14 stuff:
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 20515
diff changeset
1808 {
177cad886d4c A bunch of MSNP14 stuff:
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 20515
diff changeset
1809 int count = atoi(unread);
177cad886d4c A bunch of MSNP14 stuff:
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 20515
diff changeset
1810
177cad886d4c A bunch of MSNP14 stuff:
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 20515
diff changeset
1811 if (count > 0)
177cad886d4c A bunch of MSNP14 stuff:
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 20515
diff changeset
1812 {
177cad886d4c A bunch of MSNP14 stuff:
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 20515
diff changeset
1813 const char *passport;
177cad886d4c A bunch of MSNP14 stuff:
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 20515
diff changeset
1814 const char *url;
177cad886d4c A bunch of MSNP14 stuff:
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 20515
diff changeset
1815
177cad886d4c A bunch of MSNP14 stuff:
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 20515
diff changeset
1816 passport = msn_user_get_passport(session->user);
23924
1f8e75759bf3 Use a URL to open MSN Hotmail inbox instead of a temporary file.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 23923
diff changeset
1817 url = session->passport_info.mail_url;
20522
177cad886d4c A bunch of MSNP14 stuff:
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 20515
diff changeset
1818
21886
be9880b42bd2 Don't show a 'you ain't got no new mail' notification.
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents: 21720
diff changeset
1819 purple_notify_emails(gc, count, FALSE, NULL, NULL,
20522
177cad886d4c A bunch of MSNP14 stuff:
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 20515
diff changeset
1820 &passport, &url, NULL, NULL);
177cad886d4c A bunch of MSNP14 stuff:
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 20515
diff changeset
1821 }
177cad886d4c A bunch of MSNP14 stuff:
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 20515
diff changeset
1822 }
177cad886d4c A bunch of MSNP14 stuff:
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 20515
diff changeset
1823
177cad886d4c A bunch of MSNP14 stuff:
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 20515
diff changeset
1824 g_hash_table_destroy(table);
13855
24cff9e060d7 [gaim-migrate @ 16507]
Ma Yuan <mayuan2006@gmail.com>
parents: 13854
diff changeset
1825 }
24cff9e060d7 [gaim-migrate @ 16507]
Ma Yuan <mayuan2006@gmail.com>
parents: 13854
diff changeset
1826
13892
3cdfd486fa4f [gaim-migrate @ 17015]
Ma Yuan <mayuan2006@gmail.com>
parents: 13890
diff changeset
1827 /*offline Message Notification*/
3cdfd486fa4f [gaim-migrate @ 17015]
Ma Yuan <mayuan2006@gmail.com>
parents: 13890
diff changeset
1828 static void
3cdfd486fa4f [gaim-migrate @ 17015]
Ma Yuan <mayuan2006@gmail.com>
parents: 13890
diff changeset
1829 delete_oim_msg(MsnCmdProc *cmdproc, MsnMessage *msg)
3cdfd486fa4f [gaim-migrate @ 17015]
Ma Yuan <mayuan2006@gmail.com>
parents: 13890
diff changeset
1830 {
23830
1436e3de5d6c The great MSN debug message cleanup! Threw in a few whitespace fixes,
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 23828
diff changeset
1831 purple_debug_misc("msn", "Delete OIM message.\n");
13892
3cdfd486fa4f [gaim-migrate @ 17015]
Ma Yuan <mayuan2006@gmail.com>
parents: 13890
diff changeset
1832 }
3cdfd486fa4f [gaim-migrate @ 17015]
Ma Yuan <mayuan2006@gmail.com>
parents: 13890
diff changeset
1833
8808
1cb5ddf6b625 [gaim-migrate @ 9570]
Felipe Contreras <felipe.contreras@gmail.com>
parents: 8669
diff changeset
1834 static void
1cb5ddf6b625 [gaim-migrate @ 9570]
Felipe Contreras <felipe.contreras@gmail.com>
parents: 8669
diff changeset
1835 email_msg(MsnCmdProc *cmdproc, MsnMessage *msg)
5309
3178acad1449 [gaim-migrate @ 5681]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
1836 {
8808
1cb5ddf6b625 [gaim-migrate @ 9570]
Felipe Contreras <felipe.contreras@gmail.com>
parents: 8669
diff changeset
1837 MsnSession *session;
15884
4de1981757fc sed -ie 's/gaim/purple/g'
Sean Egan <seanegan@pidgin.im>
parents: 15435
diff changeset
1838 PurpleConnection *gc;
5309
3178acad1449 [gaim-migrate @ 5681]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
1839 GHashTable *table;
8657
82ce13f78d31 [gaim-migrate @ 9409]
Felipe Contreras <felipe.contreras@gmail.com>
parents: 8652
diff changeset
1840 char *from, *subject, *tmp;
8808
1cb5ddf6b625 [gaim-migrate @ 9570]
Felipe Contreras <felipe.contreras@gmail.com>
parents: 8669
diff changeset
1841
1cb5ddf6b625 [gaim-migrate @ 9570]
Felipe Contreras <felipe.contreras@gmail.com>
parents: 8669
diff changeset
1842 session = cmdproc->session;
1cb5ddf6b625 [gaim-migrate @ 9570]
Felipe Contreras <felipe.contreras@gmail.com>
parents: 8669
diff changeset
1843 gc = session->account->gc;
8657
82ce13f78d31 [gaim-migrate @ 9409]
Felipe Contreras <felipe.contreras@gmail.com>
parents: 8652
diff changeset
1844
9193
6e76f1367896 [gaim-migrate @ 9988]
Felipe Contreras <felipe.contreras@gmail.com>
parents: 9158
diff changeset
1845 if (strcmp(msg->remote_user, "Hotmail"))
5333
e1ae88905e28 [gaim-migrate @ 5708]
Christian Hammond <chipx86@chipx86.com>
parents: 5327
diff changeset
1846 /* This isn't an official message. */
8808
1cb5ddf6b625 [gaim-migrate @ 9570]
Felipe Contreras <felipe.contreras@gmail.com>
parents: 8669
diff changeset
1847 return;
5333
e1ae88905e28 [gaim-migrate @ 5708]
Christian Hammond <chipx86@chipx86.com>
parents: 5327
diff changeset
1848
23924
1f8e75759bf3 Use a URL to open MSN Hotmail inbox instead of a temporary file.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 23923
diff changeset
1849 if (session->passport_info.mail_url == NULL)
8808
1cb5ddf6b625 [gaim-migrate @ 9570]
Felipe Contreras <felipe.contreras@gmail.com>
parents: 8669
diff changeset
1850 {
9193
6e76f1367896 [gaim-migrate @ 9988]
Felipe Contreras <felipe.contreras@gmail.com>
parents: 9158
diff changeset
1851 MsnTransaction *trans;
10225
0dfea1bc8695 [gaim-migrate @ 11357]
Felipe Contreras <felipe.contreras@gmail.com>
parents: 10203
diff changeset
1852 trans = msn_transaction_new(cmdproc, "URL", "%s", "INBOX");
9193
6e76f1367896 [gaim-migrate @ 9988]
Felipe Contreras <felipe.contreras@gmail.com>
parents: 9158
diff changeset
1853 msn_transaction_queue_cmd(trans, msg->cmd);
5506
b53a1acacefe [gaim-migrate @ 5905]
Christian Hammond <chipx86@chipx86.com>
parents: 5498
diff changeset
1854
9193
6e76f1367896 [gaim-migrate @ 9988]
Felipe Contreras <felipe.contreras@gmail.com>
parents: 9158
diff changeset
1855 msn_cmdproc_send_trans(cmdproc, trans);
5506
b53a1acacefe [gaim-migrate @ 5905]
Christian Hammond <chipx86@chipx86.com>
parents: 5498
diff changeset
1856
8808
1cb5ddf6b625 [gaim-migrate @ 9570]
Felipe Contreras <felipe.contreras@gmail.com>
parents: 8669
diff changeset
1857 return;
5358
efa9128e93fe [gaim-migrate @ 5734]
Christian Hammond <chipx86@chipx86.com>
parents: 5353
diff changeset
1858 }
efa9128e93fe [gaim-migrate @ 5734]
Christian Hammond <chipx86@chipx86.com>
parents: 5353
diff changeset
1859
15884
4de1981757fc sed -ie 's/gaim/purple/g'
Sean Egan <seanegan@pidgin.im>
parents: 15435
diff changeset
1860 if (!purple_account_get_check_mail(session->account))
11321
a93121c0ea16 [gaim-migrate @ 13525]
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 11183
diff changeset
1861 return;
a93121c0ea16 [gaim-migrate @ 13525]
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 11183
diff changeset
1862
5309
3178acad1449 [gaim-migrate @ 5681]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
1863 table = msn_message_get_hashtable_from_body(msg);
3178acad1449 [gaim-migrate @ 5681]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
1864
9193
6e76f1367896 [gaim-migrate @ 9988]
Felipe Contreras <felipe.contreras@gmail.com>
parents: 9158
diff changeset
1865 from = subject = NULL;
6e76f1367896 [gaim-migrate @ 9988]
Felipe Contreras <felipe.contreras@gmail.com>
parents: 9158
diff changeset
1866
8657
82ce13f78d31 [gaim-migrate @ 9409]
Felipe Contreras <felipe.contreras@gmail.com>
parents: 8652
diff changeset
1867 tmp = g_hash_table_lookup(table, "From");
82ce13f78d31 [gaim-migrate @ 9409]
Felipe Contreras <felipe.contreras@gmail.com>
parents: 8652
diff changeset
1868 if (tmp != NULL)
15884
4de1981757fc sed -ie 's/gaim/purple/g'
Sean Egan <seanegan@pidgin.im>
parents: 15435
diff changeset
1869 from = purple_mime_decode_field(tmp);
8657
82ce13f78d31 [gaim-migrate @ 9409]
Felipe Contreras <felipe.contreras@gmail.com>
parents: 8652
diff changeset
1870
82ce13f78d31 [gaim-migrate @ 9409]
Felipe Contreras <felipe.contreras@gmail.com>
parents: 8652
diff changeset
1871 tmp = g_hash_table_lookup(table, "Subject");
82ce13f78d31 [gaim-migrate @ 9409]
Felipe Contreras <felipe.contreras@gmail.com>
parents: 8652
diff changeset
1872 if (tmp != NULL)
15884
4de1981757fc sed -ie 's/gaim/purple/g'
Sean Egan <seanegan@pidgin.im>
parents: 15435
diff changeset
1873 subject = purple_mime_decode_field(tmp);
5309
3178acad1449 [gaim-migrate @ 5681]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
1874
15884
4de1981757fc sed -ie 's/gaim/purple/g'
Sean Egan <seanegan@pidgin.im>
parents: 15435
diff changeset
1875 purple_notify_email(gc,
9158
f8dab42adeaf [gaim-migrate @ 9942]
Felipe Contreras <felipe.contreras@gmail.com>
parents: 8926
diff changeset
1876 (subject != NULL ? subject : ""),
f8dab42adeaf [gaim-migrate @ 9942]
Felipe Contreras <felipe.contreras@gmail.com>
parents: 8926
diff changeset
1877 (from != NULL ? from : ""),
f8dab42adeaf [gaim-migrate @ 9942]
Felipe Contreras <felipe.contreras@gmail.com>
parents: 8926
diff changeset
1878 msn_user_get_passport(session->user),
23924
1f8e75759bf3 Use a URL to open MSN Hotmail inbox instead of a temporary file.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 23923
diff changeset
1879 session->passport_info.mail_url, NULL, NULL);
5309
3178acad1449 [gaim-migrate @ 5681]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
1880
16896
cadacef82ac3 Remove a bunch of unnecessary NULL checking for g_free()
Daniel Atallah <datallah@pidgin.im>
parents: 16895
diff changeset
1881 g_free(from);
cadacef82ac3 Remove a bunch of unnecessary NULL checking for g_free()
Daniel Atallah <datallah@pidgin.im>
parents: 16895
diff changeset
1882 g_free(subject);
7817
2155f763ab5d [gaim-migrate @ 8464]
Felipe Contreras <felipe.contreras@gmail.com>
parents: 7699
diff changeset
1883
5309
3178acad1449 [gaim-migrate @ 5681]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
1884 g_hash_table_destroy(table);
3178acad1449 [gaim-migrate @ 5681]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
1885 }
3178acad1449 [gaim-migrate @ 5681]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
1886
8808
1cb5ddf6b625 [gaim-migrate @ 9570]
Felipe Contreras <felipe.contreras@gmail.com>
parents: 8669
diff changeset
1887 static void
1cb5ddf6b625 [gaim-migrate @ 9570]
Felipe Contreras <felipe.contreras@gmail.com>
parents: 8669
diff changeset
1888 system_msg(MsnCmdProc *cmdproc, MsnMessage *msg)
5333
e1ae88905e28 [gaim-migrate @ 5708]
Christian Hammond <chipx86@chipx86.com>
parents: 5327
diff changeset
1889 {
e1ae88905e28 [gaim-migrate @ 5708]
Christian Hammond <chipx86@chipx86.com>
parents: 5327
diff changeset
1890 GHashTable *table;
e1ae88905e28 [gaim-migrate @ 5708]
Christian Hammond <chipx86@chipx86.com>
parents: 5327
diff changeset
1891 const char *type_s;
e1ae88905e28 [gaim-migrate @ 5708]
Christian Hammond <chipx86@chipx86.com>
parents: 5327
diff changeset
1892
9193
6e76f1367896 [gaim-migrate @ 9988]
Felipe Contreras <felipe.contreras@gmail.com>
parents: 9158
diff changeset
1893 if (strcmp(msg->remote_user, "Hotmail"))
5333
e1ae88905e28 [gaim-migrate @ 5708]
Christian Hammond <chipx86@chipx86.com>
parents: 5327
diff changeset
1894 /* This isn't an official message. */
8808
1cb5ddf6b625 [gaim-migrate @ 9570]
Felipe Contreras <felipe.contreras@gmail.com>
parents: 8669
diff changeset
1895 return;
5333
e1ae88905e28 [gaim-migrate @ 5708]
Christian Hammond <chipx86@chipx86.com>
parents: 5327
diff changeset
1896
e1ae88905e28 [gaim-migrate @ 5708]
Christian Hammond <chipx86@chipx86.com>
parents: 5327
diff changeset
1897 table = msn_message_get_hashtable_from_body(msg);
e1ae88905e28 [gaim-migrate @ 5708]
Christian Hammond <chipx86@chipx86.com>
parents: 5327
diff changeset
1898
8808
1cb5ddf6b625 [gaim-migrate @ 9570]
Felipe Contreras <felipe.contreras@gmail.com>
parents: 8669
diff changeset
1899 if ((type_s = g_hash_table_lookup(table, "Type")) != NULL)
1cb5ddf6b625 [gaim-migrate @ 9570]
Felipe Contreras <felipe.contreras@gmail.com>
parents: 8669
diff changeset
1900 {
5333
e1ae88905e28 [gaim-migrate @ 5708]
Christian Hammond <chipx86@chipx86.com>
parents: 5327
diff changeset
1901 int type = atoi(type_s);
e1ae88905e28 [gaim-migrate @ 5708]
Christian Hammond <chipx86@chipx86.com>
parents: 5327
diff changeset
1902 char buf[MSN_BUF_LEN];
6308
12d48b4e80db [gaim-migrate @ 6807]
Mark Doliner <markdoliner@pidgin.im>
parents: 5963
diff changeset
1903 int minutes;
5333
e1ae88905e28 [gaim-migrate @ 5708]
Christian Hammond <chipx86@chipx86.com>
parents: 5327
diff changeset
1904
8808
1cb5ddf6b625 [gaim-migrate @ 9570]
Felipe Contreras <felipe.contreras@gmail.com>
parents: 8669
diff changeset
1905 switch (type)
1cb5ddf6b625 [gaim-migrate @ 9570]
Felipe Contreras <felipe.contreras@gmail.com>
parents: 8669
diff changeset
1906 {
5333
e1ae88905e28 [gaim-migrate @ 5708]
Christian Hammond <chipx86@chipx86.com>
parents: 5327
diff changeset
1907 case 1:
6308
12d48b4e80db [gaim-migrate @ 6807]
Mark Doliner <markdoliner@pidgin.im>
parents: 5963
diff changeset
1908 minutes = atoi(g_hash_table_lookup(table, "Arg1"));
23441
fd45c23a3eb2 Delete trailing whitespace
Mark Doliner <markdoliner@pidgin.im>
parents: 23085
diff changeset
1909 g_snprintf(buf, sizeof(buf), dngettext(PACKAGE,
9158
f8dab42adeaf [gaim-migrate @ 9942]
Felipe Contreras <felipe.contreras@gmail.com>
parents: 8926
diff changeset
1910 "The MSN server will shut down for maintenance "
f8dab42adeaf [gaim-migrate @ 9942]
Felipe Contreras <felipe.contreras@gmail.com>
parents: 8926
diff changeset
1911 "in %d minute. You will automatically be "
10816
ba2657f4c157 [gaim-migrate @ 12471]
Luke Schierer <lschiere@pidgin.im>
parents: 10812
diff changeset
1912 "signed out at that time. Please finish any "
9158
f8dab42adeaf [gaim-migrate @ 9942]
Felipe Contreras <felipe.contreras@gmail.com>
parents: 8926
diff changeset
1913 "conversations in progress.\n\nAfter the "
f8dab42adeaf [gaim-migrate @ 9942]
Felipe Contreras <felipe.contreras@gmail.com>
parents: 8926
diff changeset
1914 "maintenance has been completed, you will be "
f8dab42adeaf [gaim-migrate @ 9942]
Felipe Contreras <felipe.contreras@gmail.com>
parents: 8926
diff changeset
1915 "able to successfully sign in.",
f8dab42adeaf [gaim-migrate @ 9942]
Felipe Contreras <felipe.contreras@gmail.com>
parents: 8926
diff changeset
1916 "The MSN server will shut down for maintenance "
f8dab42adeaf [gaim-migrate @ 9942]
Felipe Contreras <felipe.contreras@gmail.com>
parents: 8926
diff changeset
1917 "in %d minutes. You will automatically be "
10816
ba2657f4c157 [gaim-migrate @ 12471]
Luke Schierer <lschiere@pidgin.im>
parents: 10812
diff changeset
1918 "signed out at that time. Please finish any "
9158
f8dab42adeaf [gaim-migrate @ 9942]
Felipe Contreras <felipe.contreras@gmail.com>
parents: 8926
diff changeset
1919 "conversations in progress.\n\nAfter the "
f8dab42adeaf [gaim-migrate @ 9942]
Felipe Contreras <felipe.contreras@gmail.com>
parents: 8926
diff changeset
1920 "maintenance has been completed, you will be "
f8dab42adeaf [gaim-migrate @ 9942]
Felipe Contreras <felipe.contreras@gmail.com>
parents: 8926
diff changeset
1921 "able to successfully sign in.", minutes),
f8dab42adeaf [gaim-migrate @ 9942]
Felipe Contreras <felipe.contreras@gmail.com>
parents: 8926
diff changeset
1922 minutes);
5333
e1ae88905e28 [gaim-migrate @ 5708]
Christian Hammond <chipx86@chipx86.com>
parents: 5327
diff changeset
1923 default:
e1ae88905e28 [gaim-migrate @ 5708]
Christian Hammond <chipx86@chipx86.com>
parents: 5327
diff changeset
1924 break;
e1ae88905e28 [gaim-migrate @ 5708]
Christian Hammond <chipx86@chipx86.com>
parents: 5327
diff changeset
1925 }
e1ae88905e28 [gaim-migrate @ 5708]
Christian Hammond <chipx86@chipx86.com>
parents: 5327
diff changeset
1926
5436
a0e0bacaa196 [gaim-migrate @ 5818]
Christian Hammond <chipx86@chipx86.com>
parents: 5406
diff changeset
1927 if (*buf != '\0')
15884
4de1981757fc sed -ie 's/gaim/purple/g'
Sean Egan <seanegan@pidgin.im>
parents: 15435
diff changeset
1928 purple_notify_info(cmdproc->session->account->gc, NULL, buf, NULL);
5333
e1ae88905e28 [gaim-migrate @ 5708]
Christian Hammond <chipx86@chipx86.com>
parents: 5327
diff changeset
1929 }
e1ae88905e28 [gaim-migrate @ 5708]
Christian Hammond <chipx86@chipx86.com>
parents: 5327
diff changeset
1930
e1ae88905e28 [gaim-migrate @ 5708]
Christian Hammond <chipx86@chipx86.com>
parents: 5327
diff changeset
1931 g_hash_table_destroy(table);
e1ae88905e28 [gaim-migrate @ 5708]
Christian Hammond <chipx86@chipx86.com>
parents: 5327
diff changeset
1932 }
5793
28d84d5e5663 [gaim-migrate @ 6218]
Christian Hammond <chipx86@chipx86.com>
parents: 5768
diff changeset
1933
9193
6e76f1367896 [gaim-migrate @ 9988]
Felipe Contreras <felipe.contreras@gmail.com>
parents: 9158
diff changeset
1934 void
20564
35675dd4a44d Make buddy and group management actually work, add some SOAP templates, redesign some parts of code and separate some bigger functions into its smaller tasks which are completely unrelated to each other
Carlos Silva <typ0@pidgin.im>
parents: 20560
diff changeset
1935 msn_notification_add_buddy_to_list(MsnNotification *notification, MsnListId list_id,
23443
7825ac02dc51 These forward declarations aren't needed
Mark Doliner <markdoliner@pidgin.im>
parents: 23441
diff changeset
1936 const char *who)
9193
6e76f1367896 [gaim-migrate @ 9988]
Felipe Contreras <felipe.contreras@gmail.com>
parents: 9158
diff changeset
1937 {
6e76f1367896 [gaim-migrate @ 9988]
Felipe Contreras <felipe.contreras@gmail.com>
parents: 9158
diff changeset
1938 MsnCmdProc *cmdproc;
20564
35675dd4a44d Make buddy and group management actually work, add some SOAP templates, redesign some parts of code and separate some bigger functions into its smaller tasks which are completely unrelated to each other
Carlos Silva <typ0@pidgin.im>
parents: 20560
diff changeset
1939 MsnListOp list_op = 1 << list_id;
13866
b6a2c8d390ef [gaim-migrate @ 16716]
Ma Yuan <mayuan2006@gmail.com>
parents: 13865
diff changeset
1940 xmlnode *adl_node;
b6a2c8d390ef [gaim-migrate @ 16716]
Ma Yuan <mayuan2006@gmail.com>
parents: 13865
diff changeset
1941 char *payload;
b6a2c8d390ef [gaim-migrate @ 16716]
Ma Yuan <mayuan2006@gmail.com>
parents: 13865
diff changeset
1942 int payload_len;
20571
712babe35f35 Some more cleanups
Carlos Silva <typ0@pidgin.im>
parents: 20569
diff changeset
1943
9193
6e76f1367896 [gaim-migrate @ 9988]
Felipe Contreras <felipe.contreras@gmail.com>
parents: 9158
diff changeset
1944 cmdproc = notification->servconn->cmdproc;
6e76f1367896 [gaim-migrate @ 9988]
Felipe Contreras <felipe.contreras@gmail.com>
parents: 9158
diff changeset
1945
13866
b6a2c8d390ef [gaim-migrate @ 16716]
Ma Yuan <mayuan2006@gmail.com>
parents: 13865
diff changeset
1946 adl_node = xmlnode_new("ml");
b6a2c8d390ef [gaim-migrate @ 16716]
Ma Yuan <mayuan2006@gmail.com>
parents: 13865
diff changeset
1947 adl_node->child = NULL;
9194
1ff43e1a77e5 [gaim-migrate @ 9989]
Christian Hammond <chipx86@chipx86.com>
parents: 9193
diff changeset
1948
23441
fd45c23a3eb2 Delete trailing whitespace
Mark Doliner <markdoliner@pidgin.im>
parents: 23085
diff changeset
1949 msn_add_contact_xml(notification->session, adl_node, who, list_op,
23790
eb49b07a62d6 Modifications to the MSN code for some stuff I'll be doing in later
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 23789
diff changeset
1950 MSN_NETWORK_PASSPORT);
9194
1ff43e1a77e5 [gaim-migrate @ 9989]
Christian Hammond <chipx86@chipx86.com>
parents: 9193
diff changeset
1951
13866
b6a2c8d390ef [gaim-migrate @ 16716]
Ma Yuan <mayuan2006@gmail.com>
parents: 13865
diff changeset
1952 payload = xmlnode_to_str(adl_node,&payload_len);
b6a2c8d390ef [gaim-migrate @ 16716]
Ma Yuan <mayuan2006@gmail.com>
parents: 13865
diff changeset
1953 xmlnode_free(adl_node);
23441
fd45c23a3eb2 Delete trailing whitespace
Mark Doliner <markdoliner@pidgin.im>
parents: 23085
diff changeset
1954
20564
35675dd4a44d Make buddy and group management actually work, add some SOAP templates, redesign some parts of code and separate some bigger functions into its smaller tasks which are completely unrelated to each other
Carlos Silva <typ0@pidgin.im>
parents: 20560
diff changeset
1955 msn_notification_post_adl(notification->servconn->cmdproc,
35675dd4a44d Make buddy and group management actually work, add some SOAP templates, redesign some parts of code and separate some bigger functions into its smaller tasks which are completely unrelated to each other
Carlos Silva <typ0@pidgin.im>
parents: 20560
diff changeset
1956 payload,payload_len);
20582
edd27909081a Make the buddylist sync issue a little less worse.
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents: 20578
diff changeset
1957 g_free(payload);
9193
6e76f1367896 [gaim-migrate @ 9988]
Felipe Contreras <felipe.contreras@gmail.com>
parents: 9158
diff changeset
1958 }
6e76f1367896 [gaim-migrate @ 9988]
Felipe Contreras <felipe.contreras@gmail.com>
parents: 9158
diff changeset
1959
6e76f1367896 [gaim-migrate @ 9988]
Felipe Contreras <felipe.contreras@gmail.com>
parents: 9158
diff changeset
1960 void
20564
35675dd4a44d Make buddy and group management actually work, add some SOAP templates, redesign some parts of code and separate some bigger functions into its smaller tasks which are completely unrelated to each other
Carlos Silva <typ0@pidgin.im>
parents: 20560
diff changeset
1961 msn_notification_rem_buddy_from_list(MsnNotification *notification, MsnListId list_id,
35675dd4a44d Make buddy and group management actually work, add some SOAP templates, redesign some parts of code and separate some bigger functions into its smaller tasks which are completely unrelated to each other
Carlos Silva <typ0@pidgin.im>
parents: 20560
diff changeset
1962 const char *who)
9193
6e76f1367896 [gaim-migrate @ 9988]
Felipe Contreras <felipe.contreras@gmail.com>
parents: 9158
diff changeset
1963 {
6e76f1367896 [gaim-migrate @ 9988]
Felipe Contreras <felipe.contreras@gmail.com>
parents: 9158
diff changeset
1964 MsnCmdProc *cmdproc;
13866
b6a2c8d390ef [gaim-migrate @ 16716]
Ma Yuan <mayuan2006@gmail.com>
parents: 13865
diff changeset
1965 MsnTransaction *trans;
20564
35675dd4a44d Make buddy and group management actually work, add some SOAP templates, redesign some parts of code and separate some bigger functions into its smaller tasks which are completely unrelated to each other
Carlos Silva <typ0@pidgin.im>
parents: 20560
diff changeset
1966 MsnListOp list_op = 1 << list_id;
13866
b6a2c8d390ef [gaim-migrate @ 16716]
Ma Yuan <mayuan2006@gmail.com>
parents: 13865
diff changeset
1967 xmlnode *rml_node;
b6a2c8d390ef [gaim-migrate @ 16716]
Ma Yuan <mayuan2006@gmail.com>
parents: 13865
diff changeset
1968 char *payload;
b6a2c8d390ef [gaim-migrate @ 16716]
Ma Yuan <mayuan2006@gmail.com>
parents: 13865
diff changeset
1969 int payload_len;
b6a2c8d390ef [gaim-migrate @ 16716]
Ma Yuan <mayuan2006@gmail.com>
parents: 13865
diff changeset
1970
9193
6e76f1367896 [gaim-migrate @ 9988]
Felipe Contreras <felipe.contreras@gmail.com>
parents: 9158
diff changeset
1971 cmdproc = notification->servconn->cmdproc;
6e76f1367896 [gaim-migrate @ 9988]
Felipe Contreras <felipe.contreras@gmail.com>
parents: 9158
diff changeset
1972
13866
b6a2c8d390ef [gaim-migrate @ 16716]
Ma Yuan <mayuan2006@gmail.com>
parents: 13865
diff changeset
1973 rml_node = xmlnode_new("ml");
b6a2c8d390ef [gaim-migrate @ 16716]
Ma Yuan <mayuan2006@gmail.com>
parents: 13865
diff changeset
1974 rml_node->child = NULL;
b6a2c8d390ef [gaim-migrate @ 16716]
Ma Yuan <mayuan2006@gmail.com>
parents: 13865
diff changeset
1975
23790
eb49b07a62d6 Modifications to the MSN code for some stuff I'll be doing in later
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 23789
diff changeset
1976 msn_add_contact_xml(notification->session, rml_node, who, list_op, MSN_NETWORK_PASSPORT);
13866
b6a2c8d390ef [gaim-migrate @ 16716]
Ma Yuan <mayuan2006@gmail.com>
parents: 13865
diff changeset
1977
20564
35675dd4a44d Make buddy and group management actually work, add some SOAP templates, redesign some parts of code and separate some bigger functions into its smaller tasks which are completely unrelated to each other
Carlos Silva <typ0@pidgin.im>
parents: 20560
diff changeset
1978 payload = xmlnode_to_str(rml_node, &payload_len);
13866
b6a2c8d390ef [gaim-migrate @ 16716]
Ma Yuan <mayuan2006@gmail.com>
parents: 13865
diff changeset
1979 xmlnode_free(rml_node);
b6a2c8d390ef [gaim-migrate @ 16716]
Ma Yuan <mayuan2006@gmail.com>
parents: 13865
diff changeset
1980
23830
1436e3de5d6c The great MSN debug message cleanup! Threw in a few whitespace fixes,
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 23828
diff changeset
1981 purple_debug_info("msn", "Send RML with payload:\n%s\n", payload);
22969
51f5e7777915 This cleans up a bunch of warnings that stem from the fact that size_t and
John Bailey <rekkanoryo@rekkanoryo.org>
parents: 22711
diff changeset
1982 trans = msn_transaction_new(cmdproc, "RML","%" G_GSIZE_FORMAT, strlen(payload));
13866
b6a2c8d390ef [gaim-migrate @ 16716]
Ma Yuan <mayuan2006@gmail.com>
parents: 13865
diff changeset
1983 msn_transaction_set_payload(trans, payload, strlen(payload));
b6a2c8d390ef [gaim-migrate @ 16716]
Ma Yuan <mayuan2006@gmail.com>
parents: 13865
diff changeset
1984 msn_cmdproc_send_trans(cmdproc, trans);
20582
edd27909081a Make the buddylist sync issue a little less worse.
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents: 20578
diff changeset
1985 g_free(payload);
5309
3178acad1449 [gaim-migrate @ 5681]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
1986 }
3178acad1449 [gaim-migrate @ 5681]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
1987
10463
f2f97738b401 [gaim-migrate @ 11737]
Felipe Contreras <felipe.contreras@gmail.com>
parents: 10452
diff changeset
1988 /**************************************************************************
f2f97738b401 [gaim-migrate @ 11737]
Felipe Contreras <felipe.contreras@gmail.com>
parents: 10452
diff changeset
1989 * Init
f2f97738b401 [gaim-migrate @ 11737]
Felipe Contreras <felipe.contreras@gmail.com>
parents: 10452
diff changeset
1990 **************************************************************************/
8808
1cb5ddf6b625 [gaim-migrate @ 9570]
Felipe Contreras <felipe.contreras@gmail.com>
parents: 8669
diff changeset
1991 void
1cb5ddf6b625 [gaim-migrate @ 9570]
Felipe Contreras <felipe.contreras@gmail.com>
parents: 8669
diff changeset
1992 msn_notification_init(void)
1cb5ddf6b625 [gaim-migrate @ 9570]
Felipe Contreras <felipe.contreras@gmail.com>
parents: 8669
diff changeset
1993 {
1cb5ddf6b625 [gaim-migrate @ 9570]
Felipe Contreras <felipe.contreras@gmail.com>
parents: 8669
diff changeset
1994 cbs_table = msn_table_new();
1cb5ddf6b625 [gaim-migrate @ 9570]
Felipe Contreras <felipe.contreras@gmail.com>
parents: 8669
diff changeset
1995
10310
9f797642432a [gaim-migrate @ 11504]
Mark Doliner <markdoliner@pidgin.im>
parents: 10296
diff changeset
1996 /* Synchronous */
11992
906176cc9b22 [gaim-migrate @ 14285]
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 11862
diff changeset
1997 msn_table_add_cmd(cbs_table, "CHG", "CHG", NULL);
8808
1cb5ddf6b625 [gaim-migrate @ 9570]
Felipe Contreras <felipe.contreras@gmail.com>
parents: 8669
diff changeset
1998 msn_table_add_cmd(cbs_table, "CHG", "ILN", iln_cmd);
13856
a6511183749e [gaim-migrate @ 16546]
Ma Yuan <mayuan2006@gmail.com>
parents: 13855
diff changeset
1999 msn_table_add_cmd(cbs_table, "ADL", "ILN", iln_cmd);
8808
1cb5ddf6b625 [gaim-migrate @ 9570]
Felipe Contreras <felipe.contreras@gmail.com>
parents: 8669
diff changeset
2000 msn_table_add_cmd(cbs_table, "USR", "USR", usr_cmd);
1cb5ddf6b625 [gaim-migrate @ 9570]
Felipe Contreras <felipe.contreras@gmail.com>
parents: 8669
diff changeset
2001 msn_table_add_cmd(cbs_table, "USR", "XFR", xfr_cmd);
13853
cccd9dd599eb [gaim-migrate @ 16329]
Ma Yuan <mayuan2006@gmail.com>
parents: 13713
diff changeset
2002 msn_table_add_cmd(cbs_table, "USR", "GCF", gcf_cmd);
8808
1cb5ddf6b625 [gaim-migrate @ 9570]
Felipe Contreras <felipe.contreras@gmail.com>
parents: 8669
diff changeset
2003 msn_table_add_cmd(cbs_table, "CVR", "CVR", cvr_cmd);
1cb5ddf6b625 [gaim-migrate @ 9570]
Felipe Contreras <felipe.contreras@gmail.com>
parents: 8669
diff changeset
2004 msn_table_add_cmd(cbs_table, "VER", "VER", ver_cmd);
10833
62d8c516b51b [gaim-migrate @ 12503]
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 10816
diff changeset
2005 msn_table_add_cmd(cbs_table, "PRP", "PRP", prp_cmd);
13856
a6511183749e [gaim-migrate @ 16546]
Ma Yuan <mayuan2006@gmail.com>
parents: 13855
diff changeset
2006 msn_table_add_cmd(cbs_table, "BLP", "BLP", blp_cmd);
8808
1cb5ddf6b625 [gaim-migrate @ 9570]
Felipe Contreras <felipe.contreras@gmail.com>
parents: 8669
diff changeset
2007 msn_table_add_cmd(cbs_table, "REG", "REG", reg_cmd);
1cb5ddf6b625 [gaim-migrate @ 9570]
Felipe Contreras <felipe.contreras@gmail.com>
parents: 8669
diff changeset
2008 msn_table_add_cmd(cbs_table, "ADG", "ADG", adg_cmd);
1cb5ddf6b625 [gaim-migrate @ 9570]
Felipe Contreras <felipe.contreras@gmail.com>
parents: 8669
diff changeset
2009 msn_table_add_cmd(cbs_table, "RMG", "RMG", rmg_cmd);
1cb5ddf6b625 [gaim-migrate @ 9570]
Felipe Contreras <felipe.contreras@gmail.com>
parents: 8669
diff changeset
2010 msn_table_add_cmd(cbs_table, "XFR", "XFR", xfr_cmd);
1cb5ddf6b625 [gaim-migrate @ 9570]
Felipe Contreras <felipe.contreras@gmail.com>
parents: 8669
diff changeset
2011
10310
9f797642432a [gaim-migrate @ 11504]
Mark Doliner <markdoliner@pidgin.im>
parents: 10296
diff changeset
2012 /* Asynchronous */
8808
1cb5ddf6b625 [gaim-migrate @ 9570]
Felipe Contreras <felipe.contreras@gmail.com>
parents: 8669
diff changeset
2013 msn_table_add_cmd(cbs_table, NULL, "IPG", ipg_cmd);
1cb5ddf6b625 [gaim-migrate @ 9570]
Felipe Contreras <felipe.contreras@gmail.com>
parents: 8669
diff changeset
2014 msn_table_add_cmd(cbs_table, NULL, "MSG", msg_cmd);
13870
258d48d6ab52 [gaim-migrate @ 16737]
Ma Yuan <mayuan2006@gmail.com>
parents: 13869
diff changeset
2015 msn_table_add_cmd(cbs_table, NULL, "UBM", ubm_cmd);
13853
cccd9dd599eb [gaim-migrate @ 16329]
Ma Yuan <mayuan2006@gmail.com>
parents: 13713
diff changeset
2016 msn_table_add_cmd(cbs_table, NULL, "GCF", gcf_cmd);
cccd9dd599eb [gaim-migrate @ 16329]
Ma Yuan <mayuan2006@gmail.com>
parents: 13713
diff changeset
2017 msn_table_add_cmd(cbs_table, NULL, "SBS", sbs_cmd);
8808
1cb5ddf6b625 [gaim-migrate @ 9570]
Felipe Contreras <felipe.contreras@gmail.com>
parents: 8669
diff changeset
2018 msn_table_add_cmd(cbs_table, NULL, "NOT", not_cmd);
1cb5ddf6b625 [gaim-migrate @ 9570]
Felipe Contreras <felipe.contreras@gmail.com>
parents: 8669
diff changeset
2019
1cb5ddf6b625 [gaim-migrate @ 9570]
Felipe Contreras <felipe.contreras@gmail.com>
parents: 8669
diff changeset
2020 msn_table_add_cmd(cbs_table, NULL, "CHL", chl_cmd);
13865
ce1c14d05b5f [gaim-migrate @ 16685]
Ma Yuan <mayuan2006@gmail.com>
parents: 13864
diff changeset
2021 msn_table_add_cmd(cbs_table, NULL, "RML", rml_cmd);
13856
a6511183749e [gaim-migrate @ 16546]
Ma Yuan <mayuan2006@gmail.com>
parents: 13855
diff changeset
2022 msn_table_add_cmd(cbs_table, NULL, "ADL", adl_cmd);
13873
3c20f5d70d1d [gaim-migrate @ 16772]
Ma Yuan <mayuan2006@gmail.com>
parents: 13871
diff changeset
2023 msn_table_add_cmd(cbs_table, NULL, "FQY", fqy_cmd);
8808
1cb5ddf6b625 [gaim-migrate @ 9570]
Felipe Contreras <felipe.contreras@gmail.com>
parents: 8669
diff changeset
2024
1cb5ddf6b625 [gaim-migrate @ 9570]
Felipe Contreras <felipe.contreras@gmail.com>
parents: 8669
diff changeset
2025 msn_table_add_cmd(cbs_table, NULL, "QRY", NULL);
17202
32ab8bec7403 Periodically refresh the authentication info required to automatically log
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 17178
diff changeset
2026 msn_table_add_cmd(cbs_table, NULL, "QNG", qng_cmd);
8808
1cb5ddf6b625 [gaim-migrate @ 9570]
Felipe Contreras <felipe.contreras@gmail.com>
parents: 8669
diff changeset
2027 msn_table_add_cmd(cbs_table, NULL, "FLN", fln_cmd);
1cb5ddf6b625 [gaim-migrate @ 9570]
Felipe Contreras <felipe.contreras@gmail.com>
parents: 8669
diff changeset
2028 msn_table_add_cmd(cbs_table, NULL, "NLN", nln_cmd);
8832
30eacd0f47fd [gaim-migrate @ 9596]
Felipe Contreras <felipe.contreras@gmail.com>
parents: 8808
diff changeset
2029 msn_table_add_cmd(cbs_table, NULL, "ILN", iln_cmd);
8808
1cb5ddf6b625 [gaim-migrate @ 9570]
Felipe Contreras <felipe.contreras@gmail.com>
parents: 8669
diff changeset
2030 msn_table_add_cmd(cbs_table, NULL, "OUT", out_cmd);
1cb5ddf6b625 [gaim-migrate @ 9570]
Felipe Contreras <felipe.contreras@gmail.com>
parents: 8669
diff changeset
2031 msn_table_add_cmd(cbs_table, NULL, "RNG", rng_cmd);
1cb5ddf6b625 [gaim-migrate @ 9570]
Felipe Contreras <felipe.contreras@gmail.com>
parents: 8669
diff changeset
2032
13856
a6511183749e [gaim-migrate @ 16546]
Ma Yuan <mayuan2006@gmail.com>
parents: 13855
diff changeset
2033 msn_table_add_cmd(cbs_table, NULL, "UBX", ubx_cmd);
a6511183749e [gaim-migrate @ 16546]
Ma Yuan <mayuan2006@gmail.com>
parents: 13855
diff changeset
2034 msn_table_add_cmd(cbs_table, NULL, "UUX", uux_cmd);
a6511183749e [gaim-migrate @ 16546]
Ma Yuan <mayuan2006@gmail.com>
parents: 13855
diff changeset
2035
8808
1cb5ddf6b625 [gaim-migrate @ 9570]
Felipe Contreras <felipe.contreras@gmail.com>
parents: 8669
diff changeset
2036 msn_table_add_cmd(cbs_table, NULL, "URL", url_cmd);
9194
1ff43e1a77e5 [gaim-migrate @ 9989]
Christian Hammond <chipx86@chipx86.com>
parents: 9193
diff changeset
2037
10043
4d4cc1ee9b69 [gaim-migrate @ 11002]
Felipe Contreras <felipe.contreras@gmail.com>
parents: 10010
diff changeset
2038 msn_table_add_cmd(cbs_table, "fallback", "XFR", xfr_cmd);
8808
1cb5ddf6b625 [gaim-migrate @ 9570]
Felipe Contreras <felipe.contreras@gmail.com>
parents: 8669
diff changeset
2039
24383
47b92be772ce Apply khc's patch for 241 error. Tested it out myself. Cleaned up the
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 24382
diff changeset
2040 msn_table_add_cmd(cbs_table, NULL, "241", adl_241_error_cmd);
47b92be772ce Apply khc's patch for 241 error. Tested it out myself. Cleaned up the
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 24382
diff changeset
2041
8808
1cb5ddf6b625 [gaim-migrate @ 9570]
Felipe Contreras <felipe.contreras@gmail.com>
parents: 8669
diff changeset
2042 msn_table_add_error(cbs_table, "ADD", add_error);
20522
177cad886d4c A bunch of MSNP14 stuff:
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 20515
diff changeset
2043 msn_table_add_error(cbs_table, "ADL", adl_error);
10451
2df35a139363 [gaim-migrate @ 11717]
Felipe Contreras <felipe.contreras@gmail.com>
parents: 10403
diff changeset
2044 msn_table_add_error(cbs_table, "REG", reg_error);
2df35a139363 [gaim-migrate @ 11717]
Felipe Contreras <felipe.contreras@gmail.com>
parents: 10403
diff changeset
2045 msn_table_add_error(cbs_table, "RMG", rmg_error);
10568
15f02c0e7fc1 [gaim-migrate @ 11954]
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 10519
diff changeset
2046 msn_table_add_error(cbs_table, "USR", usr_error);
10403
4647a87ef73b [gaim-migrate @ 11648]
Felipe Contreras <felipe.contreras@gmail.com>
parents: 10345
diff changeset
2047
8808
1cb5ddf6b625 [gaim-migrate @ 9570]
Felipe Contreras <felipe.contreras@gmail.com>
parents: 8669
diff changeset
2048 msn_table_add_msg_type(cbs_table,
9158
f8dab42adeaf [gaim-migrate @ 9942]
Felipe Contreras <felipe.contreras@gmail.com>
parents: 8926
diff changeset
2049 "text/x-msmsgsprofile",
f8dab42adeaf [gaim-migrate @ 9942]
Felipe Contreras <felipe.contreras@gmail.com>
parents: 8926
diff changeset
2050 profile_msg);
13861
dc0021ad2b73 [gaim-migrate @ 16653]
Ma Yuan <mayuan2006@gmail.com>
parents: 13859
diff changeset
2051 /*initial OIM notification*/
8808
1cb5ddf6b625 [gaim-migrate @ 9570]
Felipe Contreras <felipe.contreras@gmail.com>
parents: 8669
diff changeset
2052 msn_table_add_msg_type(cbs_table,
13855
24cff9e060d7 [gaim-migrate @ 16507]
Ma Yuan <mayuan2006@gmail.com>
parents: 13854
diff changeset
2053 "text/x-msmsgsinitialmdatanotification",
23441
fd45c23a3eb2 Delete trailing whitespace
Mark Doliner <markdoliner@pidgin.im>
parents: 23085
diff changeset
2054 initial_mdata_msg);
13861
dc0021ad2b73 [gaim-migrate @ 16653]
Ma Yuan <mayuan2006@gmail.com>
parents: 13859
diff changeset
2055 /*OIM notification when user online*/
dc0021ad2b73 [gaim-migrate @ 16653]
Ma Yuan <mayuan2006@gmail.com>
parents: 13859
diff changeset
2056 msn_table_add_msg_type(cbs_table,
dc0021ad2b73 [gaim-migrate @ 16653]
Ma Yuan <mayuan2006@gmail.com>
parents: 13859
diff changeset
2057 "text/x-msmsgsoimnotification",
23441
fd45c23a3eb2 Delete trailing whitespace
Mark Doliner <markdoliner@pidgin.im>
parents: 23085
diff changeset
2058 initial_mdata_msg);
8808
1cb5ddf6b625 [gaim-migrate @ 9570]
Felipe Contreras <felipe.contreras@gmail.com>
parents: 8669
diff changeset
2059 msn_table_add_msg_type(cbs_table,
9158
f8dab42adeaf [gaim-migrate @ 9942]
Felipe Contreras <felipe.contreras@gmail.com>
parents: 8926
diff changeset
2060 "text/x-msmsgsinitialemailnotification",
f8dab42adeaf [gaim-migrate @ 9942]
Felipe Contreras <felipe.contreras@gmail.com>
parents: 8926
diff changeset
2061 initial_email_msg);
8808
1cb5ddf6b625 [gaim-migrate @ 9570]
Felipe Contreras <felipe.contreras@gmail.com>
parents: 8669
diff changeset
2062 msn_table_add_msg_type(cbs_table,
9158
f8dab42adeaf [gaim-migrate @ 9942]
Felipe Contreras <felipe.contreras@gmail.com>
parents: 8926
diff changeset
2063 "text/x-msmsgsemailnotification",
f8dab42adeaf [gaim-migrate @ 9942]
Felipe Contreras <felipe.contreras@gmail.com>
parents: 8926
diff changeset
2064 email_msg);
13892
3cdfd486fa4f [gaim-migrate @ 17015]
Ma Yuan <mayuan2006@gmail.com>
parents: 13890
diff changeset
2065 /*delete an offline Message notification*/
3cdfd486fa4f [gaim-migrate @ 17015]
Ma Yuan <mayuan2006@gmail.com>
parents: 13890
diff changeset
2066 msn_table_add_msg_type(cbs_table,
3cdfd486fa4f [gaim-migrate @ 17015]
Ma Yuan <mayuan2006@gmail.com>
parents: 13890
diff changeset
2067 "text/x-msmsgsactivemailnotification",
3cdfd486fa4f [gaim-migrate @ 17015]
Ma Yuan <mayuan2006@gmail.com>
parents: 13890
diff changeset
2068 delete_oim_msg);
8808
1cb5ddf6b625 [gaim-migrate @ 9570]
Felipe Contreras <felipe.contreras@gmail.com>
parents: 8669
diff changeset
2069 msn_table_add_msg_type(cbs_table,
9158
f8dab42adeaf [gaim-migrate @ 9942]
Felipe Contreras <felipe.contreras@gmail.com>
parents: 8926
diff changeset
2070 "application/x-msmsgssystemmessage",
f8dab42adeaf [gaim-migrate @ 9942]
Felipe Contreras <felipe.contreras@gmail.com>
parents: 8926
diff changeset
2071 system_msg);
8808
1cb5ddf6b625 [gaim-migrate @ 9570]
Felipe Contreras <felipe.contreras@gmail.com>
parents: 8669
diff changeset
2072 }
1cb5ddf6b625 [gaim-migrate @ 9570]
Felipe Contreras <felipe.contreras@gmail.com>
parents: 8669
diff changeset
2073
1cb5ddf6b625 [gaim-migrate @ 9570]
Felipe Contreras <felipe.contreras@gmail.com>
parents: 8669
diff changeset
2074 void
1cb5ddf6b625 [gaim-migrate @ 9570]
Felipe Contreras <felipe.contreras@gmail.com>
parents: 8669
diff changeset
2075 msn_notification_end(void)
1cb5ddf6b625 [gaim-migrate @ 9570]
Felipe Contreras <felipe.contreras@gmail.com>
parents: 8669
diff changeset
2076 {
1cb5ddf6b625 [gaim-migrate @ 9570]
Felipe Contreras <felipe.contreras@gmail.com>
parents: 8669
diff changeset
2077 msn_table_destroy(cbs_table);
1cb5ddf6b625 [gaim-migrate @ 9570]
Felipe Contreras <felipe.contreras@gmail.com>
parents: 8669
diff changeset
2078 }
13861
dc0021ad2b73 [gaim-migrate @ 16653]
Ma Yuan <mayuan2006@gmail.com>
parents: 13859
diff changeset
2079

mercurial