Mercurial > pidgin.yaz
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 |
rev | line source |
---|---|
5309 | 1 /** |
2 * @file notification.c Notification server functions | |
3 * | |
4 * gaim | |
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 | 10 * This program is free software; you can redistribute it and/or modify |
11 * it under the terms of the GNU General Public License as published by | |
12 * the Free Software Foundation; either version 2 of the License, or | |
13 * (at your option) any later version. | |
14 * | |
15 * This program is distributed in the hope that it will be useful, | |
16 * but WITHOUT ANY WARRANTY; without even the implied warranty of | |
17 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | |
18 * GNU General Public License for more details. | |
19 * | |
20 * You should have received a copy of the GNU General Public License | |
21 * along with this program; if not, write to the Free Software | |
22 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA | |
23 */ | |
24 #include "msn.h" | |
25 #include "notification.h" | |
5361
953aa05279f4
[gaim-migrate @ 5737]
Christian Hammond <chipx86@chipx86.com>
parents:
5358
diff
changeset
|
26 #include "state.h" |
5309 | 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 | 33 #include "slplink.h" |
5309 | 34 |
9193
502707ca1836
[gaim-migrate @ 9988]
Christian Hammond <chipx86@chipx86.com>
parents:
9158
diff
changeset
|
35 static MsnTable *cbs_table; |
5309 | 36 |
19750 | 37 /**************************************************************************** |
38 * Local Function Prototype | |
39 ****************************************************************************/ | |
19757 | 40 void msn_notification_post_adl(MsnCmdProc *cmdproc,char *payload ,int payload_len); |
41 | |
19752 | 42 void msn_add_contact_xml(xmlnode *mlNode,const char *passport,int list_op,int type); |
19750 | 43 |
5309 | 44 /************************************************************************** |
10463 | 45 * Main |
46 **************************************************************************/ | |
10481 | 47 |
10463 | 48 static void |
49 destroy_cb(MsnServConn *servconn) | |
50 { | |
51 MsnNotification *notification; | |
52 | |
53 notification = servconn->cmdproc->data; | |
54 g_return_if_fail(notification != NULL); | |
55 | |
56 msn_notification_destroy(notification); | |
57 } | |
58 | |
59 MsnNotification * | |
60 msn_notification_new(MsnSession *session) | |
61 { | |
62 MsnNotification *notification; | |
63 MsnServConn *servconn; | |
64 | |
65 g_return_val_if_fail(session != NULL, NULL); | |
66 | |
67 notification = g_new0(MsnNotification, 1); | |
68 | |
69 notification->session = session; | |
10481 | 70 notification->servconn = servconn = msn_servconn_new(session, MSN_SERVCONN_NS); |
10463 | 71 msn_servconn_set_destroy_cb(servconn, destroy_cb); |
72 | |
73 notification->cmdproc = servconn->cmdproc; | |
74 notification->cmdproc->data = notification; | |
75 notification->cmdproc->cbs_table = cbs_table; | |
76 | |
77 return notification; | |
78 } | |
79 | |
80 void | |
81 msn_notification_destroy(MsnNotification *notification) | |
82 { | |
10481 | 83 notification->cmdproc->data = NULL; |
10463 | 84 |
10481 | 85 msn_servconn_set_destroy_cb(notification->servconn, NULL); |
10463 | 86 |
87 msn_servconn_destroy(notification->servconn); | |
88 | |
89 g_free(notification); | |
90 } | |
91 | |
92 /************************************************************************** | |
93 * Connect | |
94 **************************************************************************/ | |
10481 | 95 |
10463 | 96 static void |
97 connect_cb(MsnServConn *servconn) | |
98 { | |
99 MsnCmdProc *cmdproc; | |
100 MsnSession *session; | |
101 GaimAccount *account; | |
102 char **a, **c, *vers; | |
103 int i; | |
104 | |
105 g_return_if_fail(servconn != NULL); | |
106 | |
107 cmdproc = servconn->cmdproc; | |
108 session = servconn->session; | |
109 account = session->account; | |
110 | |
111 /* Allocate an array for CVR0, NULL, and all the versions */ | |
19739 | 112 // a = c = g_new0(char *, session->protocol_ver - WLM_MIN_PROTOCOL + 3); |
113 a = c = g_new0(char *, WLM_MAX_PROTOCOL - WLM_MIN_PROTOCOL + 3); | |
10463 | 114 |
19739 | 115 // for (i = session->protocol_ver; i >= WLM_MIN_PROTOCOL; i--) |
116 for (i = WLM_MAX_PROTOCOL; i >= WLM_MIN_PROTOCOL; i--) | |
10463 | 117 *c++ = g_strdup_printf("MSNP%d", i); |
118 | |
119 *c++ = g_strdup("CVR0"); | |
120 | |
121 vers = g_strjoinv(" ", a); | |
122 | |
19740 | 123 if (session->login_step == MSN_LOGIN_STEP_START){ |
10519 | 124 msn_session_set_login_step(session, MSN_LOGIN_STEP_HANDSHAKE); |
19740 | 125 }else{ |
10519 | 126 msn_session_set_login_step(session, MSN_LOGIN_STEP_HANDSHAKE2); |
19740 | 127 } |
10514 | 128 |
10463 | 129 msn_cmdproc_send(cmdproc, "VER", "%s", vers); |
130 | |
131 g_strfreev(a); | |
132 g_free(vers); | |
133 } | |
134 | |
135 gboolean | |
136 msn_notification_connect(MsnNotification *notification, const char *host, int port) | |
137 { | |
138 MsnServConn *servconn; | |
139 | |
140 g_return_val_if_fail(notification != NULL, FALSE); | |
141 | |
142 servconn = notification->servconn; | |
143 | |
144 msn_servconn_set_connect_cb(servconn, connect_cb); | |
145 notification->in_use = msn_servconn_connect(servconn, host, port); | |
146 | |
147 return notification->in_use; | |
148 } | |
149 | |
150 void | |
151 msn_notification_disconnect(MsnNotification *notification) | |
152 { | |
153 g_return_if_fail(notification != NULL); | |
154 g_return_if_fail(notification->in_use); | |
155 | |
156 msn_servconn_disconnect(notification->servconn); | |
157 | |
158 notification->in_use = FALSE; | |
159 } | |
160 | |
161 /************************************************************************** | |
10451 | 162 * Util |
163 **************************************************************************/ | |
10481 | 164 |
10451 | 165 static void |
19754 | 166 group_error_helper(MsnSession *session, const char *msg, const char *group_id, int error) |
10451 | 167 { |
168 GaimAccount *account; | |
169 GaimConnection *gc; | |
170 char *reason = NULL; | |
171 char *title = NULL; | |
172 | |
173 account = session->account; | |
174 gc = gaim_account_get_connection(account); | |
175 | |
19739 | 176 if (error == 224){ |
177 if (group_id == 0){ | |
10451 | 178 return; |
19739 | 179 }else{ |
10451 | 180 const char *group_name; |
19739 | 181 group_name = msn_userlist_find_group_name(session->userlist,group_id); |
10451 | 182 reason = g_strdup_printf(_("%s is not a valid group."), |
183 group_name); | |
184 } | |
19739 | 185 }else{ |
10451 | 186 reason = g_strdup(_("Unknown error.")); |
187 } | |
188 | |
189 title = g_strdup_printf(_("%s on %s (%s)"), msg, | |
190 gaim_account_get_username(account), | |
191 gaim_account_get_protocol_name(account)); | |
192 gaim_notify_error(gc, NULL, title, reason); | |
193 g_free(title); | |
194 g_free(reason); | |
195 } | |
196 | |
197 /************************************************************************** | |
5309 | 198 * Login |
199 **************************************************************************/ | |
10481 | 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 | 208 msn_session_set_login_step(session, MSN_LOGIN_STEP_AUTH_END); |
10481 | 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 | 215 { |
8808
bbd8cdaf0ad5
[gaim-migrate @ 9570]
Christian Hammond <chipx86@chipx86.com>
parents:
8669
diff
changeset
|
216 GaimAccount *account; |
5309 | 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 | 221 } |
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 | 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 | 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 | 234 if (!g_ascii_strcasecmp(cmd->params[1], "OK")){ |
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 | 240 msn_session_set_login_step(session, MSN_LOGIN_STEP_SYN); |
5309 | 241 |
19738 | 242 // msn_cmdproc_send(cmdproc, "SYN", "%s", "0"); |
243 //TODO we should use SOAP contact to fetch contact list | |
19737 | 244 }else if (!g_ascii_strcasecmp(cmd->params[1], "TWN")){ |
10481 | 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 | 254 for (cur = elems; *cur != NULL; cur++){ |
19740 | 255 tokens = g_strsplit(*cur, "=", 2); |
256 // gaim_debug_info("MaYuan","challenge %p,key:%s,value:%s\n", | |
257 // session->nexus->challenge_data,tokens[0],tokens[1]); | |
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 | 260 /* Don't free each of the tokens, only the array. */ |
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 | 266 msn_session_set_login_step(session, MSN_LOGIN_STEP_AUTH_START); |
5309 | 267 |
10481 | 268 msn_nexus_connect(session->nexus); |
5309 | 269 } |
270 } | |
271 | |
8808
bbd8cdaf0ad5
[gaim-migrate @ 9570]
Christian Hammond <chipx86@chipx86.com>
parents:
8669
diff
changeset
|
272 static void |
10568 | 273 usr_error(MsnCmdProc *cmdproc, MsnTransaction *trans, int error) |
274 { | |
275 MsnErrorType msnerr = 0; | |
276 | |
277 switch (error) | |
278 { | |
279 case 500: | |
280 case 601: | |
281 case 910: | |
282 case 921: | |
283 msnerr = MSN_ERROR_SERV_UNAVAILABLE; | |
284 break; | |
285 case 911: | |
286 msnerr = MSN_ERROR_AUTH; | |
287 break; | |
288 default: | |
289 return; | |
290 break; | |
291 } | |
292 | |
293 msn_session_set_error(cmdproc->session, msnerr, NULL); | |
294 } | |
295 | |
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 | 310 for (i = 1; i < cmd->param_count -1; i++){ |
19749 | 311 gaim_debug_info("MaYuan","%s,proto_str:%s\n",cmd->params[i],proto_str); |
19740 | 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 | 318 if (!protocol_supported){ |
10519 | 319 msn_session_set_error(session, MSN_ERROR_UNSUPPORTED_PROTOCOL, |
10481 | 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 | 324 /* |
325 * Windows Live Messenger 8.0 | |
326 * Notice :CVR String discriminate! | |
19740 | 327 * reference of http://www.microsoft.com/globaldev/reference/oslocversion.mspx |
328 * to see the Local ID | |
19737 | 329 */ |
9193
502707ca1836
[gaim-migrate @ 9988]
Christian Hammond <chipx86@chipx86.com>
parents:
9158
diff
changeset
|
330 msn_cmdproc_send(cmdproc, "CVR", |
19739 | 331 // "0x0409 winnt 5.1 i386 MSG80BETA 8.0.0689 msmsgs %s", |
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 | 336 /************************************************************************** |
337 * Log out | |
338 **************************************************************************/ | |
10481 | 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 | 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 | 344 msn_session_set_error(cmdproc->session, MSN_ERROR_SIGN_OTHER, |
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 | 347 msn_session_set_error(cmdproc->session, MSN_ERROR_SERV_DOWN, NULL); |
5309 | 348 } |
349 | |
10463 | 350 void |
351 msn_notification_close(MsnNotification *notification) | |
352 { | |
353 g_return_if_fail(notification != NULL); | |
354 | |
10568 | 355 if (!notification->in_use) |
356 return; | |
357 | |
10463 | 358 msn_cmdproc_send_quick(notification->cmdproc, "OUT", NULL, NULL); |
359 | |
360 msn_notification_disconnect(notification); | |
361 } | |
362 | |
5309 | 363 /************************************************************************** |
364 * Messages | |
365 **************************************************************************/ | |
10481 | 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 | 376 #ifdef MSN_DEBUG_NS |
377 msn_message_show_readable(msg, "Notification", TRUE); | |
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 | 387 { |
19737 | 388 gaim_debug_info("MaYuan","Processing MSG... \n"); |
389 if(cmd->payload_len == 0){ | |
390 return; | |
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 | 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 | 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 | 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 | 403 } |
404 | |
19754 | 405 /*send Message to Yahoo Messenger*/ |
406 void | |
407 uum_send_msg(MsnSession *session,MsnMessage *msg) | |
408 { | |
409 MsnCmdProc *cmdproc; | |
410 MsnTransaction *trans; | |
411 char *payload; | |
412 gsize payload_len; | |
413 int type; | |
414 | |
415 cmdproc = session->notification->cmdproc; | |
416 g_return_if_fail(msg != NULL); | |
417 payload = msn_message_gen_payload(msg, &payload_len); | |
418 gaim_debug_info("MaYuan","send UUM,payload{%s}\n",payload); | |
419 type = msg->type; | |
420 trans = msn_transaction_new(cmdproc, "UUM","%s 32 %d %d",msg->remote_user,type,strlen(payload)); | |
421 msn_transaction_set_payload(trans, payload, strlen(payload)); | |
422 msn_cmdproc_send_trans(cmdproc, trans); | |
423 } | |
424 | |
425 static void | |
426 ubm_cmd_post(MsnCmdProc *cmdproc, MsnCommand *cmd, char *payload, | |
427 size_t len) | |
428 { | |
429 MsnMessage *msg; | |
430 GaimConnection *gc; | |
19755 | 431 const char *passport; |
432 const char *content_type; | |
19754 | 433 |
434 gaim_debug_info("MaYuan","Process UBM payload:%s\n",payload); | |
435 msg = msn_message_new_from_cmd(cmdproc->session, cmd); | |
436 | |
437 msn_message_parse_payload(msg, payload, len); | |
438 #ifdef MSN_DEBUG_NS | |
439 msn_message_show_readable(msg, "Notification", TRUE); | |
440 #endif | |
441 | |
19755 | 442 gc = cmdproc->session->account->gc; |
443 passport = msg->remote_user; | |
444 | |
445 content_type = msn_message_get_content_type(msg); | |
446 gaim_debug_info("MaYuan","type:%d\n",content_type); | |
447 if(!strcmp(content_type,"text/plain")){ | |
19754 | 448 const char *value; |
449 const char *body; | |
450 char *body_str; | |
451 char *body_enc; | |
19757 | 452 char *body_final = NULL; |
19754 | 453 size_t body_len; |
454 | |
455 body = msn_message_get_bin_data(msg, &body_len); | |
456 body_str = g_strndup(body, body_len); | |
457 body_enc = g_markup_escape_text(body_str, -1); | |
458 g_free(body_str); | |
459 | |
19755 | 460 if ((value = msn_message_get_attr(msg, "X-MMS-IM-Format")) != NULL) { |
461 char *pre, *post; | |
19754 | 462 |
19755 | 463 msn_parse_format(value, &pre, &post); |
464 body_final = g_strdup_printf("%s%s%s", pre ? pre : "", | |
465 body_enc ? body_enc : "", post ? post : ""); | |
466 g_free(pre); | |
467 g_free(post); | |
468 g_free(body_enc); | |
19754 | 469 } |
470 serv_got_im(gc, passport, body_final, 0, time(NULL)); | |
471 } | |
19755 | 472 if(!strcmp(content_type,"text/x-msmsgscontrol")){ |
473 if(msn_message_get_attr(msg, "TypingUser") != NULL){ | |
474 serv_got_typing(gc, passport, MSN_TYPING_RECV_TIMEOUT, | |
475 GAIM_TYPING); | |
476 } | |
477 } | |
478 if(!strcmp(content_type,"text/x-msnmsgr-datacast")){ | |
479 char *username, *str; | |
480 GaimAccount *account; | |
481 GaimBuddy *buddy; | |
482 const char *user; | |
483 | |
484 account = cmdproc->session->account; | |
485 user = msg->remote_user; | |
486 | |
487 if ((buddy = gaim_find_buddy(account, user)) != NULL){ | |
488 username = g_markup_escape_text(gaim_buddy_get_alias(buddy), -1); | |
489 }else{ | |
490 username = g_markup_escape_text(user, -1); | |
491 } | |
492 | |
493 str = g_strdup_printf(_("%s just sent you a Nudge!"), username); | |
494 g_free(username); | |
495 msn_session_report_user(cmdproc->session,user,str,GAIM_MESSAGE_SYSTEM); | |
496 g_free(str); | |
497 } | |
19754 | 498 msn_message_destroy(msg); |
499 } | |
500 | |
501 /*Yahoo msg process*/ | |
502 static void | |
503 ubm_cmd(MsnCmdProc *cmdproc, MsnCommand *cmd) | |
504 { | |
505 gaim_debug_info("MaYuan","Processing UBM... \n"); | |
506 if(cmd->payload_len == 0){ | |
507 return; | |
508 } | |
509 /* NOTE: cmd is not always cmdproc->last_cmd, sometimes cmd is a queued | |
510 * command and we are processing it */ | |
511 if (cmd->payload == NULL){ | |
512 cmdproc->last_cmd->payload_cb = ubm_cmd_post; | |
513 cmdproc->servconn->payload_len = atoi(cmd->params[2]); | |
514 }else{ | |
515 g_return_if_fail(cmd->payload_cb != NULL); | |
516 | |
517 gaim_debug_info("MaYuan","UBM payload:{%s}\n",cmd->payload); | |
518 ubm_cmd_post(cmdproc, cmd, cmd->payload, cmd->payload_len); | |
519 } | |
520 } | |
521 | |
5309 | 522 /************************************************************************** |
523 * Challenges | |
19738 | 524 * we use MD5 to caculate the Chanllenges |
5309 | 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 | 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 | 531 |
19739 | 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 | 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 | 537 challenge_resp = MSNP13_WLM_PRODUCT_KEY; |
6701
b7e113a59b51
[gaim-migrate @ 7227]
Christian Hammond <chipx86@chipx86.com>
parents:
6695
diff
changeset
|
538 |
11183 | 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 | 543 |
19739 | 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 | 546 } |
547 #else | |
548 msn_handle_chl(cmd->params[1], buf); | |
549 #endif | |
19740 | 550 // gaim_debug_info("MaYuan","<<challenge:{%s}:{%s}\n",cmd->params[1],buf); |
19738 | 551 trans = msn_transaction_new(cmdproc, "QRY", "%s 32", MSNP13_WLM_PRODUCT_ID); |
5309 | 552 |
8808
bbd8cdaf0ad5
[gaim-migrate @ 9570]
Christian Hammond <chipx86@chipx86.com>
parents:
8669
diff
changeset
|
553 msn_transaction_set_payload(trans, buf, 32); |
5309 | 554 |
8808
bbd8cdaf0ad5
[gaim-migrate @ 9570]
Christian Hammond <chipx86@chipx86.com>
parents:
8669
diff
changeset
|
555 msn_cmdproc_send_trans(cmdproc, trans); |
5309 | 556 } |
557 | |
558 /************************************************************************** | |
559 * Buddy Lists | |
560 **************************************************************************/ | |
19750 | 561 /* add contact to xmlnode */ |
562 void | |
19752 | 563 msn_add_contact_xml(xmlnode *mlNode,const char *passport,int list_op,int type) |
19750 | 564 { |
565 xmlnode *d_node,*c_node; | |
566 char **tokens; | |
567 char *email,*domain; | |
568 char *list_op_str,*type_str; | |
569 | |
570 gaim_debug_info("MaYuan","passport:%s\n",passport); | |
571 tokens = g_strsplit(passport, "@", 2); | |
572 email = tokens[0]; | |
573 domain = tokens[1]; | |
574 | |
575 /*find a domain Node*/ | |
576 for(d_node = xmlnode_get_child(mlNode,"d"); d_node; d_node = xmlnode_get_next_twin(d_node)){ | |
577 const char * attr = NULL; | |
578 gaim_debug_info("MaYuan","d_node:%s\n",d_node->name); | |
579 attr = xmlnode_get_attrib(d_node,"n"); | |
580 if(attr == NULL){ | |
581 continue; | |
582 } | |
583 if(!strcmp(attr,domain)){ | |
584 break; | |
585 } | |
586 } | |
587 if(d_node == NULL){ | |
588 /*domain not found, create a new domain Node*/ | |
589 gaim_debug_info("MaYuan","get No d_node\n"); | |
590 d_node = xmlnode_new("d"); | |
591 xmlnode_set_attrib(d_node,"n",domain); | |
592 xmlnode_insert_child(mlNode,d_node); | |
593 } | |
594 | |
595 /*create contact node*/ | |
596 c_node = xmlnode_new("c"); | |
597 xmlnode_set_attrib(c_node,"n",email); | |
598 | |
599 list_op_str = g_strdup_printf("%d",list_op); | |
600 gaim_debug_info("MaYuan","list_op:%d\n",list_op_str); | |
601 xmlnode_set_attrib(c_node,"l",list_op_str); | |
602 g_free(list_op_str); | |
19754 | 603 #if 0 |
19750 | 604 type_str = g_strdup_printf("%d",type); |
605 xmlnode_set_attrib(c_node,"t",type_str); | |
606 #else | |
19753 | 607 if(g_strrstr(domain,"yahoo") != NULL){ |
19754 | 608 type_str = g_strdup_printf("32"); |
19753 | 609 }else{ |
610 /*passport*/ | |
611 type_str = g_strdup_printf("1"); | |
612 } | |
613 /*mobile*/ | |
614 //type_str = g_strdup_printf("4"); | |
19750 | 615 xmlnode_set_attrib(c_node,"t",type_str); |
616 g_free(type_str); | |
617 #endif | |
618 xmlnode_insert_child(d_node, c_node); | |
19757 | 619 |
620 g_free(tokens); | |
621 } | |
622 | |
623 void | |
624 msn_notification_post_adl(MsnCmdProc *cmdproc,char *payload, int payload_len) | |
625 { | |
626 MsnTransaction *trans; | |
627 | |
628 gaim_debug_info("MaYuan","Send ADL{%s}\n",payload); | |
629 trans = msn_transaction_new(cmdproc, "ADL","%d",strlen(payload)); | |
630 msn_transaction_set_payload(trans, payload, strlen(payload)); | |
631 msn_cmdproc_send_trans(cmdproc, trans); | |
19750 | 632 } |
633 | |
634 /*dump contact info to NS*/ | |
19739 | 635 void |
19750 | 636 msn_notification_dump_contact(MsnSession *session) |
19739 | 637 { |
638 MsnUserList *userlist; | |
639 MsnUser *user; | |
640 GList *l; | |
19750 | 641 xmlnode *adl_node; |
19740 | 642 char *payload; |
19739 | 643 int payload_len; |
644 | |
645 userlist = session->userlist; | |
646 adl_node = xmlnode_new("ml"); | |
647 adl_node->child = NULL; | |
648 xmlnode_set_attrib(adl_node, "l", "1"); | |
649 | |
650 /*get the userlist*/ | |
651 for (l = userlist->users; l != NULL; l = l->next){ | |
652 user = l->data; | |
19753 | 653 msn_add_contact_xml(adl_node,user->passport,user->list_op&MSN_LIST_OP_MASK,user->type); |
19739 | 654 } |
655 | |
19740 | 656 payload = xmlnode_to_str(adl_node,&payload_len); |
19750 | 657 xmlnode_free(adl_node); |
19739 | 658 |
19757 | 659 msn_notification_post_adl(session->notification->cmdproc,payload,payload_len); |
660 } | |
661 | |
662 /*Post FQY to NS,Inform add a Yahoo User*/ | |
663 void | |
664 msn_notification_fqy_yahoo(MsnSession *session,char *passport) | |
665 { | |
666 MsnTransaction *trans; | |
667 MsnCmdProc *cmdproc; | |
668 char* email,*domain,*payload; | |
669 char **tokens; | |
670 | |
671 cmdproc = session->notification->cmdproc; | |
672 | |
673 tokens = g_strsplit(passport, "@", 2); | |
674 email = tokens[0]; | |
675 domain = tokens[1]; | |
676 | |
677 payload = g_strdup_printf("<ml><d n=\"%s\"><c n=\"%s\"/></d></ml>",domain,email); | |
678 trans = msn_transaction_new(cmdproc, "FQY","%d",strlen(payload)); | |
19739 | 679 msn_transaction_set_payload(trans, payload, strlen(payload)); |
680 msn_cmdproc_send_trans(cmdproc, trans); | |
19757 | 681 |
682 g_free(payload); | |
683 g_free(tokens); | |
19739 | 684 } |
685 | |
686 static void | |
19740 | 687 blp_cmd(MsnCmdProc *cmdproc, MsnCommand *cmd) |
688 { | |
689 gaim_debug_info("MaYuan","Process BLP\n"); | |
690 } | |
691 | |
692 static void | |
19739 | 693 adl_cmd(MsnCmdProc *cmdproc, MsnCommand *cmd) |
694 { | |
19740 | 695 gaim_debug_info("MaYuan","Process ADL\n"); |
19739 | 696 } |
697 | |
698 static void | |
19757 | 699 fqy_cmd_post(MsnCmdProc *cmdproc, MsnCommand *cmd, char *payload, |
700 size_t len) | |
701 { | |
702 gaim_debug_info("MaYuan","FQY payload{%s}\n",payload); | |
703 msn_notification_post_adl(cmdproc,payload,len); | |
704 } | |
705 | |
706 static void | |
707 fqy_cmd(MsnCmdProc *cmdproc, MsnCommand *cmd) | |
708 { | |
709 gaim_debug_info("MaYuan","Process FQY\n"); | |
710 cmdproc->last_cmd->payload_cb = fqy_cmd_post; | |
711 } | |
712 | |
713 static void | |
19739 | 714 rml_cmd(MsnCmdProc *cmdproc, MsnCommand *cmd) |
715 { | |
716 MsnTransaction *trans; | |
717 char * payload; | |
718 | |
19749 | 719 gaim_debug_info("MaYuan","Process ADL\n"); |
720 #if 0 | |
19739 | 721 trans = msn_transaction_new(cmdproc, "RML",""); |
722 | |
723 msn_transaction_set_payload(trans, payload, strlen(payload)); | |
724 | |
725 msn_cmdproc_send_trans(cmdproc, trans); | |
19749 | 726 #endif |
19739 | 727 } |
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 | 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 | 749 msg = g_strdup_printf(_("Unable to add user on %s (%s)"), |
9900 | 750 gaim_account_get_username(account), |
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 | 753 msg = g_strdup_printf(_("Unable to block user on %s (%s)"), |
9900 | 754 gaim_account_get_username(account), |
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 | 757 msg = g_strdup_printf(_("Unable to permit user on %s (%s)"), |
9900 | 758 gaim_account_get_username(account), |
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 | 763 if (error == 210) |
9897 | 764 { |
10451 | 765 reason = g_strdup_printf(_("%s could not be added because " |
766 "your buddy list is full."), passport); | |
9897 | 767 } |
8808
bbd8cdaf0ad5
[gaim-migrate @ 9570]
Christian Hammond <chipx86@chipx86.com>
parents:
8669
diff
changeset
|
768 } |
9897 | 769 |
770 if (reason == NULL) | |
8808
bbd8cdaf0ad5
[gaim-migrate @ 9570]
Christian Hammond <chipx86@chipx86.com>
parents:
8669
diff
changeset
|
771 { |
9897 | 772 if (error == 208) |
773 { | |
10451 | 774 reason = g_strdup_printf(_("%s is not a valid passport account."), |
9897 | 775 passport); |
776 } | |
11862 | 777 else if (error == 500) |
778 { | |
779 reason = g_strdup(_("Service Temporarily Unavailable.")); | |
780 } | |
9897 | 781 else |
782 { | |
11862 | 783 reason = g_strdup(_("Unknown error.")); |
9897 | 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 | 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 | 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 | 844 { |
10296 | 845 MsnSlpLink *slplink; |
10451 | 846 MsnUser *user; |
10296 | 847 |
10451 | 848 user = msn_userlist_find_user(cmdproc->session->userlist, cmd->params[0]); |
5309 | 849 |
10451 | 850 user->status = "offline"; |
851 msn_user_update(user); | |
10296 | 852 |
853 slplink = msn_session_find_slplink(cmdproc->session, cmd->params[0]); | |
854 | |
855 if (slplink != NULL) | |
856 msn_slplink_destroy(slplink); | |
857 | |
5309 | 858 } |
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 | 862 { |
8808
bbd8cdaf0ad5
[gaim-migrate @ 9570]
Christian Hammond <chipx86@chipx86.com>
parents:
8669
diff
changeset
|
863 MsnSession *session; |
10010 | 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 | 868 int wlmclient; |
10451 | 869 const char *state, *passport, *friendly; |
5309 | 870 |
8808
bbd8cdaf0ad5
[gaim-migrate @ 9570]
Christian Hammond <chipx86@chipx86.com>
parents:
8669
diff
changeset
|
871 session = cmdproc->session; |
10010 | 872 account = session->account; |
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 | 877 /*if a contact is actually on the WLM part or the yahoo part*/ |
19741 | 878 wlmclient = atoi(cmd->params[3]); |
879 friendly = gaim_url_decode(cmd->params[4]); | |
5309 | 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 | 887 if (session->protocol_ver >= 9 && cmd->param_count == 7){ |
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 | 892 msn_user_set_state(user, state); |
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 | 902 } |
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 | 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 | 909 } |
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 | 913 { |
8808
bbd8cdaf0ad5
[gaim-migrate @ 9570]
Christian Hammond <chipx86@chipx86.com>
parents:
8669
diff
changeset
|
914 MsnSession *session; |
10010 | 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 | 920 int wlmclient; |
10451 | 921 const char *state, *passport, *friendly; |
5309 | 922 |
8808
bbd8cdaf0ad5
[gaim-migrate @ 9570]
Christian Hammond <chipx86@chipx86.com>
parents:
8669
diff
changeset
|
923 session = cmdproc->session; |
10010 | 924 account = session->account; |
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 | 929 wlmclient = atoi(cmd->params[2]); |
930 friendly = gaim_url_decode(cmd->params[3]); | |
5309 | 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 | 938 if (session->protocol_ver >= 9){ |
19741 | 939 if (cmd->param_count == 6){ |
940 msnobj = msn_object_new_from_string(gaim_url_decode(cmd->params[5])); | |
9859 | 941 msn_user_set_object(user, msnobj); |
19739 | 942 }else{ |
9859 | 943 msn_user_set_object(user, NULL); |
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 | 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 | 950 msn_user_set_state(user, state); |
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 | 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 | 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 | 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 | 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 | 1001 { |
10451 | 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 | 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 | 1011 |
9193
502707ca1836
[gaim-migrate @ 9988]
Christian Hammond <chipx86@chipx86.com>
parents:
9158
diff
changeset
|
1012 gaim_connection_set_display_name(gc, friendly); |
5309 | 1013 } |
1014 | |
8808
bbd8cdaf0ad5
[gaim-migrate @ 9570]
Christian Hammond <chipx86@chipx86.com>
parents:
8669
diff
changeset
|
1015 static void |
10833 | 1016 prp_cmd(MsnCmdProc *cmdproc, MsnCommand *cmd) |
1017 { | |
1018 MsnSession *session = cmdproc->session; | |
1019 const char *type, *value; | |
1020 | |
1021 g_return_if_fail(cmd->param_count >= 3); | |
1022 | |
1023 type = cmd->params[2]; | |
1024 | |
1025 if (cmd->param_count == 4) | |
1026 { | |
1027 value = cmd->params[3]; | |
1028 if (!strcmp(type, "PHH")) | |
1029 msn_user_set_home_phone(session->user, gaim_url_decode(value)); | |
1030 else if (!strcmp(type, "PHW")) | |
1031 msn_user_set_work_phone(session->user, gaim_url_decode(value)); | |
1032 else if (!strcmp(type, "PHM")) | |
1033 msn_user_set_mobile_phone(session->user, gaim_url_decode(value)); | |
1034 } | |
1035 else | |
1036 { | |
1037 if (!strcmp(type, "PHH")) | |
1038 msn_user_set_home_phone(session->user, NULL); | |
1039 else if (!strcmp(type, "PHW")) | |
1040 msn_user_set_work_phone(session->user, NULL); | |
1041 else if (!strcmp(type, "PHM")) | |
1042 msn_user_set_mobile_phone(session->user, NULL); | |
1043 } | |
1044 } | |
1045 | |
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 | 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 | 1061 reg_error(MsnCmdProc *cmdproc, MsnTransaction *trans, int error) |
1062 { | |
19754 | 1063 const char * group_id; |
10451 | 1064 char **params; |
1065 | |
1066 params = g_strsplit(trans->params, " ", 0); | |
1067 | |
19754 | 1068 group_id = params[0]; |
10451 | 1069 |
1070 group_error_helper(cmdproc->session, _("Unable to rename group"), group_id, error); | |
1071 | |
1072 g_strfreev(params); | |
1073 } | |
1074 | |
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 | 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 | 1116 rmg_error(MsnCmdProc *cmdproc, MsnTransaction *trans, int error) |
1117 { | |
1118 int group_id; | |
1119 char **params; | |
1120 | |
1121 params = g_strsplit(trans->params, " ", 0); | |
1122 | |
1123 group_id = atoi(params[0]); | |
1124 | |
10452 | 1125 group_error_helper(cmdproc->session, _("Unable to delete group"), group_id, error); |
10451 | 1126 |
1127 g_strfreev(params); | |
1128 } | |
1129 | |
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 | 1137 |
1138 if (cmd->param_count == 2) | |
1139 { | |
1140 /* | |
1141 * This can happen if we sent a SYN with an up-to-date | |
1142 * buddy list revision, but we send 0 to get a full list. | |
1143 * So, error out. | |
1144 */ | |
1145 | |
10481 | 1146 msn_session_set_error(cmdproc->session, MSN_ERROR_BAD_BLIST, NULL); |
10269 | 1147 return; |
1148 } | |
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 | 1170 /************************************************************************** |
1171 * Misc commands | |
1172 **************************************************************************/ | |
10481 | 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 | 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 | 1179 const char *rru; |
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 | 1183 guchar digest[16]; |
5309 | 1184 FILE *fd; |
11164 | 1185 char *buf; |
5309 | 1186 char buf2[3]; |
1187 char sendbuf[64]; | |
1188 int i; | |
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 | 1195 |
11164 | 1196 buf = g_strdup_printf("%s%lu%s", |
5309 | 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 | 1199 gaim_connection_get_password(account->gc)); |
5309 | 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 | 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 | 1207 |
11164 | 1208 g_free(buf); |
1209 | |
5309 | 1210 memset(sendbuf, 0, sizeof(sendbuf)); |
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 | 1215 strcat(sendbuf, buf2); |
1216 } | |
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 | 1221 g_free(session->passport_info.file); |
1222 } | |
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 | 1226 gaim_debug_error("msn", |
1227 "Error opening temp passport file: %s\n", | |
1228 strerror(errno)); | |
5309 | 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 | 1232 fputs("<html>\n" |
1233 "<head>\n" | |
1234 "<noscript>\n" | |
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 | 1237 "</noscript>\n" |
1238 "</head>\n\n", | |
1239 fd); | |
1240 | |
1241 fprintf(fd, "<body onload=\"document.pform.submit(); \">\n"); | |
1242 fprintf(fd, "<form name=\"pform\" action=\"%s\" method=\"POST\">\n\n", | |
1243 url); | |
1244 fprintf(fd, "<input type=\"hidden\" name=\"mode\" value=\"ttl\">\n"); | |
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 | 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 | 1249 fprintf(fd, "<input type=\"hidden\" name=\"sid\" value=\"%s\">\n", |
1250 session->passport_info.sid); | |
1251 fprintf(fd, "<input type=\"hidden\" name=\"kv\" value=\"%s\">\n", | |
1252 session->passport_info.kv); | |
1253 fprintf(fd, "<input type=\"hidden\" name=\"id\" value=\"2\">\n"); | |
1254 fprintf(fd, "<input type=\"hidden\" name=\"sl\" value=\"%ld\">\n", | |
1255 time(NULL) - session->passport_info.sl); | |
1256 fprintf(fd, "<input type=\"hidden\" name=\"rru\" value=\"%s\">\n", | |
1257 rru); | |
1258 fprintf(fd, "<input type=\"hidden\" name=\"auth\" value=\"%s\">\n", | |
1259 session->passport_info.mspauth); | |
1260 fprintf(fd, "<input type=\"hidden\" name=\"creds\" value=\"%s\">\n", | |
1261 sendbuf); /* TODO Digest me (huh? -- ChipX86) */ | |
1262 fprintf(fd, "<input type=\"hidden\" name=\"svc\" value=\"mail\">\n"); | |
7699 | 1263 fprintf(fd, "<input type=\"hidden\" name=\"js\" value=\"yes\">\n"); |
5309 | 1264 fprintf(fd, "</form></body>\n"); |
1265 fprintf(fd, "</html>\n"); | |
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 | 1272 |
10589
0f7452b1f777
[gaim-migrate @ 11994]
Daniel Atallah <daniel.atallah@gmail.com>
parents:
10568
diff
changeset
|
1273 g_unlink(session->passport_info.file); |
5309 | 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 | 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 | 1301 } |
1302 } | |
1303 /************************************************************************** | |
1304 * Switchboards | |
1305 **************************************************************************/ | |
10481 | 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 | 1309 { |
8808
bbd8cdaf0ad5
[gaim-migrate @ 9570]
Christian Hammond <chipx86@chipx86.com>
parents:
8669
diff
changeset
|
1310 MsnSession *session; |
5309 | 1311 MsnSwitchBoard *swboard; |
1312 const char *session_id; | |
9193
502707ca1836
[gaim-migrate @ 9988]
Christian Hammond <chipx86@chipx86.com>
parents:
9158
diff
changeset
|
1313 char *host; |
5309 | 1314 int port; |
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 | 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 | 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 | 1324 swboard = msn_switchboard_new(session); |
1325 | |
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 | 1331 |
10568 | 1332 if (!msn_switchboard_connect(swboard, host, port)) |
1333 msn_switchboard_destroy(swboard); | |
5309 | 1334 |
1335 g_free(host); | |
1336 } | |
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 | 1340 { |
1341 char *host; | |
1342 int port; | |
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 | 1346 /* Maybe we can have a generic bad command error. */ |
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 | 1349 } |
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 | 1352 |
19738 | 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 | 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 | 1359 |
10519 | 1360 msn_session_set_login_step(session, MSN_LOGIN_STEP_TRANSFER); |
10481 | 1361 |
9193
502707ca1836
[gaim-migrate @ 9988]
Christian Hammond <chipx86@chipx86.com>
parents:
9158
diff
changeset
|
1362 msn_notification_connect(session->notification, host, port); |
5309 | 1363 } |
1364 | |
1365 g_free(host); | |
1366 } | |
1367 | |
19737 | 1368 static void |
19751 | 1369 gcf_cmd_post(MsnCmdProc *cmdproc, MsnCommand *cmd, char *payload, |
1370 size_t len) | |
1371 { | |
1372 /*get the payload content*/ | |
1373 gaim_debug_info("MaYuan","GCF{%s}\n",cmd->payload); | |
1374 } | |
1375 | |
1376 static void | |
19737 | 1377 gcf_cmd(MsnCmdProc *cmdproc, MsnCommand *cmd) |
1378 { | |
1379 gaim_debug_info("MaYuan","Processing GCF... \n"); | |
19751 | 1380 cmdproc->last_cmd->payload_cb = gcf_cmd_post; |
1381 return; | |
19737 | 1382 } |
1383 | |
1384 static void | |
1385 sbs_cmd(MsnCmdProc *cmdproc, MsnCommand *cmd) | |
1386 { | |
1387 gaim_debug_info("MaYuan","Processing SBS... \n"); | |
1388 if(cmd->payload_len == 0){ | |
1389 return; | |
1390 } | |
1391 /*get the payload content*/ | |
1392 } | |
1393 | |
19740 | 1394 static void |
19757 | 1395 ubx_cmd_post(MsnCmdProc *cmdproc, MsnCommand *cmd, char *payload, |
1396 size_t len) | |
1397 { | |
1398 /*get the payload content*/ | |
1399 gaim_debug_info("MaYuan","ubx{%s}\n",cmd->payload); | |
1400 } | |
1401 | |
1402 static void | |
19740 | 1403 ubx_cmd(MsnCmdProc *cmdproc, MsnCommand *cmd) |
1404 { | |
1405 gaim_debug_info("MaYuan","UBX... \n"); | |
19757 | 1406 if(cmd->payload_len == 0){ |
1407 return; | |
1408 } | |
1409 cmdproc->last_cmd->payload_cb = ubx_cmd_post; | |
19740 | 1410 } |
1411 | |
1412 static void | |
1413 uux_cmd(MsnCmdProc *cmdproc, MsnCommand *cmd) | |
1414 { | |
1415 gaim_debug_info("MaYuan","UUX... \n"); | |
1416 } | |
1417 | |
5309 | 1418 /************************************************************************** |
1419 * Message Types | |
1420 **************************************************************************/ | |
10481 | 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 | 1424 { |
8808
bbd8cdaf0ad5
[gaim-migrate @ 9570]
Christian Hammond <chipx86@chipx86.com>
parents:
8669
diff
changeset
|
1425 MsnSession *session; |
5309 | 1426 const char *value; |
1427 | |
19738 | 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 | 1435 if ((value = msn_message_get_attr(msg, "kv")) != NULL){ |
10284 | 1436 if (session->passport_info.kv != NULL) |
1437 g_free(session->passport_info.kv); | |
1438 | |
5309 | 1439 session->passport_info.kv = g_strdup(value); |
10284 | 1440 } |
5309 | 1441 |
19738 | 1442 if ((value = msn_message_get_attr(msg, "sid")) != NULL){ |
10284 | 1443 if (session->passport_info.sid != NULL) |
1444 g_free(session->passport_info.sid); | |
1445 | |
5309 | 1446 session->passport_info.sid = g_strdup(value); |
10284 | 1447 } |
5309 | 1448 |
19738 | 1449 if ((value = msn_message_get_attr(msg, "MSPAuth")) != NULL){ |
10284 | 1450 if (session->passport_info.mspauth != NULL) |
1451 g_free(session->passport_info.mspauth); | |
1452 | |
19738 | 1453 gaim_debug_info("MaYuan","MSPAuth:%s\n",value); |
5309 | 1454 session->passport_info.mspauth = g_strdup(value); |
10284 | 1455 } |
5309 | 1456 |
19738 | 1457 if ((value = msn_message_get_attr(msg, "ClientIP")) != NULL){ |
10284 | 1458 if (session->passport_info.client_ip != NULL) |
1459 g_free(session->passport_info.client_ip); | |
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 | 1462 } |
6701
b7e113a59b51
[gaim-migrate @ 7227]
Christian Hammond <chipx86@chipx86.com>
parents:
6695
diff
changeset
|
1463 |
19738 | 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 | 1466 } |
10275 | 1467 |
1468 if ((value = msn_message_get_attr(msg, "LoginTime")) != NULL) | |
1469 session->passport_info.sl = atol(value); | |
19738 | 1470 |
1471 /*starting retrieve the contact list*/ | |
1472 session->contact = msn_contact_new(session); | |
1473 msn_contact_connect(session->contact); | |
5309 | 1474 } |
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 | 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 | 1481 GHashTable *table; |
1482 const char *unread; | |
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 | 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 | 1502 if (!gaim_account_get_check_mail(session->account)) |
1503 return; | |
1504 | |
5309 | 1505 table = msn_message_get_hashtable_from_body(msg); |
1506 | |
1507 unread = g_hash_table_lookup(table, "Inbox-Unread"); | |
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 | 1525 |
1526 g_hash_table_destroy(table); | |
1527 } | |
1528 | |
19745 | 1529 /*offline Message notification process*/ |
8808
bbd8cdaf0ad5
[gaim-migrate @ 9570]
Christian Hammond <chipx86@chipx86.com>
parents:
8669
diff
changeset
|
1530 static void |
19739 | 1531 initial_mdata_msg(MsnCmdProc *cmdproc, MsnMessage *msg) |
1532 { | |
19742 | 1533 MsnSession *session; |
1534 char **elems, **cur, **tokens; | |
1535 | |
1536 // gaim_debug_info("MaYuan","mdata...{%s} \n",msg->body); | |
1537 | |
19748 | 1538 // /*time debug*/ |
1539 { | |
1540 const char *timestr; | |
1541 time_t t; | |
1542 struct tm *tm; | |
1543 char datestr[]="2006-07-15T07:21:26+0700"; | |
1544 GDate *date; | |
1545 time(&t); | |
1546 tm = gmtime(&t); | |
1547 timestr = gaim_utf8_strftime("%a, %d %b %Y %T %Z", tm); | |
1548 // strftime(datestr,strlen(datestr),"%a",tm); | |
1549 date = g_date_new(); | |
1550 g_date_set_parse(date,datestr); | |
1551 gaim_debug_info("MaYuan","date is NULL?date valid%d\n",g_date_valid(date)); | |
1552 g_date_free(date); | |
1553 gaim_debug_info("MaYuan","utf8 time:{%s}\n",timestr); | |
1554 } | |
1555 | |
19742 | 1556 /*new a oim session*/ |
1557 session = cmdproc->session; | |
1558 session->oim = msn_oim_new(session); | |
19743 | 1559 // msn_oim_connect(session->oim); |
19742 | 1560 |
1561 /*parse offline message data*/ | |
1562 elems = g_strsplit(msg->body, "\r\n", 0); | |
1563 for (cur = elems; *cur != NULL; cur++){ | |
1564 const char *key, *value; | |
1565 | |
1566 // gaim_debug_info("MaYuan","cur:{%s}\n",*cur); | |
1567 tokens = g_strsplit(*cur, ": ", 2); | |
1568 | |
1569 key = tokens[0]; | |
1570 value = tokens[1]; | |
1571 | |
1572 /*if not MIME content ,then return*/ | |
1573 if ((key != NULL) && (!strcmp(key, "Mail-Data")) ){ | |
1574 // gaim_debug_info("MaYuan","data:{%s}\n",value); | |
1575 msn_parse_oim_msg(session->oim,value); | |
1576 g_strfreev(tokens); | |
1577 break; | |
1578 } | |
1579 | |
1580 g_strfreev(tokens); | |
1581 } | |
1582 | |
1583 g_strfreev(elems); | |
19749 | 1584 /* test code for add group*/ |
1585 // msn_add_group(session,"hello"); | |
19739 | 1586 } |
1587 | |
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 | 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 | 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 | 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 | 1614 if (!gaim_account_get_check_mail(session->account)) |
1615 return; | |
1616 | |
5309 | 1617 table = msn_message_get_hashtable_from_body(msg); |
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 | 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 | 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 | 1640 |
5309 | 1641 g_hash_table_destroy(table); |
1642 } | |
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 | 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 | 1665 minutes = atoi(g_hash_table_lookup(table, "Arg1")); |
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 | 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 | 1697 MsnTransaction *trans; |
1698 xmlnode *adl_node; | |
1699 char *payload; | |
1700 int payload_len; | |
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 | 1704 if (strcmp(list, "FL") != 0){ |
1705 } | |
1706 | |
1707 adl_node = xmlnode_new("ml"); | |
1708 adl_node->child = NULL; | |
1709 xmlnode_set_attrib(adl_node, "l", "1"); | |
9194
364aa73323b5
[gaim-migrate @ 9989]
Christian Hammond <chipx86@chipx86.com>
parents:
9193
diff
changeset
|
1710 |
19750 | 1711 msn_add_contact_xml(adl_node,who,3,1); |
1712 | |
1713 payload = xmlnode_to_str(adl_node,&payload_len); | |
1714 xmlnode_free(adl_node); | |
1715 | |
19757 | 1716 msn_notification_post_adl(notification->servconn->cmdproc, |
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 | 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 | 1725 MsnTransaction *trans; |
1726 xmlnode *rml_node; | |
1727 char *payload; | |
1728 int payload_len; | |
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 | 1732 rml_node = xmlnode_new("ml"); |
1733 rml_node->child = NULL; | |
1734 xmlnode_set_attrib(rml_node, "l", "1"); | |
1735 | |
1736 msn_add_contact_xml(rml_node,who,3,1); | |
1737 | |
1738 payload = xmlnode_to_str(rml_node,&payload_len); | |
1739 xmlnode_free(rml_node); | |
1740 | |
1741 gaim_debug_info("MaYuan","RML{%s}\n",payload); | |
1742 trans = msn_transaction_new(cmdproc, "RML","%d",strlen(payload)); | |
1743 msn_transaction_set_payload(trans, payload, strlen(payload)); | |
1744 msn_cmdproc_send_trans(cmdproc, trans); | |
5309 | 1745 } |
1746 | |
10463 | 1747 /************************************************************************** |
1748 * Init | |
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 | 1757 /* Synchronous */ |
11992 | 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 | 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 | 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 | 1769 msn_table_add_cmd(cbs_table, "PRP", "PRP", prp_cmd); |
19740 | 1770 msn_table_add_cmd(cbs_table, "BLP", "BLP", blp_cmd); |
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 | 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 | 1780 msn_table_add_cmd(cbs_table, NULL, "UBM", ubm_cmd); |
19737 | 1781 msn_table_add_cmd(cbs_table, NULL, "GCF", gcf_cmd); |
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 | 1786 msn_table_add_cmd(cbs_table, NULL, "RML", rml_cmd); |
19740 | 1787 msn_table_add_cmd(cbs_table, NULL, "ADL", adl_cmd); |
19757 | 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 | 1798 msn_table_add_cmd(cbs_table, NULL, "UBX", ubx_cmd); |
1799 msn_table_add_cmd(cbs_table, NULL, "UUX", uux_cmd); | |
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 | 1806 msn_table_add_error(cbs_table, "REG", reg_error); |
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 | 1809 msn_table_add_error(cbs_table, "USR", usr_error); |
10403 | 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 | 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 | 1816 "text/x-msmsgsinitialmdatanotification", |
1817 initial_mdata_msg); | |
19745 | 1818 /*OIM notification when user online*/ |
1819 msn_table_add_msg_type(cbs_table, | |
1820 "text/x-msmsgsoimnotification", | |
1821 initial_mdata_msg); | |
19739 | 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 | 1838 |