annotate src/protocols/msn/notification.c @ 19757:2315ee828b7c

[gaim-migrate @ 16772] change the UUX and FQY command procedure comitted by MaYuan<mayuan2006@gmail.com> committer: Ethan Blanton <elb@pidgin.im>
author Ma Yuan <mayuan2006@gmail.com>
date Tue, 15 Aug 2006 16:48:32 +0000
parents 90f89601d6d3
children cabf9165c9ce
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
5309
e2e53316a21d [gaim-migrate @ 5681]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
1 /**
e2e53316a21d [gaim-migrate @ 5681]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
2 * @file notification.c Notification server functions
e2e53316a21d [gaim-migrate @ 5681]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
3 *
e2e53316a21d [gaim-migrate @ 5681]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
4 * gaim
e2e53316a21d [gaim-migrate @ 5681]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
5 *
9198
ab6636c5a136 [gaim-migrate @ 9993]
Christian Hammond <chipx86@chipx86.com>
parents: 9197
diff changeset
6 * Gaim is the legal property of its developers, whose names are too numerous
ab6636c5a136 [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
ab6636c5a136 [gaim-migrate @ 9993]
Christian Hammond <chipx86@chipx86.com>
parents: 9197
diff changeset
8 * source distribution.
6701
b7e113a59b51 [gaim-migrate @ 7227]
Christian Hammond <chipx86@chipx86.com>
parents: 6695
diff changeset
9 *
5309
e2e53316a21d [gaim-migrate @ 5681]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
10 * This program is free software; you can redistribute it and/or modify
e2e53316a21d [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
e2e53316a21d [gaim-migrate @ 5681]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
12 * the Free Software Foundation; either version 2 of the License, or
e2e53316a21d [gaim-migrate @ 5681]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
13 * (at your option) any later version.
e2e53316a21d [gaim-migrate @ 5681]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
14 *
e2e53316a21d [gaim-migrate @ 5681]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
15 * This program is distributed in the hope that it will be useful,
e2e53316a21d [gaim-migrate @ 5681]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
16 * but WITHOUT ANY WARRANTY; without even the implied warranty of
e2e53316a21d [gaim-migrate @ 5681]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
17 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
e2e53316a21d [gaim-migrate @ 5681]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
18 * GNU General Public License for more details.
e2e53316a21d [gaim-migrate @ 5681]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
19 *
e2e53316a21d [gaim-migrate @ 5681]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
20 * You should have received a copy of the GNU General Public License
e2e53316a21d [gaim-migrate @ 5681]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
21 * along with this program; if not, write to the Free Software
e2e53316a21d [gaim-migrate @ 5681]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
22 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
e2e53316a21d [gaim-migrate @ 5681]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
23 */
e2e53316a21d [gaim-migrate @ 5681]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
24 #include "msn.h"
e2e53316a21d [gaim-migrate @ 5681]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
25 #include "notification.h"
5361
953aa05279f4 [gaim-migrate @ 5737]
Christian Hammond <chipx86@chipx86.com>
parents: 5358
diff changeset
26 #include "state.h"
5309
e2e53316a21d [gaim-migrate @ 5681]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
27 #include "error.h"
13627
3cfdf1653a64 [gaim-migrate @ 16014]
Evan Schoenberg <evan.s@dreskin.net>
parents: 11992
diff changeset
28 #include "msn-utils.h"
9193
502707ca1836 [gaim-migrate @ 9988]
Christian Hammond <chipx86@chipx86.com>
parents: 9158
diff changeset
29 #include "page.h"
5518
bf2a7a7b739d [gaim-migrate @ 5918]
Christian Hammond <chipx86@chipx86.com>
parents: 5509
diff changeset
30
9193
502707ca1836 [gaim-migrate @ 9988]
Christian Hammond <chipx86@chipx86.com>
parents: 9158
diff changeset
31 #include "userlist.h"
502707ca1836 [gaim-migrate @ 9988]
Christian Hammond <chipx86@chipx86.com>
parents: 9158
diff changeset
32 #include "sync.h"
10296
a7b2fd5efcf2 [gaim-migrate @ 11476]
Stu Tomlinson <stu@nosnilmot.com>
parents: 10284
diff changeset
33 #include "slplink.h"
5309
e2e53316a21d [gaim-migrate @ 5681]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
34
9193
502707ca1836 [gaim-migrate @ 9988]
Christian Hammond <chipx86@chipx86.com>
parents: 9158
diff changeset
35 static MsnTable *cbs_table;
5309
e2e53316a21d [gaim-migrate @ 5681]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
36
19750
3a15b4e5c336 [gaim-migrate @ 16716]
Ma Yuan <mayuan2006@gmail.com>
parents: 19749
diff changeset
37 /****************************************************************************
3a15b4e5c336 [gaim-migrate @ 16716]
Ma Yuan <mayuan2006@gmail.com>
parents: 19749
diff changeset
38 * Local Function Prototype
3a15b4e5c336 [gaim-migrate @ 16716]
Ma Yuan <mayuan2006@gmail.com>
parents: 19749
diff changeset
39 ****************************************************************************/
19757
2315ee828b7c [gaim-migrate @ 16772]
Ma Yuan <mayuan2006@gmail.com>
parents: 19755
diff changeset
40 void msn_notification_post_adl(MsnCmdProc *cmdproc,char *payload ,int payload_len);
2315ee828b7c [gaim-migrate @ 16772]
Ma Yuan <mayuan2006@gmail.com>
parents: 19755
diff changeset
41
19752
c2f3cd6626e1 [gaim-migrate @ 16722]
Ma Yuan <mayuan2006@gmail.com>
parents: 19751
diff changeset
42 void msn_add_contact_xml(xmlnode *mlNode,const char *passport,int list_op,int type);
19750
3a15b4e5c336 [gaim-migrate @ 16716]
Ma Yuan <mayuan2006@gmail.com>
parents: 19749
diff changeset
43
5309
e2e53316a21d [gaim-migrate @ 5681]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
44 /**************************************************************************
10463
9bed28273ec7 [gaim-migrate @ 11737]
Stu Tomlinson <stu@nosnilmot.com>
parents: 10452
diff changeset
45 * Main
9bed28273ec7 [gaim-migrate @ 11737]
Stu Tomlinson <stu@nosnilmot.com>
parents: 10452
diff changeset
46 **************************************************************************/
10481
bcfea6c3d5c9 [gaim-migrate @ 11769]
Stu Tomlinson <stu@nosnilmot.com>
parents: 10463
diff changeset
47
10463
9bed28273ec7 [gaim-migrate @ 11737]
Stu Tomlinson <stu@nosnilmot.com>
parents: 10452
diff changeset
48 static void
9bed28273ec7 [gaim-migrate @ 11737]
Stu Tomlinson <stu@nosnilmot.com>
parents: 10452
diff changeset
49 destroy_cb(MsnServConn *servconn)
9bed28273ec7 [gaim-migrate @ 11737]
Stu Tomlinson <stu@nosnilmot.com>
parents: 10452
diff changeset
50 {
9bed28273ec7 [gaim-migrate @ 11737]
Stu Tomlinson <stu@nosnilmot.com>
parents: 10452
diff changeset
51 MsnNotification *notification;
9bed28273ec7 [gaim-migrate @ 11737]
Stu Tomlinson <stu@nosnilmot.com>
parents: 10452
diff changeset
52
9bed28273ec7 [gaim-migrate @ 11737]
Stu Tomlinson <stu@nosnilmot.com>
parents: 10452
diff changeset
53 notification = servconn->cmdproc->data;
9bed28273ec7 [gaim-migrate @ 11737]
Stu Tomlinson <stu@nosnilmot.com>
parents: 10452
diff changeset
54 g_return_if_fail(notification != NULL);
9bed28273ec7 [gaim-migrate @ 11737]
Stu Tomlinson <stu@nosnilmot.com>
parents: 10452
diff changeset
55
9bed28273ec7 [gaim-migrate @ 11737]
Stu Tomlinson <stu@nosnilmot.com>
parents: 10452
diff changeset
56 msn_notification_destroy(notification);
9bed28273ec7 [gaim-migrate @ 11737]
Stu Tomlinson <stu@nosnilmot.com>
parents: 10452
diff changeset
57 }
9bed28273ec7 [gaim-migrate @ 11737]
Stu Tomlinson <stu@nosnilmot.com>
parents: 10452
diff changeset
58
9bed28273ec7 [gaim-migrate @ 11737]
Stu Tomlinson <stu@nosnilmot.com>
parents: 10452
diff changeset
59 MsnNotification *
9bed28273ec7 [gaim-migrate @ 11737]
Stu Tomlinson <stu@nosnilmot.com>
parents: 10452
diff changeset
60 msn_notification_new(MsnSession *session)
9bed28273ec7 [gaim-migrate @ 11737]
Stu Tomlinson <stu@nosnilmot.com>
parents: 10452
diff changeset
61 {
9bed28273ec7 [gaim-migrate @ 11737]
Stu Tomlinson <stu@nosnilmot.com>
parents: 10452
diff changeset
62 MsnNotification *notification;
9bed28273ec7 [gaim-migrate @ 11737]
Stu Tomlinson <stu@nosnilmot.com>
parents: 10452
diff changeset
63 MsnServConn *servconn;
9bed28273ec7 [gaim-migrate @ 11737]
Stu Tomlinson <stu@nosnilmot.com>
parents: 10452
diff changeset
64
9bed28273ec7 [gaim-migrate @ 11737]
Stu Tomlinson <stu@nosnilmot.com>
parents: 10452
diff changeset
65 g_return_val_if_fail(session != NULL, NULL);
9bed28273ec7 [gaim-migrate @ 11737]
Stu Tomlinson <stu@nosnilmot.com>
parents: 10452
diff changeset
66
9bed28273ec7 [gaim-migrate @ 11737]
Stu Tomlinson <stu@nosnilmot.com>
parents: 10452
diff changeset
67 notification = g_new0(MsnNotification, 1);
9bed28273ec7 [gaim-migrate @ 11737]
Stu Tomlinson <stu@nosnilmot.com>
parents: 10452
diff changeset
68
9bed28273ec7 [gaim-migrate @ 11737]
Stu Tomlinson <stu@nosnilmot.com>
parents: 10452
diff changeset
69 notification->session = session;
10481
bcfea6c3d5c9 [gaim-migrate @ 11769]
Stu Tomlinson <stu@nosnilmot.com>
parents: 10463
diff changeset
70 notification->servconn = servconn = msn_servconn_new(session, MSN_SERVCONN_NS);
10463
9bed28273ec7 [gaim-migrate @ 11737]
Stu Tomlinson <stu@nosnilmot.com>
parents: 10452
diff changeset
71 msn_servconn_set_destroy_cb(servconn, destroy_cb);
9bed28273ec7 [gaim-migrate @ 11737]
Stu Tomlinson <stu@nosnilmot.com>
parents: 10452
diff changeset
72
9bed28273ec7 [gaim-migrate @ 11737]
Stu Tomlinson <stu@nosnilmot.com>
parents: 10452
diff changeset
73 notification->cmdproc = servconn->cmdproc;
9bed28273ec7 [gaim-migrate @ 11737]
Stu Tomlinson <stu@nosnilmot.com>
parents: 10452
diff changeset
74 notification->cmdproc->data = notification;
9bed28273ec7 [gaim-migrate @ 11737]
Stu Tomlinson <stu@nosnilmot.com>
parents: 10452
diff changeset
75 notification->cmdproc->cbs_table = cbs_table;
9bed28273ec7 [gaim-migrate @ 11737]
Stu Tomlinson <stu@nosnilmot.com>
parents: 10452
diff changeset
76
9bed28273ec7 [gaim-migrate @ 11737]
Stu Tomlinson <stu@nosnilmot.com>
parents: 10452
diff changeset
77 return notification;
9bed28273ec7 [gaim-migrate @ 11737]
Stu Tomlinson <stu@nosnilmot.com>
parents: 10452
diff changeset
78 }
9bed28273ec7 [gaim-migrate @ 11737]
Stu Tomlinson <stu@nosnilmot.com>
parents: 10452
diff changeset
79
9bed28273ec7 [gaim-migrate @ 11737]
Stu Tomlinson <stu@nosnilmot.com>
parents: 10452
diff changeset
80 void
9bed28273ec7 [gaim-migrate @ 11737]
Stu Tomlinson <stu@nosnilmot.com>
parents: 10452
diff changeset
81 msn_notification_destroy(MsnNotification *notification)
9bed28273ec7 [gaim-migrate @ 11737]
Stu Tomlinson <stu@nosnilmot.com>
parents: 10452
diff changeset
82 {
10481
bcfea6c3d5c9 [gaim-migrate @ 11769]
Stu Tomlinson <stu@nosnilmot.com>
parents: 10463
diff changeset
83 notification->cmdproc->data = NULL;
10463
9bed28273ec7 [gaim-migrate @ 11737]
Stu Tomlinson <stu@nosnilmot.com>
parents: 10452
diff changeset
84
10481
bcfea6c3d5c9 [gaim-migrate @ 11769]
Stu Tomlinson <stu@nosnilmot.com>
parents: 10463
diff changeset
85 msn_servconn_set_destroy_cb(notification->servconn, NULL);
10463
9bed28273ec7 [gaim-migrate @ 11737]
Stu Tomlinson <stu@nosnilmot.com>
parents: 10452
diff changeset
86
9bed28273ec7 [gaim-migrate @ 11737]
Stu Tomlinson <stu@nosnilmot.com>
parents: 10452
diff changeset
87 msn_servconn_destroy(notification->servconn);
9bed28273ec7 [gaim-migrate @ 11737]
Stu Tomlinson <stu@nosnilmot.com>
parents: 10452
diff changeset
88
9bed28273ec7 [gaim-migrate @ 11737]
Stu Tomlinson <stu@nosnilmot.com>
parents: 10452
diff changeset
89 g_free(notification);
9bed28273ec7 [gaim-migrate @ 11737]
Stu Tomlinson <stu@nosnilmot.com>
parents: 10452
diff changeset
90 }
9bed28273ec7 [gaim-migrate @ 11737]
Stu Tomlinson <stu@nosnilmot.com>
parents: 10452
diff changeset
91
9bed28273ec7 [gaim-migrate @ 11737]
Stu Tomlinson <stu@nosnilmot.com>
parents: 10452
diff changeset
92 /**************************************************************************
9bed28273ec7 [gaim-migrate @ 11737]
Stu Tomlinson <stu@nosnilmot.com>
parents: 10452
diff changeset
93 * Connect
9bed28273ec7 [gaim-migrate @ 11737]
Stu Tomlinson <stu@nosnilmot.com>
parents: 10452
diff changeset
94 **************************************************************************/
10481
bcfea6c3d5c9 [gaim-migrate @ 11769]
Stu Tomlinson <stu@nosnilmot.com>
parents: 10463
diff changeset
95
10463
9bed28273ec7 [gaim-migrate @ 11737]
Stu Tomlinson <stu@nosnilmot.com>
parents: 10452
diff changeset
96 static void
9bed28273ec7 [gaim-migrate @ 11737]
Stu Tomlinson <stu@nosnilmot.com>
parents: 10452
diff changeset
97 connect_cb(MsnServConn *servconn)
9bed28273ec7 [gaim-migrate @ 11737]
Stu Tomlinson <stu@nosnilmot.com>
parents: 10452
diff changeset
98 {
9bed28273ec7 [gaim-migrate @ 11737]
Stu Tomlinson <stu@nosnilmot.com>
parents: 10452
diff changeset
99 MsnCmdProc *cmdproc;
9bed28273ec7 [gaim-migrate @ 11737]
Stu Tomlinson <stu@nosnilmot.com>
parents: 10452
diff changeset
100 MsnSession *session;
9bed28273ec7 [gaim-migrate @ 11737]
Stu Tomlinson <stu@nosnilmot.com>
parents: 10452
diff changeset
101 GaimAccount *account;
9bed28273ec7 [gaim-migrate @ 11737]
Stu Tomlinson <stu@nosnilmot.com>
parents: 10452
diff changeset
102 char **a, **c, *vers;
9bed28273ec7 [gaim-migrate @ 11737]
Stu Tomlinson <stu@nosnilmot.com>
parents: 10452
diff changeset
103 int i;
9bed28273ec7 [gaim-migrate @ 11737]
Stu Tomlinson <stu@nosnilmot.com>
parents: 10452
diff changeset
104
9bed28273ec7 [gaim-migrate @ 11737]
Stu Tomlinson <stu@nosnilmot.com>
parents: 10452
diff changeset
105 g_return_if_fail(servconn != NULL);
9bed28273ec7 [gaim-migrate @ 11737]
Stu Tomlinson <stu@nosnilmot.com>
parents: 10452
diff changeset
106
9bed28273ec7 [gaim-migrate @ 11737]
Stu Tomlinson <stu@nosnilmot.com>
parents: 10452
diff changeset
107 cmdproc = servconn->cmdproc;
9bed28273ec7 [gaim-migrate @ 11737]
Stu Tomlinson <stu@nosnilmot.com>
parents: 10452
diff changeset
108 session = servconn->session;
9bed28273ec7 [gaim-migrate @ 11737]
Stu Tomlinson <stu@nosnilmot.com>
parents: 10452
diff changeset
109 account = session->account;
9bed28273ec7 [gaim-migrate @ 11737]
Stu Tomlinson <stu@nosnilmot.com>
parents: 10452
diff changeset
110
9bed28273ec7 [gaim-migrate @ 11737]
Stu Tomlinson <stu@nosnilmot.com>
parents: 10452
diff changeset
111 /* Allocate an array for CVR0, NULL, and all the versions */
19739
852b32710df0 [gaim-migrate @ 16507]
Ma Yuan <mayuan2006@gmail.com>
parents: 19738
diff changeset
112 // a = c = g_new0(char *, session->protocol_ver - WLM_MIN_PROTOCOL + 3);
852b32710df0 [gaim-migrate @ 16507]
Ma Yuan <mayuan2006@gmail.com>
parents: 19738
diff changeset
113 a = c = g_new0(char *, WLM_MAX_PROTOCOL - WLM_MIN_PROTOCOL + 3);
10463
9bed28273ec7 [gaim-migrate @ 11737]
Stu Tomlinson <stu@nosnilmot.com>
parents: 10452
diff changeset
114
19739
852b32710df0 [gaim-migrate @ 16507]
Ma Yuan <mayuan2006@gmail.com>
parents: 19738
diff changeset
115 // for (i = session->protocol_ver; i >= WLM_MIN_PROTOCOL; i--)
852b32710df0 [gaim-migrate @ 16507]
Ma Yuan <mayuan2006@gmail.com>
parents: 19738
diff changeset
116 for (i = WLM_MAX_PROTOCOL; i >= WLM_MIN_PROTOCOL; i--)
10463
9bed28273ec7 [gaim-migrate @ 11737]
Stu Tomlinson <stu@nosnilmot.com>
parents: 10452
diff changeset
117 *c++ = g_strdup_printf("MSNP%d", i);
9bed28273ec7 [gaim-migrate @ 11737]
Stu Tomlinson <stu@nosnilmot.com>
parents: 10452
diff changeset
118
9bed28273ec7 [gaim-migrate @ 11737]
Stu Tomlinson <stu@nosnilmot.com>
parents: 10452
diff changeset
119 *c++ = g_strdup("CVR0");
9bed28273ec7 [gaim-migrate @ 11737]
Stu Tomlinson <stu@nosnilmot.com>
parents: 10452
diff changeset
120
9bed28273ec7 [gaim-migrate @ 11737]
Stu Tomlinson <stu@nosnilmot.com>
parents: 10452
diff changeset
121 vers = g_strjoinv(" ", a);
9bed28273ec7 [gaim-migrate @ 11737]
Stu Tomlinson <stu@nosnilmot.com>
parents: 10452
diff changeset
122
19740
23258253c7a0 [gaim-migrate @ 16546]
Ma Yuan <mayuan2006@gmail.com>
parents: 19739
diff changeset
123 if (session->login_step == MSN_LOGIN_STEP_START){
10519
bec9130b24d2 [gaim-migrate @ 11833]
Stu Tomlinson <stu@nosnilmot.com>
parents: 10514
diff changeset
124 msn_session_set_login_step(session, MSN_LOGIN_STEP_HANDSHAKE);
19740
23258253c7a0 [gaim-migrate @ 16546]
Ma Yuan <mayuan2006@gmail.com>
parents: 19739
diff changeset
125 }else{
10519
bec9130b24d2 [gaim-migrate @ 11833]
Stu Tomlinson <stu@nosnilmot.com>
parents: 10514
diff changeset
126 msn_session_set_login_step(session, MSN_LOGIN_STEP_HANDSHAKE2);
19740
23258253c7a0 [gaim-migrate @ 16546]
Ma Yuan <mayuan2006@gmail.com>
parents: 19739
diff changeset
127 }
10514
8f1316d77315 [gaim-migrate @ 11814]
Stu Tomlinson <stu@nosnilmot.com>
parents: 10504
diff changeset
128
10463
9bed28273ec7 [gaim-migrate @ 11737]
Stu Tomlinson <stu@nosnilmot.com>
parents: 10452
diff changeset
129 msn_cmdproc_send(cmdproc, "VER", "%s", vers);
9bed28273ec7 [gaim-migrate @ 11737]
Stu Tomlinson <stu@nosnilmot.com>
parents: 10452
diff changeset
130
9bed28273ec7 [gaim-migrate @ 11737]
Stu Tomlinson <stu@nosnilmot.com>
parents: 10452
diff changeset
131 g_strfreev(a);
9bed28273ec7 [gaim-migrate @ 11737]
Stu Tomlinson <stu@nosnilmot.com>
parents: 10452
diff changeset
132 g_free(vers);
9bed28273ec7 [gaim-migrate @ 11737]
Stu Tomlinson <stu@nosnilmot.com>
parents: 10452
diff changeset
133 }
9bed28273ec7 [gaim-migrate @ 11737]
Stu Tomlinson <stu@nosnilmot.com>
parents: 10452
diff changeset
134
9bed28273ec7 [gaim-migrate @ 11737]
Stu Tomlinson <stu@nosnilmot.com>
parents: 10452
diff changeset
135 gboolean
9bed28273ec7 [gaim-migrate @ 11737]
Stu Tomlinson <stu@nosnilmot.com>
parents: 10452
diff changeset
136 msn_notification_connect(MsnNotification *notification, const char *host, int port)
9bed28273ec7 [gaim-migrate @ 11737]
Stu Tomlinson <stu@nosnilmot.com>
parents: 10452
diff changeset
137 {
9bed28273ec7 [gaim-migrate @ 11737]
Stu Tomlinson <stu@nosnilmot.com>
parents: 10452
diff changeset
138 MsnServConn *servconn;
9bed28273ec7 [gaim-migrate @ 11737]
Stu Tomlinson <stu@nosnilmot.com>
parents: 10452
diff changeset
139
9bed28273ec7 [gaim-migrate @ 11737]
Stu Tomlinson <stu@nosnilmot.com>
parents: 10452
diff changeset
140 g_return_val_if_fail(notification != NULL, FALSE);
9bed28273ec7 [gaim-migrate @ 11737]
Stu Tomlinson <stu@nosnilmot.com>
parents: 10452
diff changeset
141
9bed28273ec7 [gaim-migrate @ 11737]
Stu Tomlinson <stu@nosnilmot.com>
parents: 10452
diff changeset
142 servconn = notification->servconn;
9bed28273ec7 [gaim-migrate @ 11737]
Stu Tomlinson <stu@nosnilmot.com>
parents: 10452
diff changeset
143
9bed28273ec7 [gaim-migrate @ 11737]
Stu Tomlinson <stu@nosnilmot.com>
parents: 10452
diff changeset
144 msn_servconn_set_connect_cb(servconn, connect_cb);
9bed28273ec7 [gaim-migrate @ 11737]
Stu Tomlinson <stu@nosnilmot.com>
parents: 10452
diff changeset
145 notification->in_use = msn_servconn_connect(servconn, host, port);
9bed28273ec7 [gaim-migrate @ 11737]
Stu Tomlinson <stu@nosnilmot.com>
parents: 10452
diff changeset
146
9bed28273ec7 [gaim-migrate @ 11737]
Stu Tomlinson <stu@nosnilmot.com>
parents: 10452
diff changeset
147 return notification->in_use;
9bed28273ec7 [gaim-migrate @ 11737]
Stu Tomlinson <stu@nosnilmot.com>
parents: 10452
diff changeset
148 }
9bed28273ec7 [gaim-migrate @ 11737]
Stu Tomlinson <stu@nosnilmot.com>
parents: 10452
diff changeset
149
9bed28273ec7 [gaim-migrate @ 11737]
Stu Tomlinson <stu@nosnilmot.com>
parents: 10452
diff changeset
150 void
9bed28273ec7 [gaim-migrate @ 11737]
Stu Tomlinson <stu@nosnilmot.com>
parents: 10452
diff changeset
151 msn_notification_disconnect(MsnNotification *notification)
9bed28273ec7 [gaim-migrate @ 11737]
Stu Tomlinson <stu@nosnilmot.com>
parents: 10452
diff changeset
152 {
9bed28273ec7 [gaim-migrate @ 11737]
Stu Tomlinson <stu@nosnilmot.com>
parents: 10452
diff changeset
153 g_return_if_fail(notification != NULL);
9bed28273ec7 [gaim-migrate @ 11737]
Stu Tomlinson <stu@nosnilmot.com>
parents: 10452
diff changeset
154 g_return_if_fail(notification->in_use);
9bed28273ec7 [gaim-migrate @ 11737]
Stu Tomlinson <stu@nosnilmot.com>
parents: 10452
diff changeset
155
9bed28273ec7 [gaim-migrate @ 11737]
Stu Tomlinson <stu@nosnilmot.com>
parents: 10452
diff changeset
156 msn_servconn_disconnect(notification->servconn);
9bed28273ec7 [gaim-migrate @ 11737]
Stu Tomlinson <stu@nosnilmot.com>
parents: 10452
diff changeset
157
9bed28273ec7 [gaim-migrate @ 11737]
Stu Tomlinson <stu@nosnilmot.com>
parents: 10452
diff changeset
158 notification->in_use = FALSE;
9bed28273ec7 [gaim-migrate @ 11737]
Stu Tomlinson <stu@nosnilmot.com>
parents: 10452
diff changeset
159 }
9bed28273ec7 [gaim-migrate @ 11737]
Stu Tomlinson <stu@nosnilmot.com>
parents: 10452
diff changeset
160
9bed28273ec7 [gaim-migrate @ 11737]
Stu Tomlinson <stu@nosnilmot.com>
parents: 10452
diff changeset
161 /**************************************************************************
10451
92d4a25fd33c [gaim-migrate @ 11717]
Stu Tomlinson <stu@nosnilmot.com>
parents: 10403
diff changeset
162 * Util
92d4a25fd33c [gaim-migrate @ 11717]
Stu Tomlinson <stu@nosnilmot.com>
parents: 10403
diff changeset
163 **************************************************************************/
10481
bcfea6c3d5c9 [gaim-migrate @ 11769]
Stu Tomlinson <stu@nosnilmot.com>
parents: 10463
diff changeset
164
10451
92d4a25fd33c [gaim-migrate @ 11717]
Stu Tomlinson <stu@nosnilmot.com>
parents: 10403
diff changeset
165 static void
19754
da3f8f7ec3ce [gaim-migrate @ 16737]
Ma Yuan <mayuan2006@gmail.com>
parents: 19753
diff changeset
166 group_error_helper(MsnSession *session, const char *msg, const char *group_id, int error)
10451
92d4a25fd33c [gaim-migrate @ 11717]
Stu Tomlinson <stu@nosnilmot.com>
parents: 10403
diff changeset
167 {
92d4a25fd33c [gaim-migrate @ 11717]
Stu Tomlinson <stu@nosnilmot.com>
parents: 10403
diff changeset
168 GaimAccount *account;
92d4a25fd33c [gaim-migrate @ 11717]
Stu Tomlinson <stu@nosnilmot.com>
parents: 10403
diff changeset
169 GaimConnection *gc;
92d4a25fd33c [gaim-migrate @ 11717]
Stu Tomlinson <stu@nosnilmot.com>
parents: 10403
diff changeset
170 char *reason = NULL;
92d4a25fd33c [gaim-migrate @ 11717]
Stu Tomlinson <stu@nosnilmot.com>
parents: 10403
diff changeset
171 char *title = NULL;
92d4a25fd33c [gaim-migrate @ 11717]
Stu Tomlinson <stu@nosnilmot.com>
parents: 10403
diff changeset
172
92d4a25fd33c [gaim-migrate @ 11717]
Stu Tomlinson <stu@nosnilmot.com>
parents: 10403
diff changeset
173 account = session->account;
92d4a25fd33c [gaim-migrate @ 11717]
Stu Tomlinson <stu@nosnilmot.com>
parents: 10403
diff changeset
174 gc = gaim_account_get_connection(account);
92d4a25fd33c [gaim-migrate @ 11717]
Stu Tomlinson <stu@nosnilmot.com>
parents: 10403
diff changeset
175
19739
852b32710df0 [gaim-migrate @ 16507]
Ma Yuan <mayuan2006@gmail.com>
parents: 19738
diff changeset
176 if (error == 224){
852b32710df0 [gaim-migrate @ 16507]
Ma Yuan <mayuan2006@gmail.com>
parents: 19738
diff changeset
177 if (group_id == 0){
10451
92d4a25fd33c [gaim-migrate @ 11717]
Stu Tomlinson <stu@nosnilmot.com>
parents: 10403
diff changeset
178 return;
19739
852b32710df0 [gaim-migrate @ 16507]
Ma Yuan <mayuan2006@gmail.com>
parents: 19738
diff changeset
179 }else{
10451
92d4a25fd33c [gaim-migrate @ 11717]
Stu Tomlinson <stu@nosnilmot.com>
parents: 10403
diff changeset
180 const char *group_name;
19739
852b32710df0 [gaim-migrate @ 16507]
Ma Yuan <mayuan2006@gmail.com>
parents: 19738
diff changeset
181 group_name = msn_userlist_find_group_name(session->userlist,group_id);
10451
92d4a25fd33c [gaim-migrate @ 11717]
Stu Tomlinson <stu@nosnilmot.com>
parents: 10403
diff changeset
182 reason = g_strdup_printf(_("%s is not a valid group."),
92d4a25fd33c [gaim-migrate @ 11717]
Stu Tomlinson <stu@nosnilmot.com>
parents: 10403
diff changeset
183 group_name);
92d4a25fd33c [gaim-migrate @ 11717]
Stu Tomlinson <stu@nosnilmot.com>
parents: 10403
diff changeset
184 }
19739
852b32710df0 [gaim-migrate @ 16507]
Ma Yuan <mayuan2006@gmail.com>
parents: 19738
diff changeset
185 }else{
10451
92d4a25fd33c [gaim-migrate @ 11717]
Stu Tomlinson <stu@nosnilmot.com>
parents: 10403
diff changeset
186 reason = g_strdup(_("Unknown error."));
92d4a25fd33c [gaim-migrate @ 11717]
Stu Tomlinson <stu@nosnilmot.com>
parents: 10403
diff changeset
187 }
92d4a25fd33c [gaim-migrate @ 11717]
Stu Tomlinson <stu@nosnilmot.com>
parents: 10403
diff changeset
188
92d4a25fd33c [gaim-migrate @ 11717]
Stu Tomlinson <stu@nosnilmot.com>
parents: 10403
diff changeset
189 title = g_strdup_printf(_("%s on %s (%s)"), msg,
92d4a25fd33c [gaim-migrate @ 11717]
Stu Tomlinson <stu@nosnilmot.com>
parents: 10403
diff changeset
190 gaim_account_get_username(account),
92d4a25fd33c [gaim-migrate @ 11717]
Stu Tomlinson <stu@nosnilmot.com>
parents: 10403
diff changeset
191 gaim_account_get_protocol_name(account));
92d4a25fd33c [gaim-migrate @ 11717]
Stu Tomlinson <stu@nosnilmot.com>
parents: 10403
diff changeset
192 gaim_notify_error(gc, NULL, title, reason);
92d4a25fd33c [gaim-migrate @ 11717]
Stu Tomlinson <stu@nosnilmot.com>
parents: 10403
diff changeset
193 g_free(title);
92d4a25fd33c [gaim-migrate @ 11717]
Stu Tomlinson <stu@nosnilmot.com>
parents: 10403
diff changeset
194 g_free(reason);
92d4a25fd33c [gaim-migrate @ 11717]
Stu Tomlinson <stu@nosnilmot.com>
parents: 10403
diff changeset
195 }
92d4a25fd33c [gaim-migrate @ 11717]
Stu Tomlinson <stu@nosnilmot.com>
parents: 10403
diff changeset
196
92d4a25fd33c [gaim-migrate @ 11717]
Stu Tomlinson <stu@nosnilmot.com>
parents: 10403
diff changeset
197 /**************************************************************************
5309
e2e53316a21d [gaim-migrate @ 5681]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
198 * Login
e2e53316a21d [gaim-migrate @ 5681]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
199 **************************************************************************/
10481
bcfea6c3d5c9 [gaim-migrate @ 11769]
Stu Tomlinson <stu@nosnilmot.com>
parents: 10463
diff changeset
200
9193
502707ca1836 [gaim-migrate @ 9988]
Christian Hammond <chipx86@chipx86.com>
parents: 9158
diff changeset
201 void
502707ca1836 [gaim-migrate @ 9988]
Christian Hammond <chipx86@chipx86.com>
parents: 9158
diff changeset
202 msn_got_login_params(MsnSession *session, const char *login_params)
502707ca1836 [gaim-migrate @ 9988]
Christian Hammond <chipx86@chipx86.com>
parents: 9158
diff changeset
203 {
502707ca1836 [gaim-migrate @ 9988]
Christian Hammond <chipx86@chipx86.com>
parents: 9158
diff changeset
204 MsnCmdProc *cmdproc;
502707ca1836 [gaim-migrate @ 9988]
Christian Hammond <chipx86@chipx86.com>
parents: 9158
diff changeset
205
502707ca1836 [gaim-migrate @ 9988]
Christian Hammond <chipx86@chipx86.com>
parents: 9158
diff changeset
206 cmdproc = session->notification->cmdproc;
502707ca1836 [gaim-migrate @ 9988]
Christian Hammond <chipx86@chipx86.com>
parents: 9158
diff changeset
207
10519
bec9130b24d2 [gaim-migrate @ 11833]
Stu Tomlinson <stu@nosnilmot.com>
parents: 10514
diff changeset
208 msn_session_set_login_step(session, MSN_LOGIN_STEP_AUTH_END);
10481
bcfea6c3d5c9 [gaim-migrate @ 11769]
Stu Tomlinson <stu@nosnilmot.com>
parents: 10463
diff changeset
209
9193
502707ca1836 [gaim-migrate @ 9988]
Christian Hammond <chipx86@chipx86.com>
parents: 9158
diff changeset
210 msn_cmdproc_send(cmdproc, "USR", "TWN S %s", login_params);
502707ca1836 [gaim-migrate @ 9988]
Christian Hammond <chipx86@chipx86.com>
parents: 9158
diff changeset
211 }
502707ca1836 [gaim-migrate @ 9988]
Christian Hammond <chipx86@chipx86.com>
parents: 9158
diff changeset
212
8808
bbd8cdaf0ad5 [gaim-migrate @ 9570]
Christian Hammond <chipx86@chipx86.com>
parents: 8669
diff changeset
213 static void
bbd8cdaf0ad5 [gaim-migrate @ 9570]
Christian Hammond <chipx86@chipx86.com>
parents: 8669
diff changeset
214 cvr_cmd(MsnCmdProc *cmdproc, MsnCommand *cmd)
5309
e2e53316a21d [gaim-migrate @ 5681]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
215 {
8808
bbd8cdaf0ad5 [gaim-migrate @ 9570]
Christian Hammond <chipx86@chipx86.com>
parents: 8669
diff changeset
216 GaimAccount *account;
5309
e2e53316a21d [gaim-migrate @ 5681]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
217
8808
bbd8cdaf0ad5 [gaim-migrate @ 9570]
Christian Hammond <chipx86@chipx86.com>
parents: 8669
diff changeset
218 account = cmdproc->session->account;
bbd8cdaf0ad5 [gaim-migrate @ 9570]
Christian Hammond <chipx86@chipx86.com>
parents: 8669
diff changeset
219 msn_cmdproc_send(cmdproc, "USR", "TWN I %s",
bbd8cdaf0ad5 [gaim-migrate @ 9570]
Christian Hammond <chipx86@chipx86.com>
parents: 8669
diff changeset
220 gaim_account_get_username(account));
5309
e2e53316a21d [gaim-migrate @ 5681]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
221 }
e2e53316a21d [gaim-migrate @ 5681]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
222
8808
bbd8cdaf0ad5 [gaim-migrate @ 9570]
Christian Hammond <chipx86@chipx86.com>
parents: 8669
diff changeset
223 static void
bbd8cdaf0ad5 [gaim-migrate @ 9570]
Christian Hammond <chipx86@chipx86.com>
parents: 8669
diff changeset
224 usr_cmd(MsnCmdProc *cmdproc, MsnCommand *cmd)
5309
e2e53316a21d [gaim-migrate @ 5681]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
225 {
8808
bbd8cdaf0ad5 [gaim-migrate @ 9570]
Christian Hammond <chipx86@chipx86.com>
parents: 8669
diff changeset
226 MsnSession *session;
bbd8cdaf0ad5 [gaim-migrate @ 9570]
Christian Hammond <chipx86@chipx86.com>
parents: 8669
diff changeset
227 GaimAccount *account;
bbd8cdaf0ad5 [gaim-migrate @ 9570]
Christian Hammond <chipx86@chipx86.com>
parents: 8669
diff changeset
228 GaimConnection *gc;
5309
e2e53316a21d [gaim-migrate @ 5681]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
229
8808
bbd8cdaf0ad5 [gaim-migrate @ 9570]
Christian Hammond <chipx86@chipx86.com>
parents: 8669
diff changeset
230 session = cmdproc->session;
bbd8cdaf0ad5 [gaim-migrate @ 9570]
Christian Hammond <chipx86@chipx86.com>
parents: 8669
diff changeset
231 account = session->account;
bbd8cdaf0ad5 [gaim-migrate @ 9570]
Christian Hammond <chipx86@chipx86.com>
parents: 8669
diff changeset
232 gc = gaim_account_get_connection(account);
bbd8cdaf0ad5 [gaim-migrate @ 9570]
Christian Hammond <chipx86@chipx86.com>
parents: 8669
diff changeset
233
19737
995aea35b05c [gaim-migrate @ 16329]
Ma Yuan <mayuan2006@gmail.com>
parents: 13711
diff changeset
234 if (!g_ascii_strcasecmp(cmd->params[1], "OK")){
995aea35b05c [gaim-migrate @ 16329]
Ma Yuan <mayuan2006@gmail.com>
parents: 13711
diff changeset
235 /* authenticate OK */
8808
bbd8cdaf0ad5 [gaim-migrate @ 9570]
Christian Hammond <chipx86@chipx86.com>
parents: 8669
diff changeset
236 const char *friendly = gaim_url_decode(cmd->params[3]);
5508
2a57266df5f6 [gaim-migrate @ 5907]
Christian Hammond <chipx86@chipx86.com>
parents: 5506
diff changeset
237
5566
9896e9068bc4 [gaim-migrate @ 5968]
Christian Hammond <chipx86@chipx86.com>
parents: 5564
diff changeset
238 gaim_connection_set_display_name(gc, friendly);
5508
2a57266df5f6 [gaim-migrate @ 5907]
Christian Hammond <chipx86@chipx86.com>
parents: 5506
diff changeset
239
10519
bec9130b24d2 [gaim-migrate @ 11833]
Stu Tomlinson <stu@nosnilmot.com>
parents: 10514
diff changeset
240 msn_session_set_login_step(session, MSN_LOGIN_STEP_SYN);
5309
e2e53316a21d [gaim-migrate @ 5681]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
241
19738
bc30c6270d9f [gaim-migrate @ 16473]
Ma Yuan <mayuan2006@gmail.com>
parents: 19737
diff changeset
242 // msn_cmdproc_send(cmdproc, "SYN", "%s", "0");
bc30c6270d9f [gaim-migrate @ 16473]
Ma Yuan <mayuan2006@gmail.com>
parents: 19737
diff changeset
243 //TODO we should use SOAP contact to fetch contact list
19737
995aea35b05c [gaim-migrate @ 16329]
Ma Yuan <mayuan2006@gmail.com>
parents: 13711
diff changeset
244 }else if (!g_ascii_strcasecmp(cmd->params[1], "TWN")){
10481
bcfea6c3d5c9 [gaim-migrate @ 11769]
Stu Tomlinson <stu@nosnilmot.com>
parents: 10463
diff changeset
245 /* Passport authentication */
8171
d0ba2f7b40e7 [gaim-migrate @ 8884]
Christian Hammond <chipx86@chipx86.com>
parents: 8029
diff changeset
246 char **elems, **cur, **tokens;
6701
b7e113a59b51 [gaim-migrate @ 7227]
Christian Hammond <chipx86@chipx86.com>
parents: 6695
diff changeset
247
8171
d0ba2f7b40e7 [gaim-migrate @ 8884]
Christian Hammond <chipx86@chipx86.com>
parents: 8029
diff changeset
248 session->nexus = msn_nexus_new(session);
6701
b7e113a59b51 [gaim-migrate @ 7227]
Christian Hammond <chipx86@chipx86.com>
parents: 6695
diff changeset
249
b7e113a59b51 [gaim-migrate @ 7227]
Christian Hammond <chipx86@chipx86.com>
parents: 6695
diff changeset
250 /* Parse the challenge data. */
9193
502707ca1836 [gaim-migrate @ 9988]
Christian Hammond <chipx86@chipx86.com>
parents: 9158
diff changeset
251
8808
bbd8cdaf0ad5 [gaim-migrate @ 9570]
Christian Hammond <chipx86@chipx86.com>
parents: 8669
diff changeset
252 elems = g_strsplit(cmd->params[3], ",", 0);
6701
b7e113a59b51 [gaim-migrate @ 7227]
Christian Hammond <chipx86@chipx86.com>
parents: 6695
diff changeset
253
19737
995aea35b05c [gaim-migrate @ 16329]
Ma Yuan <mayuan2006@gmail.com>
parents: 13711
diff changeset
254 for (cur = elems; *cur != NULL; cur++){
19740
23258253c7a0 [gaim-migrate @ 16546]
Ma Yuan <mayuan2006@gmail.com>
parents: 19739
diff changeset
255 tokens = g_strsplit(*cur, "=", 2);
23258253c7a0 [gaim-migrate @ 16546]
Ma Yuan <mayuan2006@gmail.com>
parents: 19739
diff changeset
256 // gaim_debug_info("MaYuan","challenge %p,key:%s,value:%s\n",
23258253c7a0 [gaim-migrate @ 16546]
Ma Yuan <mayuan2006@gmail.com>
parents: 19739
diff changeset
257 // session->nexus->challenge_data,tokens[0],tokens[1]);
23258253c7a0 [gaim-migrate @ 16546]
Ma Yuan <mayuan2006@gmail.com>
parents: 19739
diff changeset
258 if(tokens[0]&&tokens[1])
8171
d0ba2f7b40e7 [gaim-migrate @ 8884]
Christian Hammond <chipx86@chipx86.com>
parents: 8029
diff changeset
259 g_hash_table_insert(session->nexus->challenge_data, tokens[0], tokens[1]);
19740
23258253c7a0 [gaim-migrate @ 16546]
Ma Yuan <mayuan2006@gmail.com>
parents: 19739
diff changeset
260 /* Don't free each of the tokens, only the array. */
23258253c7a0 [gaim-migrate @ 16546]
Ma Yuan <mayuan2006@gmail.com>
parents: 19739
diff changeset
261 g_free(tokens);
6701
b7e113a59b51 [gaim-migrate @ 7227]
Christian Hammond <chipx86@chipx86.com>
parents: 6695
diff changeset
262 }
b7e113a59b51 [gaim-migrate @ 7227]
Christian Hammond <chipx86@chipx86.com>
parents: 6695
diff changeset
263
8171
d0ba2f7b40e7 [gaim-migrate @ 8884]
Christian Hammond <chipx86@chipx86.com>
parents: 8029
diff changeset
264 g_strfreev(elems);
6701
b7e113a59b51 [gaim-migrate @ 7227]
Christian Hammond <chipx86@chipx86.com>
parents: 6695
diff changeset
265
10519
bec9130b24d2 [gaim-migrate @ 11833]
Stu Tomlinson <stu@nosnilmot.com>
parents: 10514
diff changeset
266 msn_session_set_login_step(session, MSN_LOGIN_STEP_AUTH_START);
5309
e2e53316a21d [gaim-migrate @ 5681]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
267
10481
bcfea6c3d5c9 [gaim-migrate @ 11769]
Stu Tomlinson <stu@nosnilmot.com>
parents: 10463
diff changeset
268 msn_nexus_connect(session->nexus);
5309
e2e53316a21d [gaim-migrate @ 5681]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
269 }
e2e53316a21d [gaim-migrate @ 5681]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
270 }
e2e53316a21d [gaim-migrate @ 5681]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
271
8808
bbd8cdaf0ad5 [gaim-migrate @ 9570]
Christian Hammond <chipx86@chipx86.com>
parents: 8669
diff changeset
272 static void
10568
fed2a7c2471d [gaim-migrate @ 11954]
Stu Tomlinson <stu@nosnilmot.com>
parents: 10519
diff changeset
273 usr_error(MsnCmdProc *cmdproc, MsnTransaction *trans, int error)
fed2a7c2471d [gaim-migrate @ 11954]
Stu Tomlinson <stu@nosnilmot.com>
parents: 10519
diff changeset
274 {
fed2a7c2471d [gaim-migrate @ 11954]
Stu Tomlinson <stu@nosnilmot.com>
parents: 10519
diff changeset
275 MsnErrorType msnerr = 0;
fed2a7c2471d [gaim-migrate @ 11954]
Stu Tomlinson <stu@nosnilmot.com>
parents: 10519
diff changeset
276
fed2a7c2471d [gaim-migrate @ 11954]
Stu Tomlinson <stu@nosnilmot.com>
parents: 10519
diff changeset
277 switch (error)
fed2a7c2471d [gaim-migrate @ 11954]
Stu Tomlinson <stu@nosnilmot.com>
parents: 10519
diff changeset
278 {
fed2a7c2471d [gaim-migrate @ 11954]
Stu Tomlinson <stu@nosnilmot.com>
parents: 10519
diff changeset
279 case 500:
fed2a7c2471d [gaim-migrate @ 11954]
Stu Tomlinson <stu@nosnilmot.com>
parents: 10519
diff changeset
280 case 601:
fed2a7c2471d [gaim-migrate @ 11954]
Stu Tomlinson <stu@nosnilmot.com>
parents: 10519
diff changeset
281 case 910:
fed2a7c2471d [gaim-migrate @ 11954]
Stu Tomlinson <stu@nosnilmot.com>
parents: 10519
diff changeset
282 case 921:
fed2a7c2471d [gaim-migrate @ 11954]
Stu Tomlinson <stu@nosnilmot.com>
parents: 10519
diff changeset
283 msnerr = MSN_ERROR_SERV_UNAVAILABLE;
fed2a7c2471d [gaim-migrate @ 11954]
Stu Tomlinson <stu@nosnilmot.com>
parents: 10519
diff changeset
284 break;
fed2a7c2471d [gaim-migrate @ 11954]
Stu Tomlinson <stu@nosnilmot.com>
parents: 10519
diff changeset
285 case 911:
fed2a7c2471d [gaim-migrate @ 11954]
Stu Tomlinson <stu@nosnilmot.com>
parents: 10519
diff changeset
286 msnerr = MSN_ERROR_AUTH;
fed2a7c2471d [gaim-migrate @ 11954]
Stu Tomlinson <stu@nosnilmot.com>
parents: 10519
diff changeset
287 break;
fed2a7c2471d [gaim-migrate @ 11954]
Stu Tomlinson <stu@nosnilmot.com>
parents: 10519
diff changeset
288 default:
fed2a7c2471d [gaim-migrate @ 11954]
Stu Tomlinson <stu@nosnilmot.com>
parents: 10519
diff changeset
289 return;
fed2a7c2471d [gaim-migrate @ 11954]
Stu Tomlinson <stu@nosnilmot.com>
parents: 10519
diff changeset
290 break;
fed2a7c2471d [gaim-migrate @ 11954]
Stu Tomlinson <stu@nosnilmot.com>
parents: 10519
diff changeset
291 }
fed2a7c2471d [gaim-migrate @ 11954]
Stu Tomlinson <stu@nosnilmot.com>
parents: 10519
diff changeset
292
fed2a7c2471d [gaim-migrate @ 11954]
Stu Tomlinson <stu@nosnilmot.com>
parents: 10519
diff changeset
293 msn_session_set_error(cmdproc->session, msnerr, NULL);
fed2a7c2471d [gaim-migrate @ 11954]
Stu Tomlinson <stu@nosnilmot.com>
parents: 10519
diff changeset
294 }
fed2a7c2471d [gaim-migrate @ 11954]
Stu Tomlinson <stu@nosnilmot.com>
parents: 10519
diff changeset
295
fed2a7c2471d [gaim-migrate @ 11954]
Stu Tomlinson <stu@nosnilmot.com>
parents: 10519
diff changeset
296 static void
8808
bbd8cdaf0ad5 [gaim-migrate @ 9570]
Christian Hammond <chipx86@chipx86.com>
parents: 8669
diff changeset
297 ver_cmd(MsnCmdProc *cmdproc, MsnCommand *cmd)
6701
b7e113a59b51 [gaim-migrate @ 7227]
Christian Hammond <chipx86@chipx86.com>
parents: 6695
diff changeset
298 {
8808
bbd8cdaf0ad5 [gaim-migrate @ 9570]
Christian Hammond <chipx86@chipx86.com>
parents: 8669
diff changeset
299 MsnSession *session;
bbd8cdaf0ad5 [gaim-migrate @ 9570]
Christian Hammond <chipx86@chipx86.com>
parents: 8669
diff changeset
300 GaimAccount *account;
6701
b7e113a59b51 [gaim-migrate @ 7227]
Christian Hammond <chipx86@chipx86.com>
parents: 6695
diff changeset
301 gboolean protocol_supported = FALSE;
b7e113a59b51 [gaim-migrate @ 7227]
Christian Hammond <chipx86@chipx86.com>
parents: 6695
diff changeset
302 char proto_str[8];
b7e113a59b51 [gaim-migrate @ 7227]
Christian Hammond <chipx86@chipx86.com>
parents: 6695
diff changeset
303 size_t i;
b7e113a59b51 [gaim-migrate @ 7227]
Christian Hammond <chipx86@chipx86.com>
parents: 6695
diff changeset
304
8808
bbd8cdaf0ad5 [gaim-migrate @ 9570]
Christian Hammond <chipx86@chipx86.com>
parents: 8669
diff changeset
305 session = cmdproc->session;
bbd8cdaf0ad5 [gaim-migrate @ 9570]
Christian Hammond <chipx86@chipx86.com>
parents: 8669
diff changeset
306 account = session->account;
bbd8cdaf0ad5 [gaim-migrate @ 9570]
Christian Hammond <chipx86@chipx86.com>
parents: 8669
diff changeset
307
6701
b7e113a59b51 [gaim-migrate @ 7227]
Christian Hammond <chipx86@chipx86.com>
parents: 6695
diff changeset
308 g_snprintf(proto_str, sizeof(proto_str), "MSNP%d", session->protocol_ver);
b7e113a59b51 [gaim-migrate @ 7227]
Christian Hammond <chipx86@chipx86.com>
parents: 6695
diff changeset
309
19740
23258253c7a0 [gaim-migrate @ 16546]
Ma Yuan <mayuan2006@gmail.com>
parents: 19739
diff changeset
310 for (i = 1; i < cmd->param_count -1; i++){
19749
38e4a4b404e5 [gaim-migrate @ 16685]
Ma Yuan <mayuan2006@gmail.com>
parents: 19748
diff changeset
311 gaim_debug_info("MaYuan","%s,proto_str:%s\n",cmd->params[i],proto_str);
19740
23258253c7a0 [gaim-migrate @ 16546]
Ma Yuan <mayuan2006@gmail.com>
parents: 19739
diff changeset
312 if (strcmp(cmd->params[i], proto_str) >= 0) {
6701
b7e113a59b51 [gaim-migrate @ 7227]
Christian Hammond <chipx86@chipx86.com>
parents: 6695
diff changeset
313 protocol_supported = TRUE;
b7e113a59b51 [gaim-migrate @ 7227]
Christian Hammond <chipx86@chipx86.com>
parents: 6695
diff changeset
314 break;
b7e113a59b51 [gaim-migrate @ 7227]
Christian Hammond <chipx86@chipx86.com>
parents: 6695
diff changeset
315 }
b7e113a59b51 [gaim-migrate @ 7227]
Christian Hammond <chipx86@chipx86.com>
parents: 6695
diff changeset
316 }
b7e113a59b51 [gaim-migrate @ 7227]
Christian Hammond <chipx86@chipx86.com>
parents: 6695
diff changeset
317
19739
852b32710df0 [gaim-migrate @ 16507]
Ma Yuan <mayuan2006@gmail.com>
parents: 19738
diff changeset
318 if (!protocol_supported){
10519
bec9130b24d2 [gaim-migrate @ 11833]
Stu Tomlinson <stu@nosnilmot.com>
parents: 10514
diff changeset
319 msn_session_set_error(session, MSN_ERROR_UNSUPPORTED_PROTOCOL,
10481
bcfea6c3d5c9 [gaim-migrate @ 11769]
Stu Tomlinson <stu@nosnilmot.com>
parents: 10463
diff changeset
320 NULL);
8808
bbd8cdaf0ad5 [gaim-migrate @ 9570]
Christian Hammond <chipx86@chipx86.com>
parents: 8669
diff changeset
321 return;
6701
b7e113a59b51 [gaim-migrate @ 7227]
Christian Hammond <chipx86@chipx86.com>
parents: 6695
diff changeset
322 }
b7e113a59b51 [gaim-migrate @ 7227]
Christian Hammond <chipx86@chipx86.com>
parents: 6695
diff changeset
323
19737
995aea35b05c [gaim-migrate @ 16329]
Ma Yuan <mayuan2006@gmail.com>
parents: 13711
diff changeset
324 /*
995aea35b05c [gaim-migrate @ 16329]
Ma Yuan <mayuan2006@gmail.com>
parents: 13711
diff changeset
325 * Windows Live Messenger 8.0
995aea35b05c [gaim-migrate @ 16329]
Ma Yuan <mayuan2006@gmail.com>
parents: 13711
diff changeset
326 * Notice :CVR String discriminate!
19740
23258253c7a0 [gaim-migrate @ 16546]
Ma Yuan <mayuan2006@gmail.com>
parents: 19739
diff changeset
327 * reference of http://www.microsoft.com/globaldev/reference/oslocversion.mspx
23258253c7a0 [gaim-migrate @ 16546]
Ma Yuan <mayuan2006@gmail.com>
parents: 19739
diff changeset
328 * to see the Local ID
19737
995aea35b05c [gaim-migrate @ 16329]
Ma Yuan <mayuan2006@gmail.com>
parents: 13711
diff changeset
329 */
9193
502707ca1836 [gaim-migrate @ 9988]
Christian Hammond <chipx86@chipx86.com>
parents: 9158
diff changeset
330 msn_cmdproc_send(cmdproc, "CVR",
19739
852b32710df0 [gaim-migrate @ 16507]
Ma Yuan <mayuan2006@gmail.com>
parents: 19738
diff changeset
331 // "0x0409 winnt 5.1 i386 MSG80BETA 8.0.0689 msmsgs %s",
852b32710df0 [gaim-migrate @ 16507]
Ma Yuan <mayuan2006@gmail.com>
parents: 19738
diff changeset
332 "0x0804 winnt 5.1 i386 MSNMSGR 8.0.0792 msmsgs %s",
9193
502707ca1836 [gaim-migrate @ 9988]
Christian Hammond <chipx86@chipx86.com>
parents: 9158
diff changeset
333 gaim_account_get_username(account));
6701
b7e113a59b51 [gaim-migrate @ 7227]
Christian Hammond <chipx86@chipx86.com>
parents: 6695
diff changeset
334 }
b7e113a59b51 [gaim-migrate @ 7227]
Christian Hammond <chipx86@chipx86.com>
parents: 6695
diff changeset
335
5309
e2e53316a21d [gaim-migrate @ 5681]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
336 /**************************************************************************
e2e53316a21d [gaim-migrate @ 5681]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
337 * Log out
e2e53316a21d [gaim-migrate @ 5681]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
338 **************************************************************************/
10481
bcfea6c3d5c9 [gaim-migrate @ 11769]
Stu Tomlinson <stu@nosnilmot.com>
parents: 10463
diff changeset
339
8808
bbd8cdaf0ad5 [gaim-migrate @ 9570]
Christian Hammond <chipx86@chipx86.com>
parents: 8669
diff changeset
340 static void
bbd8cdaf0ad5 [gaim-migrate @ 9570]
Christian Hammond <chipx86@chipx86.com>
parents: 8669
diff changeset
341 out_cmd(MsnCmdProc *cmdproc, MsnCommand *cmd)
5309
e2e53316a21d [gaim-migrate @ 5681]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
342 {
8808
bbd8cdaf0ad5 [gaim-migrate @ 9570]
Christian Hammond <chipx86@chipx86.com>
parents: 8669
diff changeset
343 if (!g_ascii_strcasecmp(cmd->params[0], "OTH"))
10481
bcfea6c3d5c9 [gaim-migrate @ 11769]
Stu Tomlinson <stu@nosnilmot.com>
parents: 10463
diff changeset
344 msn_session_set_error(cmdproc->session, MSN_ERROR_SIGN_OTHER,
bcfea6c3d5c9 [gaim-migrate @ 11769]
Stu Tomlinson <stu@nosnilmot.com>
parents: 10463
diff changeset
345 NULL);
8808
bbd8cdaf0ad5 [gaim-migrate @ 9570]
Christian Hammond <chipx86@chipx86.com>
parents: 8669
diff changeset
346 else if (!g_ascii_strcasecmp(cmd->params[0], "SSD"))
10481
bcfea6c3d5c9 [gaim-migrate @ 11769]
Stu Tomlinson <stu@nosnilmot.com>
parents: 10463
diff changeset
347 msn_session_set_error(cmdproc->session, MSN_ERROR_SERV_DOWN, NULL);
5309
e2e53316a21d [gaim-migrate @ 5681]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
348 }
e2e53316a21d [gaim-migrate @ 5681]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
349
10463
9bed28273ec7 [gaim-migrate @ 11737]
Stu Tomlinson <stu@nosnilmot.com>
parents: 10452
diff changeset
350 void
9bed28273ec7 [gaim-migrate @ 11737]
Stu Tomlinson <stu@nosnilmot.com>
parents: 10452
diff changeset
351 msn_notification_close(MsnNotification *notification)
9bed28273ec7 [gaim-migrate @ 11737]
Stu Tomlinson <stu@nosnilmot.com>
parents: 10452
diff changeset
352 {
9bed28273ec7 [gaim-migrate @ 11737]
Stu Tomlinson <stu@nosnilmot.com>
parents: 10452
diff changeset
353 g_return_if_fail(notification != NULL);
9bed28273ec7 [gaim-migrate @ 11737]
Stu Tomlinson <stu@nosnilmot.com>
parents: 10452
diff changeset
354
10568
fed2a7c2471d [gaim-migrate @ 11954]
Stu Tomlinson <stu@nosnilmot.com>
parents: 10519
diff changeset
355 if (!notification->in_use)
fed2a7c2471d [gaim-migrate @ 11954]
Stu Tomlinson <stu@nosnilmot.com>
parents: 10519
diff changeset
356 return;
fed2a7c2471d [gaim-migrate @ 11954]
Stu Tomlinson <stu@nosnilmot.com>
parents: 10519
diff changeset
357
10463
9bed28273ec7 [gaim-migrate @ 11737]
Stu Tomlinson <stu@nosnilmot.com>
parents: 10452
diff changeset
358 msn_cmdproc_send_quick(notification->cmdproc, "OUT", NULL, NULL);
9bed28273ec7 [gaim-migrate @ 11737]
Stu Tomlinson <stu@nosnilmot.com>
parents: 10452
diff changeset
359
9bed28273ec7 [gaim-migrate @ 11737]
Stu Tomlinson <stu@nosnilmot.com>
parents: 10452
diff changeset
360 msn_notification_disconnect(notification);
9bed28273ec7 [gaim-migrate @ 11737]
Stu Tomlinson <stu@nosnilmot.com>
parents: 10452
diff changeset
361 }
9bed28273ec7 [gaim-migrate @ 11737]
Stu Tomlinson <stu@nosnilmot.com>
parents: 10452
diff changeset
362
5309
e2e53316a21d [gaim-migrate @ 5681]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
363 /**************************************************************************
e2e53316a21d [gaim-migrate @ 5681]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
364 * Messages
e2e53316a21d [gaim-migrate @ 5681]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
365 **************************************************************************/
10481
bcfea6c3d5c9 [gaim-migrate @ 11769]
Stu Tomlinson <stu@nosnilmot.com>
parents: 10463
diff changeset
366
8646
1e211dde3cae [gaim-migrate @ 9398]
Christian Hammond <chipx86@chipx86.com>
parents: 8614
diff changeset
367 static void
9193
502707ca1836 [gaim-migrate @ 9988]
Christian Hammond <chipx86@chipx86.com>
parents: 9158
diff changeset
368 msg_cmd_post(MsnCmdProc *cmdproc, MsnCommand *cmd, char *payload,
502707ca1836 [gaim-migrate @ 9988]
Christian Hammond <chipx86@chipx86.com>
parents: 9158
diff changeset
369 size_t len)
8646
1e211dde3cae [gaim-migrate @ 9398]
Christian Hammond <chipx86@chipx86.com>
parents: 8614
diff changeset
370 {
8808
bbd8cdaf0ad5 [gaim-migrate @ 9570]
Christian Hammond <chipx86@chipx86.com>
parents: 8669
diff changeset
371 MsnMessage *msg;
8646
1e211dde3cae [gaim-migrate @ 9398]
Christian Hammond <chipx86@chipx86.com>
parents: 8614
diff changeset
372
9193
502707ca1836 [gaim-migrate @ 9988]
Christian Hammond <chipx86@chipx86.com>
parents: 9158
diff changeset
373 msg = msn_message_new_from_cmd(cmdproc->session, cmd);
8646
1e211dde3cae [gaim-migrate @ 9398]
Christian Hammond <chipx86@chipx86.com>
parents: 8614
diff changeset
374
1e211dde3cae [gaim-migrate @ 9398]
Christian Hammond <chipx86@chipx86.com>
parents: 8614
diff changeset
375 msn_message_parse_payload(msg, payload, len);
11321
95fa774d216d [gaim-migrate @ 13525]
Stu Tomlinson <stu@nosnilmot.com>
parents: 11183
diff changeset
376 #ifdef MSN_DEBUG_NS
95fa774d216d [gaim-migrate @ 13525]
Stu Tomlinson <stu@nosnilmot.com>
parents: 11183
diff changeset
377 msn_message_show_readable(msg, "Notification", TRUE);
95fa774d216d [gaim-migrate @ 13525]
Stu Tomlinson <stu@nosnilmot.com>
parents: 11183
diff changeset
378 #endif
8646
1e211dde3cae [gaim-migrate @ 9398]
Christian Hammond <chipx86@chipx86.com>
parents: 8614
diff changeset
379
8808
bbd8cdaf0ad5 [gaim-migrate @ 9570]
Christian Hammond <chipx86@chipx86.com>
parents: 8669
diff changeset
380 msn_cmdproc_process_msg(cmdproc, msg);
8646
1e211dde3cae [gaim-migrate @ 9398]
Christian Hammond <chipx86@chipx86.com>
parents: 8614
diff changeset
381
1e211dde3cae [gaim-migrate @ 9398]
Christian Hammond <chipx86@chipx86.com>
parents: 8614
diff changeset
382 msn_message_destroy(msg);
1e211dde3cae [gaim-migrate @ 9398]
Christian Hammond <chipx86@chipx86.com>
parents: 8614
diff changeset
383 }
1e211dde3cae [gaim-migrate @ 9398]
Christian Hammond <chipx86@chipx86.com>
parents: 8614
diff changeset
384
8808
bbd8cdaf0ad5 [gaim-migrate @ 9570]
Christian Hammond <chipx86@chipx86.com>
parents: 8669
diff changeset
385 static void
bbd8cdaf0ad5 [gaim-migrate @ 9570]
Christian Hammond <chipx86@chipx86.com>
parents: 8669
diff changeset
386 msg_cmd(MsnCmdProc *cmdproc, MsnCommand *cmd)
5309
e2e53316a21d [gaim-migrate @ 5681]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
387 {
19737
995aea35b05c [gaim-migrate @ 16329]
Ma Yuan <mayuan2006@gmail.com>
parents: 13711
diff changeset
388 gaim_debug_info("MaYuan","Processing MSG... \n");
995aea35b05c [gaim-migrate @ 16329]
Ma Yuan <mayuan2006@gmail.com>
parents: 13711
diff changeset
389 if(cmd->payload_len == 0){
995aea35b05c [gaim-migrate @ 16329]
Ma Yuan <mayuan2006@gmail.com>
parents: 13711
diff changeset
390 return;
995aea35b05c [gaim-migrate @ 16329]
Ma Yuan <mayuan2006@gmail.com>
parents: 13711
diff changeset
391 }
9193
502707ca1836 [gaim-migrate @ 9988]
Christian Hammond <chipx86@chipx86.com>
parents: 9158
diff changeset
392 /* NOTE: cmd is not always cmdproc->last_cmd, sometimes cmd is a queued
502707ca1836 [gaim-migrate @ 9988]
Christian Hammond <chipx86@chipx86.com>
parents: 9158
diff changeset
393 * command and we are processing it */
19737
995aea35b05c [gaim-migrate @ 16329]
Ma Yuan <mayuan2006@gmail.com>
parents: 13711
diff changeset
394 if (cmd->payload == NULL){
9193
502707ca1836 [gaim-migrate @ 9988]
Christian Hammond <chipx86@chipx86.com>
parents: 9158
diff changeset
395 cmdproc->last_cmd->payload_cb = msg_cmd_post;
502707ca1836 [gaim-migrate @ 9988]
Christian Hammond <chipx86@chipx86.com>
parents: 9158
diff changeset
396 cmdproc->servconn->payload_len = atoi(cmd->params[2]);
19737
995aea35b05c [gaim-migrate @ 16329]
Ma Yuan <mayuan2006@gmail.com>
parents: 13711
diff changeset
397 }else{
9193
502707ca1836 [gaim-migrate @ 9988]
Christian Hammond <chipx86@chipx86.com>
parents: 9158
diff changeset
398 g_return_if_fail(cmd->payload_cb != NULL);
502707ca1836 [gaim-migrate @ 9988]
Christian Hammond <chipx86@chipx86.com>
parents: 9158
diff changeset
399
19742
8b4653986e8e [gaim-migrate @ 16600]
Ma Yuan <mayuan2006@gmail.com>
parents: 19741
diff changeset
400 gaim_debug_info("MaYuan","MSG payload:{%s}\n",cmd->payload);
9193
502707ca1836 [gaim-migrate @ 9988]
Christian Hammond <chipx86@chipx86.com>
parents: 9158
diff changeset
401 cmd->payload_cb(cmdproc, cmd, cmd->payload, cmd->payload_len);
502707ca1836 [gaim-migrate @ 9988]
Christian Hammond <chipx86@chipx86.com>
parents: 9158
diff changeset
402 }
5309
e2e53316a21d [gaim-migrate @ 5681]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
403 }
e2e53316a21d [gaim-migrate @ 5681]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
404
19754
da3f8f7ec3ce [gaim-migrate @ 16737]
Ma Yuan <mayuan2006@gmail.com>
parents: 19753
diff changeset
405 /*send Message to Yahoo Messenger*/
da3f8f7ec3ce [gaim-migrate @ 16737]
Ma Yuan <mayuan2006@gmail.com>
parents: 19753
diff changeset
406 void
da3f8f7ec3ce [gaim-migrate @ 16737]
Ma Yuan <mayuan2006@gmail.com>
parents: 19753
diff changeset
407 uum_send_msg(MsnSession *session,MsnMessage *msg)
da3f8f7ec3ce [gaim-migrate @ 16737]
Ma Yuan <mayuan2006@gmail.com>
parents: 19753
diff changeset
408 {
da3f8f7ec3ce [gaim-migrate @ 16737]
Ma Yuan <mayuan2006@gmail.com>
parents: 19753
diff changeset
409 MsnCmdProc *cmdproc;
da3f8f7ec3ce [gaim-migrate @ 16737]
Ma Yuan <mayuan2006@gmail.com>
parents: 19753
diff changeset
410 MsnTransaction *trans;
da3f8f7ec3ce [gaim-migrate @ 16737]
Ma Yuan <mayuan2006@gmail.com>
parents: 19753
diff changeset
411 char *payload;
da3f8f7ec3ce [gaim-migrate @ 16737]
Ma Yuan <mayuan2006@gmail.com>
parents: 19753
diff changeset
412 gsize payload_len;
da3f8f7ec3ce [gaim-migrate @ 16737]
Ma Yuan <mayuan2006@gmail.com>
parents: 19753
diff changeset
413 int type;
da3f8f7ec3ce [gaim-migrate @ 16737]
Ma Yuan <mayuan2006@gmail.com>
parents: 19753
diff changeset
414
da3f8f7ec3ce [gaim-migrate @ 16737]
Ma Yuan <mayuan2006@gmail.com>
parents: 19753
diff changeset
415 cmdproc = session->notification->cmdproc;
da3f8f7ec3ce [gaim-migrate @ 16737]
Ma Yuan <mayuan2006@gmail.com>
parents: 19753
diff changeset
416 g_return_if_fail(msg != NULL);
da3f8f7ec3ce [gaim-migrate @ 16737]
Ma Yuan <mayuan2006@gmail.com>
parents: 19753
diff changeset
417 payload = msn_message_gen_payload(msg, &payload_len);
da3f8f7ec3ce [gaim-migrate @ 16737]
Ma Yuan <mayuan2006@gmail.com>
parents: 19753
diff changeset
418 gaim_debug_info("MaYuan","send UUM,payload{%s}\n",payload);
da3f8f7ec3ce [gaim-migrate @ 16737]
Ma Yuan <mayuan2006@gmail.com>
parents: 19753
diff changeset
419 type = msg->type;
da3f8f7ec3ce [gaim-migrate @ 16737]
Ma Yuan <mayuan2006@gmail.com>
parents: 19753
diff changeset
420 trans = msn_transaction_new(cmdproc, "UUM","%s 32 %d %d",msg->remote_user,type,strlen(payload));
da3f8f7ec3ce [gaim-migrate @ 16737]
Ma Yuan <mayuan2006@gmail.com>
parents: 19753
diff changeset
421 msn_transaction_set_payload(trans, payload, strlen(payload));
da3f8f7ec3ce [gaim-migrate @ 16737]
Ma Yuan <mayuan2006@gmail.com>
parents: 19753
diff changeset
422 msn_cmdproc_send_trans(cmdproc, trans);
da3f8f7ec3ce [gaim-migrate @ 16737]
Ma Yuan <mayuan2006@gmail.com>
parents: 19753
diff changeset
423 }
da3f8f7ec3ce [gaim-migrate @ 16737]
Ma Yuan <mayuan2006@gmail.com>
parents: 19753
diff changeset
424
da3f8f7ec3ce [gaim-migrate @ 16737]
Ma Yuan <mayuan2006@gmail.com>
parents: 19753
diff changeset
425 static void
da3f8f7ec3ce [gaim-migrate @ 16737]
Ma Yuan <mayuan2006@gmail.com>
parents: 19753
diff changeset
426 ubm_cmd_post(MsnCmdProc *cmdproc, MsnCommand *cmd, char *payload,
da3f8f7ec3ce [gaim-migrate @ 16737]
Ma Yuan <mayuan2006@gmail.com>
parents: 19753
diff changeset
427 size_t len)
da3f8f7ec3ce [gaim-migrate @ 16737]
Ma Yuan <mayuan2006@gmail.com>
parents: 19753
diff changeset
428 {
da3f8f7ec3ce [gaim-migrate @ 16737]
Ma Yuan <mayuan2006@gmail.com>
parents: 19753
diff changeset
429 MsnMessage *msg;
da3f8f7ec3ce [gaim-migrate @ 16737]
Ma Yuan <mayuan2006@gmail.com>
parents: 19753
diff changeset
430 GaimConnection *gc;
19755
90f89601d6d3 [gaim-migrate @ 16758]
Ma Yuan <mayuan2006@gmail.com>
parents: 19754
diff changeset
431 const char *passport;
90f89601d6d3 [gaim-migrate @ 16758]
Ma Yuan <mayuan2006@gmail.com>
parents: 19754
diff changeset
432 const char *content_type;
19754
da3f8f7ec3ce [gaim-migrate @ 16737]
Ma Yuan <mayuan2006@gmail.com>
parents: 19753
diff changeset
433
da3f8f7ec3ce [gaim-migrate @ 16737]
Ma Yuan <mayuan2006@gmail.com>
parents: 19753
diff changeset
434 gaim_debug_info("MaYuan","Process UBM payload:%s\n",payload);
da3f8f7ec3ce [gaim-migrate @ 16737]
Ma Yuan <mayuan2006@gmail.com>
parents: 19753
diff changeset
435 msg = msn_message_new_from_cmd(cmdproc->session, cmd);
da3f8f7ec3ce [gaim-migrate @ 16737]
Ma Yuan <mayuan2006@gmail.com>
parents: 19753
diff changeset
436
da3f8f7ec3ce [gaim-migrate @ 16737]
Ma Yuan <mayuan2006@gmail.com>
parents: 19753
diff changeset
437 msn_message_parse_payload(msg, payload, len);
da3f8f7ec3ce [gaim-migrate @ 16737]
Ma Yuan <mayuan2006@gmail.com>
parents: 19753
diff changeset
438 #ifdef MSN_DEBUG_NS
da3f8f7ec3ce [gaim-migrate @ 16737]
Ma Yuan <mayuan2006@gmail.com>
parents: 19753
diff changeset
439 msn_message_show_readable(msg, "Notification", TRUE);
da3f8f7ec3ce [gaim-migrate @ 16737]
Ma Yuan <mayuan2006@gmail.com>
parents: 19753
diff changeset
440 #endif
da3f8f7ec3ce [gaim-migrate @ 16737]
Ma Yuan <mayuan2006@gmail.com>
parents: 19753
diff changeset
441
19755
90f89601d6d3 [gaim-migrate @ 16758]
Ma Yuan <mayuan2006@gmail.com>
parents: 19754
diff changeset
442 gc = cmdproc->session->account->gc;
90f89601d6d3 [gaim-migrate @ 16758]
Ma Yuan <mayuan2006@gmail.com>
parents: 19754
diff changeset
443 passport = msg->remote_user;
90f89601d6d3 [gaim-migrate @ 16758]
Ma Yuan <mayuan2006@gmail.com>
parents: 19754
diff changeset
444
90f89601d6d3 [gaim-migrate @ 16758]
Ma Yuan <mayuan2006@gmail.com>
parents: 19754
diff changeset
445 content_type = msn_message_get_content_type(msg);
90f89601d6d3 [gaim-migrate @ 16758]
Ma Yuan <mayuan2006@gmail.com>
parents: 19754
diff changeset
446 gaim_debug_info("MaYuan","type:%d\n",content_type);
90f89601d6d3 [gaim-migrate @ 16758]
Ma Yuan <mayuan2006@gmail.com>
parents: 19754
diff changeset
447 if(!strcmp(content_type,"text/plain")){
19754
da3f8f7ec3ce [gaim-migrate @ 16737]
Ma Yuan <mayuan2006@gmail.com>
parents: 19753
diff changeset
448 const char *value;
da3f8f7ec3ce [gaim-migrate @ 16737]
Ma Yuan <mayuan2006@gmail.com>
parents: 19753
diff changeset
449 const char *body;
da3f8f7ec3ce [gaim-migrate @ 16737]
Ma Yuan <mayuan2006@gmail.com>
parents: 19753
diff changeset
450 char *body_str;
da3f8f7ec3ce [gaim-migrate @ 16737]
Ma Yuan <mayuan2006@gmail.com>
parents: 19753
diff changeset
451 char *body_enc;
19757
2315ee828b7c [gaim-migrate @ 16772]
Ma Yuan <mayuan2006@gmail.com>
parents: 19755
diff changeset
452 char *body_final = NULL;
19754
da3f8f7ec3ce [gaim-migrate @ 16737]
Ma Yuan <mayuan2006@gmail.com>
parents: 19753
diff changeset
453 size_t body_len;
da3f8f7ec3ce [gaim-migrate @ 16737]
Ma Yuan <mayuan2006@gmail.com>
parents: 19753
diff changeset
454
da3f8f7ec3ce [gaim-migrate @ 16737]
Ma Yuan <mayuan2006@gmail.com>
parents: 19753
diff changeset
455 body = msn_message_get_bin_data(msg, &body_len);
da3f8f7ec3ce [gaim-migrate @ 16737]
Ma Yuan <mayuan2006@gmail.com>
parents: 19753
diff changeset
456 body_str = g_strndup(body, body_len);
da3f8f7ec3ce [gaim-migrate @ 16737]
Ma Yuan <mayuan2006@gmail.com>
parents: 19753
diff changeset
457 body_enc = g_markup_escape_text(body_str, -1);
da3f8f7ec3ce [gaim-migrate @ 16737]
Ma Yuan <mayuan2006@gmail.com>
parents: 19753
diff changeset
458 g_free(body_str);
da3f8f7ec3ce [gaim-migrate @ 16737]
Ma Yuan <mayuan2006@gmail.com>
parents: 19753
diff changeset
459
19755
90f89601d6d3 [gaim-migrate @ 16758]
Ma Yuan <mayuan2006@gmail.com>
parents: 19754
diff changeset
460 if ((value = msn_message_get_attr(msg, "X-MMS-IM-Format")) != NULL) {
90f89601d6d3 [gaim-migrate @ 16758]
Ma Yuan <mayuan2006@gmail.com>
parents: 19754
diff changeset
461 char *pre, *post;
19754
da3f8f7ec3ce [gaim-migrate @ 16737]
Ma Yuan <mayuan2006@gmail.com>
parents: 19753
diff changeset
462
19755
90f89601d6d3 [gaim-migrate @ 16758]
Ma Yuan <mayuan2006@gmail.com>
parents: 19754
diff changeset
463 msn_parse_format(value, &pre, &post);
90f89601d6d3 [gaim-migrate @ 16758]
Ma Yuan <mayuan2006@gmail.com>
parents: 19754
diff changeset
464 body_final = g_strdup_printf("%s%s%s", pre ? pre : "",
90f89601d6d3 [gaim-migrate @ 16758]
Ma Yuan <mayuan2006@gmail.com>
parents: 19754
diff changeset
465 body_enc ? body_enc : "", post ? post : "");
90f89601d6d3 [gaim-migrate @ 16758]
Ma Yuan <mayuan2006@gmail.com>
parents: 19754
diff changeset
466 g_free(pre);
90f89601d6d3 [gaim-migrate @ 16758]
Ma Yuan <mayuan2006@gmail.com>
parents: 19754
diff changeset
467 g_free(post);
90f89601d6d3 [gaim-migrate @ 16758]
Ma Yuan <mayuan2006@gmail.com>
parents: 19754
diff changeset
468 g_free(body_enc);
19754
da3f8f7ec3ce [gaim-migrate @ 16737]
Ma Yuan <mayuan2006@gmail.com>
parents: 19753
diff changeset
469 }
da3f8f7ec3ce [gaim-migrate @ 16737]
Ma Yuan <mayuan2006@gmail.com>
parents: 19753
diff changeset
470 serv_got_im(gc, passport, body_final, 0, time(NULL));
da3f8f7ec3ce [gaim-migrate @ 16737]
Ma Yuan <mayuan2006@gmail.com>
parents: 19753
diff changeset
471 }
19755
90f89601d6d3 [gaim-migrate @ 16758]
Ma Yuan <mayuan2006@gmail.com>
parents: 19754
diff changeset
472 if(!strcmp(content_type,"text/x-msmsgscontrol")){
90f89601d6d3 [gaim-migrate @ 16758]
Ma Yuan <mayuan2006@gmail.com>
parents: 19754
diff changeset
473 if(msn_message_get_attr(msg, "TypingUser") != NULL){
90f89601d6d3 [gaim-migrate @ 16758]
Ma Yuan <mayuan2006@gmail.com>
parents: 19754
diff changeset
474 serv_got_typing(gc, passport, MSN_TYPING_RECV_TIMEOUT,
90f89601d6d3 [gaim-migrate @ 16758]
Ma Yuan <mayuan2006@gmail.com>
parents: 19754
diff changeset
475 GAIM_TYPING);
90f89601d6d3 [gaim-migrate @ 16758]
Ma Yuan <mayuan2006@gmail.com>
parents: 19754
diff changeset
476 }
90f89601d6d3 [gaim-migrate @ 16758]
Ma Yuan <mayuan2006@gmail.com>
parents: 19754
diff changeset
477 }
90f89601d6d3 [gaim-migrate @ 16758]
Ma Yuan <mayuan2006@gmail.com>
parents: 19754
diff changeset
478 if(!strcmp(content_type,"text/x-msnmsgr-datacast")){
90f89601d6d3 [gaim-migrate @ 16758]
Ma Yuan <mayuan2006@gmail.com>
parents: 19754
diff changeset
479 char *username, *str;
90f89601d6d3 [gaim-migrate @ 16758]
Ma Yuan <mayuan2006@gmail.com>
parents: 19754
diff changeset
480 GaimAccount *account;
90f89601d6d3 [gaim-migrate @ 16758]
Ma Yuan <mayuan2006@gmail.com>
parents: 19754
diff changeset
481 GaimBuddy *buddy;
90f89601d6d3 [gaim-migrate @ 16758]
Ma Yuan <mayuan2006@gmail.com>
parents: 19754
diff changeset
482 const char *user;
90f89601d6d3 [gaim-migrate @ 16758]
Ma Yuan <mayuan2006@gmail.com>
parents: 19754
diff changeset
483
90f89601d6d3 [gaim-migrate @ 16758]
Ma Yuan <mayuan2006@gmail.com>
parents: 19754
diff changeset
484 account = cmdproc->session->account;
90f89601d6d3 [gaim-migrate @ 16758]
Ma Yuan <mayuan2006@gmail.com>
parents: 19754
diff changeset
485 user = msg->remote_user;
90f89601d6d3 [gaim-migrate @ 16758]
Ma Yuan <mayuan2006@gmail.com>
parents: 19754
diff changeset
486
90f89601d6d3 [gaim-migrate @ 16758]
Ma Yuan <mayuan2006@gmail.com>
parents: 19754
diff changeset
487 if ((buddy = gaim_find_buddy(account, user)) != NULL){
90f89601d6d3 [gaim-migrate @ 16758]
Ma Yuan <mayuan2006@gmail.com>
parents: 19754
diff changeset
488 username = g_markup_escape_text(gaim_buddy_get_alias(buddy), -1);
90f89601d6d3 [gaim-migrate @ 16758]
Ma Yuan <mayuan2006@gmail.com>
parents: 19754
diff changeset
489 }else{
90f89601d6d3 [gaim-migrate @ 16758]
Ma Yuan <mayuan2006@gmail.com>
parents: 19754
diff changeset
490 username = g_markup_escape_text(user, -1);
90f89601d6d3 [gaim-migrate @ 16758]
Ma Yuan <mayuan2006@gmail.com>
parents: 19754
diff changeset
491 }
90f89601d6d3 [gaim-migrate @ 16758]
Ma Yuan <mayuan2006@gmail.com>
parents: 19754
diff changeset
492
90f89601d6d3 [gaim-migrate @ 16758]
Ma Yuan <mayuan2006@gmail.com>
parents: 19754
diff changeset
493 str = g_strdup_printf(_("%s just sent you a Nudge!"), username);
90f89601d6d3 [gaim-migrate @ 16758]
Ma Yuan <mayuan2006@gmail.com>
parents: 19754
diff changeset
494 g_free(username);
90f89601d6d3 [gaim-migrate @ 16758]
Ma Yuan <mayuan2006@gmail.com>
parents: 19754
diff changeset
495 msn_session_report_user(cmdproc->session,user,str,GAIM_MESSAGE_SYSTEM);
90f89601d6d3 [gaim-migrate @ 16758]
Ma Yuan <mayuan2006@gmail.com>
parents: 19754
diff changeset
496 g_free(str);
90f89601d6d3 [gaim-migrate @ 16758]
Ma Yuan <mayuan2006@gmail.com>
parents: 19754
diff changeset
497 }
19754
da3f8f7ec3ce [gaim-migrate @ 16737]
Ma Yuan <mayuan2006@gmail.com>
parents: 19753
diff changeset
498 msn_message_destroy(msg);
da3f8f7ec3ce [gaim-migrate @ 16737]
Ma Yuan <mayuan2006@gmail.com>
parents: 19753
diff changeset
499 }
da3f8f7ec3ce [gaim-migrate @ 16737]
Ma Yuan <mayuan2006@gmail.com>
parents: 19753
diff changeset
500
da3f8f7ec3ce [gaim-migrate @ 16737]
Ma Yuan <mayuan2006@gmail.com>
parents: 19753
diff changeset
501 /*Yahoo msg process*/
da3f8f7ec3ce [gaim-migrate @ 16737]
Ma Yuan <mayuan2006@gmail.com>
parents: 19753
diff changeset
502 static void
da3f8f7ec3ce [gaim-migrate @ 16737]
Ma Yuan <mayuan2006@gmail.com>
parents: 19753
diff changeset
503 ubm_cmd(MsnCmdProc *cmdproc, MsnCommand *cmd)
da3f8f7ec3ce [gaim-migrate @ 16737]
Ma Yuan <mayuan2006@gmail.com>
parents: 19753
diff changeset
504 {
da3f8f7ec3ce [gaim-migrate @ 16737]
Ma Yuan <mayuan2006@gmail.com>
parents: 19753
diff changeset
505 gaim_debug_info("MaYuan","Processing UBM... \n");
da3f8f7ec3ce [gaim-migrate @ 16737]
Ma Yuan <mayuan2006@gmail.com>
parents: 19753
diff changeset
506 if(cmd->payload_len == 0){
da3f8f7ec3ce [gaim-migrate @ 16737]
Ma Yuan <mayuan2006@gmail.com>
parents: 19753
diff changeset
507 return;
da3f8f7ec3ce [gaim-migrate @ 16737]
Ma Yuan <mayuan2006@gmail.com>
parents: 19753
diff changeset
508 }
da3f8f7ec3ce [gaim-migrate @ 16737]
Ma Yuan <mayuan2006@gmail.com>
parents: 19753
diff changeset
509 /* NOTE: cmd is not always cmdproc->last_cmd, sometimes cmd is a queued
da3f8f7ec3ce [gaim-migrate @ 16737]
Ma Yuan <mayuan2006@gmail.com>
parents: 19753
diff changeset
510 * command and we are processing it */
da3f8f7ec3ce [gaim-migrate @ 16737]
Ma Yuan <mayuan2006@gmail.com>
parents: 19753
diff changeset
511 if (cmd->payload == NULL){
da3f8f7ec3ce [gaim-migrate @ 16737]
Ma Yuan <mayuan2006@gmail.com>
parents: 19753
diff changeset
512 cmdproc->last_cmd->payload_cb = ubm_cmd_post;
da3f8f7ec3ce [gaim-migrate @ 16737]
Ma Yuan <mayuan2006@gmail.com>
parents: 19753
diff changeset
513 cmdproc->servconn->payload_len = atoi(cmd->params[2]);
da3f8f7ec3ce [gaim-migrate @ 16737]
Ma Yuan <mayuan2006@gmail.com>
parents: 19753
diff changeset
514 }else{
da3f8f7ec3ce [gaim-migrate @ 16737]
Ma Yuan <mayuan2006@gmail.com>
parents: 19753
diff changeset
515 g_return_if_fail(cmd->payload_cb != NULL);
da3f8f7ec3ce [gaim-migrate @ 16737]
Ma Yuan <mayuan2006@gmail.com>
parents: 19753
diff changeset
516
da3f8f7ec3ce [gaim-migrate @ 16737]
Ma Yuan <mayuan2006@gmail.com>
parents: 19753
diff changeset
517 gaim_debug_info("MaYuan","UBM payload:{%s}\n",cmd->payload);
da3f8f7ec3ce [gaim-migrate @ 16737]
Ma Yuan <mayuan2006@gmail.com>
parents: 19753
diff changeset
518 ubm_cmd_post(cmdproc, cmd, cmd->payload, cmd->payload_len);
da3f8f7ec3ce [gaim-migrate @ 16737]
Ma Yuan <mayuan2006@gmail.com>
parents: 19753
diff changeset
519 }
da3f8f7ec3ce [gaim-migrate @ 16737]
Ma Yuan <mayuan2006@gmail.com>
parents: 19753
diff changeset
520 }
da3f8f7ec3ce [gaim-migrate @ 16737]
Ma Yuan <mayuan2006@gmail.com>
parents: 19753
diff changeset
521
5309
e2e53316a21d [gaim-migrate @ 5681]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
522 /**************************************************************************
e2e53316a21d [gaim-migrate @ 5681]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
523 * Challenges
19738
bc30c6270d9f [gaim-migrate @ 16473]
Ma Yuan <mayuan2006@gmail.com>
parents: 19737
diff changeset
524 * we use MD5 to caculate the Chanllenges
5309
e2e53316a21d [gaim-migrate @ 5681]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
525 **************************************************************************/
8808
bbd8cdaf0ad5 [gaim-migrate @ 9570]
Christian Hammond <chipx86@chipx86.com>
parents: 8669
diff changeset
526 static void
bbd8cdaf0ad5 [gaim-migrate @ 9570]
Christian Hammond <chipx86@chipx86.com>
parents: 8669
diff changeset
527 chl_cmd(MsnCmdProc *cmdproc, MsnCommand *cmd)
5309
e2e53316a21d [gaim-migrate @ 5681]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
528 {
8808
bbd8cdaf0ad5 [gaim-migrate @ 9570]
Christian Hammond <chipx86@chipx86.com>
parents: 8669
diff changeset
529 MsnTransaction *trans;
9158
c30d81b4dd22 [gaim-migrate @ 9942]
Christian Hammond <chipx86@chipx86.com>
parents: 8926
diff changeset
530 char buf[33];
5309
e2e53316a21d [gaim-migrate @ 5681]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
531
19739
852b32710df0 [gaim-migrate @ 16507]
Ma Yuan <mayuan2006@gmail.com>
parents: 19738
diff changeset
532 #if 0
10684
72a5babfa8b4 [gaim-migrate @ 12231]
Luke Schierer <lschiere@pidgin.im>
parents: 10647
diff changeset
533 cipher = gaim_ciphers_find_cipher("md5");
72a5babfa8b4 [gaim-migrate @ 12231]
Luke Schierer <lschiere@pidgin.im>
parents: 10647
diff changeset
534 context = gaim_cipher_context_new(cipher, NULL);
11183
8dca96cbcd64 [gaim-migrate @ 13295]
Mark Doliner <mark@kingant.net>
parents: 11164
diff changeset
535 gaim_cipher_context_append(context, (const guchar *)cmd->params[1],
10684
72a5babfa8b4 [gaim-migrate @ 12231]
Luke Schierer <lschiere@pidgin.im>
parents: 10647
diff changeset
536 strlen(cmd->params[1]));
19738
bc30c6270d9f [gaim-migrate @ 16473]
Ma Yuan <mayuan2006@gmail.com>
parents: 19737
diff changeset
537 challenge_resp = MSNP13_WLM_PRODUCT_KEY;
6701
b7e113a59b51 [gaim-migrate @ 7227]
Christian Hammond <chipx86@chipx86.com>
parents: 6695
diff changeset
538
11183
8dca96cbcd64 [gaim-migrate @ 13295]
Mark Doliner <mark@kingant.net>
parents: 11164
diff changeset
539 gaim_cipher_context_append(context, (const guchar *)challenge_resp,
10684
72a5babfa8b4 [gaim-migrate @ 12231]
Luke Schierer <lschiere@pidgin.im>
parents: 10647
diff changeset
540 strlen(challenge_resp));
10687
b256ce6b85b8 [gaim-migrate @ 12235]
Etan Reisner <pidgin@unreliablesource.net>
parents: 10684
diff changeset
541 gaim_cipher_context_digest(context, sizeof(digest), digest, NULL);
10684
72a5babfa8b4 [gaim-migrate @ 12231]
Luke Schierer <lschiere@pidgin.im>
parents: 10647
diff changeset
542 gaim_cipher_context_destroy(context);
5309
e2e53316a21d [gaim-migrate @ 5681]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
543
19739
852b32710df0 [gaim-migrate @ 16507]
Ma Yuan <mayuan2006@gmail.com>
parents: 19738
diff changeset
544 for (i = 0; i < 16; i++){
10684
72a5babfa8b4 [gaim-migrate @ 12231]
Luke Schierer <lschiere@pidgin.im>
parents: 10647
diff changeset
545 g_snprintf(buf + (i*2), 3, "%02x", digest[i]);
19739
852b32710df0 [gaim-migrate @ 16507]
Ma Yuan <mayuan2006@gmail.com>
parents: 19738
diff changeset
546 }
852b32710df0 [gaim-migrate @ 16507]
Ma Yuan <mayuan2006@gmail.com>
parents: 19738
diff changeset
547 #else
852b32710df0 [gaim-migrate @ 16507]
Ma Yuan <mayuan2006@gmail.com>
parents: 19738
diff changeset
548 msn_handle_chl(cmd->params[1], buf);
852b32710df0 [gaim-migrate @ 16507]
Ma Yuan <mayuan2006@gmail.com>
parents: 19738
diff changeset
549 #endif
19740
23258253c7a0 [gaim-migrate @ 16546]
Ma Yuan <mayuan2006@gmail.com>
parents: 19739
diff changeset
550 // gaim_debug_info("MaYuan","<<challenge:{%s}:{%s}\n",cmd->params[1],buf);
19738
bc30c6270d9f [gaim-migrate @ 16473]
Ma Yuan <mayuan2006@gmail.com>
parents: 19737
diff changeset
551 trans = msn_transaction_new(cmdproc, "QRY", "%s 32", MSNP13_WLM_PRODUCT_ID);
5309
e2e53316a21d [gaim-migrate @ 5681]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
552
8808
bbd8cdaf0ad5 [gaim-migrate @ 9570]
Christian Hammond <chipx86@chipx86.com>
parents: 8669
diff changeset
553 msn_transaction_set_payload(trans, buf, 32);
5309
e2e53316a21d [gaim-migrate @ 5681]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
554
8808
bbd8cdaf0ad5 [gaim-migrate @ 9570]
Christian Hammond <chipx86@chipx86.com>
parents: 8669
diff changeset
555 msn_cmdproc_send_trans(cmdproc, trans);
5309
e2e53316a21d [gaim-migrate @ 5681]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
556 }
e2e53316a21d [gaim-migrate @ 5681]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
557
e2e53316a21d [gaim-migrate @ 5681]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
558 /**************************************************************************
e2e53316a21d [gaim-migrate @ 5681]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
559 * Buddy Lists
e2e53316a21d [gaim-migrate @ 5681]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
560 **************************************************************************/
19750
3a15b4e5c336 [gaim-migrate @ 16716]
Ma Yuan <mayuan2006@gmail.com>
parents: 19749
diff changeset
561 /* add contact to xmlnode */
3a15b4e5c336 [gaim-migrate @ 16716]
Ma Yuan <mayuan2006@gmail.com>
parents: 19749
diff changeset
562 void
19752
c2f3cd6626e1 [gaim-migrate @ 16722]
Ma Yuan <mayuan2006@gmail.com>
parents: 19751
diff changeset
563 msn_add_contact_xml(xmlnode *mlNode,const char *passport,int list_op,int type)
19750
3a15b4e5c336 [gaim-migrate @ 16716]
Ma Yuan <mayuan2006@gmail.com>
parents: 19749
diff changeset
564 {
3a15b4e5c336 [gaim-migrate @ 16716]
Ma Yuan <mayuan2006@gmail.com>
parents: 19749
diff changeset
565 xmlnode *d_node,*c_node;
3a15b4e5c336 [gaim-migrate @ 16716]
Ma Yuan <mayuan2006@gmail.com>
parents: 19749
diff changeset
566 char **tokens;
3a15b4e5c336 [gaim-migrate @ 16716]
Ma Yuan <mayuan2006@gmail.com>
parents: 19749
diff changeset
567 char *email,*domain;
3a15b4e5c336 [gaim-migrate @ 16716]
Ma Yuan <mayuan2006@gmail.com>
parents: 19749
diff changeset
568 char *list_op_str,*type_str;
3a15b4e5c336 [gaim-migrate @ 16716]
Ma Yuan <mayuan2006@gmail.com>
parents: 19749
diff changeset
569
3a15b4e5c336 [gaim-migrate @ 16716]
Ma Yuan <mayuan2006@gmail.com>
parents: 19749
diff changeset
570 gaim_debug_info("MaYuan","passport:%s\n",passport);
3a15b4e5c336 [gaim-migrate @ 16716]
Ma Yuan <mayuan2006@gmail.com>
parents: 19749
diff changeset
571 tokens = g_strsplit(passport, "@", 2);
3a15b4e5c336 [gaim-migrate @ 16716]
Ma Yuan <mayuan2006@gmail.com>
parents: 19749
diff changeset
572 email = tokens[0];
3a15b4e5c336 [gaim-migrate @ 16716]
Ma Yuan <mayuan2006@gmail.com>
parents: 19749
diff changeset
573 domain = tokens[1];
3a15b4e5c336 [gaim-migrate @ 16716]
Ma Yuan <mayuan2006@gmail.com>
parents: 19749
diff changeset
574
3a15b4e5c336 [gaim-migrate @ 16716]
Ma Yuan <mayuan2006@gmail.com>
parents: 19749
diff changeset
575 /*find a domain Node*/
3a15b4e5c336 [gaim-migrate @ 16716]
Ma Yuan <mayuan2006@gmail.com>
parents: 19749
diff changeset
576 for(d_node = xmlnode_get_child(mlNode,"d"); d_node; d_node = xmlnode_get_next_twin(d_node)){
3a15b4e5c336 [gaim-migrate @ 16716]
Ma Yuan <mayuan2006@gmail.com>
parents: 19749
diff changeset
577 const char * attr = NULL;
3a15b4e5c336 [gaim-migrate @ 16716]
Ma Yuan <mayuan2006@gmail.com>
parents: 19749
diff changeset
578 gaim_debug_info("MaYuan","d_node:%s\n",d_node->name);
3a15b4e5c336 [gaim-migrate @ 16716]
Ma Yuan <mayuan2006@gmail.com>
parents: 19749
diff changeset
579 attr = xmlnode_get_attrib(d_node,"n");
3a15b4e5c336 [gaim-migrate @ 16716]
Ma Yuan <mayuan2006@gmail.com>
parents: 19749
diff changeset
580 if(attr == NULL){
3a15b4e5c336 [gaim-migrate @ 16716]
Ma Yuan <mayuan2006@gmail.com>
parents: 19749
diff changeset
581 continue;
3a15b4e5c336 [gaim-migrate @ 16716]
Ma Yuan <mayuan2006@gmail.com>
parents: 19749
diff changeset
582 }
3a15b4e5c336 [gaim-migrate @ 16716]
Ma Yuan <mayuan2006@gmail.com>
parents: 19749
diff changeset
583 if(!strcmp(attr,domain)){
3a15b4e5c336 [gaim-migrate @ 16716]
Ma Yuan <mayuan2006@gmail.com>
parents: 19749
diff changeset
584 break;
3a15b4e5c336 [gaim-migrate @ 16716]
Ma Yuan <mayuan2006@gmail.com>
parents: 19749
diff changeset
585 }
3a15b4e5c336 [gaim-migrate @ 16716]
Ma Yuan <mayuan2006@gmail.com>
parents: 19749
diff changeset
586 }
3a15b4e5c336 [gaim-migrate @ 16716]
Ma Yuan <mayuan2006@gmail.com>
parents: 19749
diff changeset
587 if(d_node == NULL){
3a15b4e5c336 [gaim-migrate @ 16716]
Ma Yuan <mayuan2006@gmail.com>
parents: 19749
diff changeset
588 /*domain not found, create a new domain Node*/
3a15b4e5c336 [gaim-migrate @ 16716]
Ma Yuan <mayuan2006@gmail.com>
parents: 19749
diff changeset
589 gaim_debug_info("MaYuan","get No d_node\n");
3a15b4e5c336 [gaim-migrate @ 16716]
Ma Yuan <mayuan2006@gmail.com>
parents: 19749
diff changeset
590 d_node = xmlnode_new("d");
3a15b4e5c336 [gaim-migrate @ 16716]
Ma Yuan <mayuan2006@gmail.com>
parents: 19749
diff changeset
591 xmlnode_set_attrib(d_node,"n",domain);
3a15b4e5c336 [gaim-migrate @ 16716]
Ma Yuan <mayuan2006@gmail.com>
parents: 19749
diff changeset
592 xmlnode_insert_child(mlNode,d_node);
3a15b4e5c336 [gaim-migrate @ 16716]
Ma Yuan <mayuan2006@gmail.com>
parents: 19749
diff changeset
593 }
3a15b4e5c336 [gaim-migrate @ 16716]
Ma Yuan <mayuan2006@gmail.com>
parents: 19749
diff changeset
594
3a15b4e5c336 [gaim-migrate @ 16716]
Ma Yuan <mayuan2006@gmail.com>
parents: 19749
diff changeset
595 /*create contact node*/
3a15b4e5c336 [gaim-migrate @ 16716]
Ma Yuan <mayuan2006@gmail.com>
parents: 19749
diff changeset
596 c_node = xmlnode_new("c");
3a15b4e5c336 [gaim-migrate @ 16716]
Ma Yuan <mayuan2006@gmail.com>
parents: 19749
diff changeset
597 xmlnode_set_attrib(c_node,"n",email);
3a15b4e5c336 [gaim-migrate @ 16716]
Ma Yuan <mayuan2006@gmail.com>
parents: 19749
diff changeset
598
3a15b4e5c336 [gaim-migrate @ 16716]
Ma Yuan <mayuan2006@gmail.com>
parents: 19749
diff changeset
599 list_op_str = g_strdup_printf("%d",list_op);
3a15b4e5c336 [gaim-migrate @ 16716]
Ma Yuan <mayuan2006@gmail.com>
parents: 19749
diff changeset
600 gaim_debug_info("MaYuan","list_op:%d\n",list_op_str);
3a15b4e5c336 [gaim-migrate @ 16716]
Ma Yuan <mayuan2006@gmail.com>
parents: 19749
diff changeset
601 xmlnode_set_attrib(c_node,"l",list_op_str);
3a15b4e5c336 [gaim-migrate @ 16716]
Ma Yuan <mayuan2006@gmail.com>
parents: 19749
diff changeset
602 g_free(list_op_str);
19754
da3f8f7ec3ce [gaim-migrate @ 16737]
Ma Yuan <mayuan2006@gmail.com>
parents: 19753
diff changeset
603 #if 0
19750
3a15b4e5c336 [gaim-migrate @ 16716]
Ma Yuan <mayuan2006@gmail.com>
parents: 19749
diff changeset
604 type_str = g_strdup_printf("%d",type);
3a15b4e5c336 [gaim-migrate @ 16716]
Ma Yuan <mayuan2006@gmail.com>
parents: 19749
diff changeset
605 xmlnode_set_attrib(c_node,"t",type_str);
3a15b4e5c336 [gaim-migrate @ 16716]
Ma Yuan <mayuan2006@gmail.com>
parents: 19749
diff changeset
606 #else
19753
88b0c434259a [gaim-migrate @ 16733]
Ma Yuan <mayuan2006@gmail.com>
parents: 19752
diff changeset
607 if(g_strrstr(domain,"yahoo") != NULL){
19754
da3f8f7ec3ce [gaim-migrate @ 16737]
Ma Yuan <mayuan2006@gmail.com>
parents: 19753
diff changeset
608 type_str = g_strdup_printf("32");
19753
88b0c434259a [gaim-migrate @ 16733]
Ma Yuan <mayuan2006@gmail.com>
parents: 19752
diff changeset
609 }else{
88b0c434259a [gaim-migrate @ 16733]
Ma Yuan <mayuan2006@gmail.com>
parents: 19752
diff changeset
610 /*passport*/
88b0c434259a [gaim-migrate @ 16733]
Ma Yuan <mayuan2006@gmail.com>
parents: 19752
diff changeset
611 type_str = g_strdup_printf("1");
88b0c434259a [gaim-migrate @ 16733]
Ma Yuan <mayuan2006@gmail.com>
parents: 19752
diff changeset
612 }
88b0c434259a [gaim-migrate @ 16733]
Ma Yuan <mayuan2006@gmail.com>
parents: 19752
diff changeset
613 /*mobile*/
88b0c434259a [gaim-migrate @ 16733]
Ma Yuan <mayuan2006@gmail.com>
parents: 19752
diff changeset
614 //type_str = g_strdup_printf("4");
19750
3a15b4e5c336 [gaim-migrate @ 16716]
Ma Yuan <mayuan2006@gmail.com>
parents: 19749
diff changeset
615 xmlnode_set_attrib(c_node,"t",type_str);
3a15b4e5c336 [gaim-migrate @ 16716]
Ma Yuan <mayuan2006@gmail.com>
parents: 19749
diff changeset
616 g_free(type_str);
3a15b4e5c336 [gaim-migrate @ 16716]
Ma Yuan <mayuan2006@gmail.com>
parents: 19749
diff changeset
617 #endif
3a15b4e5c336 [gaim-migrate @ 16716]
Ma Yuan <mayuan2006@gmail.com>
parents: 19749
diff changeset
618 xmlnode_insert_child(d_node, c_node);
19757
2315ee828b7c [gaim-migrate @ 16772]
Ma Yuan <mayuan2006@gmail.com>
parents: 19755
diff changeset
619
2315ee828b7c [gaim-migrate @ 16772]
Ma Yuan <mayuan2006@gmail.com>
parents: 19755
diff changeset
620 g_free(tokens);
2315ee828b7c [gaim-migrate @ 16772]
Ma Yuan <mayuan2006@gmail.com>
parents: 19755
diff changeset
621 }
2315ee828b7c [gaim-migrate @ 16772]
Ma Yuan <mayuan2006@gmail.com>
parents: 19755
diff changeset
622
2315ee828b7c [gaim-migrate @ 16772]
Ma Yuan <mayuan2006@gmail.com>
parents: 19755
diff changeset
623 void
2315ee828b7c [gaim-migrate @ 16772]
Ma Yuan <mayuan2006@gmail.com>
parents: 19755
diff changeset
624 msn_notification_post_adl(MsnCmdProc *cmdproc,char *payload, int payload_len)
2315ee828b7c [gaim-migrate @ 16772]
Ma Yuan <mayuan2006@gmail.com>
parents: 19755
diff changeset
625 {
2315ee828b7c [gaim-migrate @ 16772]
Ma Yuan <mayuan2006@gmail.com>
parents: 19755
diff changeset
626 MsnTransaction *trans;
2315ee828b7c [gaim-migrate @ 16772]
Ma Yuan <mayuan2006@gmail.com>
parents: 19755
diff changeset
627
2315ee828b7c [gaim-migrate @ 16772]
Ma Yuan <mayuan2006@gmail.com>
parents: 19755
diff changeset
628 gaim_debug_info("MaYuan","Send ADL{%s}\n",payload);
2315ee828b7c [gaim-migrate @ 16772]
Ma Yuan <mayuan2006@gmail.com>
parents: 19755
diff changeset
629 trans = msn_transaction_new(cmdproc, "ADL","%d",strlen(payload));
2315ee828b7c [gaim-migrate @ 16772]
Ma Yuan <mayuan2006@gmail.com>
parents: 19755
diff changeset
630 msn_transaction_set_payload(trans, payload, strlen(payload));
2315ee828b7c [gaim-migrate @ 16772]
Ma Yuan <mayuan2006@gmail.com>
parents: 19755
diff changeset
631 msn_cmdproc_send_trans(cmdproc, trans);
19750
3a15b4e5c336 [gaim-migrate @ 16716]
Ma Yuan <mayuan2006@gmail.com>
parents: 19749
diff changeset
632 }
3a15b4e5c336 [gaim-migrate @ 16716]
Ma Yuan <mayuan2006@gmail.com>
parents: 19749
diff changeset
633
3a15b4e5c336 [gaim-migrate @ 16716]
Ma Yuan <mayuan2006@gmail.com>
parents: 19749
diff changeset
634 /*dump contact info to NS*/
19739
852b32710df0 [gaim-migrate @ 16507]
Ma Yuan <mayuan2006@gmail.com>
parents: 19738
diff changeset
635 void
19750
3a15b4e5c336 [gaim-migrate @ 16716]
Ma Yuan <mayuan2006@gmail.com>
parents: 19749
diff changeset
636 msn_notification_dump_contact(MsnSession *session)
19739
852b32710df0 [gaim-migrate @ 16507]
Ma Yuan <mayuan2006@gmail.com>
parents: 19738
diff changeset
637 {
852b32710df0 [gaim-migrate @ 16507]
Ma Yuan <mayuan2006@gmail.com>
parents: 19738
diff changeset
638 MsnUserList *userlist;
852b32710df0 [gaim-migrate @ 16507]
Ma Yuan <mayuan2006@gmail.com>
parents: 19738
diff changeset
639 MsnUser *user;
852b32710df0 [gaim-migrate @ 16507]
Ma Yuan <mayuan2006@gmail.com>
parents: 19738
diff changeset
640 GList *l;
19750
3a15b4e5c336 [gaim-migrate @ 16716]
Ma Yuan <mayuan2006@gmail.com>
parents: 19749
diff changeset
641 xmlnode *adl_node;
19740
23258253c7a0 [gaim-migrate @ 16546]
Ma Yuan <mayuan2006@gmail.com>
parents: 19739
diff changeset
642 char *payload;
19739
852b32710df0 [gaim-migrate @ 16507]
Ma Yuan <mayuan2006@gmail.com>
parents: 19738
diff changeset
643 int payload_len;
852b32710df0 [gaim-migrate @ 16507]
Ma Yuan <mayuan2006@gmail.com>
parents: 19738
diff changeset
644
852b32710df0 [gaim-migrate @ 16507]
Ma Yuan <mayuan2006@gmail.com>
parents: 19738
diff changeset
645 userlist = session->userlist;
852b32710df0 [gaim-migrate @ 16507]
Ma Yuan <mayuan2006@gmail.com>
parents: 19738
diff changeset
646 adl_node = xmlnode_new("ml");
852b32710df0 [gaim-migrate @ 16507]
Ma Yuan <mayuan2006@gmail.com>
parents: 19738
diff changeset
647 adl_node->child = NULL;
852b32710df0 [gaim-migrate @ 16507]
Ma Yuan <mayuan2006@gmail.com>
parents: 19738
diff changeset
648 xmlnode_set_attrib(adl_node, "l", "1");
852b32710df0 [gaim-migrate @ 16507]
Ma Yuan <mayuan2006@gmail.com>
parents: 19738
diff changeset
649
852b32710df0 [gaim-migrate @ 16507]
Ma Yuan <mayuan2006@gmail.com>
parents: 19738
diff changeset
650 /*get the userlist*/
852b32710df0 [gaim-migrate @ 16507]
Ma Yuan <mayuan2006@gmail.com>
parents: 19738
diff changeset
651 for (l = userlist->users; l != NULL; l = l->next){
852b32710df0 [gaim-migrate @ 16507]
Ma Yuan <mayuan2006@gmail.com>
parents: 19738
diff changeset
652 user = l->data;
19753
88b0c434259a [gaim-migrate @ 16733]
Ma Yuan <mayuan2006@gmail.com>
parents: 19752
diff changeset
653 msn_add_contact_xml(adl_node,user->passport,user->list_op&MSN_LIST_OP_MASK,user->type);
19739
852b32710df0 [gaim-migrate @ 16507]
Ma Yuan <mayuan2006@gmail.com>
parents: 19738
diff changeset
654 }
852b32710df0 [gaim-migrate @ 16507]
Ma Yuan <mayuan2006@gmail.com>
parents: 19738
diff changeset
655
19740
23258253c7a0 [gaim-migrate @ 16546]
Ma Yuan <mayuan2006@gmail.com>
parents: 19739
diff changeset
656 payload = xmlnode_to_str(adl_node,&payload_len);
19750
3a15b4e5c336 [gaim-migrate @ 16716]
Ma Yuan <mayuan2006@gmail.com>
parents: 19749
diff changeset
657 xmlnode_free(adl_node);
19739
852b32710df0 [gaim-migrate @ 16507]
Ma Yuan <mayuan2006@gmail.com>
parents: 19738
diff changeset
658
19757
2315ee828b7c [gaim-migrate @ 16772]
Ma Yuan <mayuan2006@gmail.com>
parents: 19755
diff changeset
659 msn_notification_post_adl(session->notification->cmdproc,payload,payload_len);
2315ee828b7c [gaim-migrate @ 16772]
Ma Yuan <mayuan2006@gmail.com>
parents: 19755
diff changeset
660 }
2315ee828b7c [gaim-migrate @ 16772]
Ma Yuan <mayuan2006@gmail.com>
parents: 19755
diff changeset
661
2315ee828b7c [gaim-migrate @ 16772]
Ma Yuan <mayuan2006@gmail.com>
parents: 19755
diff changeset
662 /*Post FQY to NS,Inform add a Yahoo User*/
2315ee828b7c [gaim-migrate @ 16772]
Ma Yuan <mayuan2006@gmail.com>
parents: 19755
diff changeset
663 void
2315ee828b7c [gaim-migrate @ 16772]
Ma Yuan <mayuan2006@gmail.com>
parents: 19755
diff changeset
664 msn_notification_fqy_yahoo(MsnSession *session,char *passport)
2315ee828b7c [gaim-migrate @ 16772]
Ma Yuan <mayuan2006@gmail.com>
parents: 19755
diff changeset
665 {
2315ee828b7c [gaim-migrate @ 16772]
Ma Yuan <mayuan2006@gmail.com>
parents: 19755
diff changeset
666 MsnTransaction *trans;
2315ee828b7c [gaim-migrate @ 16772]
Ma Yuan <mayuan2006@gmail.com>
parents: 19755
diff changeset
667 MsnCmdProc *cmdproc;
2315ee828b7c [gaim-migrate @ 16772]
Ma Yuan <mayuan2006@gmail.com>
parents: 19755
diff changeset
668 char* email,*domain,*payload;
2315ee828b7c [gaim-migrate @ 16772]
Ma Yuan <mayuan2006@gmail.com>
parents: 19755
diff changeset
669 char **tokens;
2315ee828b7c [gaim-migrate @ 16772]
Ma Yuan <mayuan2006@gmail.com>
parents: 19755
diff changeset
670
2315ee828b7c [gaim-migrate @ 16772]
Ma Yuan <mayuan2006@gmail.com>
parents: 19755
diff changeset
671 cmdproc = session->notification->cmdproc;
2315ee828b7c [gaim-migrate @ 16772]
Ma Yuan <mayuan2006@gmail.com>
parents: 19755
diff changeset
672
2315ee828b7c [gaim-migrate @ 16772]
Ma Yuan <mayuan2006@gmail.com>
parents: 19755
diff changeset
673 tokens = g_strsplit(passport, "@", 2);
2315ee828b7c [gaim-migrate @ 16772]
Ma Yuan <mayuan2006@gmail.com>
parents: 19755
diff changeset
674 email = tokens[0];
2315ee828b7c [gaim-migrate @ 16772]
Ma Yuan <mayuan2006@gmail.com>
parents: 19755
diff changeset
675 domain = tokens[1];
2315ee828b7c [gaim-migrate @ 16772]
Ma Yuan <mayuan2006@gmail.com>
parents: 19755
diff changeset
676
2315ee828b7c [gaim-migrate @ 16772]
Ma Yuan <mayuan2006@gmail.com>
parents: 19755
diff changeset
677 payload = g_strdup_printf("<ml><d n=\"%s\"><c n=\"%s\"/></d></ml>",domain,email);
2315ee828b7c [gaim-migrate @ 16772]
Ma Yuan <mayuan2006@gmail.com>
parents: 19755
diff changeset
678 trans = msn_transaction_new(cmdproc, "FQY","%d",strlen(payload));
19739
852b32710df0 [gaim-migrate @ 16507]
Ma Yuan <mayuan2006@gmail.com>
parents: 19738
diff changeset
679 msn_transaction_set_payload(trans, payload, strlen(payload));
852b32710df0 [gaim-migrate @ 16507]
Ma Yuan <mayuan2006@gmail.com>
parents: 19738
diff changeset
680 msn_cmdproc_send_trans(cmdproc, trans);
19757
2315ee828b7c [gaim-migrate @ 16772]
Ma Yuan <mayuan2006@gmail.com>
parents: 19755
diff changeset
681
2315ee828b7c [gaim-migrate @ 16772]
Ma Yuan <mayuan2006@gmail.com>
parents: 19755
diff changeset
682 g_free(payload);
2315ee828b7c [gaim-migrate @ 16772]
Ma Yuan <mayuan2006@gmail.com>
parents: 19755
diff changeset
683 g_free(tokens);
19739
852b32710df0 [gaim-migrate @ 16507]
Ma Yuan <mayuan2006@gmail.com>
parents: 19738
diff changeset
684 }
852b32710df0 [gaim-migrate @ 16507]
Ma Yuan <mayuan2006@gmail.com>
parents: 19738
diff changeset
685
852b32710df0 [gaim-migrate @ 16507]
Ma Yuan <mayuan2006@gmail.com>
parents: 19738
diff changeset
686 static void
19740
23258253c7a0 [gaim-migrate @ 16546]
Ma Yuan <mayuan2006@gmail.com>
parents: 19739
diff changeset
687 blp_cmd(MsnCmdProc *cmdproc, MsnCommand *cmd)
23258253c7a0 [gaim-migrate @ 16546]
Ma Yuan <mayuan2006@gmail.com>
parents: 19739
diff changeset
688 {
23258253c7a0 [gaim-migrate @ 16546]
Ma Yuan <mayuan2006@gmail.com>
parents: 19739
diff changeset
689 gaim_debug_info("MaYuan","Process BLP\n");
23258253c7a0 [gaim-migrate @ 16546]
Ma Yuan <mayuan2006@gmail.com>
parents: 19739
diff changeset
690 }
23258253c7a0 [gaim-migrate @ 16546]
Ma Yuan <mayuan2006@gmail.com>
parents: 19739
diff changeset
691
23258253c7a0 [gaim-migrate @ 16546]
Ma Yuan <mayuan2006@gmail.com>
parents: 19739
diff changeset
692 static void
19739
852b32710df0 [gaim-migrate @ 16507]
Ma Yuan <mayuan2006@gmail.com>
parents: 19738
diff changeset
693 adl_cmd(MsnCmdProc *cmdproc, MsnCommand *cmd)
852b32710df0 [gaim-migrate @ 16507]
Ma Yuan <mayuan2006@gmail.com>
parents: 19738
diff changeset
694 {
19740
23258253c7a0 [gaim-migrate @ 16546]
Ma Yuan <mayuan2006@gmail.com>
parents: 19739
diff changeset
695 gaim_debug_info("MaYuan","Process ADL\n");
19739
852b32710df0 [gaim-migrate @ 16507]
Ma Yuan <mayuan2006@gmail.com>
parents: 19738
diff changeset
696 }
852b32710df0 [gaim-migrate @ 16507]
Ma Yuan <mayuan2006@gmail.com>
parents: 19738
diff changeset
697
852b32710df0 [gaim-migrate @ 16507]
Ma Yuan <mayuan2006@gmail.com>
parents: 19738
diff changeset
698 static void
19757
2315ee828b7c [gaim-migrate @ 16772]
Ma Yuan <mayuan2006@gmail.com>
parents: 19755
diff changeset
699 fqy_cmd_post(MsnCmdProc *cmdproc, MsnCommand *cmd, char *payload,
2315ee828b7c [gaim-migrate @ 16772]
Ma Yuan <mayuan2006@gmail.com>
parents: 19755
diff changeset
700 size_t len)
2315ee828b7c [gaim-migrate @ 16772]
Ma Yuan <mayuan2006@gmail.com>
parents: 19755
diff changeset
701 {
2315ee828b7c [gaim-migrate @ 16772]
Ma Yuan <mayuan2006@gmail.com>
parents: 19755
diff changeset
702 gaim_debug_info("MaYuan","FQY payload{%s}\n",payload);
2315ee828b7c [gaim-migrate @ 16772]
Ma Yuan <mayuan2006@gmail.com>
parents: 19755
diff changeset
703 msn_notification_post_adl(cmdproc,payload,len);
2315ee828b7c [gaim-migrate @ 16772]
Ma Yuan <mayuan2006@gmail.com>
parents: 19755
diff changeset
704 }
2315ee828b7c [gaim-migrate @ 16772]
Ma Yuan <mayuan2006@gmail.com>
parents: 19755
diff changeset
705
2315ee828b7c [gaim-migrate @ 16772]
Ma Yuan <mayuan2006@gmail.com>
parents: 19755
diff changeset
706 static void
2315ee828b7c [gaim-migrate @ 16772]
Ma Yuan <mayuan2006@gmail.com>
parents: 19755
diff changeset
707 fqy_cmd(MsnCmdProc *cmdproc, MsnCommand *cmd)
2315ee828b7c [gaim-migrate @ 16772]
Ma Yuan <mayuan2006@gmail.com>
parents: 19755
diff changeset
708 {
2315ee828b7c [gaim-migrate @ 16772]
Ma Yuan <mayuan2006@gmail.com>
parents: 19755
diff changeset
709 gaim_debug_info("MaYuan","Process FQY\n");
2315ee828b7c [gaim-migrate @ 16772]
Ma Yuan <mayuan2006@gmail.com>
parents: 19755
diff changeset
710 cmdproc->last_cmd->payload_cb = fqy_cmd_post;
2315ee828b7c [gaim-migrate @ 16772]
Ma Yuan <mayuan2006@gmail.com>
parents: 19755
diff changeset
711 }
2315ee828b7c [gaim-migrate @ 16772]
Ma Yuan <mayuan2006@gmail.com>
parents: 19755
diff changeset
712
2315ee828b7c [gaim-migrate @ 16772]
Ma Yuan <mayuan2006@gmail.com>
parents: 19755
diff changeset
713 static void
19739
852b32710df0 [gaim-migrate @ 16507]
Ma Yuan <mayuan2006@gmail.com>
parents: 19738
diff changeset
714 rml_cmd(MsnCmdProc *cmdproc, MsnCommand *cmd)
852b32710df0 [gaim-migrate @ 16507]
Ma Yuan <mayuan2006@gmail.com>
parents: 19738
diff changeset
715 {
852b32710df0 [gaim-migrate @ 16507]
Ma Yuan <mayuan2006@gmail.com>
parents: 19738
diff changeset
716 MsnTransaction *trans;
852b32710df0 [gaim-migrate @ 16507]
Ma Yuan <mayuan2006@gmail.com>
parents: 19738
diff changeset
717 char * payload;
852b32710df0 [gaim-migrate @ 16507]
Ma Yuan <mayuan2006@gmail.com>
parents: 19738
diff changeset
718
19749
38e4a4b404e5 [gaim-migrate @ 16685]
Ma Yuan <mayuan2006@gmail.com>
parents: 19748
diff changeset
719 gaim_debug_info("MaYuan","Process ADL\n");
38e4a4b404e5 [gaim-migrate @ 16685]
Ma Yuan <mayuan2006@gmail.com>
parents: 19748
diff changeset
720 #if 0
19739
852b32710df0 [gaim-migrate @ 16507]
Ma Yuan <mayuan2006@gmail.com>
parents: 19738
diff changeset
721 trans = msn_transaction_new(cmdproc, "RML","");
852b32710df0 [gaim-migrate @ 16507]
Ma Yuan <mayuan2006@gmail.com>
parents: 19738
diff changeset
722
852b32710df0 [gaim-migrate @ 16507]
Ma Yuan <mayuan2006@gmail.com>
parents: 19738
diff changeset
723 msn_transaction_set_payload(trans, payload, strlen(payload));
852b32710df0 [gaim-migrate @ 16507]
Ma Yuan <mayuan2006@gmail.com>
parents: 19738
diff changeset
724
852b32710df0 [gaim-migrate @ 16507]
Ma Yuan <mayuan2006@gmail.com>
parents: 19738
diff changeset
725 msn_cmdproc_send_trans(cmdproc, trans);
19749
38e4a4b404e5 [gaim-migrate @ 16685]
Ma Yuan <mayuan2006@gmail.com>
parents: 19748
diff changeset
726 #endif
19739
852b32710df0 [gaim-migrate @ 16507]
Ma Yuan <mayuan2006@gmail.com>
parents: 19738
diff changeset
727 }
852b32710df0 [gaim-migrate @ 16507]
Ma Yuan <mayuan2006@gmail.com>
parents: 19738
diff changeset
728
8808
bbd8cdaf0ad5 [gaim-migrate @ 9570]
Christian Hammond <chipx86@chipx86.com>
parents: 8669
diff changeset
729 static void
bbd8cdaf0ad5 [gaim-migrate @ 9570]
Christian Hammond <chipx86@chipx86.com>
parents: 8669
diff changeset
730 add_error(MsnCmdProc *cmdproc, MsnTransaction *trans, int error)
bbd8cdaf0ad5 [gaim-migrate @ 9570]
Christian Hammond <chipx86@chipx86.com>
parents: 8669
diff changeset
731 {
bbd8cdaf0ad5 [gaim-migrate @ 9570]
Christian Hammond <chipx86@chipx86.com>
parents: 8669
diff changeset
732 MsnSession *session;
bbd8cdaf0ad5 [gaim-migrate @ 9570]
Christian Hammond <chipx86@chipx86.com>
parents: 8669
diff changeset
733 GaimAccount *account;
bbd8cdaf0ad5 [gaim-migrate @ 9570]
Christian Hammond <chipx86@chipx86.com>
parents: 8669
diff changeset
734 GaimConnection *gc;
bbd8cdaf0ad5 [gaim-migrate @ 9570]
Christian Hammond <chipx86@chipx86.com>
parents: 8669
diff changeset
735 const char *list, *passport;
9897
62ccc10573d6 [gaim-migrate @ 10786]
Luke Schierer <lschiere@pidgin.im>
parents: 9859
diff changeset
736 char *reason = NULL;
8808
bbd8cdaf0ad5 [gaim-migrate @ 9570]
Christian Hammond <chipx86@chipx86.com>
parents: 8669
diff changeset
737 char *msg = NULL;
bbd8cdaf0ad5 [gaim-migrate @ 9570]
Christian Hammond <chipx86@chipx86.com>
parents: 8669
diff changeset
738 char **params;
bbd8cdaf0ad5 [gaim-migrate @ 9570]
Christian Hammond <chipx86@chipx86.com>
parents: 8669
diff changeset
739
bbd8cdaf0ad5 [gaim-migrate @ 9570]
Christian Hammond <chipx86@chipx86.com>
parents: 8669
diff changeset
740 session = cmdproc->session;
bbd8cdaf0ad5 [gaim-migrate @ 9570]
Christian Hammond <chipx86@chipx86.com>
parents: 8669
diff changeset
741 account = session->account;
bbd8cdaf0ad5 [gaim-migrate @ 9570]
Christian Hammond <chipx86@chipx86.com>
parents: 8669
diff changeset
742 gc = gaim_account_get_connection(account);
bbd8cdaf0ad5 [gaim-migrate @ 9570]
Christian Hammond <chipx86@chipx86.com>
parents: 8669
diff changeset
743 params = g_strsplit(trans->params, " ", 0);
bbd8cdaf0ad5 [gaim-migrate @ 9570]
Christian Hammond <chipx86@chipx86.com>
parents: 8669
diff changeset
744
bbd8cdaf0ad5 [gaim-migrate @ 9570]
Christian Hammond <chipx86@chipx86.com>
parents: 8669
diff changeset
745 list = params[0];
bbd8cdaf0ad5 [gaim-migrate @ 9570]
Christian Hammond <chipx86@chipx86.com>
parents: 8669
diff changeset
746 passport = params[1];
bbd8cdaf0ad5 [gaim-migrate @ 9570]
Christian Hammond <chipx86@chipx86.com>
parents: 8669
diff changeset
747
bbd8cdaf0ad5 [gaim-migrate @ 9570]
Christian Hammond <chipx86@chipx86.com>
parents: 8669
diff changeset
748 if (!strcmp(list, "FL"))
10451
92d4a25fd33c [gaim-migrate @ 11717]
Stu Tomlinson <stu@nosnilmot.com>
parents: 10403
diff changeset
749 msg = g_strdup_printf(_("Unable to add user on %s (%s)"),
9900
0172daa9fcb5 [gaim-migrate @ 10791]
Mark Doliner <mark@kingant.net>
parents: 9897
diff changeset
750 gaim_account_get_username(account),
0172daa9fcb5 [gaim-migrate @ 10791]
Mark Doliner <mark@kingant.net>
parents: 9897
diff changeset
751 gaim_account_get_protocol_name(account));
8808
bbd8cdaf0ad5 [gaim-migrate @ 9570]
Christian Hammond <chipx86@chipx86.com>
parents: 8669
diff changeset
752 else if (!strcmp(list, "BL"))
10451
92d4a25fd33c [gaim-migrate @ 11717]
Stu Tomlinson <stu@nosnilmot.com>
parents: 10403
diff changeset
753 msg = g_strdup_printf(_("Unable to block user on %s (%s)"),
9900
0172daa9fcb5 [gaim-migrate @ 10791]
Mark Doliner <mark@kingant.net>
parents: 9897
diff changeset
754 gaim_account_get_username(account),
0172daa9fcb5 [gaim-migrate @ 10791]
Mark Doliner <mark@kingant.net>
parents: 9897
diff changeset
755 gaim_account_get_protocol_name(account));
8808
bbd8cdaf0ad5 [gaim-migrate @ 9570]
Christian Hammond <chipx86@chipx86.com>
parents: 8669
diff changeset
756 else if (!strcmp(list, "AL"))
10451
92d4a25fd33c [gaim-migrate @ 11717]
Stu Tomlinson <stu@nosnilmot.com>
parents: 10403
diff changeset
757 msg = g_strdup_printf(_("Unable to permit user on %s (%s)"),
9900
0172daa9fcb5 [gaim-migrate @ 10791]
Mark Doliner <mark@kingant.net>
parents: 9897
diff changeset
758 gaim_account_get_username(account),
0172daa9fcb5 [gaim-migrate @ 10791]
Mark Doliner <mark@kingant.net>
parents: 9897
diff changeset
759 gaim_account_get_protocol_name(account));
8808
bbd8cdaf0ad5 [gaim-migrate @ 9570]
Christian Hammond <chipx86@chipx86.com>
parents: 8669
diff changeset
760
bbd8cdaf0ad5 [gaim-migrate @ 9570]
Christian Hammond <chipx86@chipx86.com>
parents: 8669
diff changeset
761 if (!strcmp(list, "FL"))
bbd8cdaf0ad5 [gaim-migrate @ 9570]
Christian Hammond <chipx86@chipx86.com>
parents: 8669
diff changeset
762 {
9900
0172daa9fcb5 [gaim-migrate @ 10791]
Mark Doliner <mark@kingant.net>
parents: 9897
diff changeset
763 if (error == 210)
9897
62ccc10573d6 [gaim-migrate @ 10786]
Luke Schierer <lschiere@pidgin.im>
parents: 9859
diff changeset
764 {
10451
92d4a25fd33c [gaim-migrate @ 11717]
Stu Tomlinson <stu@nosnilmot.com>
parents: 10403
diff changeset
765 reason = g_strdup_printf(_("%s could not be added because "
92d4a25fd33c [gaim-migrate @ 11717]
Stu Tomlinson <stu@nosnilmot.com>
parents: 10403
diff changeset
766 "your buddy list is full."), passport);
9897
62ccc10573d6 [gaim-migrate @ 10786]
Luke Schierer <lschiere@pidgin.im>
parents: 9859
diff changeset
767 }
8808
bbd8cdaf0ad5 [gaim-migrate @ 9570]
Christian Hammond <chipx86@chipx86.com>
parents: 8669
diff changeset
768 }
9897
62ccc10573d6 [gaim-migrate @ 10786]
Luke Schierer <lschiere@pidgin.im>
parents: 9859
diff changeset
769
62ccc10573d6 [gaim-migrate @ 10786]
Luke Schierer <lschiere@pidgin.im>
parents: 9859
diff changeset
770 if (reason == NULL)
8808
bbd8cdaf0ad5 [gaim-migrate @ 9570]
Christian Hammond <chipx86@chipx86.com>
parents: 8669
diff changeset
771 {
9897
62ccc10573d6 [gaim-migrate @ 10786]
Luke Schierer <lschiere@pidgin.im>
parents: 9859
diff changeset
772 if (error == 208)
62ccc10573d6 [gaim-migrate @ 10786]
Luke Schierer <lschiere@pidgin.im>
parents: 9859
diff changeset
773 {
10451
92d4a25fd33c [gaim-migrate @ 11717]
Stu Tomlinson <stu@nosnilmot.com>
parents: 10403
diff changeset
774 reason = g_strdup_printf(_("%s is not a valid passport account."),
9897
62ccc10573d6 [gaim-migrate @ 10786]
Luke Schierer <lschiere@pidgin.im>
parents: 9859
diff changeset
775 passport);
62ccc10573d6 [gaim-migrate @ 10786]
Luke Schierer <lschiere@pidgin.im>
parents: 9859
diff changeset
776 }
11862
f8cd06753755 [gaim-migrate @ 14153]
Stu Tomlinson <stu@nosnilmot.com>
parents: 11819
diff changeset
777 else if (error == 500)
f8cd06753755 [gaim-migrate @ 14153]
Stu Tomlinson <stu@nosnilmot.com>
parents: 11819
diff changeset
778 {
f8cd06753755 [gaim-migrate @ 14153]
Stu Tomlinson <stu@nosnilmot.com>
parents: 11819
diff changeset
779 reason = g_strdup(_("Service Temporarily Unavailable."));
f8cd06753755 [gaim-migrate @ 14153]
Stu Tomlinson <stu@nosnilmot.com>
parents: 11819
diff changeset
780 }
9897
62ccc10573d6 [gaim-migrate @ 10786]
Luke Schierer <lschiere@pidgin.im>
parents: 9859
diff changeset
781 else
62ccc10573d6 [gaim-migrate @ 10786]
Luke Schierer <lschiere@pidgin.im>
parents: 9859
diff changeset
782 {
11862
f8cd06753755 [gaim-migrate @ 14153]
Stu Tomlinson <stu@nosnilmot.com>
parents: 11819
diff changeset
783 reason = g_strdup(_("Unknown error."));
9897
62ccc10573d6 [gaim-migrate @ 10786]
Luke Schierer <lschiere@pidgin.im>
parents: 9859
diff changeset
784 }
8808
bbd8cdaf0ad5 [gaim-migrate @ 9570]
Christian Hammond <chipx86@chipx86.com>
parents: 8669
diff changeset
785 }
bbd8cdaf0ad5 [gaim-migrate @ 9570]
Christian Hammond <chipx86@chipx86.com>
parents: 8669
diff changeset
786
bbd8cdaf0ad5 [gaim-migrate @ 9570]
Christian Hammond <chipx86@chipx86.com>
parents: 8669
diff changeset
787 if (msg != NULL)
bbd8cdaf0ad5 [gaim-migrate @ 9570]
Christian Hammond <chipx86@chipx86.com>
parents: 8669
diff changeset
788 {
bbd8cdaf0ad5 [gaim-migrate @ 9570]
Christian Hammond <chipx86@chipx86.com>
parents: 8669
diff changeset
789 gaim_notify_error(gc, NULL, msg, reason);
bbd8cdaf0ad5 [gaim-migrate @ 9570]
Christian Hammond <chipx86@chipx86.com>
parents: 8669
diff changeset
790 g_free(msg);
bbd8cdaf0ad5 [gaim-migrate @ 9570]
Christian Hammond <chipx86@chipx86.com>
parents: 8669
diff changeset
791 }
bbd8cdaf0ad5 [gaim-migrate @ 9570]
Christian Hammond <chipx86@chipx86.com>
parents: 8669
diff changeset
792
bbd8cdaf0ad5 [gaim-migrate @ 9570]
Christian Hammond <chipx86@chipx86.com>
parents: 8669
diff changeset
793 if (!strcmp(list, "FL"))
bbd8cdaf0ad5 [gaim-migrate @ 9570]
Christian Hammond <chipx86@chipx86.com>
parents: 8669
diff changeset
794 {
bbd8cdaf0ad5 [gaim-migrate @ 9570]
Christian Hammond <chipx86@chipx86.com>
parents: 8669
diff changeset
795 GaimBuddy *buddy;
bbd8cdaf0ad5 [gaim-migrate @ 9570]
Christian Hammond <chipx86@chipx86.com>
parents: 8669
diff changeset
796
bbd8cdaf0ad5 [gaim-migrate @ 9570]
Christian Hammond <chipx86@chipx86.com>
parents: 8669
diff changeset
797 buddy = gaim_find_buddy(account, passport);
bbd8cdaf0ad5 [gaim-migrate @ 9570]
Christian Hammond <chipx86@chipx86.com>
parents: 8669
diff changeset
798
bbd8cdaf0ad5 [gaim-migrate @ 9570]
Christian Hammond <chipx86@chipx86.com>
parents: 8669
diff changeset
799 if (buddy != NULL)
bbd8cdaf0ad5 [gaim-migrate @ 9570]
Christian Hammond <chipx86@chipx86.com>
parents: 8669
diff changeset
800 gaim_blist_remove_buddy(buddy);
bbd8cdaf0ad5 [gaim-migrate @ 9570]
Christian Hammond <chipx86@chipx86.com>
parents: 8669
diff changeset
801 }
bbd8cdaf0ad5 [gaim-migrate @ 9570]
Christian Hammond <chipx86@chipx86.com>
parents: 8669
diff changeset
802
bbd8cdaf0ad5 [gaim-migrate @ 9570]
Christian Hammond <chipx86@chipx86.com>
parents: 8669
diff changeset
803 g_free(reason);
bbd8cdaf0ad5 [gaim-migrate @ 9570]
Christian Hammond <chipx86@chipx86.com>
parents: 8669
diff changeset
804
bbd8cdaf0ad5 [gaim-migrate @ 9570]
Christian Hammond <chipx86@chipx86.com>
parents: 8669
diff changeset
805 g_strfreev(params);
bbd8cdaf0ad5 [gaim-migrate @ 9570]
Christian Hammond <chipx86@chipx86.com>
parents: 8669
diff changeset
806 }
bbd8cdaf0ad5 [gaim-migrate @ 9570]
Christian Hammond <chipx86@chipx86.com>
parents: 8669
diff changeset
807
bbd8cdaf0ad5 [gaim-migrate @ 9570]
Christian Hammond <chipx86@chipx86.com>
parents: 8669
diff changeset
808 static void
bbd8cdaf0ad5 [gaim-migrate @ 9570]
Christian Hammond <chipx86@chipx86.com>
parents: 8669
diff changeset
809 adg_cmd(MsnCmdProc *cmdproc, MsnCommand *cmd)
5322
a4d017bee1de [gaim-migrate @ 5694]
Christian Hammond <chipx86@chipx86.com>
parents: 5318
diff changeset
810 {
8808
bbd8cdaf0ad5 [gaim-migrate @ 9570]
Christian Hammond <chipx86@chipx86.com>
parents: 8669
diff changeset
811 MsnSession *session;
5518
bf2a7a7b739d [gaim-migrate @ 5918]
Christian Hammond <chipx86@chipx86.com>
parents: 5509
diff changeset
812 gint group_id;
7162
d14e026611c0 [gaim-migrate @ 7729]
Nathan Walp <nwalp@pidgin.im>
parents: 7134
diff changeset
813 const char *group_name;
5322
a4d017bee1de [gaim-migrate @ 5694]
Christian Hammond <chipx86@chipx86.com>
parents: 5318
diff changeset
814
8808
bbd8cdaf0ad5 [gaim-migrate @ 9570]
Christian Hammond <chipx86@chipx86.com>
parents: 8669
diff changeset
815 session = cmdproc->session;
5322
a4d017bee1de [gaim-migrate @ 5694]
Christian Hammond <chipx86@chipx86.com>
parents: 5318
diff changeset
816
8808
bbd8cdaf0ad5 [gaim-migrate @ 9570]
Christian Hammond <chipx86@chipx86.com>
parents: 8669
diff changeset
817 group_id = atoi(cmd->params[3]);
bbd8cdaf0ad5 [gaim-migrate @ 9570]
Christian Hammond <chipx86@chipx86.com>
parents: 8669
diff changeset
818
bbd8cdaf0ad5 [gaim-migrate @ 9570]
Christian Hammond <chipx86@chipx86.com>
parents: 8669
diff changeset
819 group_name = gaim_url_decode(cmd->params[2]);
5322
a4d017bee1de [gaim-migrate @ 5694]
Christian Hammond <chipx86@chipx86.com>
parents: 5318
diff changeset
820
13711
967ef719cb62 [gaim-migrate @ 16115]
Richard Laager <rlaager@wiktel.com>
parents: 13627
diff changeset
821 msn_group_new(session->userlist, group_id, group_name);
6701
b7e113a59b51 [gaim-migrate @ 7227]
Christian Hammond <chipx86@chipx86.com>
parents: 6695
diff changeset
822
9193
502707ca1836 [gaim-migrate @ 9988]
Christian Hammond <chipx86@chipx86.com>
parents: 9158
diff changeset
823 /* There is a user that must me moved to this group */
502707ca1836 [gaim-migrate @ 9988]
Christian Hammond <chipx86@chipx86.com>
parents: 9158
diff changeset
824 if (cmd->trans->data)
8808
bbd8cdaf0ad5 [gaim-migrate @ 9570]
Christian Hammond <chipx86@chipx86.com>
parents: 8669
diff changeset
825 {
9193
502707ca1836 [gaim-migrate @ 9988]
Christian Hammond <chipx86@chipx86.com>
parents: 9158
diff changeset
826 /* msn_userlist_move_buddy(); */
502707ca1836 [gaim-migrate @ 9988]
Christian Hammond <chipx86@chipx86.com>
parents: 9158
diff changeset
827 MsnUserList *userlist = cmdproc->session->userlist;
502707ca1836 [gaim-migrate @ 9988]
Christian Hammond <chipx86@chipx86.com>
parents: 9158
diff changeset
828 MsnMoveBuddy *data = cmd->trans->data;
5309
e2e53316a21d [gaim-migrate @ 5681]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
829
9193
502707ca1836 [gaim-migrate @ 9988]
Christian Hammond <chipx86@chipx86.com>
parents: 9158
diff changeset
830 if (data->old_group_name != NULL)
502707ca1836 [gaim-migrate @ 9988]
Christian Hammond <chipx86@chipx86.com>
parents: 9158
diff changeset
831 {
502707ca1836 [gaim-migrate @ 9988]
Christian Hammond <chipx86@chipx86.com>
parents: 9158
diff changeset
832 msn_userlist_rem_buddy(userlist, data->who, MSN_LIST_FL, data->old_group_name);
502707ca1836 [gaim-migrate @ 9988]
Christian Hammond <chipx86@chipx86.com>
parents: 9158
diff changeset
833 g_free(data->old_group_name);
502707ca1836 [gaim-migrate @ 9988]
Christian Hammond <chipx86@chipx86.com>
parents: 9158
diff changeset
834 }
9198
ab6636c5a136 [gaim-migrate @ 9993]
Christian Hammond <chipx86@chipx86.com>
parents: 9197
diff changeset
835
9193
502707ca1836 [gaim-migrate @ 9988]
Christian Hammond <chipx86@chipx86.com>
parents: 9158
diff changeset
836 msn_userlist_add_buddy(userlist, data->who, MSN_LIST_FL, group_name);
502707ca1836 [gaim-migrate @ 9988]
Christian Hammond <chipx86@chipx86.com>
parents: 9158
diff changeset
837 g_free(data->who);
5963
eb336b2c451f [gaim-migrate @ 6410]
Christian Hammond <chipx86@chipx86.com>
parents: 5962
diff changeset
838
5361
953aa05279f4 [gaim-migrate @ 5737]
Christian Hammond <chipx86@chipx86.com>
parents: 5358
diff changeset
839 }
953aa05279f4 [gaim-migrate @ 5737]
Christian Hammond <chipx86@chipx86.com>
parents: 5358
diff changeset
840 }
953aa05279f4 [gaim-migrate @ 5737]
Christian Hammond <chipx86@chipx86.com>
parents: 5358
diff changeset
841
8808
bbd8cdaf0ad5 [gaim-migrate @ 9570]
Christian Hammond <chipx86@chipx86.com>
parents: 8669
diff changeset
842 static void
bbd8cdaf0ad5 [gaim-migrate @ 9570]
Christian Hammond <chipx86@chipx86.com>
parents: 8669
diff changeset
843 fln_cmd(MsnCmdProc *cmdproc, MsnCommand *cmd)
5309
e2e53316a21d [gaim-migrate @ 5681]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
844 {
10296
a7b2fd5efcf2 [gaim-migrate @ 11476]
Stu Tomlinson <stu@nosnilmot.com>
parents: 10284
diff changeset
845 MsnSlpLink *slplink;
10451
92d4a25fd33c [gaim-migrate @ 11717]
Stu Tomlinson <stu@nosnilmot.com>
parents: 10403
diff changeset
846 MsnUser *user;
10296
a7b2fd5efcf2 [gaim-migrate @ 11476]
Stu Tomlinson <stu@nosnilmot.com>
parents: 10284
diff changeset
847
10451
92d4a25fd33c [gaim-migrate @ 11717]
Stu Tomlinson <stu@nosnilmot.com>
parents: 10403
diff changeset
848 user = msn_userlist_find_user(cmdproc->session->userlist, cmd->params[0]);
5309
e2e53316a21d [gaim-migrate @ 5681]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
849
10451
92d4a25fd33c [gaim-migrate @ 11717]
Stu Tomlinson <stu@nosnilmot.com>
parents: 10403
diff changeset
850 user->status = "offline";
92d4a25fd33c [gaim-migrate @ 11717]
Stu Tomlinson <stu@nosnilmot.com>
parents: 10403
diff changeset
851 msn_user_update(user);
10296
a7b2fd5efcf2 [gaim-migrate @ 11476]
Stu Tomlinson <stu@nosnilmot.com>
parents: 10284
diff changeset
852
a7b2fd5efcf2 [gaim-migrate @ 11476]
Stu Tomlinson <stu@nosnilmot.com>
parents: 10284
diff changeset
853 slplink = msn_session_find_slplink(cmdproc->session, cmd->params[0]);
a7b2fd5efcf2 [gaim-migrate @ 11476]
Stu Tomlinson <stu@nosnilmot.com>
parents: 10284
diff changeset
854
a7b2fd5efcf2 [gaim-migrate @ 11476]
Stu Tomlinson <stu@nosnilmot.com>
parents: 10284
diff changeset
855 if (slplink != NULL)
a7b2fd5efcf2 [gaim-migrate @ 11476]
Stu Tomlinson <stu@nosnilmot.com>
parents: 10284
diff changeset
856 msn_slplink_destroy(slplink);
a7b2fd5efcf2 [gaim-migrate @ 11476]
Stu Tomlinson <stu@nosnilmot.com>
parents: 10284
diff changeset
857
5309
e2e53316a21d [gaim-migrate @ 5681]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
858 }
e2e53316a21d [gaim-migrate @ 5681]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
859
8808
bbd8cdaf0ad5 [gaim-migrate @ 9570]
Christian Hammond <chipx86@chipx86.com>
parents: 8669
diff changeset
860 static void
bbd8cdaf0ad5 [gaim-migrate @ 9570]
Christian Hammond <chipx86@chipx86.com>
parents: 8669
diff changeset
861 iln_cmd(MsnCmdProc *cmdproc, MsnCommand *cmd)
5309
e2e53316a21d [gaim-migrate @ 5681]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
862 {
8808
bbd8cdaf0ad5 [gaim-migrate @ 9570]
Christian Hammond <chipx86@chipx86.com>
parents: 8669
diff changeset
863 MsnSession *session;
10010
56e34a659db2 [gaim-migrate @ 10927]
Mark Doliner <mark@kingant.net>
parents: 9967
diff changeset
864 GaimAccount *account;
8808
bbd8cdaf0ad5 [gaim-migrate @ 9570]
Christian Hammond <chipx86@chipx86.com>
parents: 8669
diff changeset
865 GaimConnection *gc;
6800
8f228a7d5076 [gaim-migrate @ 7340]
Christian Hammond <chipx86@chipx86.com>
parents: 6779
diff changeset
866 MsnUser *user;
8f228a7d5076 [gaim-migrate @ 7340]
Christian Hammond <chipx86@chipx86.com>
parents: 6779
diff changeset
867 MsnObject *msnobj;
19741
b99512bd6d85 [gaim-migrate @ 16547]
Ma Yuan <mayuan2006@gmail.com>
parents: 19740
diff changeset
868 int wlmclient;
10451
92d4a25fd33c [gaim-migrate @ 11717]
Stu Tomlinson <stu@nosnilmot.com>
parents: 10403
diff changeset
869 const char *state, *passport, *friendly;
5309
e2e53316a21d [gaim-migrate @ 5681]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
870
8808
bbd8cdaf0ad5 [gaim-migrate @ 9570]
Christian Hammond <chipx86@chipx86.com>
parents: 8669
diff changeset
871 session = cmdproc->session;
10010
56e34a659db2 [gaim-migrate @ 10927]
Mark Doliner <mark@kingant.net>
parents: 9967
diff changeset
872 account = session->account;
56e34a659db2 [gaim-migrate @ 10927]
Mark Doliner <mark@kingant.net>
parents: 9967
diff changeset
873 gc = gaim_account_get_connection(account);
8808
bbd8cdaf0ad5 [gaim-migrate @ 9570]
Christian Hammond <chipx86@chipx86.com>
parents: 8669
diff changeset
874
bbd8cdaf0ad5 [gaim-migrate @ 9570]
Christian Hammond <chipx86@chipx86.com>
parents: 8669
diff changeset
875 state = cmd->params[1];
bbd8cdaf0ad5 [gaim-migrate @ 9570]
Christian Hammond <chipx86@chipx86.com>
parents: 8669
diff changeset
876 passport = cmd->params[2];
19753
88b0c434259a [gaim-migrate @ 16733]
Ma Yuan <mayuan2006@gmail.com>
parents: 19752
diff changeset
877 /*if a contact is actually on the WLM part or the yahoo part*/
19741
b99512bd6d85 [gaim-migrate @ 16547]
Ma Yuan <mayuan2006@gmail.com>
parents: 19740
diff changeset
878 wlmclient = atoi(cmd->params[3]);
b99512bd6d85 [gaim-migrate @ 16547]
Ma Yuan <mayuan2006@gmail.com>
parents: 19740
diff changeset
879 friendly = gaim_url_decode(cmd->params[4]);
5309
e2e53316a21d [gaim-migrate @ 5681]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
880
9193
502707ca1836 [gaim-migrate @ 9988]
Christian Hammond <chipx86@chipx86.com>
parents: 9158
diff changeset
881 user = msn_userlist_find_user(session->userlist, passport);
6858
885c6528843b [gaim-migrate @ 7403]
Christian Hammond <chipx86@chipx86.com>
parents: 6833
diff changeset
882
9193
502707ca1836 [gaim-migrate @ 9988]
Christian Hammond <chipx86@chipx86.com>
parents: 9158
diff changeset
883 serv_got_alias(gc, passport, friendly);
6833
ccfbd7c552ba [gaim-migrate @ 7378]
Christian Hammond <chipx86@chipx86.com>
parents: 6830
diff changeset
884
9193
502707ca1836 [gaim-migrate @ 9988]
Christian Hammond <chipx86@chipx86.com>
parents: 9158
diff changeset
885 msn_user_set_friendly_name(user, friendly);
6858
885c6528843b [gaim-migrate @ 7403]
Christian Hammond <chipx86@chipx86.com>
parents: 6833
diff changeset
886
19741
b99512bd6d85 [gaim-migrate @ 16547]
Ma Yuan <mayuan2006@gmail.com>
parents: 19740
diff changeset
887 if (session->protocol_ver >= 9 && cmd->param_count == 7){
b99512bd6d85 [gaim-migrate @ 16547]
Ma Yuan <mayuan2006@gmail.com>
parents: 19740
diff changeset
888 msnobj = msn_object_new_from_string(gaim_url_decode(cmd->params[6]));
6800
8f228a7d5076 [gaim-migrate @ 7340]
Christian Hammond <chipx86@chipx86.com>
parents: 6779
diff changeset
889 msn_user_set_object(user, msnobj);
8f228a7d5076 [gaim-migrate @ 7340]
Christian Hammond <chipx86@chipx86.com>
parents: 6779
diff changeset
890 }
8f228a7d5076 [gaim-migrate @ 7340]
Christian Hammond <chipx86@chipx86.com>
parents: 6779
diff changeset
891
10451
92d4a25fd33c [gaim-migrate @ 11717]
Stu Tomlinson <stu@nosnilmot.com>
parents: 10403
diff changeset
892 msn_user_set_state(user, state);
92d4a25fd33c [gaim-migrate @ 11717]
Stu Tomlinson <stu@nosnilmot.com>
parents: 10403
diff changeset
893 msn_user_update(user);
9193
502707ca1836 [gaim-migrate @ 9988]
Christian Hammond <chipx86@chipx86.com>
parents: 9158
diff changeset
894 }
502707ca1836 [gaim-migrate @ 9988]
Christian Hammond <chipx86@chipx86.com>
parents: 9158
diff changeset
895
502707ca1836 [gaim-migrate @ 9988]
Christian Hammond <chipx86@chipx86.com>
parents: 9158
diff changeset
896 static void
502707ca1836 [gaim-migrate @ 9988]
Christian Hammond <chipx86@chipx86.com>
parents: 9158
diff changeset
897 ipg_cmd_post(MsnCmdProc *cmdproc, MsnCommand *cmd, char *payload, size_t len)
502707ca1836 [gaim-migrate @ 9988]
Christian Hammond <chipx86@chipx86.com>
parents: 9158
diff changeset
898 {
502707ca1836 [gaim-migrate @ 9988]
Christian Hammond <chipx86@chipx86.com>
parents: 9158
diff changeset
899 #if 0
502707ca1836 [gaim-migrate @ 9988]
Christian Hammond <chipx86@chipx86.com>
parents: 9158
diff changeset
900 gaim_debug_misc("msn", "Incoming Page: {%s}\n", payload);
502707ca1836 [gaim-migrate @ 9988]
Christian Hammond <chipx86@chipx86.com>
parents: 9158
diff changeset
901 #endif
5309
e2e53316a21d [gaim-migrate @ 5681]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
902 }
e2e53316a21d [gaim-migrate @ 5681]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
903
8808
bbd8cdaf0ad5 [gaim-migrate @ 9570]
Christian Hammond <chipx86@chipx86.com>
parents: 8669
diff changeset
904 static void
bbd8cdaf0ad5 [gaim-migrate @ 9570]
Christian Hammond <chipx86@chipx86.com>
parents: 8669
diff changeset
905 ipg_cmd(MsnCmdProc *cmdproc, MsnCommand *cmd)
5960
03bf7c905782 [gaim-migrate @ 6407]
Christian Hammond <chipx86@chipx86.com>
parents: 5933
diff changeset
906 {
8926
8ef82d89faf3 [gaim-migrate @ 9696]
Luke Schierer <lschiere@pidgin.im>
parents: 8924
diff changeset
907 cmdproc->servconn->payload_len = atoi(cmd->params[0]);
9193
502707ca1836 [gaim-migrate @ 9988]
Christian Hammond <chipx86@chipx86.com>
parents: 9158
diff changeset
908 cmdproc->last_cmd->payload_cb = ipg_cmd_post;
5309
e2e53316a21d [gaim-migrate @ 5681]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
909 }
e2e53316a21d [gaim-migrate @ 5681]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
910
8808
bbd8cdaf0ad5 [gaim-migrate @ 9570]
Christian Hammond <chipx86@chipx86.com>
parents: 8669
diff changeset
911 static void
bbd8cdaf0ad5 [gaim-migrate @ 9570]
Christian Hammond <chipx86@chipx86.com>
parents: 8669
diff changeset
912 nln_cmd(MsnCmdProc *cmdproc, MsnCommand *cmd)
5309
e2e53316a21d [gaim-migrate @ 5681]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
913 {
8808
bbd8cdaf0ad5 [gaim-migrate @ 9570]
Christian Hammond <chipx86@chipx86.com>
parents: 8669
diff changeset
914 MsnSession *session;
10010
56e34a659db2 [gaim-migrate @ 10927]
Mark Doliner <mark@kingant.net>
parents: 9967
diff changeset
915 GaimAccount *account;
8808
bbd8cdaf0ad5 [gaim-migrate @ 9570]
Christian Hammond <chipx86@chipx86.com>
parents: 8669
diff changeset
916 GaimConnection *gc;
6829
dff2d0a282e7 [gaim-migrate @ 7374]
Christian Hammond <chipx86@chipx86.com>
parents: 6828
diff changeset
917 MsnUser *user;
dff2d0a282e7 [gaim-migrate @ 7374]
Christian Hammond <chipx86@chipx86.com>
parents: 6828
diff changeset
918 MsnObject *msnobj;
11819
1452a3a9f07a [gaim-migrate @ 14110]
Richard Laager <rlaager@wiktel.com>
parents: 11321
diff changeset
919 int clientid;
19741
b99512bd6d85 [gaim-migrate @ 16547]
Ma Yuan <mayuan2006@gmail.com>
parents: 19740
diff changeset
920 int wlmclient;
10451
92d4a25fd33c [gaim-migrate @ 11717]
Stu Tomlinson <stu@nosnilmot.com>
parents: 10403
diff changeset
921 const char *state, *passport, *friendly;
5309
e2e53316a21d [gaim-migrate @ 5681]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
922
8808
bbd8cdaf0ad5 [gaim-migrate @ 9570]
Christian Hammond <chipx86@chipx86.com>
parents: 8669
diff changeset
923 session = cmdproc->session;
10010
56e34a659db2 [gaim-migrate @ 10927]
Mark Doliner <mark@kingant.net>
parents: 9967
diff changeset
924 account = session->account;
56e34a659db2 [gaim-migrate @ 10927]
Mark Doliner <mark@kingant.net>
parents: 9967
diff changeset
925 gc = gaim_account_get_connection(account);
8808
bbd8cdaf0ad5 [gaim-migrate @ 9570]
Christian Hammond <chipx86@chipx86.com>
parents: 8669
diff changeset
926
bbd8cdaf0ad5 [gaim-migrate @ 9570]
Christian Hammond <chipx86@chipx86.com>
parents: 8669
diff changeset
927 state = cmd->params[0];
bbd8cdaf0ad5 [gaim-migrate @ 9570]
Christian Hammond <chipx86@chipx86.com>
parents: 8669
diff changeset
928 passport = cmd->params[1];
19741
b99512bd6d85 [gaim-migrate @ 16547]
Ma Yuan <mayuan2006@gmail.com>
parents: 19740
diff changeset
929 wlmclient = atoi(cmd->params[2]);
b99512bd6d85 [gaim-migrate @ 16547]
Ma Yuan <mayuan2006@gmail.com>
parents: 19740
diff changeset
930 friendly = gaim_url_decode(cmd->params[3]);
5309
e2e53316a21d [gaim-migrate @ 5681]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
931
9193
502707ca1836 [gaim-migrate @ 9988]
Christian Hammond <chipx86@chipx86.com>
parents: 9158
diff changeset
932 user = msn_userlist_find_user(session->userlist, passport);
6858
885c6528843b [gaim-migrate @ 7403]
Christian Hammond <chipx86@chipx86.com>
parents: 6833
diff changeset
933
9193
502707ca1836 [gaim-migrate @ 9988]
Christian Hammond <chipx86@chipx86.com>
parents: 9158
diff changeset
934 serv_got_alias(gc, passport, friendly);
6833
ccfbd7c552ba [gaim-migrate @ 7378]
Christian Hammond <chipx86@chipx86.com>
parents: 6830
diff changeset
935
9193
502707ca1836 [gaim-migrate @ 9988]
Christian Hammond <chipx86@chipx86.com>
parents: 9158
diff changeset
936 msn_user_set_friendly_name(user, friendly);
6858
885c6528843b [gaim-migrate @ 7403]
Christian Hammond <chipx86@chipx86.com>
parents: 6833
diff changeset
937
19739
852b32710df0 [gaim-migrate @ 16507]
Ma Yuan <mayuan2006@gmail.com>
parents: 19738
diff changeset
938 if (session->protocol_ver >= 9){
19741
b99512bd6d85 [gaim-migrate @ 16547]
Ma Yuan <mayuan2006@gmail.com>
parents: 19740
diff changeset
939 if (cmd->param_count == 6){
b99512bd6d85 [gaim-migrate @ 16547]
Ma Yuan <mayuan2006@gmail.com>
parents: 19740
diff changeset
940 msnobj = msn_object_new_from_string(gaim_url_decode(cmd->params[5]));
9859
42f6b69c9d8e [gaim-migrate @ 10738]
Luke Schierer <lschiere@pidgin.im>
parents: 9363
diff changeset
941 msn_user_set_object(user, msnobj);
19739
852b32710df0 [gaim-migrate @ 16507]
Ma Yuan <mayuan2006@gmail.com>
parents: 19738
diff changeset
942 }else{
9859
42f6b69c9d8e [gaim-migrate @ 10738]
Luke Schierer <lschiere@pidgin.im>
parents: 9363
diff changeset
943 msn_user_set_object(user, NULL);
42f6b69c9d8e [gaim-migrate @ 10738]
Luke Schierer <lschiere@pidgin.im>
parents: 9363
diff changeset
944 }
6829
dff2d0a282e7 [gaim-migrate @ 7374]
Christian Hammond <chipx86@chipx86.com>
parents: 6828
diff changeset
945 }
dff2d0a282e7 [gaim-migrate @ 7374]
Christian Hammond <chipx86@chipx86.com>
parents: 6828
diff changeset
946
19741
b99512bd6d85 [gaim-migrate @ 16547]
Ma Yuan <mayuan2006@gmail.com>
parents: 19740
diff changeset
947 clientid = atoi(cmd->params[4]);
11819
1452a3a9f07a [gaim-migrate @ 14110]
Richard Laager <rlaager@wiktel.com>
parents: 11321
diff changeset
948 user->mobile = (clientid & MSN_CLIENT_CAP_MSNMOBILE);
1452a3a9f07a [gaim-migrate @ 14110]
Richard Laager <rlaager@wiktel.com>
parents: 11321
diff changeset
949
10451
92d4a25fd33c [gaim-migrate @ 11717]
Stu Tomlinson <stu@nosnilmot.com>
parents: 10403
diff changeset
950 msn_user_set_state(user, state);
92d4a25fd33c [gaim-migrate @ 11717]
Stu Tomlinson <stu@nosnilmot.com>
parents: 10403
diff changeset
951 msn_user_update(user);
9158
c30d81b4dd22 [gaim-migrate @ 9942]
Christian Hammond <chipx86@chipx86.com>
parents: 8926
diff changeset
952 }
c30d81b4dd22 [gaim-migrate @ 9942]
Christian Hammond <chipx86@chipx86.com>
parents: 8926
diff changeset
953
11992
c824e39db0e7 [gaim-migrate @ 14285]
Stu Tomlinson <stu@nosnilmot.com>
parents: 11862
diff changeset
954 #if 0
9158
c30d81b4dd22 [gaim-migrate @ 9942]
Christian Hammond <chipx86@chipx86.com>
parents: 8926
diff changeset
955 static void
9193
502707ca1836 [gaim-migrate @ 9988]
Christian Hammond <chipx86@chipx86.com>
parents: 9158
diff changeset
956 chg_cmd(MsnCmdProc *cmdproc, MsnCommand *cmd)
502707ca1836 [gaim-migrate @ 9988]
Christian Hammond <chipx86@chipx86.com>
parents: 9158
diff changeset
957 {
502707ca1836 [gaim-migrate @ 9988]
Christian Hammond <chipx86@chipx86.com>
parents: 9158
diff changeset
958 char *state = cmd->params[1];
502707ca1836 [gaim-migrate @ 9988]
Christian Hammond <chipx86@chipx86.com>
parents: 9158
diff changeset
959 int state_id = 0;
502707ca1836 [gaim-migrate @ 9988]
Christian Hammond <chipx86@chipx86.com>
parents: 9158
diff changeset
960
502707ca1836 [gaim-migrate @ 9988]
Christian Hammond <chipx86@chipx86.com>
parents: 9158
diff changeset
961 if (!strcmp(state, "NLN"))
502707ca1836 [gaim-migrate @ 9988]
Christian Hammond <chipx86@chipx86.com>
parents: 9158
diff changeset
962 state_id = MSN_ONLINE;
502707ca1836 [gaim-migrate @ 9988]
Christian Hammond <chipx86@chipx86.com>
parents: 9158
diff changeset
963 else if (!strcmp(state, "BSY"))
502707ca1836 [gaim-migrate @ 9988]
Christian Hammond <chipx86@chipx86.com>
parents: 9158
diff changeset
964 state_id = MSN_BUSY;
502707ca1836 [gaim-migrate @ 9988]
Christian Hammond <chipx86@chipx86.com>
parents: 9158
diff changeset
965 else if (!strcmp(state, "IDL"))
502707ca1836 [gaim-migrate @ 9988]
Christian Hammond <chipx86@chipx86.com>
parents: 9158
diff changeset
966 state_id = MSN_IDLE;
502707ca1836 [gaim-migrate @ 9988]
Christian Hammond <chipx86@chipx86.com>
parents: 9158
diff changeset
967 else if (!strcmp(state, "BRB"))
502707ca1836 [gaim-migrate @ 9988]
Christian Hammond <chipx86@chipx86.com>
parents: 9158
diff changeset
968 state_id = MSN_BRB;
502707ca1836 [gaim-migrate @ 9988]
Christian Hammond <chipx86@chipx86.com>
parents: 9158
diff changeset
969 else if (!strcmp(state, "AWY"))
502707ca1836 [gaim-migrate @ 9988]
Christian Hammond <chipx86@chipx86.com>
parents: 9158
diff changeset
970 state_id = MSN_AWAY;
502707ca1836 [gaim-migrate @ 9988]
Christian Hammond <chipx86@chipx86.com>
parents: 9158
diff changeset
971 else if (!strcmp(state, "PHN"))
502707ca1836 [gaim-migrate @ 9988]
Christian Hammond <chipx86@chipx86.com>
parents: 9158
diff changeset
972 state_id = MSN_PHONE;
502707ca1836 [gaim-migrate @ 9988]
Christian Hammond <chipx86@chipx86.com>
parents: 9158
diff changeset
973 else if (!strcmp(state, "LUN"))
502707ca1836 [gaim-migrate @ 9988]
Christian Hammond <chipx86@chipx86.com>
parents: 9158
diff changeset
974 state_id = MSN_LUNCH;
502707ca1836 [gaim-migrate @ 9988]
Christian Hammond <chipx86@chipx86.com>
parents: 9158
diff changeset
975 else if (!strcmp(state, "HDN"))
502707ca1836 [gaim-migrate @ 9988]
Christian Hammond <chipx86@chipx86.com>
parents: 9158
diff changeset
976 state_id = MSN_HIDDEN;
502707ca1836 [gaim-migrate @ 9988]
Christian Hammond <chipx86@chipx86.com>
parents: 9158
diff changeset
977
502707ca1836 [gaim-migrate @ 9988]
Christian Hammond <chipx86@chipx86.com>
parents: 9158
diff changeset
978 cmdproc->session->state = state_id;
502707ca1836 [gaim-migrate @ 9988]
Christian Hammond <chipx86@chipx86.com>
parents: 9158
diff changeset
979 }
11992
c824e39db0e7 [gaim-migrate @ 14285]
Stu Tomlinson <stu@nosnilmot.com>
parents: 11862
diff changeset
980 #endif
9193
502707ca1836 [gaim-migrate @ 9988]
Christian Hammond <chipx86@chipx86.com>
parents: 9158
diff changeset
981
502707ca1836 [gaim-migrate @ 9988]
Christian Hammond <chipx86@chipx86.com>
parents: 9158
diff changeset
982
502707ca1836 [gaim-migrate @ 9988]
Christian Hammond <chipx86@chipx86.com>
parents: 9158
diff changeset
983 static void
502707ca1836 [gaim-migrate @ 9988]
Christian Hammond <chipx86@chipx86.com>
parents: 9158
diff changeset
984 not_cmd_post(MsnCmdProc *cmdproc, MsnCommand *cmd, char *payload, size_t len)
9158
c30d81b4dd22 [gaim-migrate @ 9942]
Christian Hammond <chipx86@chipx86.com>
parents: 8926
diff changeset
985 {
c30d81b4dd22 [gaim-migrate @ 9942]
Christian Hammond <chipx86@chipx86.com>
parents: 8926
diff changeset
986 #if 0
9193
502707ca1836 [gaim-migrate @ 9988]
Christian Hammond <chipx86@chipx86.com>
parents: 9158
diff changeset
987 MSN_SET_PARAMS("NOT %d\r\n%s", cmdproc->servconn->payload, payload);
9158
c30d81b4dd22 [gaim-migrate @ 9942]
Christian Hammond <chipx86@chipx86.com>
parents: 8926
diff changeset
988 gaim_debug_misc("msn", "Notification: {%s}\n", payload);
c30d81b4dd22 [gaim-migrate @ 9942]
Christian Hammond <chipx86@chipx86.com>
parents: 8926
diff changeset
989 #endif
8808
bbd8cdaf0ad5 [gaim-migrate @ 9570]
Christian Hammond <chipx86@chipx86.com>
parents: 8669
diff changeset
990 }
5309
e2e53316a21d [gaim-migrate @ 5681]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
991
8808
bbd8cdaf0ad5 [gaim-migrate @ 9570]
Christian Hammond <chipx86@chipx86.com>
parents: 8669
diff changeset
992 static void
bbd8cdaf0ad5 [gaim-migrate @ 9570]
Christian Hammond <chipx86@chipx86.com>
parents: 8669
diff changeset
993 not_cmd(MsnCmdProc *cmdproc, MsnCommand *cmd)
bbd8cdaf0ad5 [gaim-migrate @ 9570]
Christian Hammond <chipx86@chipx86.com>
parents: 8669
diff changeset
994 {
8926
8ef82d89faf3 [gaim-migrate @ 9696]
Luke Schierer <lschiere@pidgin.im>
parents: 8924
diff changeset
995 cmdproc->servconn->payload_len = atoi(cmd->params[0]);
9193
502707ca1836 [gaim-migrate @ 9988]
Christian Hammond <chipx86@chipx86.com>
parents: 9158
diff changeset
996 cmdproc->last_cmd->payload_cb = not_cmd_post;
5363
ebebc833cf77 [gaim-migrate @ 5739]
Christian Hammond <chipx86@chipx86.com>
parents: 5361
diff changeset
997 }
ebebc833cf77 [gaim-migrate @ 5739]
Christian Hammond <chipx86@chipx86.com>
parents: 5361
diff changeset
998
8808
bbd8cdaf0ad5 [gaim-migrate @ 9570]
Christian Hammond <chipx86@chipx86.com>
parents: 8669
diff changeset
999 static void
bbd8cdaf0ad5 [gaim-migrate @ 9570]
Christian Hammond <chipx86@chipx86.com>
parents: 8669
diff changeset
1000 rea_cmd(MsnCmdProc *cmdproc, MsnCommand *cmd)
5309
e2e53316a21d [gaim-migrate @ 5681]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
1001 {
10451
92d4a25fd33c [gaim-migrate @ 11717]
Stu Tomlinson <stu@nosnilmot.com>
parents: 10403
diff changeset
1002 /* TODO: This might be for us too */
9193
502707ca1836 [gaim-migrate @ 9988]
Christian Hammond <chipx86@chipx86.com>
parents: 9158
diff changeset
1003
8808
bbd8cdaf0ad5 [gaim-migrate @ 9570]
Christian Hammond <chipx86@chipx86.com>
parents: 8669
diff changeset
1004 MsnSession *session;
bbd8cdaf0ad5 [gaim-migrate @ 9570]
Christian Hammond <chipx86@chipx86.com>
parents: 8669
diff changeset
1005 GaimConnection *gc;
9193
502707ca1836 [gaim-migrate @ 9988]
Christian Hammond <chipx86@chipx86.com>
parents: 9158
diff changeset
1006 const char *friendly;
5309
e2e53316a21d [gaim-migrate @ 5681]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
1007
8808
bbd8cdaf0ad5 [gaim-migrate @ 9570]
Christian Hammond <chipx86@chipx86.com>
parents: 8669
diff changeset
1008 session = cmdproc->session;
bbd8cdaf0ad5 [gaim-migrate @ 9570]
Christian Hammond <chipx86@chipx86.com>
parents: 8669
diff changeset
1009 gc = session->account->gc;
9193
502707ca1836 [gaim-migrate @ 9988]
Christian Hammond <chipx86@chipx86.com>
parents: 9158
diff changeset
1010 friendly = gaim_url_decode(cmd->params[3]);
5309
e2e53316a21d [gaim-migrate @ 5681]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
1011
9193
502707ca1836 [gaim-migrate @ 9988]
Christian Hammond <chipx86@chipx86.com>
parents: 9158
diff changeset
1012 gaim_connection_set_display_name(gc, friendly);
5309
e2e53316a21d [gaim-migrate @ 5681]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
1013 }
e2e53316a21d [gaim-migrate @ 5681]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
1014
8808
bbd8cdaf0ad5 [gaim-migrate @ 9570]
Christian Hammond <chipx86@chipx86.com>
parents: 8669
diff changeset
1015 static void
10833
a60704081c3e [gaim-migrate @ 12503]
Stu Tomlinson <stu@nosnilmot.com>
parents: 10816
diff changeset
1016 prp_cmd(MsnCmdProc *cmdproc, MsnCommand *cmd)
a60704081c3e [gaim-migrate @ 12503]
Stu Tomlinson <stu@nosnilmot.com>
parents: 10816
diff changeset
1017 {
a60704081c3e [gaim-migrate @ 12503]
Stu Tomlinson <stu@nosnilmot.com>
parents: 10816
diff changeset
1018 MsnSession *session = cmdproc->session;
a60704081c3e [gaim-migrate @ 12503]
Stu Tomlinson <stu@nosnilmot.com>
parents: 10816
diff changeset
1019 const char *type, *value;
a60704081c3e [gaim-migrate @ 12503]
Stu Tomlinson <stu@nosnilmot.com>
parents: 10816
diff changeset
1020
a60704081c3e [gaim-migrate @ 12503]
Stu Tomlinson <stu@nosnilmot.com>
parents: 10816
diff changeset
1021 g_return_if_fail(cmd->param_count >= 3);
a60704081c3e [gaim-migrate @ 12503]
Stu Tomlinson <stu@nosnilmot.com>
parents: 10816
diff changeset
1022
a60704081c3e [gaim-migrate @ 12503]
Stu Tomlinson <stu@nosnilmot.com>
parents: 10816
diff changeset
1023 type = cmd->params[2];
a60704081c3e [gaim-migrate @ 12503]
Stu Tomlinson <stu@nosnilmot.com>
parents: 10816
diff changeset
1024
a60704081c3e [gaim-migrate @ 12503]
Stu Tomlinson <stu@nosnilmot.com>
parents: 10816
diff changeset
1025 if (cmd->param_count == 4)
a60704081c3e [gaim-migrate @ 12503]
Stu Tomlinson <stu@nosnilmot.com>
parents: 10816
diff changeset
1026 {
a60704081c3e [gaim-migrate @ 12503]
Stu Tomlinson <stu@nosnilmot.com>
parents: 10816
diff changeset
1027 value = cmd->params[3];
a60704081c3e [gaim-migrate @ 12503]
Stu Tomlinson <stu@nosnilmot.com>
parents: 10816
diff changeset
1028 if (!strcmp(type, "PHH"))
a60704081c3e [gaim-migrate @ 12503]
Stu Tomlinson <stu@nosnilmot.com>
parents: 10816
diff changeset
1029 msn_user_set_home_phone(session->user, gaim_url_decode(value));
a60704081c3e [gaim-migrate @ 12503]
Stu Tomlinson <stu@nosnilmot.com>
parents: 10816
diff changeset
1030 else if (!strcmp(type, "PHW"))
a60704081c3e [gaim-migrate @ 12503]
Stu Tomlinson <stu@nosnilmot.com>
parents: 10816
diff changeset
1031 msn_user_set_work_phone(session->user, gaim_url_decode(value));
a60704081c3e [gaim-migrate @ 12503]
Stu Tomlinson <stu@nosnilmot.com>
parents: 10816
diff changeset
1032 else if (!strcmp(type, "PHM"))
a60704081c3e [gaim-migrate @ 12503]
Stu Tomlinson <stu@nosnilmot.com>
parents: 10816
diff changeset
1033 msn_user_set_mobile_phone(session->user, gaim_url_decode(value));
a60704081c3e [gaim-migrate @ 12503]
Stu Tomlinson <stu@nosnilmot.com>
parents: 10816
diff changeset
1034 }
a60704081c3e [gaim-migrate @ 12503]
Stu Tomlinson <stu@nosnilmot.com>
parents: 10816
diff changeset
1035 else
a60704081c3e [gaim-migrate @ 12503]
Stu Tomlinson <stu@nosnilmot.com>
parents: 10816
diff changeset
1036 {
a60704081c3e [gaim-migrate @ 12503]
Stu Tomlinson <stu@nosnilmot.com>
parents: 10816
diff changeset
1037 if (!strcmp(type, "PHH"))
a60704081c3e [gaim-migrate @ 12503]
Stu Tomlinson <stu@nosnilmot.com>
parents: 10816
diff changeset
1038 msn_user_set_home_phone(session->user, NULL);
a60704081c3e [gaim-migrate @ 12503]
Stu Tomlinson <stu@nosnilmot.com>
parents: 10816
diff changeset
1039 else if (!strcmp(type, "PHW"))
a60704081c3e [gaim-migrate @ 12503]
Stu Tomlinson <stu@nosnilmot.com>
parents: 10816
diff changeset
1040 msn_user_set_work_phone(session->user, NULL);
a60704081c3e [gaim-migrate @ 12503]
Stu Tomlinson <stu@nosnilmot.com>
parents: 10816
diff changeset
1041 else if (!strcmp(type, "PHM"))
a60704081c3e [gaim-migrate @ 12503]
Stu Tomlinson <stu@nosnilmot.com>
parents: 10816
diff changeset
1042 msn_user_set_mobile_phone(session->user, NULL);
a60704081c3e [gaim-migrate @ 12503]
Stu Tomlinson <stu@nosnilmot.com>
parents: 10816
diff changeset
1043 }
a60704081c3e [gaim-migrate @ 12503]
Stu Tomlinson <stu@nosnilmot.com>
parents: 10816
diff changeset
1044 }
a60704081c3e [gaim-migrate @ 12503]
Stu Tomlinson <stu@nosnilmot.com>
parents: 10816
diff changeset
1045
a60704081c3e [gaim-migrate @ 12503]
Stu Tomlinson <stu@nosnilmot.com>
parents: 10816
diff changeset
1046 static void
8808
bbd8cdaf0ad5 [gaim-migrate @ 9570]
Christian Hammond <chipx86@chipx86.com>
parents: 8669
diff changeset
1047 reg_cmd(MsnCmdProc *cmdproc, MsnCommand *cmd)
5318
bd98232872a3 [gaim-migrate @ 5690]
Christian Hammond <chipx86@chipx86.com>
parents: 5312
diff changeset
1048 {
8808
bbd8cdaf0ad5 [gaim-migrate @ 9570]
Christian Hammond <chipx86@chipx86.com>
parents: 8669
diff changeset
1049 MsnSession *session;
5518
bf2a7a7b739d [gaim-migrate @ 5918]
Christian Hammond <chipx86@chipx86.com>
parents: 5509
diff changeset
1050 int group_id;
7162
d14e026611c0 [gaim-migrate @ 7729]
Nathan Walp <nwalp@pidgin.im>
parents: 7134
diff changeset
1051 const char *group_name;
5318
bd98232872a3 [gaim-migrate @ 5690]
Christian Hammond <chipx86@chipx86.com>
parents: 5312
diff changeset
1052
8808
bbd8cdaf0ad5 [gaim-migrate @ 9570]
Christian Hammond <chipx86@chipx86.com>
parents: 8669
diff changeset
1053 session = cmdproc->session;
bbd8cdaf0ad5 [gaim-migrate @ 9570]
Christian Hammond <chipx86@chipx86.com>
parents: 8669
diff changeset
1054 group_id = atoi(cmd->params[2]);
bbd8cdaf0ad5 [gaim-migrate @ 9570]
Christian Hammond <chipx86@chipx86.com>
parents: 8669
diff changeset
1055 group_name = gaim_url_decode(cmd->params[3]);
5318
bd98232872a3 [gaim-migrate @ 5690]
Christian Hammond <chipx86@chipx86.com>
parents: 5312
diff changeset
1056
9193
502707ca1836 [gaim-migrate @ 9988]
Christian Hammond <chipx86@chipx86.com>
parents: 9158
diff changeset
1057 msn_userlist_rename_group_id(session->userlist, group_id, group_name);
5318
bd98232872a3 [gaim-migrate @ 5690]
Christian Hammond <chipx86@chipx86.com>
parents: 5312
diff changeset
1058 }
bd98232872a3 [gaim-migrate @ 5690]
Christian Hammond <chipx86@chipx86.com>
parents: 5312
diff changeset
1059
8808
bbd8cdaf0ad5 [gaim-migrate @ 9570]
Christian Hammond <chipx86@chipx86.com>
parents: 8669
diff changeset
1060 static void
10451
92d4a25fd33c [gaim-migrate @ 11717]
Stu Tomlinson <stu@nosnilmot.com>
parents: 10403
diff changeset
1061 reg_error(MsnCmdProc *cmdproc, MsnTransaction *trans, int error)
92d4a25fd33c [gaim-migrate @ 11717]
Stu Tomlinson <stu@nosnilmot.com>
parents: 10403
diff changeset
1062 {
19754
da3f8f7ec3ce [gaim-migrate @ 16737]
Ma Yuan <mayuan2006@gmail.com>
parents: 19753
diff changeset
1063 const char * group_id;
10451
92d4a25fd33c [gaim-migrate @ 11717]
Stu Tomlinson <stu@nosnilmot.com>
parents: 10403
diff changeset
1064 char **params;
92d4a25fd33c [gaim-migrate @ 11717]
Stu Tomlinson <stu@nosnilmot.com>
parents: 10403
diff changeset
1065
92d4a25fd33c [gaim-migrate @ 11717]
Stu Tomlinson <stu@nosnilmot.com>
parents: 10403
diff changeset
1066 params = g_strsplit(trans->params, " ", 0);
92d4a25fd33c [gaim-migrate @ 11717]
Stu Tomlinson <stu@nosnilmot.com>
parents: 10403
diff changeset
1067
19754
da3f8f7ec3ce [gaim-migrate @ 16737]
Ma Yuan <mayuan2006@gmail.com>
parents: 19753
diff changeset
1068 group_id = params[0];
10451
92d4a25fd33c [gaim-migrate @ 11717]
Stu Tomlinson <stu@nosnilmot.com>
parents: 10403
diff changeset
1069
92d4a25fd33c [gaim-migrate @ 11717]
Stu Tomlinson <stu@nosnilmot.com>
parents: 10403
diff changeset
1070 group_error_helper(cmdproc->session, _("Unable to rename group"), group_id, error);
92d4a25fd33c [gaim-migrate @ 11717]
Stu Tomlinson <stu@nosnilmot.com>
parents: 10403
diff changeset
1071
92d4a25fd33c [gaim-migrate @ 11717]
Stu Tomlinson <stu@nosnilmot.com>
parents: 10403
diff changeset
1072 g_strfreev(params);
92d4a25fd33c [gaim-migrate @ 11717]
Stu Tomlinson <stu@nosnilmot.com>
parents: 10403
diff changeset
1073 }
92d4a25fd33c [gaim-migrate @ 11717]
Stu Tomlinson <stu@nosnilmot.com>
parents: 10403
diff changeset
1074
92d4a25fd33c [gaim-migrate @ 11717]
Stu Tomlinson <stu@nosnilmot.com>
parents: 10403
diff changeset
1075 static void
8808
bbd8cdaf0ad5 [gaim-migrate @ 9570]
Christian Hammond <chipx86@chipx86.com>
parents: 8669
diff changeset
1076 rem_cmd(MsnCmdProc *cmdproc, MsnCommand *cmd)
5322
a4d017bee1de [gaim-migrate @ 5694]
Christian Hammond <chipx86@chipx86.com>
parents: 5318
diff changeset
1077 {
8808
bbd8cdaf0ad5 [gaim-migrate @ 9570]
Christian Hammond <chipx86@chipx86.com>
parents: 8669
diff changeset
1078 MsnSession *session;
9193
502707ca1836 [gaim-migrate @ 9988]
Christian Hammond <chipx86@chipx86.com>
parents: 9158
diff changeset
1079 MsnUser *user;
502707ca1836 [gaim-migrate @ 9988]
Christian Hammond <chipx86@chipx86.com>
parents: 9158
diff changeset
1080 const char *list;
8808
bbd8cdaf0ad5 [gaim-migrate @ 9570]
Christian Hammond <chipx86@chipx86.com>
parents: 8669
diff changeset
1081 const char *passport;
9193
502707ca1836 [gaim-migrate @ 9988]
Christian Hammond <chipx86@chipx86.com>
parents: 9158
diff changeset
1082 MsnListId list_id;
502707ca1836 [gaim-migrate @ 9988]
Christian Hammond <chipx86@chipx86.com>
parents: 9158
diff changeset
1083 int group_id;
6772
e719379c8a79 [gaim-migrate @ 7309]
Christian Hammond <chipx86@chipx86.com>
parents: 6767
diff changeset
1084
8808
bbd8cdaf0ad5 [gaim-migrate @ 9570]
Christian Hammond <chipx86@chipx86.com>
parents: 8669
diff changeset
1085 session = cmdproc->session;
9193
502707ca1836 [gaim-migrate @ 9988]
Christian Hammond <chipx86@chipx86.com>
parents: 9158
diff changeset
1086 list = cmd->params[1];
8808
bbd8cdaf0ad5 [gaim-migrate @ 9570]
Christian Hammond <chipx86@chipx86.com>
parents: 8669
diff changeset
1087 passport = cmd->params[3];
9193
502707ca1836 [gaim-migrate @ 9988]
Christian Hammond <chipx86@chipx86.com>
parents: 9158
diff changeset
1088 user = msn_userlist_find_user(session->userlist, passport);
502707ca1836 [gaim-migrate @ 9988]
Christian Hammond <chipx86@chipx86.com>
parents: 9158
diff changeset
1089
502707ca1836 [gaim-migrate @ 9988]
Christian Hammond <chipx86@chipx86.com>
parents: 9158
diff changeset
1090 g_return_if_fail(user != NULL);
502707ca1836 [gaim-migrate @ 9988]
Christian Hammond <chipx86@chipx86.com>
parents: 9158
diff changeset
1091
502707ca1836 [gaim-migrate @ 9988]
Christian Hammond <chipx86@chipx86.com>
parents: 9158
diff changeset
1092 list_id = msn_get_list_id(list);
8808
bbd8cdaf0ad5 [gaim-migrate @ 9570]
Christian Hammond <chipx86@chipx86.com>
parents: 8669
diff changeset
1093
bbd8cdaf0ad5 [gaim-migrate @ 9570]
Christian Hammond <chipx86@chipx86.com>
parents: 8669
diff changeset
1094 if (cmd->param_count == 5)
9193
502707ca1836 [gaim-migrate @ 9988]
Christian Hammond <chipx86@chipx86.com>
parents: 9158
diff changeset
1095 group_id = atoi(cmd->params[4]);
502707ca1836 [gaim-migrate @ 9988]
Christian Hammond <chipx86@chipx86.com>
parents: 9158
diff changeset
1096 else
502707ca1836 [gaim-migrate @ 9988]
Christian Hammond <chipx86@chipx86.com>
parents: 9158
diff changeset
1097 group_id = -1;
5518
bf2a7a7b739d [gaim-migrate @ 5918]
Christian Hammond <chipx86@chipx86.com>
parents: 5509
diff changeset
1098
9193
502707ca1836 [gaim-migrate @ 9988]
Christian Hammond <chipx86@chipx86.com>
parents: 9158
diff changeset
1099 msn_got_rem_user(session, user, list_id, group_id);
10451
92d4a25fd33c [gaim-migrate @ 11717]
Stu Tomlinson <stu@nosnilmot.com>
parents: 10403
diff changeset
1100 msn_user_update(user);
5322
a4d017bee1de [gaim-migrate @ 5694]
Christian Hammond <chipx86@chipx86.com>
parents: 5318
diff changeset
1101 }
a4d017bee1de [gaim-migrate @ 5694]
Christian Hammond <chipx86@chipx86.com>
parents: 5318
diff changeset
1102
8808
bbd8cdaf0ad5 [gaim-migrate @ 9570]
Christian Hammond <chipx86@chipx86.com>
parents: 8669
diff changeset
1103 static void
bbd8cdaf0ad5 [gaim-migrate @ 9570]
Christian Hammond <chipx86@chipx86.com>
parents: 8669
diff changeset
1104 rmg_cmd(MsnCmdProc *cmdproc, MsnCommand *cmd)
5518
bf2a7a7b739d [gaim-migrate @ 5918]
Christian Hammond <chipx86@chipx86.com>
parents: 5509
diff changeset
1105 {
8808
bbd8cdaf0ad5 [gaim-migrate @ 9570]
Christian Hammond <chipx86@chipx86.com>
parents: 8669
diff changeset
1106 MsnSession *session;
9193
502707ca1836 [gaim-migrate @ 9988]
Christian Hammond <chipx86@chipx86.com>
parents: 9158
diff changeset
1107 int group_id;
5518
bf2a7a7b739d [gaim-migrate @ 5918]
Christian Hammond <chipx86@chipx86.com>
parents: 5509
diff changeset
1108
8808
bbd8cdaf0ad5 [gaim-migrate @ 9570]
Christian Hammond <chipx86@chipx86.com>
parents: 8669
diff changeset
1109 session = cmdproc->session;
9193
502707ca1836 [gaim-migrate @ 9988]
Christian Hammond <chipx86@chipx86.com>
parents: 9158
diff changeset
1110 group_id = atoi(cmd->params[2]);
5518
bf2a7a7b739d [gaim-migrate @ 5918]
Christian Hammond <chipx86@chipx86.com>
parents: 5509
diff changeset
1111
9193
502707ca1836 [gaim-migrate @ 9988]
Christian Hammond <chipx86@chipx86.com>
parents: 9158
diff changeset
1112 msn_userlist_remove_group_id(session->userlist, group_id);
5518
bf2a7a7b739d [gaim-migrate @ 5918]
Christian Hammond <chipx86@chipx86.com>
parents: 5509
diff changeset
1113 }
bf2a7a7b739d [gaim-migrate @ 5918]
Christian Hammond <chipx86@chipx86.com>
parents: 5509
diff changeset
1114
8808
bbd8cdaf0ad5 [gaim-migrate @ 9570]
Christian Hammond <chipx86@chipx86.com>
parents: 8669
diff changeset
1115 static void
10451
92d4a25fd33c [gaim-migrate @ 11717]
Stu Tomlinson <stu@nosnilmot.com>
parents: 10403
diff changeset
1116 rmg_error(MsnCmdProc *cmdproc, MsnTransaction *trans, int error)
92d4a25fd33c [gaim-migrate @ 11717]
Stu Tomlinson <stu@nosnilmot.com>
parents: 10403
diff changeset
1117 {
92d4a25fd33c [gaim-migrate @ 11717]
Stu Tomlinson <stu@nosnilmot.com>
parents: 10403
diff changeset
1118 int group_id;
92d4a25fd33c [gaim-migrate @ 11717]
Stu Tomlinson <stu@nosnilmot.com>
parents: 10403
diff changeset
1119 char **params;
92d4a25fd33c [gaim-migrate @ 11717]
Stu Tomlinson <stu@nosnilmot.com>
parents: 10403
diff changeset
1120
92d4a25fd33c [gaim-migrate @ 11717]
Stu Tomlinson <stu@nosnilmot.com>
parents: 10403
diff changeset
1121 params = g_strsplit(trans->params, " ", 0);
92d4a25fd33c [gaim-migrate @ 11717]
Stu Tomlinson <stu@nosnilmot.com>
parents: 10403
diff changeset
1122
92d4a25fd33c [gaim-migrate @ 11717]
Stu Tomlinson <stu@nosnilmot.com>
parents: 10403
diff changeset
1123 group_id = atoi(params[0]);
92d4a25fd33c [gaim-migrate @ 11717]
Stu Tomlinson <stu@nosnilmot.com>
parents: 10403
diff changeset
1124
10452
e1c98422f4df [gaim-migrate @ 11719]
Stu Tomlinson <stu@nosnilmot.com>
parents: 10451
diff changeset
1125 group_error_helper(cmdproc->session, _("Unable to delete group"), group_id, error);
10451
92d4a25fd33c [gaim-migrate @ 11717]
Stu Tomlinson <stu@nosnilmot.com>
parents: 10403
diff changeset
1126
92d4a25fd33c [gaim-migrate @ 11717]
Stu Tomlinson <stu@nosnilmot.com>
parents: 10403
diff changeset
1127 g_strfreev(params);
92d4a25fd33c [gaim-migrate @ 11717]
Stu Tomlinson <stu@nosnilmot.com>
parents: 10403
diff changeset
1128 }
92d4a25fd33c [gaim-migrate @ 11717]
Stu Tomlinson <stu@nosnilmot.com>
parents: 10403
diff changeset
1129
92d4a25fd33c [gaim-migrate @ 11717]
Stu Tomlinson <stu@nosnilmot.com>
parents: 10403
diff changeset
1130 static void
8808
bbd8cdaf0ad5 [gaim-migrate @ 9570]
Christian Hammond <chipx86@chipx86.com>
parents: 8669
diff changeset
1131 syn_cmd(MsnCmdProc *cmdproc, MsnCommand *cmd)
6701
b7e113a59b51 [gaim-migrate @ 7227]
Christian Hammond <chipx86@chipx86.com>
parents: 6695
diff changeset
1132 {
8808
bbd8cdaf0ad5 [gaim-migrate @ 9570]
Christian Hammond <chipx86@chipx86.com>
parents: 8669
diff changeset
1133 MsnSession *session;
9193
502707ca1836 [gaim-migrate @ 9988]
Christian Hammond <chipx86@chipx86.com>
parents: 9158
diff changeset
1134 int total_users;
8808
bbd8cdaf0ad5 [gaim-migrate @ 9570]
Christian Hammond <chipx86@chipx86.com>
parents: 8669
diff changeset
1135
bbd8cdaf0ad5 [gaim-migrate @ 9570]
Christian Hammond <chipx86@chipx86.com>
parents: 8669
diff changeset
1136 session = cmdproc->session;
10269
59b1fce24f60 [gaim-migrate @ 11417]
Stu Tomlinson <stu@nosnilmot.com>
parents: 10240
diff changeset
1137
59b1fce24f60 [gaim-migrate @ 11417]
Stu Tomlinson <stu@nosnilmot.com>
parents: 10240
diff changeset
1138 if (cmd->param_count == 2)
59b1fce24f60 [gaim-migrate @ 11417]
Stu Tomlinson <stu@nosnilmot.com>
parents: 10240
diff changeset
1139 {
59b1fce24f60 [gaim-migrate @ 11417]
Stu Tomlinson <stu@nosnilmot.com>
parents: 10240
diff changeset
1140 /*
59b1fce24f60 [gaim-migrate @ 11417]
Stu Tomlinson <stu@nosnilmot.com>
parents: 10240
diff changeset
1141 * This can happen if we sent a SYN with an up-to-date
59b1fce24f60 [gaim-migrate @ 11417]
Stu Tomlinson <stu@nosnilmot.com>
parents: 10240
diff changeset
1142 * buddy list revision, but we send 0 to get a full list.
59b1fce24f60 [gaim-migrate @ 11417]
Stu Tomlinson <stu@nosnilmot.com>
parents: 10240
diff changeset
1143 * So, error out.
59b1fce24f60 [gaim-migrate @ 11417]
Stu Tomlinson <stu@nosnilmot.com>
parents: 10240
diff changeset
1144 */
59b1fce24f60 [gaim-migrate @ 11417]
Stu Tomlinson <stu@nosnilmot.com>
parents: 10240
diff changeset
1145
10481
bcfea6c3d5c9 [gaim-migrate @ 11769]
Stu Tomlinson <stu@nosnilmot.com>
parents: 10463
diff changeset
1146 msn_session_set_error(cmdproc->session, MSN_ERROR_BAD_BLIST, NULL);
10269
59b1fce24f60 [gaim-migrate @ 11417]
Stu Tomlinson <stu@nosnilmot.com>
parents: 10240
diff changeset
1147 return;
59b1fce24f60 [gaim-migrate @ 11417]
Stu Tomlinson <stu@nosnilmot.com>
parents: 10240
diff changeset
1148 }
59b1fce24f60 [gaim-migrate @ 11417]
Stu Tomlinson <stu@nosnilmot.com>
parents: 10240
diff changeset
1149
9193
502707ca1836 [gaim-migrate @ 9988]
Christian Hammond <chipx86@chipx86.com>
parents: 9158
diff changeset
1150 total_users = atoi(cmd->params[2]);
8808
bbd8cdaf0ad5 [gaim-migrate @ 9570]
Christian Hammond <chipx86@chipx86.com>
parents: 8669
diff changeset
1151
9193
502707ca1836 [gaim-migrate @ 9988]
Christian Hammond <chipx86@chipx86.com>
parents: 9158
diff changeset
1152 if (total_users == 0)
502707ca1836 [gaim-migrate @ 9988]
Christian Hammond <chipx86@chipx86.com>
parents: 9158
diff changeset
1153 {
10044
86a6d78b070b [gaim-migrate @ 11003]
Luke Schierer <lschiere@pidgin.im>
parents: 10043
diff changeset
1154 msn_session_finish_login(session);
9193
502707ca1836 [gaim-migrate @ 9988]
Christian Hammond <chipx86@chipx86.com>
parents: 9158
diff changeset
1155 }
502707ca1836 [gaim-migrate @ 9988]
Christian Hammond <chipx86@chipx86.com>
parents: 9158
diff changeset
1156 else
502707ca1836 [gaim-migrate @ 9988]
Christian Hammond <chipx86@chipx86.com>
parents: 9158
diff changeset
1157 {
502707ca1836 [gaim-migrate @ 9988]
Christian Hammond <chipx86@chipx86.com>
parents: 9158
diff changeset
1158 /* syn_table */
502707ca1836 [gaim-migrate @ 9988]
Christian Hammond <chipx86@chipx86.com>
parents: 9158
diff changeset
1159 MsnSync *sync;
8613
b0ceb2a9e122 [gaim-migrate @ 9364]
Christian Hammond <chipx86@chipx86.com>
parents: 8583
diff changeset
1160
9193
502707ca1836 [gaim-migrate @ 9988]
Christian Hammond <chipx86@chipx86.com>
parents: 9158
diff changeset
1161 sync = msn_sync_new(session);
502707ca1836 [gaim-migrate @ 9988]
Christian Hammond <chipx86@chipx86.com>
parents: 9158
diff changeset
1162 sync->total_users = total_users;
502707ca1836 [gaim-migrate @ 9988]
Christian Hammond <chipx86@chipx86.com>
parents: 9158
diff changeset
1163 sync->old_cbs_table = cmdproc->cbs_table;
7289
ab2085024a29 [gaim-migrate @ 7870]
Christian Hammond <chipx86@chipx86.com>
parents: 7288
diff changeset
1164
9193
502707ca1836 [gaim-migrate @ 9988]
Christian Hammond <chipx86@chipx86.com>
parents: 9158
diff changeset
1165 session->sync = sync;
502707ca1836 [gaim-migrate @ 9988]
Christian Hammond <chipx86@chipx86.com>
parents: 9158
diff changeset
1166 cmdproc->cbs_table = sync->cbs_table;
6701
b7e113a59b51 [gaim-migrate @ 7227]
Christian Hammond <chipx86@chipx86.com>
parents: 6695
diff changeset
1167 }
b7e113a59b51 [gaim-migrate @ 7227]
Christian Hammond <chipx86@chipx86.com>
parents: 6695
diff changeset
1168 }
b7e113a59b51 [gaim-migrate @ 7227]
Christian Hammond <chipx86@chipx86.com>
parents: 6695
diff changeset
1169
5309
e2e53316a21d [gaim-migrate @ 5681]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
1170 /**************************************************************************
e2e53316a21d [gaim-migrate @ 5681]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
1171 * Misc commands
e2e53316a21d [gaim-migrate @ 5681]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
1172 **************************************************************************/
10481
bcfea6c3d5c9 [gaim-migrate @ 11769]
Stu Tomlinson <stu@nosnilmot.com>
parents: 10463
diff changeset
1173
8808
bbd8cdaf0ad5 [gaim-migrate @ 9570]
Christian Hammond <chipx86@chipx86.com>
parents: 8669
diff changeset
1174 static void
bbd8cdaf0ad5 [gaim-migrate @ 9570]
Christian Hammond <chipx86@chipx86.com>
parents: 8669
diff changeset
1175 url_cmd(MsnCmdProc *cmdproc, MsnCommand *cmd)
5309
e2e53316a21d [gaim-migrate @ 5681]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
1176 {
8808
bbd8cdaf0ad5 [gaim-migrate @ 9570]
Christian Hammond <chipx86@chipx86.com>
parents: 8669
diff changeset
1177 MsnSession *session;
bbd8cdaf0ad5 [gaim-migrate @ 9570]
Christian Hammond <chipx86@chipx86.com>
parents: 8669
diff changeset
1178 GaimAccount *account;
5309
e2e53316a21d [gaim-migrate @ 5681]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
1179 const char *rru;
e2e53316a21d [gaim-migrate @ 5681]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
1180 const char *url;
10684
72a5babfa8b4 [gaim-migrate @ 12231]
Luke Schierer <lschiere@pidgin.im>
parents: 10647
diff changeset
1181 GaimCipher *cipher;
72a5babfa8b4 [gaim-migrate @ 12231]
Luke Schierer <lschiere@pidgin.im>
parents: 10647
diff changeset
1182 GaimCipherContext *context;
11183
8dca96cbcd64 [gaim-migrate @ 13295]
Mark Doliner <mark@kingant.net>
parents: 11164
diff changeset
1183 guchar digest[16];
5309
e2e53316a21d [gaim-migrate @ 5681]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
1184 FILE *fd;
11164
93663df88ec4 [gaim-migrate @ 13265]
Mark Doliner <mark@kingant.net>
parents: 10833
diff changeset
1185 char *buf;
5309
e2e53316a21d [gaim-migrate @ 5681]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
1186 char buf2[3];
e2e53316a21d [gaim-migrate @ 5681]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
1187 char sendbuf[64];
e2e53316a21d [gaim-migrate @ 5681]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
1188 int i;
e2e53316a21d [gaim-migrate @ 5681]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
1189
8808
bbd8cdaf0ad5 [gaim-migrate @ 9570]
Christian Hammond <chipx86@chipx86.com>
parents: 8669
diff changeset
1190 session = cmdproc->session;
bbd8cdaf0ad5 [gaim-migrate @ 9570]
Christian Hammond <chipx86@chipx86.com>
parents: 8669
diff changeset
1191 account = session->account;
bbd8cdaf0ad5 [gaim-migrate @ 9570]
Christian Hammond <chipx86@chipx86.com>
parents: 8669
diff changeset
1192
bbd8cdaf0ad5 [gaim-migrate @ 9570]
Christian Hammond <chipx86@chipx86.com>
parents: 8669
diff changeset
1193 rru = cmd->params[1];
bbd8cdaf0ad5 [gaim-migrate @ 9570]
Christian Hammond <chipx86@chipx86.com>
parents: 8669
diff changeset
1194 url = cmd->params[2];
5309
e2e53316a21d [gaim-migrate @ 5681]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
1195
11164
93663df88ec4 [gaim-migrate @ 13265]
Mark Doliner <mark@kingant.net>
parents: 10833
diff changeset
1196 buf = g_strdup_printf("%s%lu%s",
5309
e2e53316a21d [gaim-migrate @ 5681]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
1197 session->passport_info.mspauth,
5566
9896e9068bc4 [gaim-migrate @ 5968]
Christian Hammond <chipx86@chipx86.com>
parents: 5564
diff changeset
1198 time(NULL) - session->passport_info.sl,
10740
94cc67130789 [gaim-migrate @ 12342]
Mark Doliner <mark@kingant.net>
parents: 10687
diff changeset
1199 gaim_connection_get_password(account->gc));
5309
e2e53316a21d [gaim-migrate @ 5681]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
1200
10684
72a5babfa8b4 [gaim-migrate @ 12231]
Luke Schierer <lschiere@pidgin.im>
parents: 10647
diff changeset
1201 cipher = gaim_ciphers_find_cipher("md5");
72a5babfa8b4 [gaim-migrate @ 12231]
Luke Schierer <lschiere@pidgin.im>
parents: 10647
diff changeset
1202 context = gaim_cipher_context_new(cipher, NULL);
72a5babfa8b4 [gaim-migrate @ 12231]
Luke Schierer <lschiere@pidgin.im>
parents: 10647
diff changeset
1203
11183
8dca96cbcd64 [gaim-migrate @ 13295]
Mark Doliner <mark@kingant.net>
parents: 11164
diff changeset
1204 gaim_cipher_context_append(context, (const guchar *)buf, strlen(buf));
10687
b256ce6b85b8 [gaim-migrate @ 12235]
Etan Reisner <pidgin@unreliablesource.net>
parents: 10684
diff changeset
1205 gaim_cipher_context_digest(context, sizeof(digest), digest, NULL);
10684
72a5babfa8b4 [gaim-migrate @ 12231]
Luke Schierer <lschiere@pidgin.im>
parents: 10647
diff changeset
1206 gaim_cipher_context_destroy(context);
5309
e2e53316a21d [gaim-migrate @ 5681]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
1207
11164
93663df88ec4 [gaim-migrate @ 13265]
Mark Doliner <mark@kingant.net>
parents: 10833
diff changeset
1208 g_free(buf);
93663df88ec4 [gaim-migrate @ 13265]
Mark Doliner <mark@kingant.net>
parents: 10833
diff changeset
1209
5309
e2e53316a21d [gaim-migrate @ 5681]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
1210 memset(sendbuf, 0, sizeof(sendbuf));
e2e53316a21d [gaim-migrate @ 5681]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
1211
8808
bbd8cdaf0ad5 [gaim-migrate @ 9570]
Christian Hammond <chipx86@chipx86.com>
parents: 8669
diff changeset
1212 for (i = 0; i < 16; i++)
bbd8cdaf0ad5 [gaim-migrate @ 9570]
Christian Hammond <chipx86@chipx86.com>
parents: 8669
diff changeset
1213 {
10684
72a5babfa8b4 [gaim-migrate @ 12231]
Luke Schierer <lschiere@pidgin.im>
parents: 10647
diff changeset
1214 g_snprintf(buf2, sizeof(buf2), "%02x", digest[i]);
5309
e2e53316a21d [gaim-migrate @ 5681]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
1215 strcat(sendbuf, buf2);
e2e53316a21d [gaim-migrate @ 5681]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
1216 }
e2e53316a21d [gaim-migrate @ 5681]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
1217
8808
bbd8cdaf0ad5 [gaim-migrate @ 9570]
Christian Hammond <chipx86@chipx86.com>
parents: 8669
diff changeset
1218 if (session->passport_info.file != NULL)
bbd8cdaf0ad5 [gaim-migrate @ 9570]
Christian Hammond <chipx86@chipx86.com>
parents: 8669
diff changeset
1219 {
10589
0f7452b1f777 [gaim-migrate @ 11994]
Daniel Atallah <daniel.atallah@gmail.com>
parents: 10568
diff changeset
1220 g_unlink(session->passport_info.file);
5309
e2e53316a21d [gaim-migrate @ 5681]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
1221 g_free(session->passport_info.file);
e2e53316a21d [gaim-migrate @ 5681]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
1222 }
e2e53316a21d [gaim-migrate @ 5681]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
1223
10203
7ff9b8b22e7d [gaim-migrate @ 11324]
Herman Bloggs <hermanator12002@yahoo.com>
parents: 10057
diff changeset
1224 if ((fd = gaim_mkstemp(&session->passport_info.file, FALSE)) == NULL)
8808
bbd8cdaf0ad5 [gaim-migrate @ 9570]
Christian Hammond <chipx86@chipx86.com>
parents: 8669
diff changeset
1225 {
10345
2e01c503aa4f [gaim-migrate @ 11556]
Stu Tomlinson <stu@nosnilmot.com>
parents: 10310
diff changeset
1226 gaim_debug_error("msn",
2e01c503aa4f [gaim-migrate @ 11556]
Stu Tomlinson <stu@nosnilmot.com>
parents: 10310
diff changeset
1227 "Error opening temp passport file: %s\n",
2e01c503aa4f [gaim-migrate @ 11556]
Stu Tomlinson <stu@nosnilmot.com>
parents: 10310
diff changeset
1228 strerror(errno));
5309
e2e53316a21d [gaim-migrate @ 5681]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
1229 }
8808
bbd8cdaf0ad5 [gaim-migrate @ 9570]
Christian Hammond <chipx86@chipx86.com>
parents: 8669
diff changeset
1230 else
bbd8cdaf0ad5 [gaim-migrate @ 9570]
Christian Hammond <chipx86@chipx86.com>
parents: 8669
diff changeset
1231 {
5309
e2e53316a21d [gaim-migrate @ 5681]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
1232 fputs("<html>\n"
e2e53316a21d [gaim-migrate @ 5681]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
1233 "<head>\n"
e2e53316a21d [gaim-migrate @ 5681]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
1234 "<noscript>\n"
e2e53316a21d [gaim-migrate @ 5681]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
1235 "<meta http-equiv=\"Refresh\" content=\"0; "
9158
c30d81b4dd22 [gaim-migrate @ 9942]
Christian Hammond <chipx86@chipx86.com>
parents: 8926
diff changeset
1236 "url=http://www.hotmail.com\">\n"
5309
e2e53316a21d [gaim-migrate @ 5681]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
1237 "</noscript>\n"
e2e53316a21d [gaim-migrate @ 5681]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
1238 "</head>\n\n",
e2e53316a21d [gaim-migrate @ 5681]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
1239 fd);
e2e53316a21d [gaim-migrate @ 5681]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
1240
e2e53316a21d [gaim-migrate @ 5681]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
1241 fprintf(fd, "<body onload=\"document.pform.submit(); \">\n");
e2e53316a21d [gaim-migrate @ 5681]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
1242 fprintf(fd, "<form name=\"pform\" action=\"%s\" method=\"POST\">\n\n",
e2e53316a21d [gaim-migrate @ 5681]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
1243 url);
e2e53316a21d [gaim-migrate @ 5681]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
1244 fprintf(fd, "<input type=\"hidden\" name=\"mode\" value=\"ttl\">\n");
e2e53316a21d [gaim-migrate @ 5681]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
1245 fprintf(fd, "<input type=\"hidden\" name=\"login\" value=\"%s\">\n",
5564
187c740f2a4e [gaim-migrate @ 5966]
Christian Hammond <chipx86@chipx86.com>
parents: 5520
diff changeset
1246 gaim_account_get_username(account));
5309
e2e53316a21d [gaim-migrate @ 5681]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
1247 fprintf(fd, "<input type=\"hidden\" name=\"username\" value=\"%s\">\n",
5564
187c740f2a4e [gaim-migrate @ 5966]
Christian Hammond <chipx86@chipx86.com>
parents: 5520
diff changeset
1248 gaim_account_get_username(account));
5309
e2e53316a21d [gaim-migrate @ 5681]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
1249 fprintf(fd, "<input type=\"hidden\" name=\"sid\" value=\"%s\">\n",
e2e53316a21d [gaim-migrate @ 5681]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
1250 session->passport_info.sid);
e2e53316a21d [gaim-migrate @ 5681]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
1251 fprintf(fd, "<input type=\"hidden\" name=\"kv\" value=\"%s\">\n",
e2e53316a21d [gaim-migrate @ 5681]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
1252 session->passport_info.kv);
e2e53316a21d [gaim-migrate @ 5681]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
1253 fprintf(fd, "<input type=\"hidden\" name=\"id\" value=\"2\">\n");
e2e53316a21d [gaim-migrate @ 5681]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
1254 fprintf(fd, "<input type=\"hidden\" name=\"sl\" value=\"%ld\">\n",
e2e53316a21d [gaim-migrate @ 5681]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
1255 time(NULL) - session->passport_info.sl);
e2e53316a21d [gaim-migrate @ 5681]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
1256 fprintf(fd, "<input type=\"hidden\" name=\"rru\" value=\"%s\">\n",
e2e53316a21d [gaim-migrate @ 5681]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
1257 rru);
e2e53316a21d [gaim-migrate @ 5681]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
1258 fprintf(fd, "<input type=\"hidden\" name=\"auth\" value=\"%s\">\n",
e2e53316a21d [gaim-migrate @ 5681]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
1259 session->passport_info.mspauth);
e2e53316a21d [gaim-migrate @ 5681]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
1260 fprintf(fd, "<input type=\"hidden\" name=\"creds\" value=\"%s\">\n",
e2e53316a21d [gaim-migrate @ 5681]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
1261 sendbuf); /* TODO Digest me (huh? -- ChipX86) */
e2e53316a21d [gaim-migrate @ 5681]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
1262 fprintf(fd, "<input type=\"hidden\" name=\"svc\" value=\"mail\">\n");
7699
04f9c750657f [gaim-migrate @ 8344]
Luke Schierer <lschiere@pidgin.im>
parents: 7590
diff changeset
1263 fprintf(fd, "<input type=\"hidden\" name=\"js\" value=\"yes\">\n");
5309
e2e53316a21d [gaim-migrate @ 5681]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
1264 fprintf(fd, "</form></body>\n");
e2e53316a21d [gaim-migrate @ 5681]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
1265 fprintf(fd, "</html>\n");
e2e53316a21d [gaim-migrate @ 5681]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
1266
8808
bbd8cdaf0ad5 [gaim-migrate @ 9570]
Christian Hammond <chipx86@chipx86.com>
parents: 8669
diff changeset
1267 if (fclose(fd))
bbd8cdaf0ad5 [gaim-migrate @ 9570]
Christian Hammond <chipx86@chipx86.com>
parents: 8669
diff changeset
1268 {
9158
c30d81b4dd22 [gaim-migrate @ 9942]
Christian Hammond <chipx86@chipx86.com>
parents: 8926
diff changeset
1269 gaim_debug_error("msn",
c30d81b4dd22 [gaim-migrate @ 9942]
Christian Hammond <chipx86@chipx86.com>
parents: 8926
diff changeset
1270 "Error closing temp passport file: %s\n",
c30d81b4dd22 [gaim-migrate @ 9942]
Christian Hammond <chipx86@chipx86.com>
parents: 8926
diff changeset
1271 strerror(errno));
5309
e2e53316a21d [gaim-migrate @ 5681]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
1272
10589
0f7452b1f777 [gaim-migrate @ 11994]
Daniel Atallah <daniel.atallah@gmail.com>
parents: 10568
diff changeset
1273 g_unlink(session->passport_info.file);
5309
e2e53316a21d [gaim-migrate @ 5681]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
1274 g_free(session->passport_info.file);
10240
95ca0db2d01d [gaim-migrate @ 11377]
Herman Bloggs <hermanator12002@yahoo.com>
parents: 10225
diff changeset
1275 session->passport_info.file = NULL;
5309
e2e53316a21d [gaim-migrate @ 5681]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
1276 }
10647
7d13c04387ad [gaim-migrate @ 12163]
Daniel Atallah <daniel.atallah@gmail.com>
parents: 10629
diff changeset
1277 #ifdef _WIN32
10629
d93621a98f12 [gaim-migrate @ 12106]
Daniel Atallah <daniel.atallah@gmail.com>
parents: 10589
diff changeset
1278 else
d93621a98f12 [gaim-migrate @ 12106]
Daniel Atallah <daniel.atallah@gmail.com>
parents: 10589
diff changeset
1279 {
10647
7d13c04387ad [gaim-migrate @ 12163]
Daniel Atallah <daniel.atallah@gmail.com>
parents: 10629
diff changeset
1280 /*
10629
d93621a98f12 [gaim-migrate @ 12106]
Daniel Atallah <daniel.atallah@gmail.com>
parents: 10589
diff changeset
1281 * Renaming file with .html extension, so that the
d93621a98f12 [gaim-migrate @ 12106]
Daniel Atallah <daniel.atallah@gmail.com>
parents: 10589
diff changeset
1282 * win32 open_url will work.
d93621a98f12 [gaim-migrate @ 12106]
Daniel Atallah <daniel.atallah@gmail.com>
parents: 10589
diff changeset
1283 */
d93621a98f12 [gaim-migrate @ 12106]
Daniel Atallah <daniel.atallah@gmail.com>
parents: 10589
diff changeset
1284 char *tmp;
d93621a98f12 [gaim-migrate @ 12106]
Daniel Atallah <daniel.atallah@gmail.com>
parents: 10589
diff changeset
1285
d93621a98f12 [gaim-migrate @ 12106]
Daniel Atallah <daniel.atallah@gmail.com>
parents: 10589
diff changeset
1286 if ((tmp =
d93621a98f12 [gaim-migrate @ 12106]
Daniel Atallah <daniel.atallah@gmail.com>
parents: 10589
diff changeset
1287 g_strdup_printf("%s.html",
d93621a98f12 [gaim-migrate @ 12106]
Daniel Atallah <daniel.atallah@gmail.com>
parents: 10589
diff changeset
1288 session->passport_info.file)) != NULL)
d93621a98f12 [gaim-migrate @ 12106]
Daniel Atallah <daniel.atallah@gmail.com>
parents: 10589
diff changeset
1289 {
d93621a98f12 [gaim-migrate @ 12106]
Daniel Atallah <daniel.atallah@gmail.com>
parents: 10589
diff changeset
1290 if (g_rename(session->passport_info.file,
d93621a98f12 [gaim-migrate @ 12106]
Daniel Atallah <daniel.atallah@gmail.com>
parents: 10589
diff changeset
1291 tmp) == 0)
d93621a98f12 [gaim-migrate @ 12106]
Daniel Atallah <daniel.atallah@gmail.com>
parents: 10589
diff changeset
1292 {
d93621a98f12 [gaim-migrate @ 12106]
Daniel Atallah <daniel.atallah@gmail.com>
parents: 10589
diff changeset
1293 g_free(session->passport_info.file);
d93621a98f12 [gaim-migrate @ 12106]
Daniel Atallah <daniel.atallah@gmail.com>
parents: 10589
diff changeset
1294 session->passport_info.file = tmp;
10647
7d13c04387ad [gaim-migrate @ 12163]
Daniel Atallah <daniel.atallah@gmail.com>
parents: 10629
diff changeset
1295 }
10629
d93621a98f12 [gaim-migrate @ 12106]
Daniel Atallah <daniel.atallah@gmail.com>
parents: 10589
diff changeset
1296 else
d93621a98f12 [gaim-migrate @ 12106]
Daniel Atallah <daniel.atallah@gmail.com>
parents: 10589
diff changeset
1297 g_free(tmp);
d93621a98f12 [gaim-migrate @ 12106]
Daniel Atallah <daniel.atallah@gmail.com>
parents: 10589
diff changeset
1298 }
d93621a98f12 [gaim-migrate @ 12106]
Daniel Atallah <daniel.atallah@gmail.com>
parents: 10589
diff changeset
1299 }
10647
7d13c04387ad [gaim-migrate @ 12163]
Daniel Atallah <daniel.atallah@gmail.com>
parents: 10629
diff changeset
1300 #endif
5309
e2e53316a21d [gaim-migrate @ 5681]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
1301 }
e2e53316a21d [gaim-migrate @ 5681]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
1302 }
e2e53316a21d [gaim-migrate @ 5681]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
1303 /**************************************************************************
e2e53316a21d [gaim-migrate @ 5681]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
1304 * Switchboards
e2e53316a21d [gaim-migrate @ 5681]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
1305 **************************************************************************/
10481
bcfea6c3d5c9 [gaim-migrate @ 11769]
Stu Tomlinson <stu@nosnilmot.com>
parents: 10463
diff changeset
1306
8808
bbd8cdaf0ad5 [gaim-migrate @ 9570]
Christian Hammond <chipx86@chipx86.com>
parents: 8669
diff changeset
1307 static void
bbd8cdaf0ad5 [gaim-migrate @ 9570]
Christian Hammond <chipx86@chipx86.com>
parents: 8669
diff changeset
1308 rng_cmd(MsnCmdProc *cmdproc, MsnCommand *cmd)
5309
e2e53316a21d [gaim-migrate @ 5681]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
1309 {
8808
bbd8cdaf0ad5 [gaim-migrate @ 9570]
Christian Hammond <chipx86@chipx86.com>
parents: 8669
diff changeset
1310 MsnSession *session;
5309
e2e53316a21d [gaim-migrate @ 5681]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
1311 MsnSwitchBoard *swboard;
e2e53316a21d [gaim-migrate @ 5681]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
1312 const char *session_id;
9193
502707ca1836 [gaim-migrate @ 9988]
Christian Hammond <chipx86@chipx86.com>
parents: 9158
diff changeset
1313 char *host;
5309
e2e53316a21d [gaim-migrate @ 5681]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
1314 int port;
e2e53316a21d [gaim-migrate @ 5681]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
1315
8808
bbd8cdaf0ad5 [gaim-migrate @ 9570]
Christian Hammond <chipx86@chipx86.com>
parents: 8669
diff changeset
1316 session = cmdproc->session;
bbd8cdaf0ad5 [gaim-migrate @ 9570]
Christian Hammond <chipx86@chipx86.com>
parents: 8669
diff changeset
1317 session_id = cmd->params[0];
5309
e2e53316a21d [gaim-migrate @ 5681]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
1318
9193
502707ca1836 [gaim-migrate @ 9988]
Christian Hammond <chipx86@chipx86.com>
parents: 9158
diff changeset
1319 msn_parse_socket(cmd->params[1], &host, &port);
5309
e2e53316a21d [gaim-migrate @ 5681]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
1320
7288
ff9127038a5a [gaim-migrate @ 7869]
Christian Hammond <chipx86@chipx86.com>
parents: 7274
diff changeset
1321 if (session->http_method)
ff9127038a5a [gaim-migrate @ 7869]
Christian Hammond <chipx86@chipx86.com>
parents: 7274
diff changeset
1322 port = 80;
ff9127038a5a [gaim-migrate @ 7869]
Christian Hammond <chipx86@chipx86.com>
parents: 7274
diff changeset
1323
5309
e2e53316a21d [gaim-migrate @ 5681]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
1324 swboard = msn_switchboard_new(session);
e2e53316a21d [gaim-migrate @ 5681]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
1325
e2e53316a21d [gaim-migrate @ 5681]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
1326 msn_switchboard_set_invited(swboard, TRUE);
8808
bbd8cdaf0ad5 [gaim-migrate @ 9570]
Christian Hammond <chipx86@chipx86.com>
parents: 8669
diff changeset
1327 msn_switchboard_set_session_id(swboard, cmd->params[0]);
bbd8cdaf0ad5 [gaim-migrate @ 9570]
Christian Hammond <chipx86@chipx86.com>
parents: 8669
diff changeset
1328 msn_switchboard_set_auth_key(swboard, cmd->params[3]);
9193
502707ca1836 [gaim-migrate @ 9988]
Christian Hammond <chipx86@chipx86.com>
parents: 9158
diff changeset
1329 swboard->im_user = g_strdup(cmd->params[4]);
502707ca1836 [gaim-migrate @ 9988]
Christian Hammond <chipx86@chipx86.com>
parents: 9158
diff changeset
1330 /* msn_switchboard_add_user(swboard, cmd->params[4]); */
5309
e2e53316a21d [gaim-migrate @ 5681]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
1331
10568
fed2a7c2471d [gaim-migrate @ 11954]
Stu Tomlinson <stu@nosnilmot.com>
parents: 10519
diff changeset
1332 if (!msn_switchboard_connect(swboard, host, port))
fed2a7c2471d [gaim-migrate @ 11954]
Stu Tomlinson <stu@nosnilmot.com>
parents: 10519
diff changeset
1333 msn_switchboard_destroy(swboard);
5309
e2e53316a21d [gaim-migrate @ 5681]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
1334
e2e53316a21d [gaim-migrate @ 5681]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
1335 g_free(host);
e2e53316a21d [gaim-migrate @ 5681]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
1336 }
e2e53316a21d [gaim-migrate @ 5681]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
1337
8808
bbd8cdaf0ad5 [gaim-migrate @ 9570]
Christian Hammond <chipx86@chipx86.com>
parents: 8669
diff changeset
1338 static void
bbd8cdaf0ad5 [gaim-migrate @ 9570]
Christian Hammond <chipx86@chipx86.com>
parents: 8669
diff changeset
1339 xfr_cmd(MsnCmdProc *cmdproc, MsnCommand *cmd)
5309
e2e53316a21d [gaim-migrate @ 5681]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
1340 {
e2e53316a21d [gaim-migrate @ 5681]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
1341 char *host;
e2e53316a21d [gaim-migrate @ 5681]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
1342 int port;
e2e53316a21d [gaim-migrate @ 5681]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
1343
8808
bbd8cdaf0ad5 [gaim-migrate @ 9570]
Christian Hammond <chipx86@chipx86.com>
parents: 8669
diff changeset
1344 if (strcmp(cmd->params[1], "SB") && strcmp(cmd->params[1], "NS"))
bbd8cdaf0ad5 [gaim-migrate @ 9570]
Christian Hammond <chipx86@chipx86.com>
parents: 8669
diff changeset
1345 {
10481
bcfea6c3d5c9 [gaim-migrate @ 11769]
Stu Tomlinson <stu@nosnilmot.com>
parents: 10463
diff changeset
1346 /* Maybe we can have a generic bad command error. */
bcfea6c3d5c9 [gaim-migrate @ 11769]
Stu Tomlinson <stu@nosnilmot.com>
parents: 10463
diff changeset
1347 gaim_debug_error("msn", "Bad XFR command (%s)\n", cmd->params[1]);
8808
bbd8cdaf0ad5 [gaim-migrate @ 9570]
Christian Hammond <chipx86@chipx86.com>
parents: 8669
diff changeset
1348 return;
5309
e2e53316a21d [gaim-migrate @ 5681]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
1349 }
e2e53316a21d [gaim-migrate @ 5681]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
1350
9193
502707ca1836 [gaim-migrate @ 9988]
Christian Hammond <chipx86@chipx86.com>
parents: 9158
diff changeset
1351 msn_parse_socket(cmd->params[2], &host, &port);
5309
e2e53316a21d [gaim-migrate @ 5681]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
1352
19738
bc30c6270d9f [gaim-migrate @ 16473]
Ma Yuan <mayuan2006@gmail.com>
parents: 19737
diff changeset
1353 if (!strcmp(cmd->params[1], "SB")){
9193
502707ca1836 [gaim-migrate @ 9988]
Christian Hammond <chipx86@chipx86.com>
parents: 9158
diff changeset
1354 gaim_debug_error("msn", "This shouldn't be handled here.\n");
19738
bc30c6270d9f [gaim-migrate @ 16473]
Ma Yuan <mayuan2006@gmail.com>
parents: 19737
diff changeset
1355 }else if (!strcmp(cmd->params[1], "NS")){
9193
502707ca1836 [gaim-migrate @ 9988]
Christian Hammond <chipx86@chipx86.com>
parents: 9158
diff changeset
1356 MsnSession *session;
8646
1e211dde3cae [gaim-migrate @ 9398]
Christian Hammond <chipx86@chipx86.com>
parents: 8614
diff changeset
1357
9193
502707ca1836 [gaim-migrate @ 9988]
Christian Hammond <chipx86@chipx86.com>
parents: 9158
diff changeset
1358 session = cmdproc->session;
5309
e2e53316a21d [gaim-migrate @ 5681]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
1359
10519
bec9130b24d2 [gaim-migrate @ 11833]
Stu Tomlinson <stu@nosnilmot.com>
parents: 10514
diff changeset
1360 msn_session_set_login_step(session, MSN_LOGIN_STEP_TRANSFER);
10481
bcfea6c3d5c9 [gaim-migrate @ 11769]
Stu Tomlinson <stu@nosnilmot.com>
parents: 10463
diff changeset
1361
9193
502707ca1836 [gaim-migrate @ 9988]
Christian Hammond <chipx86@chipx86.com>
parents: 9158
diff changeset
1362 msn_notification_connect(session->notification, host, port);
5309
e2e53316a21d [gaim-migrate @ 5681]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
1363 }
e2e53316a21d [gaim-migrate @ 5681]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
1364
e2e53316a21d [gaim-migrate @ 5681]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
1365 g_free(host);
e2e53316a21d [gaim-migrate @ 5681]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
1366 }
e2e53316a21d [gaim-migrate @ 5681]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
1367
19737
995aea35b05c [gaim-migrate @ 16329]
Ma Yuan <mayuan2006@gmail.com>
parents: 13711
diff changeset
1368 static void
19751
1ffbe358c877 [gaim-migrate @ 16721]
Ma Yuan <mayuan2006@gmail.com>
parents: 19750
diff changeset
1369 gcf_cmd_post(MsnCmdProc *cmdproc, MsnCommand *cmd, char *payload,
1ffbe358c877 [gaim-migrate @ 16721]
Ma Yuan <mayuan2006@gmail.com>
parents: 19750
diff changeset
1370 size_t len)
1ffbe358c877 [gaim-migrate @ 16721]
Ma Yuan <mayuan2006@gmail.com>
parents: 19750
diff changeset
1371 {
1ffbe358c877 [gaim-migrate @ 16721]
Ma Yuan <mayuan2006@gmail.com>
parents: 19750
diff changeset
1372 /*get the payload content*/
1ffbe358c877 [gaim-migrate @ 16721]
Ma Yuan <mayuan2006@gmail.com>
parents: 19750
diff changeset
1373 gaim_debug_info("MaYuan","GCF{%s}\n",cmd->payload);
1ffbe358c877 [gaim-migrate @ 16721]
Ma Yuan <mayuan2006@gmail.com>
parents: 19750
diff changeset
1374 }
1ffbe358c877 [gaim-migrate @ 16721]
Ma Yuan <mayuan2006@gmail.com>
parents: 19750
diff changeset
1375
1ffbe358c877 [gaim-migrate @ 16721]
Ma Yuan <mayuan2006@gmail.com>
parents: 19750
diff changeset
1376 static void
19737
995aea35b05c [gaim-migrate @ 16329]
Ma Yuan <mayuan2006@gmail.com>
parents: 13711
diff changeset
1377 gcf_cmd(MsnCmdProc *cmdproc, MsnCommand *cmd)
995aea35b05c [gaim-migrate @ 16329]
Ma Yuan <mayuan2006@gmail.com>
parents: 13711
diff changeset
1378 {
995aea35b05c [gaim-migrate @ 16329]
Ma Yuan <mayuan2006@gmail.com>
parents: 13711
diff changeset
1379 gaim_debug_info("MaYuan","Processing GCF... \n");
19751
1ffbe358c877 [gaim-migrate @ 16721]
Ma Yuan <mayuan2006@gmail.com>
parents: 19750
diff changeset
1380 cmdproc->last_cmd->payload_cb = gcf_cmd_post;
1ffbe358c877 [gaim-migrate @ 16721]
Ma Yuan <mayuan2006@gmail.com>
parents: 19750
diff changeset
1381 return;
19737
995aea35b05c [gaim-migrate @ 16329]
Ma Yuan <mayuan2006@gmail.com>
parents: 13711
diff changeset
1382 }
995aea35b05c [gaim-migrate @ 16329]
Ma Yuan <mayuan2006@gmail.com>
parents: 13711
diff changeset
1383
995aea35b05c [gaim-migrate @ 16329]
Ma Yuan <mayuan2006@gmail.com>
parents: 13711
diff changeset
1384 static void
995aea35b05c [gaim-migrate @ 16329]
Ma Yuan <mayuan2006@gmail.com>
parents: 13711
diff changeset
1385 sbs_cmd(MsnCmdProc *cmdproc, MsnCommand *cmd)
995aea35b05c [gaim-migrate @ 16329]
Ma Yuan <mayuan2006@gmail.com>
parents: 13711
diff changeset
1386 {
995aea35b05c [gaim-migrate @ 16329]
Ma Yuan <mayuan2006@gmail.com>
parents: 13711
diff changeset
1387 gaim_debug_info("MaYuan","Processing SBS... \n");
995aea35b05c [gaim-migrate @ 16329]
Ma Yuan <mayuan2006@gmail.com>
parents: 13711
diff changeset
1388 if(cmd->payload_len == 0){
995aea35b05c [gaim-migrate @ 16329]
Ma Yuan <mayuan2006@gmail.com>
parents: 13711
diff changeset
1389 return;
995aea35b05c [gaim-migrate @ 16329]
Ma Yuan <mayuan2006@gmail.com>
parents: 13711
diff changeset
1390 }
995aea35b05c [gaim-migrate @ 16329]
Ma Yuan <mayuan2006@gmail.com>
parents: 13711
diff changeset
1391 /*get the payload content*/
995aea35b05c [gaim-migrate @ 16329]
Ma Yuan <mayuan2006@gmail.com>
parents: 13711
diff changeset
1392 }
995aea35b05c [gaim-migrate @ 16329]
Ma Yuan <mayuan2006@gmail.com>
parents: 13711
diff changeset
1393
19740
23258253c7a0 [gaim-migrate @ 16546]
Ma Yuan <mayuan2006@gmail.com>
parents: 19739
diff changeset
1394 static void
19757
2315ee828b7c [gaim-migrate @ 16772]
Ma Yuan <mayuan2006@gmail.com>
parents: 19755
diff changeset
1395 ubx_cmd_post(MsnCmdProc *cmdproc, MsnCommand *cmd, char *payload,
2315ee828b7c [gaim-migrate @ 16772]
Ma Yuan <mayuan2006@gmail.com>
parents: 19755
diff changeset
1396 size_t len)
2315ee828b7c [gaim-migrate @ 16772]
Ma Yuan <mayuan2006@gmail.com>
parents: 19755
diff changeset
1397 {
2315ee828b7c [gaim-migrate @ 16772]
Ma Yuan <mayuan2006@gmail.com>
parents: 19755
diff changeset
1398 /*get the payload content*/
2315ee828b7c [gaim-migrate @ 16772]
Ma Yuan <mayuan2006@gmail.com>
parents: 19755
diff changeset
1399 gaim_debug_info("MaYuan","ubx{%s}\n",cmd->payload);
2315ee828b7c [gaim-migrate @ 16772]
Ma Yuan <mayuan2006@gmail.com>
parents: 19755
diff changeset
1400 }
2315ee828b7c [gaim-migrate @ 16772]
Ma Yuan <mayuan2006@gmail.com>
parents: 19755
diff changeset
1401
2315ee828b7c [gaim-migrate @ 16772]
Ma Yuan <mayuan2006@gmail.com>
parents: 19755
diff changeset
1402 static void
19740
23258253c7a0 [gaim-migrate @ 16546]
Ma Yuan <mayuan2006@gmail.com>
parents: 19739
diff changeset
1403 ubx_cmd(MsnCmdProc *cmdproc, MsnCommand *cmd)
23258253c7a0 [gaim-migrate @ 16546]
Ma Yuan <mayuan2006@gmail.com>
parents: 19739
diff changeset
1404 {
23258253c7a0 [gaim-migrate @ 16546]
Ma Yuan <mayuan2006@gmail.com>
parents: 19739
diff changeset
1405 gaim_debug_info("MaYuan","UBX... \n");
19757
2315ee828b7c [gaim-migrate @ 16772]
Ma Yuan <mayuan2006@gmail.com>
parents: 19755
diff changeset
1406 if(cmd->payload_len == 0){
2315ee828b7c [gaim-migrate @ 16772]
Ma Yuan <mayuan2006@gmail.com>
parents: 19755
diff changeset
1407 return;
2315ee828b7c [gaim-migrate @ 16772]
Ma Yuan <mayuan2006@gmail.com>
parents: 19755
diff changeset
1408 }
2315ee828b7c [gaim-migrate @ 16772]
Ma Yuan <mayuan2006@gmail.com>
parents: 19755
diff changeset
1409 cmdproc->last_cmd->payload_cb = ubx_cmd_post;
19740
23258253c7a0 [gaim-migrate @ 16546]
Ma Yuan <mayuan2006@gmail.com>
parents: 19739
diff changeset
1410 }
23258253c7a0 [gaim-migrate @ 16546]
Ma Yuan <mayuan2006@gmail.com>
parents: 19739
diff changeset
1411
23258253c7a0 [gaim-migrate @ 16546]
Ma Yuan <mayuan2006@gmail.com>
parents: 19739
diff changeset
1412 static void
23258253c7a0 [gaim-migrate @ 16546]
Ma Yuan <mayuan2006@gmail.com>
parents: 19739
diff changeset
1413 uux_cmd(MsnCmdProc *cmdproc, MsnCommand *cmd)
23258253c7a0 [gaim-migrate @ 16546]
Ma Yuan <mayuan2006@gmail.com>
parents: 19739
diff changeset
1414 {
23258253c7a0 [gaim-migrate @ 16546]
Ma Yuan <mayuan2006@gmail.com>
parents: 19739
diff changeset
1415 gaim_debug_info("MaYuan","UUX... \n");
23258253c7a0 [gaim-migrate @ 16546]
Ma Yuan <mayuan2006@gmail.com>
parents: 19739
diff changeset
1416 }
23258253c7a0 [gaim-migrate @ 16546]
Ma Yuan <mayuan2006@gmail.com>
parents: 19739
diff changeset
1417
5309
e2e53316a21d [gaim-migrate @ 5681]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
1418 /**************************************************************************
e2e53316a21d [gaim-migrate @ 5681]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
1419 * Message Types
e2e53316a21d [gaim-migrate @ 5681]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
1420 **************************************************************************/
10481
bcfea6c3d5c9 [gaim-migrate @ 11769]
Stu Tomlinson <stu@nosnilmot.com>
parents: 10463
diff changeset
1421
8808
bbd8cdaf0ad5 [gaim-migrate @ 9570]
Christian Hammond <chipx86@chipx86.com>
parents: 8669
diff changeset
1422 static void
bbd8cdaf0ad5 [gaim-migrate @ 9570]
Christian Hammond <chipx86@chipx86.com>
parents: 8669
diff changeset
1423 profile_msg(MsnCmdProc *cmdproc, MsnMessage *msg)
5309
e2e53316a21d [gaim-migrate @ 5681]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
1424 {
8808
bbd8cdaf0ad5 [gaim-migrate @ 9570]
Christian Hammond <chipx86@chipx86.com>
parents: 8669
diff changeset
1425 MsnSession *session;
5309
e2e53316a21d [gaim-migrate @ 5681]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
1426 const char *value;
e2e53316a21d [gaim-migrate @ 5681]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
1427
19738
bc30c6270d9f [gaim-migrate @ 16473]
Ma Yuan <mayuan2006@gmail.com>
parents: 19737
diff changeset
1428 gaim_debug_info("MaYuan","profile_msg... \n");
8808
bbd8cdaf0ad5 [gaim-migrate @ 9570]
Christian Hammond <chipx86@chipx86.com>
parents: 8669
diff changeset
1429 session = cmdproc->session;
bbd8cdaf0ad5 [gaim-migrate @ 9570]
Christian Hammond <chipx86@chipx86.com>
parents: 8669
diff changeset
1430
9193
502707ca1836 [gaim-migrate @ 9988]
Christian Hammond <chipx86@chipx86.com>
parents: 9158
diff changeset
1431 if (strcmp(msg->remote_user, "Hotmail"))
5333
bbbf616bd924 [gaim-migrate @ 5708]
Christian Hammond <chipx86@chipx86.com>
parents: 5327
diff changeset
1432 /* This isn't an official message. */
8808
bbd8cdaf0ad5 [gaim-migrate @ 9570]
Christian Hammond <chipx86@chipx86.com>
parents: 8669
diff changeset
1433 return;
5333
bbbf616bd924 [gaim-migrate @ 5708]
Christian Hammond <chipx86@chipx86.com>
parents: 5327
diff changeset
1434
19738
bc30c6270d9f [gaim-migrate @ 16473]
Ma Yuan <mayuan2006@gmail.com>
parents: 19737
diff changeset
1435 if ((value = msn_message_get_attr(msg, "kv")) != NULL){
10284
f776e117c17b [gaim-migrate @ 11454]
Stu Tomlinson <stu@nosnilmot.com>
parents: 10275
diff changeset
1436 if (session->passport_info.kv != NULL)
f776e117c17b [gaim-migrate @ 11454]
Stu Tomlinson <stu@nosnilmot.com>
parents: 10275
diff changeset
1437 g_free(session->passport_info.kv);
f776e117c17b [gaim-migrate @ 11454]
Stu Tomlinson <stu@nosnilmot.com>
parents: 10275
diff changeset
1438
5309
e2e53316a21d [gaim-migrate @ 5681]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
1439 session->passport_info.kv = g_strdup(value);
10284
f776e117c17b [gaim-migrate @ 11454]
Stu Tomlinson <stu@nosnilmot.com>
parents: 10275
diff changeset
1440 }
5309
e2e53316a21d [gaim-migrate @ 5681]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
1441
19738
bc30c6270d9f [gaim-migrate @ 16473]
Ma Yuan <mayuan2006@gmail.com>
parents: 19737
diff changeset
1442 if ((value = msn_message_get_attr(msg, "sid")) != NULL){
10284
f776e117c17b [gaim-migrate @ 11454]
Stu Tomlinson <stu@nosnilmot.com>
parents: 10275
diff changeset
1443 if (session->passport_info.sid != NULL)
f776e117c17b [gaim-migrate @ 11454]
Stu Tomlinson <stu@nosnilmot.com>
parents: 10275
diff changeset
1444 g_free(session->passport_info.sid);
f776e117c17b [gaim-migrate @ 11454]
Stu Tomlinson <stu@nosnilmot.com>
parents: 10275
diff changeset
1445
5309
e2e53316a21d [gaim-migrate @ 5681]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
1446 session->passport_info.sid = g_strdup(value);
10284
f776e117c17b [gaim-migrate @ 11454]
Stu Tomlinson <stu@nosnilmot.com>
parents: 10275
diff changeset
1447 }
5309
e2e53316a21d [gaim-migrate @ 5681]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
1448
19738
bc30c6270d9f [gaim-migrate @ 16473]
Ma Yuan <mayuan2006@gmail.com>
parents: 19737
diff changeset
1449 if ((value = msn_message_get_attr(msg, "MSPAuth")) != NULL){
10284
f776e117c17b [gaim-migrate @ 11454]
Stu Tomlinson <stu@nosnilmot.com>
parents: 10275
diff changeset
1450 if (session->passport_info.mspauth != NULL)
f776e117c17b [gaim-migrate @ 11454]
Stu Tomlinson <stu@nosnilmot.com>
parents: 10275
diff changeset
1451 g_free(session->passport_info.mspauth);
f776e117c17b [gaim-migrate @ 11454]
Stu Tomlinson <stu@nosnilmot.com>
parents: 10275
diff changeset
1452
19738
bc30c6270d9f [gaim-migrate @ 16473]
Ma Yuan <mayuan2006@gmail.com>
parents: 19737
diff changeset
1453 gaim_debug_info("MaYuan","MSPAuth:%s\n",value);
5309
e2e53316a21d [gaim-migrate @ 5681]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
1454 session->passport_info.mspauth = g_strdup(value);
10284
f776e117c17b [gaim-migrate @ 11454]
Stu Tomlinson <stu@nosnilmot.com>
parents: 10275
diff changeset
1455 }
5309
e2e53316a21d [gaim-migrate @ 5681]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
1456
19738
bc30c6270d9f [gaim-migrate @ 16473]
Ma Yuan <mayuan2006@gmail.com>
parents: 19737
diff changeset
1457 if ((value = msn_message_get_attr(msg, "ClientIP")) != NULL){
10284
f776e117c17b [gaim-migrate @ 11454]
Stu Tomlinson <stu@nosnilmot.com>
parents: 10275
diff changeset
1458 if (session->passport_info.client_ip != NULL)
f776e117c17b [gaim-migrate @ 11454]
Stu Tomlinson <stu@nosnilmot.com>
parents: 10275
diff changeset
1459 g_free(session->passport_info.client_ip);
f776e117c17b [gaim-migrate @ 11454]
Stu Tomlinson <stu@nosnilmot.com>
parents: 10275
diff changeset
1460
6701
b7e113a59b51 [gaim-migrate @ 7227]
Christian Hammond <chipx86@chipx86.com>
parents: 6695
diff changeset
1461 session->passport_info.client_ip = g_strdup(value);
10284
f776e117c17b [gaim-migrate @ 11454]
Stu Tomlinson <stu@nosnilmot.com>
parents: 10275
diff changeset
1462 }
6701
b7e113a59b51 [gaim-migrate @ 7227]
Christian Hammond <chipx86@chipx86.com>
parents: 6695
diff changeset
1463
19738
bc30c6270d9f [gaim-migrate @ 16473]
Ma Yuan <mayuan2006@gmail.com>
parents: 19737
diff changeset
1464 if ((value = msn_message_get_attr(msg, "ClientPort")) != NULL){
6701
b7e113a59b51 [gaim-migrate @ 7227]
Christian Hammond <chipx86@chipx86.com>
parents: 6695
diff changeset
1465 session->passport_info.client_port = ntohs(atoi(value));
19738
bc30c6270d9f [gaim-migrate @ 16473]
Ma Yuan <mayuan2006@gmail.com>
parents: 19737
diff changeset
1466 }
10275
d9468bd22b7c [gaim-migrate @ 11428]
Stu Tomlinson <stu@nosnilmot.com>
parents: 10269
diff changeset
1467
d9468bd22b7c [gaim-migrate @ 11428]
Stu Tomlinson <stu@nosnilmot.com>
parents: 10269
diff changeset
1468 if ((value = msn_message_get_attr(msg, "LoginTime")) != NULL)
d9468bd22b7c [gaim-migrate @ 11428]
Stu Tomlinson <stu@nosnilmot.com>
parents: 10269
diff changeset
1469 session->passport_info.sl = atol(value);
19738
bc30c6270d9f [gaim-migrate @ 16473]
Ma Yuan <mayuan2006@gmail.com>
parents: 19737
diff changeset
1470
bc30c6270d9f [gaim-migrate @ 16473]
Ma Yuan <mayuan2006@gmail.com>
parents: 19737
diff changeset
1471 /*starting retrieve the contact list*/
bc30c6270d9f [gaim-migrate @ 16473]
Ma Yuan <mayuan2006@gmail.com>
parents: 19737
diff changeset
1472 session->contact = msn_contact_new(session);
bc30c6270d9f [gaim-migrate @ 16473]
Ma Yuan <mayuan2006@gmail.com>
parents: 19737
diff changeset
1473 msn_contact_connect(session->contact);
5309
e2e53316a21d [gaim-migrate @ 5681]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
1474 }
e2e53316a21d [gaim-migrate @ 5681]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
1475
8808
bbd8cdaf0ad5 [gaim-migrate @ 9570]
Christian Hammond <chipx86@chipx86.com>
parents: 8669
diff changeset
1476 static void
bbd8cdaf0ad5 [gaim-migrate @ 9570]
Christian Hammond <chipx86@chipx86.com>
parents: 8669
diff changeset
1477 initial_email_msg(MsnCmdProc *cmdproc, MsnMessage *msg)
5309
e2e53316a21d [gaim-migrate @ 5681]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
1478 {
8808
bbd8cdaf0ad5 [gaim-migrate @ 9570]
Christian Hammond <chipx86@chipx86.com>
parents: 8669
diff changeset
1479 MsnSession *session;
bbd8cdaf0ad5 [gaim-migrate @ 9570]
Christian Hammond <chipx86@chipx86.com>
parents: 8669
diff changeset
1480 GaimConnection *gc;
5309
e2e53316a21d [gaim-migrate @ 5681]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
1481 GHashTable *table;
e2e53316a21d [gaim-migrate @ 5681]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
1482 const char *unread;
e2e53316a21d [gaim-migrate @ 5681]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
1483
8808
bbd8cdaf0ad5 [gaim-migrate @ 9570]
Christian Hammond <chipx86@chipx86.com>
parents: 8669
diff changeset
1484 session = cmdproc->session;
bbd8cdaf0ad5 [gaim-migrate @ 9570]
Christian Hammond <chipx86@chipx86.com>
parents: 8669
diff changeset
1485 gc = session->account->gc;
bbd8cdaf0ad5 [gaim-migrate @ 9570]
Christian Hammond <chipx86@chipx86.com>
parents: 8669
diff changeset
1486
9193
502707ca1836 [gaim-migrate @ 9988]
Christian Hammond <chipx86@chipx86.com>
parents: 9158
diff changeset
1487 if (strcmp(msg->remote_user, "Hotmail"))
5333
bbbf616bd924 [gaim-migrate @ 5708]
Christian Hammond <chipx86@chipx86.com>
parents: 5327
diff changeset
1488 /* This isn't an official message. */
8808
bbd8cdaf0ad5 [gaim-migrate @ 9570]
Christian Hammond <chipx86@chipx86.com>
parents: 8669
diff changeset
1489 return;
5333
bbbf616bd924 [gaim-migrate @ 5708]
Christian Hammond <chipx86@chipx86.com>
parents: 5327
diff changeset
1490
8808
bbd8cdaf0ad5 [gaim-migrate @ 9570]
Christian Hammond <chipx86@chipx86.com>
parents: 8669
diff changeset
1491 if (session->passport_info.file == NULL)
bbd8cdaf0ad5 [gaim-migrate @ 9570]
Christian Hammond <chipx86@chipx86.com>
parents: 8669
diff changeset
1492 {
9193
502707ca1836 [gaim-migrate @ 9988]
Christian Hammond <chipx86@chipx86.com>
parents: 9158
diff changeset
1493 MsnTransaction *trans;
10225
ecf3ce2e2ab1 [gaim-migrate @ 11357]
Stu Tomlinson <stu@nosnilmot.com>
parents: 10203
diff changeset
1494 trans = msn_transaction_new(cmdproc, "URL", "%s", "INBOX");
9193
502707ca1836 [gaim-migrate @ 9988]
Christian Hammond <chipx86@chipx86.com>
parents: 9158
diff changeset
1495 msn_transaction_queue_cmd(trans, msg->cmd);
5506
4f72b611f0ee [gaim-migrate @ 5905]
Christian Hammond <chipx86@chipx86.com>
parents: 5498
diff changeset
1496
9193
502707ca1836 [gaim-migrate @ 9988]
Christian Hammond <chipx86@chipx86.com>
parents: 9158
diff changeset
1497 msn_cmdproc_send_trans(cmdproc, trans);
5506
4f72b611f0ee [gaim-migrate @ 5905]
Christian Hammond <chipx86@chipx86.com>
parents: 5498
diff changeset
1498
8808
bbd8cdaf0ad5 [gaim-migrate @ 9570]
Christian Hammond <chipx86@chipx86.com>
parents: 8669
diff changeset
1499 return;
5358
91db34a45cbe [gaim-migrate @ 5734]
Christian Hammond <chipx86@chipx86.com>
parents: 5353
diff changeset
1500 }
91db34a45cbe [gaim-migrate @ 5734]
Christian Hammond <chipx86@chipx86.com>
parents: 5353
diff changeset
1501
11321
95fa774d216d [gaim-migrate @ 13525]
Stu Tomlinson <stu@nosnilmot.com>
parents: 11183
diff changeset
1502 if (!gaim_account_get_check_mail(session->account))
95fa774d216d [gaim-migrate @ 13525]
Stu Tomlinson <stu@nosnilmot.com>
parents: 11183
diff changeset
1503 return;
95fa774d216d [gaim-migrate @ 13525]
Stu Tomlinson <stu@nosnilmot.com>
parents: 11183
diff changeset
1504
5309
e2e53316a21d [gaim-migrate @ 5681]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
1505 table = msn_message_get_hashtable_from_body(msg);
e2e53316a21d [gaim-migrate @ 5681]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
1506
e2e53316a21d [gaim-migrate @ 5681]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
1507 unread = g_hash_table_lookup(table, "Inbox-Unread");
e2e53316a21d [gaim-migrate @ 5681]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
1508
8808
bbd8cdaf0ad5 [gaim-migrate @ 9570]
Christian Hammond <chipx86@chipx86.com>
parents: 8669
diff changeset
1509 if (unread != NULL)
bbd8cdaf0ad5 [gaim-migrate @ 9570]
Christian Hammond <chipx86@chipx86.com>
parents: 8669
diff changeset
1510 {
7190
13c725566078 [gaim-migrate @ 7759]
Christian Hammond <chipx86@chipx86.com>
parents: 7188
diff changeset
1511 int count = atoi(unread);
13c725566078 [gaim-migrate @ 7759]
Christian Hammond <chipx86@chipx86.com>
parents: 7188
diff changeset
1512
9193
502707ca1836 [gaim-migrate @ 9988]
Christian Hammond <chipx86@chipx86.com>
parents: 9158
diff changeset
1513 if (count > 0)
7190
13c725566078 [gaim-migrate @ 7759]
Christian Hammond <chipx86@chipx86.com>
parents: 7188
diff changeset
1514 {
9158
c30d81b4dd22 [gaim-migrate @ 9942]
Christian Hammond <chipx86@chipx86.com>
parents: 8926
diff changeset
1515 const char *passport;
9193
502707ca1836 [gaim-migrate @ 9988]
Christian Hammond <chipx86@chipx86.com>
parents: 9158
diff changeset
1516 const char *url;
9158
c30d81b4dd22 [gaim-migrate @ 9942]
Christian Hammond <chipx86@chipx86.com>
parents: 8926
diff changeset
1517
c30d81b4dd22 [gaim-migrate @ 9942]
Christian Hammond <chipx86@chipx86.com>
parents: 8926
diff changeset
1518 passport = msn_user_get_passport(session->user);
9193
502707ca1836 [gaim-migrate @ 9988]
Christian Hammond <chipx86@chipx86.com>
parents: 9158
diff changeset
1519 url = session->passport_info.file;
502707ca1836 [gaim-migrate @ 9988]
Christian Hammond <chipx86@chipx86.com>
parents: 9158
diff changeset
1520
502707ca1836 [gaim-migrate @ 9988]
Christian Hammond <chipx86@chipx86.com>
parents: 9158
diff changeset
1521 gaim_notify_emails(gc, atoi(unread), FALSE, NULL, NULL,
502707ca1836 [gaim-migrate @ 9988]
Christian Hammond <chipx86@chipx86.com>
parents: 9158
diff changeset
1522 &passport, &url, NULL, NULL);
7190
13c725566078 [gaim-migrate @ 7759]
Christian Hammond <chipx86@chipx86.com>
parents: 7188
diff changeset
1523 }
5520
11be8ae32937 [gaim-migrate @ 5920]
Christian Hammond <chipx86@chipx86.com>
parents: 5518
diff changeset
1524 }
5309
e2e53316a21d [gaim-migrate @ 5681]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
1525
e2e53316a21d [gaim-migrate @ 5681]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
1526 g_hash_table_destroy(table);
e2e53316a21d [gaim-migrate @ 5681]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
1527 }
e2e53316a21d [gaim-migrate @ 5681]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
1528
19745
bddd32f36bde [gaim-migrate @ 16653]
Ma Yuan <mayuan2006@gmail.com>
parents: 19743
diff changeset
1529 /*offline Message notification process*/
8808
bbd8cdaf0ad5 [gaim-migrate @ 9570]
Christian Hammond <chipx86@chipx86.com>
parents: 8669
diff changeset
1530 static void
19739
852b32710df0 [gaim-migrate @ 16507]
Ma Yuan <mayuan2006@gmail.com>
parents: 19738
diff changeset
1531 initial_mdata_msg(MsnCmdProc *cmdproc, MsnMessage *msg)
852b32710df0 [gaim-migrate @ 16507]
Ma Yuan <mayuan2006@gmail.com>
parents: 19738
diff changeset
1532 {
19742
8b4653986e8e [gaim-migrate @ 16600]
Ma Yuan <mayuan2006@gmail.com>
parents: 19741
diff changeset
1533 MsnSession *session;
8b4653986e8e [gaim-migrate @ 16600]
Ma Yuan <mayuan2006@gmail.com>
parents: 19741
diff changeset
1534 char **elems, **cur, **tokens;
8b4653986e8e [gaim-migrate @ 16600]
Ma Yuan <mayuan2006@gmail.com>
parents: 19741
diff changeset
1535
8b4653986e8e [gaim-migrate @ 16600]
Ma Yuan <mayuan2006@gmail.com>
parents: 19741
diff changeset
1536 // gaim_debug_info("MaYuan","mdata...{%s} \n",msg->body);
8b4653986e8e [gaim-migrate @ 16600]
Ma Yuan <mayuan2006@gmail.com>
parents: 19741
diff changeset
1537
19748
b22d13f55232 [gaim-migrate @ 16684]
Ma Yuan <mayuan2006@gmail.com>
parents: 19745
diff changeset
1538 // /*time debug*/
b22d13f55232 [gaim-migrate @ 16684]
Ma Yuan <mayuan2006@gmail.com>
parents: 19745
diff changeset
1539 {
b22d13f55232 [gaim-migrate @ 16684]
Ma Yuan <mayuan2006@gmail.com>
parents: 19745
diff changeset
1540 const char *timestr;
b22d13f55232 [gaim-migrate @ 16684]
Ma Yuan <mayuan2006@gmail.com>
parents: 19745
diff changeset
1541 time_t t;
b22d13f55232 [gaim-migrate @ 16684]
Ma Yuan <mayuan2006@gmail.com>
parents: 19745
diff changeset
1542 struct tm *tm;
b22d13f55232 [gaim-migrate @ 16684]
Ma Yuan <mayuan2006@gmail.com>
parents: 19745
diff changeset
1543 char datestr[]="2006-07-15T07:21:26+0700";
b22d13f55232 [gaim-migrate @ 16684]
Ma Yuan <mayuan2006@gmail.com>
parents: 19745
diff changeset
1544 GDate *date;
b22d13f55232 [gaim-migrate @ 16684]
Ma Yuan <mayuan2006@gmail.com>
parents: 19745
diff changeset
1545 time(&t);
b22d13f55232 [gaim-migrate @ 16684]
Ma Yuan <mayuan2006@gmail.com>
parents: 19745
diff changeset
1546 tm = gmtime(&t);
b22d13f55232 [gaim-migrate @ 16684]
Ma Yuan <mayuan2006@gmail.com>
parents: 19745
diff changeset
1547 timestr = gaim_utf8_strftime("%a, %d %b %Y %T %Z", tm);
b22d13f55232 [gaim-migrate @ 16684]
Ma Yuan <mayuan2006@gmail.com>
parents: 19745
diff changeset
1548 // strftime(datestr,strlen(datestr),"%a",tm);
b22d13f55232 [gaim-migrate @ 16684]
Ma Yuan <mayuan2006@gmail.com>
parents: 19745
diff changeset
1549 date = g_date_new();
b22d13f55232 [gaim-migrate @ 16684]
Ma Yuan <mayuan2006@gmail.com>
parents: 19745
diff changeset
1550 g_date_set_parse(date,datestr);
b22d13f55232 [gaim-migrate @ 16684]
Ma Yuan <mayuan2006@gmail.com>
parents: 19745
diff changeset
1551 gaim_debug_info("MaYuan","date is NULL?date valid%d\n",g_date_valid(date));
b22d13f55232 [gaim-migrate @ 16684]
Ma Yuan <mayuan2006@gmail.com>
parents: 19745
diff changeset
1552 g_date_free(date);
b22d13f55232 [gaim-migrate @ 16684]
Ma Yuan <mayuan2006@gmail.com>
parents: 19745
diff changeset
1553 gaim_debug_info("MaYuan","utf8 time:{%s}\n",timestr);
b22d13f55232 [gaim-migrate @ 16684]
Ma Yuan <mayuan2006@gmail.com>
parents: 19745
diff changeset
1554 }
b22d13f55232 [gaim-migrate @ 16684]
Ma Yuan <mayuan2006@gmail.com>
parents: 19745
diff changeset
1555
19742
8b4653986e8e [gaim-migrate @ 16600]
Ma Yuan <mayuan2006@gmail.com>
parents: 19741
diff changeset
1556 /*new a oim session*/
8b4653986e8e [gaim-migrate @ 16600]
Ma Yuan <mayuan2006@gmail.com>
parents: 19741
diff changeset
1557 session = cmdproc->session;
8b4653986e8e [gaim-migrate @ 16600]
Ma Yuan <mayuan2006@gmail.com>
parents: 19741
diff changeset
1558 session->oim = msn_oim_new(session);
19743
7e36832172a9 [gaim-migrate @ 16601]
Ma Yuan <mayuan2006@gmail.com>
parents: 19742
diff changeset
1559 // msn_oim_connect(session->oim);
19742
8b4653986e8e [gaim-migrate @ 16600]
Ma Yuan <mayuan2006@gmail.com>
parents: 19741
diff changeset
1560
8b4653986e8e [gaim-migrate @ 16600]
Ma Yuan <mayuan2006@gmail.com>
parents: 19741
diff changeset
1561 /*parse offline message data*/
8b4653986e8e [gaim-migrate @ 16600]
Ma Yuan <mayuan2006@gmail.com>
parents: 19741
diff changeset
1562 elems = g_strsplit(msg->body, "\r\n", 0);
8b4653986e8e [gaim-migrate @ 16600]
Ma Yuan <mayuan2006@gmail.com>
parents: 19741
diff changeset
1563 for (cur = elems; *cur != NULL; cur++){
8b4653986e8e [gaim-migrate @ 16600]
Ma Yuan <mayuan2006@gmail.com>
parents: 19741
diff changeset
1564 const char *key, *value;
8b4653986e8e [gaim-migrate @ 16600]
Ma Yuan <mayuan2006@gmail.com>
parents: 19741
diff changeset
1565
8b4653986e8e [gaim-migrate @ 16600]
Ma Yuan <mayuan2006@gmail.com>
parents: 19741
diff changeset
1566 // gaim_debug_info("MaYuan","cur:{%s}\n",*cur);
8b4653986e8e [gaim-migrate @ 16600]
Ma Yuan <mayuan2006@gmail.com>
parents: 19741
diff changeset
1567 tokens = g_strsplit(*cur, ": ", 2);
8b4653986e8e [gaim-migrate @ 16600]
Ma Yuan <mayuan2006@gmail.com>
parents: 19741
diff changeset
1568
8b4653986e8e [gaim-migrate @ 16600]
Ma Yuan <mayuan2006@gmail.com>
parents: 19741
diff changeset
1569 key = tokens[0];
8b4653986e8e [gaim-migrate @ 16600]
Ma Yuan <mayuan2006@gmail.com>
parents: 19741
diff changeset
1570 value = tokens[1];
8b4653986e8e [gaim-migrate @ 16600]
Ma Yuan <mayuan2006@gmail.com>
parents: 19741
diff changeset
1571
8b4653986e8e [gaim-migrate @ 16600]
Ma Yuan <mayuan2006@gmail.com>
parents: 19741
diff changeset
1572 /*if not MIME content ,then return*/
8b4653986e8e [gaim-migrate @ 16600]
Ma Yuan <mayuan2006@gmail.com>
parents: 19741
diff changeset
1573 if ((key != NULL) && (!strcmp(key, "Mail-Data")) ){
8b4653986e8e [gaim-migrate @ 16600]
Ma Yuan <mayuan2006@gmail.com>
parents: 19741
diff changeset
1574 // gaim_debug_info("MaYuan","data:{%s}\n",value);
8b4653986e8e [gaim-migrate @ 16600]
Ma Yuan <mayuan2006@gmail.com>
parents: 19741
diff changeset
1575 msn_parse_oim_msg(session->oim,value);
8b4653986e8e [gaim-migrate @ 16600]
Ma Yuan <mayuan2006@gmail.com>
parents: 19741
diff changeset
1576 g_strfreev(tokens);
8b4653986e8e [gaim-migrate @ 16600]
Ma Yuan <mayuan2006@gmail.com>
parents: 19741
diff changeset
1577 break;
8b4653986e8e [gaim-migrate @ 16600]
Ma Yuan <mayuan2006@gmail.com>
parents: 19741
diff changeset
1578 }
8b4653986e8e [gaim-migrate @ 16600]
Ma Yuan <mayuan2006@gmail.com>
parents: 19741
diff changeset
1579
8b4653986e8e [gaim-migrate @ 16600]
Ma Yuan <mayuan2006@gmail.com>
parents: 19741
diff changeset
1580 g_strfreev(tokens);
8b4653986e8e [gaim-migrate @ 16600]
Ma Yuan <mayuan2006@gmail.com>
parents: 19741
diff changeset
1581 }
8b4653986e8e [gaim-migrate @ 16600]
Ma Yuan <mayuan2006@gmail.com>
parents: 19741
diff changeset
1582
8b4653986e8e [gaim-migrate @ 16600]
Ma Yuan <mayuan2006@gmail.com>
parents: 19741
diff changeset
1583 g_strfreev(elems);
19749
38e4a4b404e5 [gaim-migrate @ 16685]
Ma Yuan <mayuan2006@gmail.com>
parents: 19748
diff changeset
1584 /* test code for add group*/
38e4a4b404e5 [gaim-migrate @ 16685]
Ma Yuan <mayuan2006@gmail.com>
parents: 19748
diff changeset
1585 // msn_add_group(session,"hello");
19739
852b32710df0 [gaim-migrate @ 16507]
Ma Yuan <mayuan2006@gmail.com>
parents: 19738
diff changeset
1586 }
852b32710df0 [gaim-migrate @ 16507]
Ma Yuan <mayuan2006@gmail.com>
parents: 19738
diff changeset
1587
852b32710df0 [gaim-migrate @ 16507]
Ma Yuan <mayuan2006@gmail.com>
parents: 19738
diff changeset
1588 static void
8808
bbd8cdaf0ad5 [gaim-migrate @ 9570]
Christian Hammond <chipx86@chipx86.com>
parents: 8669
diff changeset
1589 email_msg(MsnCmdProc *cmdproc, MsnMessage *msg)
5309
e2e53316a21d [gaim-migrate @ 5681]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
1590 {
8808
bbd8cdaf0ad5 [gaim-migrate @ 9570]
Christian Hammond <chipx86@chipx86.com>
parents: 8669
diff changeset
1591 MsnSession *session;
bbd8cdaf0ad5 [gaim-migrate @ 9570]
Christian Hammond <chipx86@chipx86.com>
parents: 8669
diff changeset
1592 GaimConnection *gc;
5309
e2e53316a21d [gaim-migrate @ 5681]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
1593 GHashTable *table;
8657
4a1e87c50d6f [gaim-migrate @ 9409]
Christian Hammond <chipx86@chipx86.com>
parents: 8652
diff changeset
1594 char *from, *subject, *tmp;
8808
bbd8cdaf0ad5 [gaim-migrate @ 9570]
Christian Hammond <chipx86@chipx86.com>
parents: 8669
diff changeset
1595
bbd8cdaf0ad5 [gaim-migrate @ 9570]
Christian Hammond <chipx86@chipx86.com>
parents: 8669
diff changeset
1596 session = cmdproc->session;
bbd8cdaf0ad5 [gaim-migrate @ 9570]
Christian Hammond <chipx86@chipx86.com>
parents: 8669
diff changeset
1597 gc = session->account->gc;
8657
4a1e87c50d6f [gaim-migrate @ 9409]
Christian Hammond <chipx86@chipx86.com>
parents: 8652
diff changeset
1598
9193
502707ca1836 [gaim-migrate @ 9988]
Christian Hammond <chipx86@chipx86.com>
parents: 9158
diff changeset
1599 if (strcmp(msg->remote_user, "Hotmail"))
5333
bbbf616bd924 [gaim-migrate @ 5708]
Christian Hammond <chipx86@chipx86.com>
parents: 5327
diff changeset
1600 /* This isn't an official message. */
8808
bbd8cdaf0ad5 [gaim-migrate @ 9570]
Christian Hammond <chipx86@chipx86.com>
parents: 8669
diff changeset
1601 return;
5333
bbbf616bd924 [gaim-migrate @ 5708]
Christian Hammond <chipx86@chipx86.com>
parents: 5327
diff changeset
1602
8808
bbd8cdaf0ad5 [gaim-migrate @ 9570]
Christian Hammond <chipx86@chipx86.com>
parents: 8669
diff changeset
1603 if (session->passport_info.file == NULL)
bbd8cdaf0ad5 [gaim-migrate @ 9570]
Christian Hammond <chipx86@chipx86.com>
parents: 8669
diff changeset
1604 {
9193
502707ca1836 [gaim-migrate @ 9988]
Christian Hammond <chipx86@chipx86.com>
parents: 9158
diff changeset
1605 MsnTransaction *trans;
10225
ecf3ce2e2ab1 [gaim-migrate @ 11357]
Stu Tomlinson <stu@nosnilmot.com>
parents: 10203
diff changeset
1606 trans = msn_transaction_new(cmdproc, "URL", "%s", "INBOX");
9193
502707ca1836 [gaim-migrate @ 9988]
Christian Hammond <chipx86@chipx86.com>
parents: 9158
diff changeset
1607 msn_transaction_queue_cmd(trans, msg->cmd);
5506
4f72b611f0ee [gaim-migrate @ 5905]
Christian Hammond <chipx86@chipx86.com>
parents: 5498
diff changeset
1608
9193
502707ca1836 [gaim-migrate @ 9988]
Christian Hammond <chipx86@chipx86.com>
parents: 9158
diff changeset
1609 msn_cmdproc_send_trans(cmdproc, trans);
5506
4f72b611f0ee [gaim-migrate @ 5905]
Christian Hammond <chipx86@chipx86.com>
parents: 5498
diff changeset
1610
8808
bbd8cdaf0ad5 [gaim-migrate @ 9570]
Christian Hammond <chipx86@chipx86.com>
parents: 8669
diff changeset
1611 return;
5358
91db34a45cbe [gaim-migrate @ 5734]
Christian Hammond <chipx86@chipx86.com>
parents: 5353
diff changeset
1612 }
91db34a45cbe [gaim-migrate @ 5734]
Christian Hammond <chipx86@chipx86.com>
parents: 5353
diff changeset
1613
11321
95fa774d216d [gaim-migrate @ 13525]
Stu Tomlinson <stu@nosnilmot.com>
parents: 11183
diff changeset
1614 if (!gaim_account_get_check_mail(session->account))
95fa774d216d [gaim-migrate @ 13525]
Stu Tomlinson <stu@nosnilmot.com>
parents: 11183
diff changeset
1615 return;
95fa774d216d [gaim-migrate @ 13525]
Stu Tomlinson <stu@nosnilmot.com>
parents: 11183
diff changeset
1616
5309
e2e53316a21d [gaim-migrate @ 5681]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
1617 table = msn_message_get_hashtable_from_body(msg);
e2e53316a21d [gaim-migrate @ 5681]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
1618
9193
502707ca1836 [gaim-migrate @ 9988]
Christian Hammond <chipx86@chipx86.com>
parents: 9158
diff changeset
1619 from = subject = NULL;
502707ca1836 [gaim-migrate @ 9988]
Christian Hammond <chipx86@chipx86.com>
parents: 9158
diff changeset
1620
8657
4a1e87c50d6f [gaim-migrate @ 9409]
Christian Hammond <chipx86@chipx86.com>
parents: 8652
diff changeset
1621 tmp = g_hash_table_lookup(table, "From");
4a1e87c50d6f [gaim-migrate @ 9409]
Christian Hammond <chipx86@chipx86.com>
parents: 8652
diff changeset
1622 if (tmp != NULL)
4a1e87c50d6f [gaim-migrate @ 9409]
Christian Hammond <chipx86@chipx86.com>
parents: 8652
diff changeset
1623 from = gaim_mime_decode_field(tmp);
4a1e87c50d6f [gaim-migrate @ 9409]
Christian Hammond <chipx86@chipx86.com>
parents: 8652
diff changeset
1624
4a1e87c50d6f [gaim-migrate @ 9409]
Christian Hammond <chipx86@chipx86.com>
parents: 8652
diff changeset
1625 tmp = g_hash_table_lookup(table, "Subject");
4a1e87c50d6f [gaim-migrate @ 9409]
Christian Hammond <chipx86@chipx86.com>
parents: 8652
diff changeset
1626 if (tmp != NULL)
4a1e87c50d6f [gaim-migrate @ 9409]
Christian Hammond <chipx86@chipx86.com>
parents: 8652
diff changeset
1627 subject = gaim_mime_decode_field(tmp);
5309
e2e53316a21d [gaim-migrate @ 5681]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
1628
9158
c30d81b4dd22 [gaim-migrate @ 9942]
Christian Hammond <chipx86@chipx86.com>
parents: 8926
diff changeset
1629 gaim_notify_email(gc,
c30d81b4dd22 [gaim-migrate @ 9942]
Christian Hammond <chipx86@chipx86.com>
parents: 8926
diff changeset
1630 (subject != NULL ? subject : ""),
c30d81b4dd22 [gaim-migrate @ 9942]
Christian Hammond <chipx86@chipx86.com>
parents: 8926
diff changeset
1631 (from != NULL ? from : ""),
c30d81b4dd22 [gaim-migrate @ 9942]
Christian Hammond <chipx86@chipx86.com>
parents: 8926
diff changeset
1632 msn_user_get_passport(session->user),
c30d81b4dd22 [gaim-migrate @ 9942]
Christian Hammond <chipx86@chipx86.com>
parents: 8926
diff changeset
1633 session->passport_info.file, NULL, NULL);
5309
e2e53316a21d [gaim-migrate @ 5681]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
1634
8657
4a1e87c50d6f [gaim-migrate @ 9409]
Christian Hammond <chipx86@chipx86.com>
parents: 8652
diff changeset
1635 if (from != NULL)
4a1e87c50d6f [gaim-migrate @ 9409]
Christian Hammond <chipx86@chipx86.com>
parents: 8652
diff changeset
1636 g_free(from);
4a1e87c50d6f [gaim-migrate @ 9409]
Christian Hammond <chipx86@chipx86.com>
parents: 8652
diff changeset
1637
4a1e87c50d6f [gaim-migrate @ 9409]
Christian Hammond <chipx86@chipx86.com>
parents: 8652
diff changeset
1638 if (subject != NULL)
4a1e87c50d6f [gaim-migrate @ 9409]
Christian Hammond <chipx86@chipx86.com>
parents: 8652
diff changeset
1639 g_free(subject);
7817
954b986ad3e3 [gaim-migrate @ 8464]
Mark Doliner <mark@kingant.net>
parents: 7699
diff changeset
1640
5309
e2e53316a21d [gaim-migrate @ 5681]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
1641 g_hash_table_destroy(table);
e2e53316a21d [gaim-migrate @ 5681]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
1642 }
e2e53316a21d [gaim-migrate @ 5681]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
1643
8808
bbd8cdaf0ad5 [gaim-migrate @ 9570]
Christian Hammond <chipx86@chipx86.com>
parents: 8669
diff changeset
1644 static void
bbd8cdaf0ad5 [gaim-migrate @ 9570]
Christian Hammond <chipx86@chipx86.com>
parents: 8669
diff changeset
1645 system_msg(MsnCmdProc *cmdproc, MsnMessage *msg)
5333
bbbf616bd924 [gaim-migrate @ 5708]
Christian Hammond <chipx86@chipx86.com>
parents: 5327
diff changeset
1646 {
bbbf616bd924 [gaim-migrate @ 5708]
Christian Hammond <chipx86@chipx86.com>
parents: 5327
diff changeset
1647 GHashTable *table;
bbbf616bd924 [gaim-migrate @ 5708]
Christian Hammond <chipx86@chipx86.com>
parents: 5327
diff changeset
1648 const char *type_s;
bbbf616bd924 [gaim-migrate @ 5708]
Christian Hammond <chipx86@chipx86.com>
parents: 5327
diff changeset
1649
9193
502707ca1836 [gaim-migrate @ 9988]
Christian Hammond <chipx86@chipx86.com>
parents: 9158
diff changeset
1650 if (strcmp(msg->remote_user, "Hotmail"))
5333
bbbf616bd924 [gaim-migrate @ 5708]
Christian Hammond <chipx86@chipx86.com>
parents: 5327
diff changeset
1651 /* This isn't an official message. */
8808
bbd8cdaf0ad5 [gaim-migrate @ 9570]
Christian Hammond <chipx86@chipx86.com>
parents: 8669
diff changeset
1652 return;
5333
bbbf616bd924 [gaim-migrate @ 5708]
Christian Hammond <chipx86@chipx86.com>
parents: 5327
diff changeset
1653
bbbf616bd924 [gaim-migrate @ 5708]
Christian Hammond <chipx86@chipx86.com>
parents: 5327
diff changeset
1654 table = msn_message_get_hashtable_from_body(msg);
bbbf616bd924 [gaim-migrate @ 5708]
Christian Hammond <chipx86@chipx86.com>
parents: 5327
diff changeset
1655
8808
bbd8cdaf0ad5 [gaim-migrate @ 9570]
Christian Hammond <chipx86@chipx86.com>
parents: 8669
diff changeset
1656 if ((type_s = g_hash_table_lookup(table, "Type")) != NULL)
bbd8cdaf0ad5 [gaim-migrate @ 9570]
Christian Hammond <chipx86@chipx86.com>
parents: 8669
diff changeset
1657 {
5333
bbbf616bd924 [gaim-migrate @ 5708]
Christian Hammond <chipx86@chipx86.com>
parents: 5327
diff changeset
1658 int type = atoi(type_s);
bbbf616bd924 [gaim-migrate @ 5708]
Christian Hammond <chipx86@chipx86.com>
parents: 5327
diff changeset
1659 char buf[MSN_BUF_LEN];
6308
a21cf07cd8e1 [gaim-migrate @ 6807]
Mark Doliner <mark@kingant.net>
parents: 5963
diff changeset
1660 int minutes;
5333
bbbf616bd924 [gaim-migrate @ 5708]
Christian Hammond <chipx86@chipx86.com>
parents: 5327
diff changeset
1661
8808
bbd8cdaf0ad5 [gaim-migrate @ 9570]
Christian Hammond <chipx86@chipx86.com>
parents: 8669
diff changeset
1662 switch (type)
bbd8cdaf0ad5 [gaim-migrate @ 9570]
Christian Hammond <chipx86@chipx86.com>
parents: 8669
diff changeset
1663 {
5333
bbbf616bd924 [gaim-migrate @ 5708]
Christian Hammond <chipx86@chipx86.com>
parents: 5327
diff changeset
1664 case 1:
6308
a21cf07cd8e1 [gaim-migrate @ 6807]
Mark Doliner <mark@kingant.net>
parents: 5963
diff changeset
1665 minutes = atoi(g_hash_table_lookup(table, "Arg1"));
a21cf07cd8e1 [gaim-migrate @ 6807]
Mark Doliner <mark@kingant.net>
parents: 5963
diff changeset
1666 g_snprintf(buf, sizeof(buf), ngettext(
9158
c30d81b4dd22 [gaim-migrate @ 9942]
Christian Hammond <chipx86@chipx86.com>
parents: 8926
diff changeset
1667 "The MSN server will shut down for maintenance "
c30d81b4dd22 [gaim-migrate @ 9942]
Christian Hammond <chipx86@chipx86.com>
parents: 8926
diff changeset
1668 "in %d minute. You will automatically be "
10816
c94f40ffcafb [gaim-migrate @ 12471]
Luke Schierer <lschiere@pidgin.im>
parents: 10812
diff changeset
1669 "signed out at that time. Please finish any "
9158
c30d81b4dd22 [gaim-migrate @ 9942]
Christian Hammond <chipx86@chipx86.com>
parents: 8926
diff changeset
1670 "conversations in progress.\n\nAfter the "
c30d81b4dd22 [gaim-migrate @ 9942]
Christian Hammond <chipx86@chipx86.com>
parents: 8926
diff changeset
1671 "maintenance has been completed, you will be "
c30d81b4dd22 [gaim-migrate @ 9942]
Christian Hammond <chipx86@chipx86.com>
parents: 8926
diff changeset
1672 "able to successfully sign in.",
c30d81b4dd22 [gaim-migrate @ 9942]
Christian Hammond <chipx86@chipx86.com>
parents: 8926
diff changeset
1673 "The MSN server will shut down for maintenance "
c30d81b4dd22 [gaim-migrate @ 9942]
Christian Hammond <chipx86@chipx86.com>
parents: 8926
diff changeset
1674 "in %d minutes. You will automatically be "
10816
c94f40ffcafb [gaim-migrate @ 12471]
Luke Schierer <lschiere@pidgin.im>
parents: 10812
diff changeset
1675 "signed out at that time. Please finish any "
9158
c30d81b4dd22 [gaim-migrate @ 9942]
Christian Hammond <chipx86@chipx86.com>
parents: 8926
diff changeset
1676 "conversations in progress.\n\nAfter the "
c30d81b4dd22 [gaim-migrate @ 9942]
Christian Hammond <chipx86@chipx86.com>
parents: 8926
diff changeset
1677 "maintenance has been completed, you will be "
c30d81b4dd22 [gaim-migrate @ 9942]
Christian Hammond <chipx86@chipx86.com>
parents: 8926
diff changeset
1678 "able to successfully sign in.", minutes),
c30d81b4dd22 [gaim-migrate @ 9942]
Christian Hammond <chipx86@chipx86.com>
parents: 8926
diff changeset
1679 minutes);
5333
bbbf616bd924 [gaim-migrate @ 5708]
Christian Hammond <chipx86@chipx86.com>
parents: 5327
diff changeset
1680 default:
bbbf616bd924 [gaim-migrate @ 5708]
Christian Hammond <chipx86@chipx86.com>
parents: 5327
diff changeset
1681 break;
bbbf616bd924 [gaim-migrate @ 5708]
Christian Hammond <chipx86@chipx86.com>
parents: 5327
diff changeset
1682 }
bbbf616bd924 [gaim-migrate @ 5708]
Christian Hammond <chipx86@chipx86.com>
parents: 5327
diff changeset
1683
5436
ad445074d239 [gaim-migrate @ 5818]
Christian Hammond <chipx86@chipx86.com>
parents: 5406
diff changeset
1684 if (*buf != '\0')
8808
bbd8cdaf0ad5 [gaim-migrate @ 9570]
Christian Hammond <chipx86@chipx86.com>
parents: 8669
diff changeset
1685 gaim_notify_info(cmdproc->session->account->gc, NULL, buf, NULL);
5333
bbbf616bd924 [gaim-migrate @ 5708]
Christian Hammond <chipx86@chipx86.com>
parents: 5327
diff changeset
1686 }
bbbf616bd924 [gaim-migrate @ 5708]
Christian Hammond <chipx86@chipx86.com>
parents: 5327
diff changeset
1687
bbbf616bd924 [gaim-migrate @ 5708]
Christian Hammond <chipx86@chipx86.com>
parents: 5327
diff changeset
1688 g_hash_table_destroy(table);
bbbf616bd924 [gaim-migrate @ 5708]
Christian Hammond <chipx86@chipx86.com>
parents: 5327
diff changeset
1689 }
5793
952710ac6635 [gaim-migrate @ 6218]
Christian Hammond <chipx86@chipx86.com>
parents: 5768
diff changeset
1690
9193
502707ca1836 [gaim-migrate @ 9988]
Christian Hammond <chipx86@chipx86.com>
parents: 9158
diff changeset
1691 void
502707ca1836 [gaim-migrate @ 9988]
Christian Hammond <chipx86@chipx86.com>
parents: 9158
diff changeset
1692 msn_notification_add_buddy(MsnNotification *notification, const char *list,
502707ca1836 [gaim-migrate @ 9988]
Christian Hammond <chipx86@chipx86.com>
parents: 9158
diff changeset
1693 const char *who, const char *store_name,
19740
23258253c7a0 [gaim-migrate @ 16546]
Ma Yuan <mayuan2006@gmail.com>
parents: 19739
diff changeset
1694 const char *group_id)
9193
502707ca1836 [gaim-migrate @ 9988]
Christian Hammond <chipx86@chipx86.com>
parents: 9158
diff changeset
1695 {
502707ca1836 [gaim-migrate @ 9988]
Christian Hammond <chipx86@chipx86.com>
parents: 9158
diff changeset
1696 MsnCmdProc *cmdproc;
19750
3a15b4e5c336 [gaim-migrate @ 16716]
Ma Yuan <mayuan2006@gmail.com>
parents: 19749
diff changeset
1697 MsnTransaction *trans;
3a15b4e5c336 [gaim-migrate @ 16716]
Ma Yuan <mayuan2006@gmail.com>
parents: 19749
diff changeset
1698 xmlnode *adl_node;
3a15b4e5c336 [gaim-migrate @ 16716]
Ma Yuan <mayuan2006@gmail.com>
parents: 19749
diff changeset
1699 char *payload;
3a15b4e5c336 [gaim-migrate @ 16716]
Ma Yuan <mayuan2006@gmail.com>
parents: 19749
diff changeset
1700 int payload_len;
3a15b4e5c336 [gaim-migrate @ 16716]
Ma Yuan <mayuan2006@gmail.com>
parents: 19749
diff changeset
1701
9193
502707ca1836 [gaim-migrate @ 9988]
Christian Hammond <chipx86@chipx86.com>
parents: 9158
diff changeset
1702 cmdproc = notification->servconn->cmdproc;
502707ca1836 [gaim-migrate @ 9988]
Christian Hammond <chipx86@chipx86.com>
parents: 9158
diff changeset
1703
19750
3a15b4e5c336 [gaim-migrate @ 16716]
Ma Yuan <mayuan2006@gmail.com>
parents: 19749
diff changeset
1704 if (strcmp(list, "FL") != 0){
3a15b4e5c336 [gaim-migrate @ 16716]
Ma Yuan <mayuan2006@gmail.com>
parents: 19749
diff changeset
1705 }
3a15b4e5c336 [gaim-migrate @ 16716]
Ma Yuan <mayuan2006@gmail.com>
parents: 19749
diff changeset
1706
3a15b4e5c336 [gaim-migrate @ 16716]
Ma Yuan <mayuan2006@gmail.com>
parents: 19749
diff changeset
1707 adl_node = xmlnode_new("ml");
3a15b4e5c336 [gaim-migrate @ 16716]
Ma Yuan <mayuan2006@gmail.com>
parents: 19749
diff changeset
1708 adl_node->child = NULL;
3a15b4e5c336 [gaim-migrate @ 16716]
Ma Yuan <mayuan2006@gmail.com>
parents: 19749
diff changeset
1709 xmlnode_set_attrib(adl_node, "l", "1");
9194
364aa73323b5 [gaim-migrate @ 9989]
Christian Hammond <chipx86@chipx86.com>
parents: 9193
diff changeset
1710
19750
3a15b4e5c336 [gaim-migrate @ 16716]
Ma Yuan <mayuan2006@gmail.com>
parents: 19749
diff changeset
1711 msn_add_contact_xml(adl_node,who,3,1);
3a15b4e5c336 [gaim-migrate @ 16716]
Ma Yuan <mayuan2006@gmail.com>
parents: 19749
diff changeset
1712
3a15b4e5c336 [gaim-migrate @ 16716]
Ma Yuan <mayuan2006@gmail.com>
parents: 19749
diff changeset
1713 payload = xmlnode_to_str(adl_node,&payload_len);
3a15b4e5c336 [gaim-migrate @ 16716]
Ma Yuan <mayuan2006@gmail.com>
parents: 19749
diff changeset
1714 xmlnode_free(adl_node);
3a15b4e5c336 [gaim-migrate @ 16716]
Ma Yuan <mayuan2006@gmail.com>
parents: 19749
diff changeset
1715
19757
2315ee828b7c [gaim-migrate @ 16772]
Ma Yuan <mayuan2006@gmail.com>
parents: 19755
diff changeset
1716 msn_notification_post_adl(notification->servconn->cmdproc,
2315ee828b7c [gaim-migrate @ 16772]
Ma Yuan <mayuan2006@gmail.com>
parents: 19755
diff changeset
1717 payload,payload_len);
9193
502707ca1836 [gaim-migrate @ 9988]
Christian Hammond <chipx86@chipx86.com>
parents: 9158
diff changeset
1718 }
502707ca1836 [gaim-migrate @ 9988]
Christian Hammond <chipx86@chipx86.com>
parents: 9158
diff changeset
1719
502707ca1836 [gaim-migrate @ 9988]
Christian Hammond <chipx86@chipx86.com>
parents: 9158
diff changeset
1720 void
502707ca1836 [gaim-migrate @ 9988]
Christian Hammond <chipx86@chipx86.com>
parents: 9158
diff changeset
1721 msn_notification_rem_buddy(MsnNotification *notification, const char *list,
19740
23258253c7a0 [gaim-migrate @ 16546]
Ma Yuan <mayuan2006@gmail.com>
parents: 19739
diff changeset
1722 const char *who, const char *group_id)
9193
502707ca1836 [gaim-migrate @ 9988]
Christian Hammond <chipx86@chipx86.com>
parents: 9158
diff changeset
1723 {
502707ca1836 [gaim-migrate @ 9988]
Christian Hammond <chipx86@chipx86.com>
parents: 9158
diff changeset
1724 MsnCmdProc *cmdproc;
19750
3a15b4e5c336 [gaim-migrate @ 16716]
Ma Yuan <mayuan2006@gmail.com>
parents: 19749
diff changeset
1725 MsnTransaction *trans;
3a15b4e5c336 [gaim-migrate @ 16716]
Ma Yuan <mayuan2006@gmail.com>
parents: 19749
diff changeset
1726 xmlnode *rml_node;
3a15b4e5c336 [gaim-migrate @ 16716]
Ma Yuan <mayuan2006@gmail.com>
parents: 19749
diff changeset
1727 char *payload;
3a15b4e5c336 [gaim-migrate @ 16716]
Ma Yuan <mayuan2006@gmail.com>
parents: 19749
diff changeset
1728 int payload_len;
3a15b4e5c336 [gaim-migrate @ 16716]
Ma Yuan <mayuan2006@gmail.com>
parents: 19749
diff changeset
1729
9193
502707ca1836 [gaim-migrate @ 9988]
Christian Hammond <chipx86@chipx86.com>
parents: 9158
diff changeset
1730 cmdproc = notification->servconn->cmdproc;
502707ca1836 [gaim-migrate @ 9988]
Christian Hammond <chipx86@chipx86.com>
parents: 9158
diff changeset
1731
19750
3a15b4e5c336 [gaim-migrate @ 16716]
Ma Yuan <mayuan2006@gmail.com>
parents: 19749
diff changeset
1732 rml_node = xmlnode_new("ml");
3a15b4e5c336 [gaim-migrate @ 16716]
Ma Yuan <mayuan2006@gmail.com>
parents: 19749
diff changeset
1733 rml_node->child = NULL;
3a15b4e5c336 [gaim-migrate @ 16716]
Ma Yuan <mayuan2006@gmail.com>
parents: 19749
diff changeset
1734 xmlnode_set_attrib(rml_node, "l", "1");
3a15b4e5c336 [gaim-migrate @ 16716]
Ma Yuan <mayuan2006@gmail.com>
parents: 19749
diff changeset
1735
3a15b4e5c336 [gaim-migrate @ 16716]
Ma Yuan <mayuan2006@gmail.com>
parents: 19749
diff changeset
1736 msn_add_contact_xml(rml_node,who,3,1);
3a15b4e5c336 [gaim-migrate @ 16716]
Ma Yuan <mayuan2006@gmail.com>
parents: 19749
diff changeset
1737
3a15b4e5c336 [gaim-migrate @ 16716]
Ma Yuan <mayuan2006@gmail.com>
parents: 19749
diff changeset
1738 payload = xmlnode_to_str(rml_node,&payload_len);
3a15b4e5c336 [gaim-migrate @ 16716]
Ma Yuan <mayuan2006@gmail.com>
parents: 19749
diff changeset
1739 xmlnode_free(rml_node);
3a15b4e5c336 [gaim-migrate @ 16716]
Ma Yuan <mayuan2006@gmail.com>
parents: 19749
diff changeset
1740
3a15b4e5c336 [gaim-migrate @ 16716]
Ma Yuan <mayuan2006@gmail.com>
parents: 19749
diff changeset
1741 gaim_debug_info("MaYuan","RML{%s}\n",payload);
3a15b4e5c336 [gaim-migrate @ 16716]
Ma Yuan <mayuan2006@gmail.com>
parents: 19749
diff changeset
1742 trans = msn_transaction_new(cmdproc, "RML","%d",strlen(payload));
3a15b4e5c336 [gaim-migrate @ 16716]
Ma Yuan <mayuan2006@gmail.com>
parents: 19749
diff changeset
1743 msn_transaction_set_payload(trans, payload, strlen(payload));
3a15b4e5c336 [gaim-migrate @ 16716]
Ma Yuan <mayuan2006@gmail.com>
parents: 19749
diff changeset
1744 msn_cmdproc_send_trans(cmdproc, trans);
5309
e2e53316a21d [gaim-migrate @ 5681]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
1745 }
e2e53316a21d [gaim-migrate @ 5681]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
1746
10463
9bed28273ec7 [gaim-migrate @ 11737]
Stu Tomlinson <stu@nosnilmot.com>
parents: 10452
diff changeset
1747 /**************************************************************************
9bed28273ec7 [gaim-migrate @ 11737]
Stu Tomlinson <stu@nosnilmot.com>
parents: 10452
diff changeset
1748 * Init
9bed28273ec7 [gaim-migrate @ 11737]
Stu Tomlinson <stu@nosnilmot.com>
parents: 10452
diff changeset
1749 **************************************************************************/
8808
bbd8cdaf0ad5 [gaim-migrate @ 9570]
Christian Hammond <chipx86@chipx86.com>
parents: 8669
diff changeset
1750 void
bbd8cdaf0ad5 [gaim-migrate @ 9570]
Christian Hammond <chipx86@chipx86.com>
parents: 8669
diff changeset
1751 msn_notification_init(void)
bbd8cdaf0ad5 [gaim-migrate @ 9570]
Christian Hammond <chipx86@chipx86.com>
parents: 8669
diff changeset
1752 {
9193
502707ca1836 [gaim-migrate @ 9988]
Christian Hammond <chipx86@chipx86.com>
parents: 9158
diff changeset
1753 /* TODO: check prp, blp */
502707ca1836 [gaim-migrate @ 9988]
Christian Hammond <chipx86@chipx86.com>
parents: 9158
diff changeset
1754
8808
bbd8cdaf0ad5 [gaim-migrate @ 9570]
Christian Hammond <chipx86@chipx86.com>
parents: 8669
diff changeset
1755 cbs_table = msn_table_new();
bbd8cdaf0ad5 [gaim-migrate @ 9570]
Christian Hammond <chipx86@chipx86.com>
parents: 8669
diff changeset
1756
10310
926bd0e5f487 [gaim-migrate @ 11504]
Mark Doliner <mark@kingant.net>
parents: 10296
diff changeset
1757 /* Synchronous */
11992
c824e39db0e7 [gaim-migrate @ 14285]
Stu Tomlinson <stu@nosnilmot.com>
parents: 11862
diff changeset
1758 msn_table_add_cmd(cbs_table, "CHG", "CHG", NULL);
8808
bbd8cdaf0ad5 [gaim-migrate @ 9570]
Christian Hammond <chipx86@chipx86.com>
parents: 8669
diff changeset
1759 msn_table_add_cmd(cbs_table, "CHG", "ILN", iln_cmd);
19740
23258253c7a0 [gaim-migrate @ 16546]
Ma Yuan <mayuan2006@gmail.com>
parents: 19739
diff changeset
1760 msn_table_add_cmd(cbs_table, "ADL", "ILN", iln_cmd);
8808
bbd8cdaf0ad5 [gaim-migrate @ 9570]
Christian Hammond <chipx86@chipx86.com>
parents: 8669
diff changeset
1761 msn_table_add_cmd(cbs_table, "REM", "REM", rem_cmd);
bbd8cdaf0ad5 [gaim-migrate @ 9570]
Christian Hammond <chipx86@chipx86.com>
parents: 8669
diff changeset
1762 msn_table_add_cmd(cbs_table, "USR", "USR", usr_cmd);
bbd8cdaf0ad5 [gaim-migrate @ 9570]
Christian Hammond <chipx86@chipx86.com>
parents: 8669
diff changeset
1763 msn_table_add_cmd(cbs_table, "USR", "XFR", xfr_cmd);
19737
995aea35b05c [gaim-migrate @ 16329]
Ma Yuan <mayuan2006@gmail.com>
parents: 13711
diff changeset
1764 msn_table_add_cmd(cbs_table, "USR", "GCF", gcf_cmd);
8808
bbd8cdaf0ad5 [gaim-migrate @ 9570]
Christian Hammond <chipx86@chipx86.com>
parents: 8669
diff changeset
1765 msn_table_add_cmd(cbs_table, "SYN", "SYN", syn_cmd);
bbd8cdaf0ad5 [gaim-migrate @ 9570]
Christian Hammond <chipx86@chipx86.com>
parents: 8669
diff changeset
1766 msn_table_add_cmd(cbs_table, "CVR", "CVR", cvr_cmd);
bbd8cdaf0ad5 [gaim-migrate @ 9570]
Christian Hammond <chipx86@chipx86.com>
parents: 8669
diff changeset
1767 msn_table_add_cmd(cbs_table, "VER", "VER", ver_cmd);
bbd8cdaf0ad5 [gaim-migrate @ 9570]
Christian Hammond <chipx86@chipx86.com>
parents: 8669
diff changeset
1768 msn_table_add_cmd(cbs_table, "REA", "REA", rea_cmd);
10833
a60704081c3e [gaim-migrate @ 12503]
Stu Tomlinson <stu@nosnilmot.com>
parents: 10816
diff changeset
1769 msn_table_add_cmd(cbs_table, "PRP", "PRP", prp_cmd);
19740
23258253c7a0 [gaim-migrate @ 16546]
Ma Yuan <mayuan2006@gmail.com>
parents: 19739
diff changeset
1770 msn_table_add_cmd(cbs_table, "BLP", "BLP", blp_cmd);
23258253c7a0 [gaim-migrate @ 16546]
Ma Yuan <mayuan2006@gmail.com>
parents: 19739
diff changeset
1771 // msn_table_add_cmd(cbs_table, "BLP", "BLP", NULL);
8808
bbd8cdaf0ad5 [gaim-migrate @ 9570]
Christian Hammond <chipx86@chipx86.com>
parents: 8669
diff changeset
1772 msn_table_add_cmd(cbs_table, "REG", "REG", reg_cmd);
bbd8cdaf0ad5 [gaim-migrate @ 9570]
Christian Hammond <chipx86@chipx86.com>
parents: 8669
diff changeset
1773 msn_table_add_cmd(cbs_table, "ADG", "ADG", adg_cmd);
bbd8cdaf0ad5 [gaim-migrate @ 9570]
Christian Hammond <chipx86@chipx86.com>
parents: 8669
diff changeset
1774 msn_table_add_cmd(cbs_table, "RMG", "RMG", rmg_cmd);
bbd8cdaf0ad5 [gaim-migrate @ 9570]
Christian Hammond <chipx86@chipx86.com>
parents: 8669
diff changeset
1775 msn_table_add_cmd(cbs_table, "XFR", "XFR", xfr_cmd);
bbd8cdaf0ad5 [gaim-migrate @ 9570]
Christian Hammond <chipx86@chipx86.com>
parents: 8669
diff changeset
1776
10310
926bd0e5f487 [gaim-migrate @ 11504]
Mark Doliner <mark@kingant.net>
parents: 10296
diff changeset
1777 /* Asynchronous */
8808
bbd8cdaf0ad5 [gaim-migrate @ 9570]
Christian Hammond <chipx86@chipx86.com>
parents: 8669
diff changeset
1778 msn_table_add_cmd(cbs_table, NULL, "IPG", ipg_cmd);
bbd8cdaf0ad5 [gaim-migrate @ 9570]
Christian Hammond <chipx86@chipx86.com>
parents: 8669
diff changeset
1779 msn_table_add_cmd(cbs_table, NULL, "MSG", msg_cmd);
19754
da3f8f7ec3ce [gaim-migrate @ 16737]
Ma Yuan <mayuan2006@gmail.com>
parents: 19753
diff changeset
1780 msn_table_add_cmd(cbs_table, NULL, "UBM", ubm_cmd);
19737
995aea35b05c [gaim-migrate @ 16329]
Ma Yuan <mayuan2006@gmail.com>
parents: 13711
diff changeset
1781 msn_table_add_cmd(cbs_table, NULL, "GCF", gcf_cmd);
995aea35b05c [gaim-migrate @ 16329]
Ma Yuan <mayuan2006@gmail.com>
parents: 13711
diff changeset
1782 msn_table_add_cmd(cbs_table, NULL, "SBS", sbs_cmd);
8808
bbd8cdaf0ad5 [gaim-migrate @ 9570]
Christian Hammond <chipx86@chipx86.com>
parents: 8669
diff changeset
1783 msn_table_add_cmd(cbs_table, NULL, "NOT", not_cmd);
bbd8cdaf0ad5 [gaim-migrate @ 9570]
Christian Hammond <chipx86@chipx86.com>
parents: 8669
diff changeset
1784
bbd8cdaf0ad5 [gaim-migrate @ 9570]
Christian Hammond <chipx86@chipx86.com>
parents: 8669
diff changeset
1785 msn_table_add_cmd(cbs_table, NULL, "CHL", chl_cmd);
19749
38e4a4b404e5 [gaim-migrate @ 16685]
Ma Yuan <mayuan2006@gmail.com>
parents: 19748
diff changeset
1786 msn_table_add_cmd(cbs_table, NULL, "RML", rml_cmd);
19740
23258253c7a0 [gaim-migrate @ 16546]
Ma Yuan <mayuan2006@gmail.com>
parents: 19739
diff changeset
1787 msn_table_add_cmd(cbs_table, NULL, "ADL", adl_cmd);
19757
2315ee828b7c [gaim-migrate @ 16772]
Ma Yuan <mayuan2006@gmail.com>
parents: 19755
diff changeset
1788 msn_table_add_cmd(cbs_table, NULL, "FQY", fqy_cmd);
8808
bbd8cdaf0ad5 [gaim-migrate @ 9570]
Christian Hammond <chipx86@chipx86.com>
parents: 8669
diff changeset
1789
bbd8cdaf0ad5 [gaim-migrate @ 9570]
Christian Hammond <chipx86@chipx86.com>
parents: 8669
diff changeset
1790 msn_table_add_cmd(cbs_table, NULL, "QRY", NULL);
bbd8cdaf0ad5 [gaim-migrate @ 9570]
Christian Hammond <chipx86@chipx86.com>
parents: 8669
diff changeset
1791 msn_table_add_cmd(cbs_table, NULL, "QNG", NULL);
bbd8cdaf0ad5 [gaim-migrate @ 9570]
Christian Hammond <chipx86@chipx86.com>
parents: 8669
diff changeset
1792 msn_table_add_cmd(cbs_table, NULL, "FLN", fln_cmd);
bbd8cdaf0ad5 [gaim-migrate @ 9570]
Christian Hammond <chipx86@chipx86.com>
parents: 8669
diff changeset
1793 msn_table_add_cmd(cbs_table, NULL, "NLN", nln_cmd);
8832
c313e3b1f2c0 [gaim-migrate @ 9596]
Christian Hammond <chipx86@chipx86.com>
parents: 8808
diff changeset
1794 msn_table_add_cmd(cbs_table, NULL, "ILN", iln_cmd);
8808
bbd8cdaf0ad5 [gaim-migrate @ 9570]
Christian Hammond <chipx86@chipx86.com>
parents: 8669
diff changeset
1795 msn_table_add_cmd(cbs_table, NULL, "OUT", out_cmd);
bbd8cdaf0ad5 [gaim-migrate @ 9570]
Christian Hammond <chipx86@chipx86.com>
parents: 8669
diff changeset
1796 msn_table_add_cmd(cbs_table, NULL, "RNG", rng_cmd);
bbd8cdaf0ad5 [gaim-migrate @ 9570]
Christian Hammond <chipx86@chipx86.com>
parents: 8669
diff changeset
1797
19740
23258253c7a0 [gaim-migrate @ 16546]
Ma Yuan <mayuan2006@gmail.com>
parents: 19739
diff changeset
1798 msn_table_add_cmd(cbs_table, NULL, "UBX", ubx_cmd);
23258253c7a0 [gaim-migrate @ 16546]
Ma Yuan <mayuan2006@gmail.com>
parents: 19739
diff changeset
1799 msn_table_add_cmd(cbs_table, NULL, "UUX", uux_cmd);
23258253c7a0 [gaim-migrate @ 16546]
Ma Yuan <mayuan2006@gmail.com>
parents: 19739
diff changeset
1800
8808
bbd8cdaf0ad5 [gaim-migrate @ 9570]
Christian Hammond <chipx86@chipx86.com>
parents: 8669
diff changeset
1801 msn_table_add_cmd(cbs_table, NULL, "URL", url_cmd);
9194
364aa73323b5 [gaim-migrate @ 9989]
Christian Hammond <chipx86@chipx86.com>
parents: 9193
diff changeset
1802
10043
700f8fb9e581 [gaim-migrate @ 11002]
Luke Schierer <lschiere@pidgin.im>
parents: 10010
diff changeset
1803 msn_table_add_cmd(cbs_table, "fallback", "XFR", xfr_cmd);
8808
bbd8cdaf0ad5 [gaim-migrate @ 9570]
Christian Hammond <chipx86@chipx86.com>
parents: 8669
diff changeset
1804
bbd8cdaf0ad5 [gaim-migrate @ 9570]
Christian Hammond <chipx86@chipx86.com>
parents: 8669
diff changeset
1805 msn_table_add_error(cbs_table, "ADD", add_error);
10451
92d4a25fd33c [gaim-migrate @ 11717]
Stu Tomlinson <stu@nosnilmot.com>
parents: 10403
diff changeset
1806 msn_table_add_error(cbs_table, "REG", reg_error);
92d4a25fd33c [gaim-migrate @ 11717]
Stu Tomlinson <stu@nosnilmot.com>
parents: 10403
diff changeset
1807 msn_table_add_error(cbs_table, "RMG", rmg_error);
9193
502707ca1836 [gaim-migrate @ 9988]
Christian Hammond <chipx86@chipx86.com>
parents: 9158
diff changeset
1808 /* msn_table_add_error(cbs_table, "REA", rea_error); */
10568
fed2a7c2471d [gaim-migrate @ 11954]
Stu Tomlinson <stu@nosnilmot.com>
parents: 10519
diff changeset
1809 msn_table_add_error(cbs_table, "USR", usr_error);
10403
e5455f1dc9b6 [gaim-migrate @ 11648]
Stu Tomlinson <stu@nosnilmot.com>
parents: 10345
diff changeset
1810
8808
bbd8cdaf0ad5 [gaim-migrate @ 9570]
Christian Hammond <chipx86@chipx86.com>
parents: 8669
diff changeset
1811 msn_table_add_msg_type(cbs_table,
9158
c30d81b4dd22 [gaim-migrate @ 9942]
Christian Hammond <chipx86@chipx86.com>
parents: 8926
diff changeset
1812 "text/x-msmsgsprofile",
c30d81b4dd22 [gaim-migrate @ 9942]
Christian Hammond <chipx86@chipx86.com>
parents: 8926
diff changeset
1813 profile_msg);
19745
bddd32f36bde [gaim-migrate @ 16653]
Ma Yuan <mayuan2006@gmail.com>
parents: 19743
diff changeset
1814 /*initial OIM notification*/
8808
bbd8cdaf0ad5 [gaim-migrate @ 9570]
Christian Hammond <chipx86@chipx86.com>
parents: 8669
diff changeset
1815 msn_table_add_msg_type(cbs_table,
19739
852b32710df0 [gaim-migrate @ 16507]
Ma Yuan <mayuan2006@gmail.com>
parents: 19738
diff changeset
1816 "text/x-msmsgsinitialmdatanotification",
852b32710df0 [gaim-migrate @ 16507]
Ma Yuan <mayuan2006@gmail.com>
parents: 19738
diff changeset
1817 initial_mdata_msg);
19745
bddd32f36bde [gaim-migrate @ 16653]
Ma Yuan <mayuan2006@gmail.com>
parents: 19743
diff changeset
1818 /*OIM notification when user online*/
bddd32f36bde [gaim-migrate @ 16653]
Ma Yuan <mayuan2006@gmail.com>
parents: 19743
diff changeset
1819 msn_table_add_msg_type(cbs_table,
bddd32f36bde [gaim-migrate @ 16653]
Ma Yuan <mayuan2006@gmail.com>
parents: 19743
diff changeset
1820 "text/x-msmsgsoimnotification",
bddd32f36bde [gaim-migrate @ 16653]
Ma Yuan <mayuan2006@gmail.com>
parents: 19743
diff changeset
1821 initial_mdata_msg);
19739
852b32710df0 [gaim-migrate @ 16507]
Ma Yuan <mayuan2006@gmail.com>
parents: 19738
diff changeset
1822 msn_table_add_msg_type(cbs_table,
9158
c30d81b4dd22 [gaim-migrate @ 9942]
Christian Hammond <chipx86@chipx86.com>
parents: 8926
diff changeset
1823 "text/x-msmsgsinitialemailnotification",
c30d81b4dd22 [gaim-migrate @ 9942]
Christian Hammond <chipx86@chipx86.com>
parents: 8926
diff changeset
1824 initial_email_msg);
8808
bbd8cdaf0ad5 [gaim-migrate @ 9570]
Christian Hammond <chipx86@chipx86.com>
parents: 8669
diff changeset
1825 msn_table_add_msg_type(cbs_table,
9158
c30d81b4dd22 [gaim-migrate @ 9942]
Christian Hammond <chipx86@chipx86.com>
parents: 8926
diff changeset
1826 "text/x-msmsgsemailnotification",
c30d81b4dd22 [gaim-migrate @ 9942]
Christian Hammond <chipx86@chipx86.com>
parents: 8926
diff changeset
1827 email_msg);
8808
bbd8cdaf0ad5 [gaim-migrate @ 9570]
Christian Hammond <chipx86@chipx86.com>
parents: 8669
diff changeset
1828 msn_table_add_msg_type(cbs_table,
9158
c30d81b4dd22 [gaim-migrate @ 9942]
Christian Hammond <chipx86@chipx86.com>
parents: 8926
diff changeset
1829 "application/x-msmsgssystemmessage",
c30d81b4dd22 [gaim-migrate @ 9942]
Christian Hammond <chipx86@chipx86.com>
parents: 8926
diff changeset
1830 system_msg);
8808
bbd8cdaf0ad5 [gaim-migrate @ 9570]
Christian Hammond <chipx86@chipx86.com>
parents: 8669
diff changeset
1831 }
bbd8cdaf0ad5 [gaim-migrate @ 9570]
Christian Hammond <chipx86@chipx86.com>
parents: 8669
diff changeset
1832
bbd8cdaf0ad5 [gaim-migrate @ 9570]
Christian Hammond <chipx86@chipx86.com>
parents: 8669
diff changeset
1833 void
bbd8cdaf0ad5 [gaim-migrate @ 9570]
Christian Hammond <chipx86@chipx86.com>
parents: 8669
diff changeset
1834 msn_notification_end(void)
bbd8cdaf0ad5 [gaim-migrate @ 9570]
Christian Hammond <chipx86@chipx86.com>
parents: 8669
diff changeset
1835 {
bbd8cdaf0ad5 [gaim-migrate @ 9570]
Christian Hammond <chipx86@chipx86.com>
parents: 8669
diff changeset
1836 msn_table_destroy(cbs_table);
bbd8cdaf0ad5 [gaim-migrate @ 9570]
Christian Hammond <chipx86@chipx86.com>
parents: 8669
diff changeset
1837 }
19745
bddd32f36bde [gaim-migrate @ 16653]
Ma Yuan <mayuan2006@gmail.com>
parents: 19743
diff changeset
1838