Mercurial > pidgin.yaz
annotate src/protocols/msn/notification.c @ 11819:1452a3a9f07a
[gaim-migrate @ 14110]
SF Patch #1249461 from David Fiander
"When a buddy toggles Allow/Disallow mobile pages the
server sends an NLN command to the client with an
updated client id number (see
http://www.hypothetic.org/docs/msn/notification/presence.php).
This patch adds support for properly tracking the
mobile paging status of buddies."
committer: Tailor Script <tailor@pidgin.im>
author | Richard Laager <rlaager@wiktel.com> |
---|---|
date | Tue, 25 Oct 2005 19:18:44 +0000 |
parents | 95fa774d216d |
children | f8cd06753755 |
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" |
28 #include "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 |
37 /************************************************************************** | |
10463 | 38 * Main |
39 **************************************************************************/ | |
10481 | 40 |
10463 | 41 static void |
42 destroy_cb(MsnServConn *servconn) | |
43 { | |
44 MsnNotification *notification; | |
45 | |
46 notification = servconn->cmdproc->data; | |
47 g_return_if_fail(notification != NULL); | |
48 | |
49 msn_notification_destroy(notification); | |
50 } | |
51 | |
52 MsnNotification * | |
53 msn_notification_new(MsnSession *session) | |
54 { | |
55 MsnNotification *notification; | |
56 MsnServConn *servconn; | |
57 | |
58 g_return_val_if_fail(session != NULL, NULL); | |
59 | |
60 notification = g_new0(MsnNotification, 1); | |
61 | |
62 notification->session = session; | |
10481 | 63 notification->servconn = servconn = msn_servconn_new(session, MSN_SERVCONN_NS); |
10463 | 64 msn_servconn_set_destroy_cb(servconn, destroy_cb); |
65 | |
66 notification->cmdproc = servconn->cmdproc; | |
67 notification->cmdproc->data = notification; | |
68 notification->cmdproc->cbs_table = cbs_table; | |
69 | |
70 return notification; | |
71 } | |
72 | |
73 void | |
74 msn_notification_destroy(MsnNotification *notification) | |
75 { | |
10481 | 76 notification->cmdproc->data = NULL; |
10463 | 77 |
10481 | 78 msn_servconn_set_destroy_cb(notification->servconn, NULL); |
10463 | 79 |
80 msn_servconn_destroy(notification->servconn); | |
81 | |
82 g_free(notification); | |
83 } | |
84 | |
85 /************************************************************************** | |
86 * Connect | |
87 **************************************************************************/ | |
10481 | 88 |
10463 | 89 static void |
90 connect_cb(MsnServConn *servconn) | |
91 { | |
92 MsnCmdProc *cmdproc; | |
93 MsnSession *session; | |
94 GaimAccount *account; | |
95 char **a, **c, *vers; | |
96 int i; | |
97 | |
98 g_return_if_fail(servconn != NULL); | |
99 | |
100 cmdproc = servconn->cmdproc; | |
101 session = servconn->session; | |
102 account = session->account; | |
103 | |
104 /* Allocate an array for CVR0, NULL, and all the versions */ | |
105 a = c = g_new0(char *, session->protocol_ver - 8 + 3); | |
106 | |
107 for (i = session->protocol_ver; i >= 8; i--) | |
108 *c++ = g_strdup_printf("MSNP%d", i); | |
109 | |
110 *c++ = g_strdup("CVR0"); | |
111 | |
112 vers = g_strjoinv(" ", a); | |
113 | |
10519 | 114 if (session->login_step == MSN_LOGIN_STEP_START) |
115 msn_session_set_login_step(session, MSN_LOGIN_STEP_HANDSHAKE); | |
116 else | |
117 msn_session_set_login_step(session, MSN_LOGIN_STEP_HANDSHAKE2); | |
10514 | 118 |
10463 | 119 msn_cmdproc_send(cmdproc, "VER", "%s", vers); |
120 | |
121 g_strfreev(a); | |
122 g_free(vers); | |
123 } | |
124 | |
125 gboolean | |
126 msn_notification_connect(MsnNotification *notification, const char *host, int port) | |
127 { | |
128 MsnServConn *servconn; | |
129 | |
130 g_return_val_if_fail(notification != NULL, FALSE); | |
131 | |
132 servconn = notification->servconn; | |
133 | |
134 msn_servconn_set_connect_cb(servconn, connect_cb); | |
135 notification->in_use = msn_servconn_connect(servconn, host, port); | |
136 | |
137 return notification->in_use; | |
138 } | |
139 | |
140 void | |
141 msn_notification_disconnect(MsnNotification *notification) | |
142 { | |
143 g_return_if_fail(notification != NULL); | |
144 g_return_if_fail(notification->in_use); | |
145 | |
146 msn_servconn_disconnect(notification->servconn); | |
147 | |
148 notification->in_use = FALSE; | |
149 } | |
150 | |
151 /************************************************************************** | |
10451 | 152 * Util |
153 **************************************************************************/ | |
10481 | 154 |
10451 | 155 static void |
156 group_error_helper(MsnSession *session, const char *msg, int group_id, int error) | |
157 { | |
158 GaimAccount *account; | |
159 GaimConnection *gc; | |
160 char *reason = NULL; | |
161 char *title = NULL; | |
162 | |
163 account = session->account; | |
164 gc = gaim_account_get_connection(account); | |
165 | |
166 if (error == 224) | |
167 { | |
168 if (group_id == 0) | |
169 { | |
170 return; | |
171 } | |
172 else | |
173 { | |
174 const char *group_name; | |
175 group_name = | |
176 msn_userlist_find_group_name(session->userlist, | |
177 group_id); | |
178 reason = g_strdup_printf(_("%s is not a valid group."), | |
179 group_name); | |
180 } | |
181 } | |
182 else | |
183 { | |
184 reason = g_strdup(_("Unknown error.")); | |
185 } | |
186 | |
187 title = g_strdup_printf(_("%s on %s (%s)"), msg, | |
188 gaim_account_get_username(account), | |
189 gaim_account_get_protocol_name(account)); | |
190 gaim_notify_error(gc, NULL, title, reason); | |
191 g_free(title); | |
192 g_free(reason); | |
193 } | |
194 | |
195 /************************************************************************** | |
5309 | 196 * Login |
197 **************************************************************************/ | |
10481 | 198 |
9193
502707ca1836
[gaim-migrate @ 9988]
Christian Hammond <chipx86@chipx86.com>
parents:
9158
diff
changeset
|
199 void |
502707ca1836
[gaim-migrate @ 9988]
Christian Hammond <chipx86@chipx86.com>
parents:
9158
diff
changeset
|
200 msn_got_login_params(MsnSession *session, const char *login_params) |
502707ca1836
[gaim-migrate @ 9988]
Christian Hammond <chipx86@chipx86.com>
parents:
9158
diff
changeset
|
201 { |
502707ca1836
[gaim-migrate @ 9988]
Christian Hammond <chipx86@chipx86.com>
parents:
9158
diff
changeset
|
202 MsnCmdProc *cmdproc; |
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 cmdproc = session->notification->cmdproc; |
502707ca1836
[gaim-migrate @ 9988]
Christian Hammond <chipx86@chipx86.com>
parents:
9158
diff
changeset
|
205 |
10519 | 206 msn_session_set_login_step(session, MSN_LOGIN_STEP_AUTH_END); |
10481 | 207 |
9193
502707ca1836
[gaim-migrate @ 9988]
Christian Hammond <chipx86@chipx86.com>
parents:
9158
diff
changeset
|
208 msn_cmdproc_send(cmdproc, "USR", "TWN S %s", login_params); |
502707ca1836
[gaim-migrate @ 9988]
Christian Hammond <chipx86@chipx86.com>
parents:
9158
diff
changeset
|
209 } |
502707ca1836
[gaim-migrate @ 9988]
Christian Hammond <chipx86@chipx86.com>
parents:
9158
diff
changeset
|
210 |
8808
bbd8cdaf0ad5
[gaim-migrate @ 9570]
Christian Hammond <chipx86@chipx86.com>
parents:
8669
diff
changeset
|
211 static void |
bbd8cdaf0ad5
[gaim-migrate @ 9570]
Christian Hammond <chipx86@chipx86.com>
parents:
8669
diff
changeset
|
212 cvr_cmd(MsnCmdProc *cmdproc, MsnCommand *cmd) |
5309 | 213 { |
8808
bbd8cdaf0ad5
[gaim-migrate @ 9570]
Christian Hammond <chipx86@chipx86.com>
parents:
8669
diff
changeset
|
214 GaimAccount *account; |
5309 | 215 |
8808
bbd8cdaf0ad5
[gaim-migrate @ 9570]
Christian Hammond <chipx86@chipx86.com>
parents:
8669
diff
changeset
|
216 account = cmdproc->session->account; |
5309 | 217 |
8808
bbd8cdaf0ad5
[gaim-migrate @ 9570]
Christian Hammond <chipx86@chipx86.com>
parents:
8669
diff
changeset
|
218 msn_cmdproc_send(cmdproc, "USR", "TWN I %s", |
bbd8cdaf0ad5
[gaim-migrate @ 9570]
Christian Hammond <chipx86@chipx86.com>
parents:
8669
diff
changeset
|
219 gaim_account_get_username(account)); |
5309 | 220 } |
221 | |
8808
bbd8cdaf0ad5
[gaim-migrate @ 9570]
Christian Hammond <chipx86@chipx86.com>
parents:
8669
diff
changeset
|
222 static void |
bbd8cdaf0ad5
[gaim-migrate @ 9570]
Christian Hammond <chipx86@chipx86.com>
parents:
8669
diff
changeset
|
223 usr_cmd(MsnCmdProc *cmdproc, MsnCommand *cmd) |
5309 | 224 { |
8808
bbd8cdaf0ad5
[gaim-migrate @ 9570]
Christian Hammond <chipx86@chipx86.com>
parents:
8669
diff
changeset
|
225 MsnSession *session; |
bbd8cdaf0ad5
[gaim-migrate @ 9570]
Christian Hammond <chipx86@chipx86.com>
parents:
8669
diff
changeset
|
226 GaimAccount *account; |
bbd8cdaf0ad5
[gaim-migrate @ 9570]
Christian Hammond <chipx86@chipx86.com>
parents:
8669
diff
changeset
|
227 GaimConnection *gc; |
5309 | 228 |
8808
bbd8cdaf0ad5
[gaim-migrate @ 9570]
Christian Hammond <chipx86@chipx86.com>
parents:
8669
diff
changeset
|
229 session = cmdproc->session; |
bbd8cdaf0ad5
[gaim-migrate @ 9570]
Christian Hammond <chipx86@chipx86.com>
parents:
8669
diff
changeset
|
230 account = session->account; |
bbd8cdaf0ad5
[gaim-migrate @ 9570]
Christian Hammond <chipx86@chipx86.com>
parents:
8669
diff
changeset
|
231 gc = gaim_account_get_connection(account); |
bbd8cdaf0ad5
[gaim-migrate @ 9570]
Christian Hammond <chipx86@chipx86.com>
parents:
8669
diff
changeset
|
232 |
bbd8cdaf0ad5
[gaim-migrate @ 9570]
Christian Hammond <chipx86@chipx86.com>
parents:
8669
diff
changeset
|
233 if (!g_ascii_strcasecmp(cmd->params[1], "OK")) |
6701
b7e113a59b51
[gaim-migrate @ 7227]
Christian Hammond <chipx86@chipx86.com>
parents:
6695
diff
changeset
|
234 { |
10481 | 235 /* 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 |
10481 | 242 msn_cmdproc_send(cmdproc, "SYN", "%s", "0"); |
5309 | 243 } |
8808
bbd8cdaf0ad5
[gaim-migrate @ 9570]
Christian Hammond <chipx86@chipx86.com>
parents:
8669
diff
changeset
|
244 else if (!g_ascii_strcasecmp(cmd->params[1], "TWN")) |
6701
b7e113a59b51
[gaim-migrate @ 7227]
Christian Hammond <chipx86@chipx86.com>
parents:
6695
diff
changeset
|
245 { |
10481 | 246 /* Passport authentication */ |
8171
d0ba2f7b40e7
[gaim-migrate @ 8884]
Christian Hammond <chipx86@chipx86.com>
parents:
8029
diff
changeset
|
247 char **elems, **cur, **tokens; |
6701
b7e113a59b51
[gaim-migrate @ 7227]
Christian Hammond <chipx86@chipx86.com>
parents:
6695
diff
changeset
|
248 |
8171
d0ba2f7b40e7
[gaim-migrate @ 8884]
Christian Hammond <chipx86@chipx86.com>
parents:
8029
diff
changeset
|
249 session->nexus = msn_nexus_new(session); |
6701
b7e113a59b51
[gaim-migrate @ 7227]
Christian Hammond <chipx86@chipx86.com>
parents:
6695
diff
changeset
|
250 |
b7e113a59b51
[gaim-migrate @ 7227]
Christian Hammond <chipx86@chipx86.com>
parents:
6695
diff
changeset
|
251 /* Parse the challenge data. */ |
9193
502707ca1836
[gaim-migrate @ 9988]
Christian Hammond <chipx86@chipx86.com>
parents:
9158
diff
changeset
|
252 |
8808
bbd8cdaf0ad5
[gaim-migrate @ 9570]
Christian Hammond <chipx86@chipx86.com>
parents:
8669
diff
changeset
|
253 elems = g_strsplit(cmd->params[3], ",", 0); |
6701
b7e113a59b51
[gaim-migrate @ 7227]
Christian Hammond <chipx86@chipx86.com>
parents:
6695
diff
changeset
|
254 |
8171
d0ba2f7b40e7
[gaim-migrate @ 8884]
Christian Hammond <chipx86@chipx86.com>
parents:
8029
diff
changeset
|
255 for (cur = elems; *cur != NULL; cur++) |
d0ba2f7b40e7
[gaim-migrate @ 8884]
Christian Hammond <chipx86@chipx86.com>
parents:
8029
diff
changeset
|
256 { |
d0ba2f7b40e7
[gaim-migrate @ 8884]
Christian Hammond <chipx86@chipx86.com>
parents:
8029
diff
changeset
|
257 tokens = g_strsplit(*cur, "=", 2); |
d0ba2f7b40e7
[gaim-migrate @ 8884]
Christian Hammond <chipx86@chipx86.com>
parents:
8029
diff
changeset
|
258 g_hash_table_insert(session->nexus->challenge_data, tokens[0], tokens[1]); |
d0ba2f7b40e7
[gaim-migrate @ 8884]
Christian Hammond <chipx86@chipx86.com>
parents:
8029
diff
changeset
|
259 /* Don't free each of the tokens, only the array. */ |
d0ba2f7b40e7
[gaim-migrate @ 8884]
Christian Hammond <chipx86@chipx86.com>
parents:
8029
diff
changeset
|
260 g_free(tokens); |
6701
b7e113a59b51
[gaim-migrate @ 7227]
Christian Hammond <chipx86@chipx86.com>
parents:
6695
diff
changeset
|
261 } |
b7e113a59b51
[gaim-migrate @ 7227]
Christian Hammond <chipx86@chipx86.com>
parents:
6695
diff
changeset
|
262 |
8171
d0ba2f7b40e7
[gaim-migrate @ 8884]
Christian Hammond <chipx86@chipx86.com>
parents:
8029
diff
changeset
|
263 g_strfreev(elems); |
6701
b7e113a59b51
[gaim-migrate @ 7227]
Christian Hammond <chipx86@chipx86.com>
parents:
6695
diff
changeset
|
264 |
10519 | 265 msn_session_set_login_step(session, MSN_LOGIN_STEP_AUTH_START); |
5309 | 266 |
10481 | 267 msn_nexus_connect(session->nexus); |
5309 | 268 } |
269 } | |
270 | |
8808
bbd8cdaf0ad5
[gaim-migrate @ 9570]
Christian Hammond <chipx86@chipx86.com>
parents:
8669
diff
changeset
|
271 static void |
10568 | 272 usr_error(MsnCmdProc *cmdproc, MsnTransaction *trans, int error) |
273 { | |
274 MsnErrorType msnerr = 0; | |
275 | |
276 switch (error) | |
277 { | |
278 case 500: | |
279 case 601: | |
280 case 910: | |
281 case 921: | |
282 msnerr = MSN_ERROR_SERV_UNAVAILABLE; | |
283 break; | |
284 case 911: | |
285 msnerr = MSN_ERROR_AUTH; | |
286 break; | |
287 default: | |
288 return; | |
289 break; | |
290 } | |
291 | |
292 msn_session_set_error(cmdproc->session, msnerr, NULL); | |
293 } | |
294 | |
295 static void | |
8808
bbd8cdaf0ad5
[gaim-migrate @ 9570]
Christian Hammond <chipx86@chipx86.com>
parents:
8669
diff
changeset
|
296 ver_cmd(MsnCmdProc *cmdproc, MsnCommand *cmd) |
6701
b7e113a59b51
[gaim-migrate @ 7227]
Christian Hammond <chipx86@chipx86.com>
parents:
6695
diff
changeset
|
297 { |
8808
bbd8cdaf0ad5
[gaim-migrate @ 9570]
Christian Hammond <chipx86@chipx86.com>
parents:
8669
diff
changeset
|
298 MsnSession *session; |
bbd8cdaf0ad5
[gaim-migrate @ 9570]
Christian Hammond <chipx86@chipx86.com>
parents:
8669
diff
changeset
|
299 GaimAccount *account; |
6701
b7e113a59b51
[gaim-migrate @ 7227]
Christian Hammond <chipx86@chipx86.com>
parents:
6695
diff
changeset
|
300 gboolean protocol_supported = FALSE; |
b7e113a59b51
[gaim-migrate @ 7227]
Christian Hammond <chipx86@chipx86.com>
parents:
6695
diff
changeset
|
301 char proto_str[8]; |
b7e113a59b51
[gaim-migrate @ 7227]
Christian Hammond <chipx86@chipx86.com>
parents:
6695
diff
changeset
|
302 size_t i; |
b7e113a59b51
[gaim-migrate @ 7227]
Christian Hammond <chipx86@chipx86.com>
parents:
6695
diff
changeset
|
303 |
8808
bbd8cdaf0ad5
[gaim-migrate @ 9570]
Christian Hammond <chipx86@chipx86.com>
parents:
8669
diff
changeset
|
304 session = cmdproc->session; |
bbd8cdaf0ad5
[gaim-migrate @ 9570]
Christian Hammond <chipx86@chipx86.com>
parents:
8669
diff
changeset
|
305 account = session->account; |
bbd8cdaf0ad5
[gaim-migrate @ 9570]
Christian Hammond <chipx86@chipx86.com>
parents:
8669
diff
changeset
|
306 |
6701
b7e113a59b51
[gaim-migrate @ 7227]
Christian Hammond <chipx86@chipx86.com>
parents:
6695
diff
changeset
|
307 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
|
308 |
8808
bbd8cdaf0ad5
[gaim-migrate @ 9570]
Christian Hammond <chipx86@chipx86.com>
parents:
8669
diff
changeset
|
309 for (i = 1; i < cmd->param_count; i++) |
6701
b7e113a59b51
[gaim-migrate @ 7227]
Christian Hammond <chipx86@chipx86.com>
parents:
6695
diff
changeset
|
310 { |
8808
bbd8cdaf0ad5
[gaim-migrate @ 9570]
Christian Hammond <chipx86@chipx86.com>
parents:
8669
diff
changeset
|
311 if (!strcmp(cmd->params[i], proto_str)) |
6701
b7e113a59b51
[gaim-migrate @ 7227]
Christian Hammond <chipx86@chipx86.com>
parents:
6695
diff
changeset
|
312 { |
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 |
8808
bbd8cdaf0ad5
[gaim-migrate @ 9570]
Christian Hammond <chipx86@chipx86.com>
parents:
8669
diff
changeset
|
318 if (!protocol_supported) |
bbd8cdaf0ad5
[gaim-migrate @ 9570]
Christian Hammond <chipx86@chipx86.com>
parents:
8669
diff
changeset
|
319 { |
10519 | 320 msn_session_set_error(session, MSN_ERROR_UNSUPPORTED_PROTOCOL, |
10481 | 321 NULL); |
8808
bbd8cdaf0ad5
[gaim-migrate @ 9570]
Christian Hammond <chipx86@chipx86.com>
parents:
8669
diff
changeset
|
322 return; |
6701
b7e113a59b51
[gaim-migrate @ 7227]
Christian Hammond <chipx86@chipx86.com>
parents:
6695
diff
changeset
|
323 } |
b7e113a59b51
[gaim-migrate @ 7227]
Christian Hammond <chipx86@chipx86.com>
parents:
6695
diff
changeset
|
324 |
9193
502707ca1836
[gaim-migrate @ 9988]
Christian Hammond <chipx86@chipx86.com>
parents:
9158
diff
changeset
|
325 msn_cmdproc_send(cmdproc, "CVR", |
502707ca1836
[gaim-migrate @ 9988]
Christian Hammond <chipx86@chipx86.com>
parents:
9158
diff
changeset
|
326 "0x0409 winnt 5.1 i386 MSNMSGR 6.0.0602 MSMSGS %s", |
502707ca1836
[gaim-migrate @ 9988]
Christian Hammond <chipx86@chipx86.com>
parents:
9158
diff
changeset
|
327 gaim_account_get_username(account)); |
6701
b7e113a59b51
[gaim-migrate @ 7227]
Christian Hammond <chipx86@chipx86.com>
parents:
6695
diff
changeset
|
328 } |
b7e113a59b51
[gaim-migrate @ 7227]
Christian Hammond <chipx86@chipx86.com>
parents:
6695
diff
changeset
|
329 |
5309 | 330 /************************************************************************** |
331 * Log out | |
332 **************************************************************************/ | |
10481 | 333 |
8808
bbd8cdaf0ad5
[gaim-migrate @ 9570]
Christian Hammond <chipx86@chipx86.com>
parents:
8669
diff
changeset
|
334 static void |
bbd8cdaf0ad5
[gaim-migrate @ 9570]
Christian Hammond <chipx86@chipx86.com>
parents:
8669
diff
changeset
|
335 out_cmd(MsnCmdProc *cmdproc, MsnCommand *cmd) |
5309 | 336 { |
8808
bbd8cdaf0ad5
[gaim-migrate @ 9570]
Christian Hammond <chipx86@chipx86.com>
parents:
8669
diff
changeset
|
337 if (!g_ascii_strcasecmp(cmd->params[0], "OTH")) |
10481 | 338 msn_session_set_error(cmdproc->session, MSN_ERROR_SIGN_OTHER, |
339 NULL); | |
8808
bbd8cdaf0ad5
[gaim-migrate @ 9570]
Christian Hammond <chipx86@chipx86.com>
parents:
8669
diff
changeset
|
340 else if (!g_ascii_strcasecmp(cmd->params[0], "SSD")) |
10481 | 341 msn_session_set_error(cmdproc->session, MSN_ERROR_SERV_DOWN, NULL); |
5309 | 342 } |
343 | |
10463 | 344 void |
345 msn_notification_close(MsnNotification *notification) | |
346 { | |
347 g_return_if_fail(notification != NULL); | |
348 | |
10568 | 349 if (!notification->in_use) |
350 return; | |
351 | |
10463 | 352 msn_cmdproc_send_quick(notification->cmdproc, "OUT", NULL, NULL); |
353 | |
354 msn_notification_disconnect(notification); | |
355 } | |
356 | |
5309 | 357 /************************************************************************** |
358 * Messages | |
359 **************************************************************************/ | |
10481 | 360 |
8646
1e211dde3cae
[gaim-migrate @ 9398]
Christian Hammond <chipx86@chipx86.com>
parents:
8614
diff
changeset
|
361 static void |
9193
502707ca1836
[gaim-migrate @ 9988]
Christian Hammond <chipx86@chipx86.com>
parents:
9158
diff
changeset
|
362 msg_cmd_post(MsnCmdProc *cmdproc, MsnCommand *cmd, char *payload, |
502707ca1836
[gaim-migrate @ 9988]
Christian Hammond <chipx86@chipx86.com>
parents:
9158
diff
changeset
|
363 size_t len) |
8646
1e211dde3cae
[gaim-migrate @ 9398]
Christian Hammond <chipx86@chipx86.com>
parents:
8614
diff
changeset
|
364 { |
8808
bbd8cdaf0ad5
[gaim-migrate @ 9570]
Christian Hammond <chipx86@chipx86.com>
parents:
8669
diff
changeset
|
365 MsnMessage *msg; |
8646
1e211dde3cae
[gaim-migrate @ 9398]
Christian Hammond <chipx86@chipx86.com>
parents:
8614
diff
changeset
|
366 |
9193
502707ca1836
[gaim-migrate @ 9988]
Christian Hammond <chipx86@chipx86.com>
parents:
9158
diff
changeset
|
367 msg = msn_message_new_from_cmd(cmdproc->session, cmd); |
8646
1e211dde3cae
[gaim-migrate @ 9398]
Christian Hammond <chipx86@chipx86.com>
parents:
8614
diff
changeset
|
368 |
1e211dde3cae
[gaim-migrate @ 9398]
Christian Hammond <chipx86@chipx86.com>
parents:
8614
diff
changeset
|
369 msn_message_parse_payload(msg, payload, len); |
11321 | 370 #ifdef MSN_DEBUG_NS |
371 msn_message_show_readable(msg, "Notification", TRUE); | |
372 #endif | |
8646
1e211dde3cae
[gaim-migrate @ 9398]
Christian Hammond <chipx86@chipx86.com>
parents:
8614
diff
changeset
|
373 |
8808
bbd8cdaf0ad5
[gaim-migrate @ 9570]
Christian Hammond <chipx86@chipx86.com>
parents:
8669
diff
changeset
|
374 msn_cmdproc_process_msg(cmdproc, msg); |
8646
1e211dde3cae
[gaim-migrate @ 9398]
Christian Hammond <chipx86@chipx86.com>
parents:
8614
diff
changeset
|
375 |
1e211dde3cae
[gaim-migrate @ 9398]
Christian Hammond <chipx86@chipx86.com>
parents:
8614
diff
changeset
|
376 msn_message_destroy(msg); |
1e211dde3cae
[gaim-migrate @ 9398]
Christian Hammond <chipx86@chipx86.com>
parents:
8614
diff
changeset
|
377 } |
1e211dde3cae
[gaim-migrate @ 9398]
Christian Hammond <chipx86@chipx86.com>
parents:
8614
diff
changeset
|
378 |
8808
bbd8cdaf0ad5
[gaim-migrate @ 9570]
Christian Hammond <chipx86@chipx86.com>
parents:
8669
diff
changeset
|
379 static void |
bbd8cdaf0ad5
[gaim-migrate @ 9570]
Christian Hammond <chipx86@chipx86.com>
parents:
8669
diff
changeset
|
380 msg_cmd(MsnCmdProc *cmdproc, MsnCommand *cmd) |
5309 | 381 { |
9193
502707ca1836
[gaim-migrate @ 9988]
Christian Hammond <chipx86@chipx86.com>
parents:
9158
diff
changeset
|
382 /* 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
|
383 * command and we are processing it */ |
502707ca1836
[gaim-migrate @ 9988]
Christian Hammond <chipx86@chipx86.com>
parents:
9158
diff
changeset
|
384 |
502707ca1836
[gaim-migrate @ 9988]
Christian Hammond <chipx86@chipx86.com>
parents:
9158
diff
changeset
|
385 if (cmd->payload == NULL) |
502707ca1836
[gaim-migrate @ 9988]
Christian Hammond <chipx86@chipx86.com>
parents:
9158
diff
changeset
|
386 { |
502707ca1836
[gaim-migrate @ 9988]
Christian Hammond <chipx86@chipx86.com>
parents:
9158
diff
changeset
|
387 cmdproc->last_cmd->payload_cb = msg_cmd_post; |
502707ca1836
[gaim-migrate @ 9988]
Christian Hammond <chipx86@chipx86.com>
parents:
9158
diff
changeset
|
388 cmdproc->servconn->payload_len = atoi(cmd->params[2]); |
502707ca1836
[gaim-migrate @ 9988]
Christian Hammond <chipx86@chipx86.com>
parents:
9158
diff
changeset
|
389 } |
502707ca1836
[gaim-migrate @ 9988]
Christian Hammond <chipx86@chipx86.com>
parents:
9158
diff
changeset
|
390 else |
502707ca1836
[gaim-migrate @ 9988]
Christian Hammond <chipx86@chipx86.com>
parents:
9158
diff
changeset
|
391 { |
502707ca1836
[gaim-migrate @ 9988]
Christian Hammond <chipx86@chipx86.com>
parents:
9158
diff
changeset
|
392 g_return_if_fail(cmd->payload_cb != NULL); |
502707ca1836
[gaim-migrate @ 9988]
Christian Hammond <chipx86@chipx86.com>
parents:
9158
diff
changeset
|
393 |
502707ca1836
[gaim-migrate @ 9988]
Christian Hammond <chipx86@chipx86.com>
parents:
9158
diff
changeset
|
394 cmd->payload_cb(cmdproc, cmd, cmd->payload, cmd->payload_len); |
502707ca1836
[gaim-migrate @ 9988]
Christian Hammond <chipx86@chipx86.com>
parents:
9158
diff
changeset
|
395 } |
5309 | 396 } |
397 | |
398 /************************************************************************** | |
399 * Challenges | |
400 **************************************************************************/ | |
10481 | 401 |
8808
bbd8cdaf0ad5
[gaim-migrate @ 9570]
Christian Hammond <chipx86@chipx86.com>
parents:
8669
diff
changeset
|
402 static void |
bbd8cdaf0ad5
[gaim-migrate @ 9570]
Christian Hammond <chipx86@chipx86.com>
parents:
8669
diff
changeset
|
403 chl_cmd(MsnCmdProc *cmdproc, MsnCommand *cmd) |
5309 | 404 { |
8808
bbd8cdaf0ad5
[gaim-migrate @ 9570]
Christian Hammond <chipx86@chipx86.com>
parents:
8669
diff
changeset
|
405 MsnTransaction *trans; |
9158
c30d81b4dd22
[gaim-migrate @ 9942]
Christian Hammond <chipx86@chipx86.com>
parents:
8926
diff
changeset
|
406 char buf[33]; |
6701
b7e113a59b51
[gaim-migrate @ 7227]
Christian Hammond <chipx86@chipx86.com>
parents:
6695
diff
changeset
|
407 const char *challenge_resp; |
10684
72a5babfa8b4
[gaim-migrate @ 12231]
Luke Schierer <lschiere@pidgin.im>
parents:
10647
diff
changeset
|
408 GaimCipher *cipher; |
72a5babfa8b4
[gaim-migrate @ 12231]
Luke Schierer <lschiere@pidgin.im>
parents:
10647
diff
changeset
|
409 GaimCipherContext *context; |
11183 | 410 guchar digest[16]; |
5309 | 411 int i; |
412 | |
10684
72a5babfa8b4
[gaim-migrate @ 12231]
Luke Schierer <lschiere@pidgin.im>
parents:
10647
diff
changeset
|
413 cipher = gaim_ciphers_find_cipher("md5"); |
72a5babfa8b4
[gaim-migrate @ 12231]
Luke Schierer <lschiere@pidgin.im>
parents:
10647
diff
changeset
|
414 context = gaim_cipher_context_new(cipher, NULL); |
72a5babfa8b4
[gaim-migrate @ 12231]
Luke Schierer <lschiere@pidgin.im>
parents:
10647
diff
changeset
|
415 |
11183 | 416 gaim_cipher_context_append(context, (const guchar *)cmd->params[1], |
10684
72a5babfa8b4
[gaim-migrate @ 12231]
Luke Schierer <lschiere@pidgin.im>
parents:
10647
diff
changeset
|
417 strlen(cmd->params[1])); |
6701
b7e113a59b51
[gaim-migrate @ 7227]
Christian Hammond <chipx86@chipx86.com>
parents:
6695
diff
changeset
|
418 |
9193
502707ca1836
[gaim-migrate @ 9988]
Christian Hammond <chipx86@chipx86.com>
parents:
9158
diff
changeset
|
419 challenge_resp = "VT6PX?UQTM4WM%YR"; |
6701
b7e113a59b51
[gaim-migrate @ 7227]
Christian Hammond <chipx86@chipx86.com>
parents:
6695
diff
changeset
|
420 |
11183 | 421 gaim_cipher_context_append(context, (const guchar *)challenge_resp, |
10684
72a5babfa8b4
[gaim-migrate @ 12231]
Luke Schierer <lschiere@pidgin.im>
parents:
10647
diff
changeset
|
422 strlen(challenge_resp)); |
10687
b256ce6b85b8
[gaim-migrate @ 12235]
Etan Reisner <pidgin@unreliablesource.net>
parents:
10684
diff
changeset
|
423 gaim_cipher_context_digest(context, sizeof(digest), digest, NULL); |
10684
72a5babfa8b4
[gaim-migrate @ 12231]
Luke Schierer <lschiere@pidgin.im>
parents:
10647
diff
changeset
|
424 gaim_cipher_context_destroy(context); |
5309 | 425 |
8808
bbd8cdaf0ad5
[gaim-migrate @ 9570]
Christian Hammond <chipx86@chipx86.com>
parents:
8669
diff
changeset
|
426 for (i = 0; i < 16; i++) |
10684
72a5babfa8b4
[gaim-migrate @ 12231]
Luke Schierer <lschiere@pidgin.im>
parents:
10647
diff
changeset
|
427 g_snprintf(buf + (i*2), 3, "%02x", digest[i]); |
5309 | 428 |
10225 | 429 trans = msn_transaction_new(cmdproc, "QRY", "%s 32", "PROD0038W!61ZTF9"); |
5309 | 430 |
8808
bbd8cdaf0ad5
[gaim-migrate @ 9570]
Christian Hammond <chipx86@chipx86.com>
parents:
8669
diff
changeset
|
431 msn_transaction_set_payload(trans, buf, 32); |
5309 | 432 |
8808
bbd8cdaf0ad5
[gaim-migrate @ 9570]
Christian Hammond <chipx86@chipx86.com>
parents:
8669
diff
changeset
|
433 msn_cmdproc_send_trans(cmdproc, trans); |
5309 | 434 } |
435 | |
436 /************************************************************************** | |
437 * Buddy Lists | |
438 **************************************************************************/ | |
10481 | 439 |
8808
bbd8cdaf0ad5
[gaim-migrate @ 9570]
Christian Hammond <chipx86@chipx86.com>
parents:
8669
diff
changeset
|
440 static void |
bbd8cdaf0ad5
[gaim-migrate @ 9570]
Christian Hammond <chipx86@chipx86.com>
parents:
8669
diff
changeset
|
441 add_cmd(MsnCmdProc *cmdproc, MsnCommand *cmd) |
5309 | 442 { |
8808
bbd8cdaf0ad5
[gaim-migrate @ 9570]
Christian Hammond <chipx86@chipx86.com>
parents:
8669
diff
changeset
|
443 MsnSession *session; |
5457
c8c290021b7b
[gaim-migrate @ 5845]
Christian Hammond <chipx86@chipx86.com>
parents:
5456
diff
changeset
|
444 MsnUser *user; |
9193
502707ca1836
[gaim-migrate @ 9988]
Christian Hammond <chipx86@chipx86.com>
parents:
9158
diff
changeset
|
445 const char *list; |
502707ca1836
[gaim-migrate @ 9988]
Christian Hammond <chipx86@chipx86.com>
parents:
9158
diff
changeset
|
446 const char *passport; |
502707ca1836
[gaim-migrate @ 9988]
Christian Hammond <chipx86@chipx86.com>
parents:
9158
diff
changeset
|
447 const char *friendly; |
502707ca1836
[gaim-migrate @ 9988]
Christian Hammond <chipx86@chipx86.com>
parents:
9158
diff
changeset
|
448 MsnListId list_id; |
502707ca1836
[gaim-migrate @ 9988]
Christian Hammond <chipx86@chipx86.com>
parents:
9158
diff
changeset
|
449 int group_id; |
5309 | 450 |
8808
bbd8cdaf0ad5
[gaim-migrate @ 9570]
Christian Hammond <chipx86@chipx86.com>
parents:
8669
diff
changeset
|
451 list = cmd->params[1]; |
bbd8cdaf0ad5
[gaim-migrate @ 9570]
Christian Hammond <chipx86@chipx86.com>
parents:
8669
diff
changeset
|
452 passport = cmd->params[3]; |
9193
502707ca1836
[gaim-migrate @ 9988]
Christian Hammond <chipx86@chipx86.com>
parents:
9158
diff
changeset
|
453 friendly = gaim_url_decode(cmd->params[4]); |
5518
bf2a7a7b739d
[gaim-migrate @ 5918]
Christian Hammond <chipx86@chipx86.com>
parents:
5509
diff
changeset
|
454 |
9193
502707ca1836
[gaim-migrate @ 9988]
Christian Hammond <chipx86@chipx86.com>
parents:
9158
diff
changeset
|
455 session = cmdproc->session; |
5457
c8c290021b7b
[gaim-migrate @ 5845]
Christian Hammond <chipx86@chipx86.com>
parents:
5456
diff
changeset
|
456 |
9193
502707ca1836
[gaim-migrate @ 9988]
Christian Hammond <chipx86@chipx86.com>
parents:
9158
diff
changeset
|
457 user = msn_userlist_find_user(session->userlist, passport); |
5309 | 458 |
9193
502707ca1836
[gaim-migrate @ 9988]
Christian Hammond <chipx86@chipx86.com>
parents:
9158
diff
changeset
|
459 if (user == NULL) |
502707ca1836
[gaim-migrate @ 9988]
Christian Hammond <chipx86@chipx86.com>
parents:
9158
diff
changeset
|
460 { |
502707ca1836
[gaim-migrate @ 9988]
Christian Hammond <chipx86@chipx86.com>
parents:
9158
diff
changeset
|
461 user = msn_user_new(session->userlist, passport, friendly); |
502707ca1836
[gaim-migrate @ 9988]
Christian Hammond <chipx86@chipx86.com>
parents:
9158
diff
changeset
|
462 msn_userlist_add_user(session->userlist, user); |
502707ca1836
[gaim-migrate @ 9988]
Christian Hammond <chipx86@chipx86.com>
parents:
9158
diff
changeset
|
463 } |
9197
ec417d2f9666
[gaim-migrate @ 9992]
Christian Hammond <chipx86@chipx86.com>
parents:
9194
diff
changeset
|
464 else |
ec417d2f9666
[gaim-migrate @ 9992]
Christian Hammond <chipx86@chipx86.com>
parents:
9194
diff
changeset
|
465 msn_user_set_friendly_name(user, friendly); |
5457
c8c290021b7b
[gaim-migrate @ 5845]
Christian Hammond <chipx86@chipx86.com>
parents:
5456
diff
changeset
|
466 |
9193
502707ca1836
[gaim-migrate @ 9988]
Christian Hammond <chipx86@chipx86.com>
parents:
9158
diff
changeset
|
467 list_id = msn_get_list_id(list); |
9197
ec417d2f9666
[gaim-migrate @ 9992]
Christian Hammond <chipx86@chipx86.com>
parents:
9194
diff
changeset
|
468 |
9193
502707ca1836
[gaim-migrate @ 9988]
Christian Hammond <chipx86@chipx86.com>
parents:
9158
diff
changeset
|
469 if (cmd->param_count >= 6) |
502707ca1836
[gaim-migrate @ 9988]
Christian Hammond <chipx86@chipx86.com>
parents:
9158
diff
changeset
|
470 group_id = atoi(cmd->params[5]); |
502707ca1836
[gaim-migrate @ 9988]
Christian Hammond <chipx86@chipx86.com>
parents:
9158
diff
changeset
|
471 else |
502707ca1836
[gaim-migrate @ 9988]
Christian Hammond <chipx86@chipx86.com>
parents:
9158
diff
changeset
|
472 group_id = -1; |
5309 | 473 |
9193
502707ca1836
[gaim-migrate @ 9988]
Christian Hammond <chipx86@chipx86.com>
parents:
9158
diff
changeset
|
474 msn_got_add_user(session, user, list_id, group_id); |
10451 | 475 msn_user_update(user); |
5309 | 476 } |
477 | |
8808
bbd8cdaf0ad5
[gaim-migrate @ 9570]
Christian Hammond <chipx86@chipx86.com>
parents:
8669
diff
changeset
|
478 static void |
bbd8cdaf0ad5
[gaim-migrate @ 9570]
Christian Hammond <chipx86@chipx86.com>
parents:
8669
diff
changeset
|
479 add_error(MsnCmdProc *cmdproc, MsnTransaction *trans, int error) |
bbd8cdaf0ad5
[gaim-migrate @ 9570]
Christian Hammond <chipx86@chipx86.com>
parents:
8669
diff
changeset
|
480 { |
bbd8cdaf0ad5
[gaim-migrate @ 9570]
Christian Hammond <chipx86@chipx86.com>
parents:
8669
diff
changeset
|
481 MsnSession *session; |
bbd8cdaf0ad5
[gaim-migrate @ 9570]
Christian Hammond <chipx86@chipx86.com>
parents:
8669
diff
changeset
|
482 GaimAccount *account; |
bbd8cdaf0ad5
[gaim-migrate @ 9570]
Christian Hammond <chipx86@chipx86.com>
parents:
8669
diff
changeset
|
483 GaimConnection *gc; |
bbd8cdaf0ad5
[gaim-migrate @ 9570]
Christian Hammond <chipx86@chipx86.com>
parents:
8669
diff
changeset
|
484 const char *list, *passport; |
9897 | 485 char *reason = NULL; |
8808
bbd8cdaf0ad5
[gaim-migrate @ 9570]
Christian Hammond <chipx86@chipx86.com>
parents:
8669
diff
changeset
|
486 char *msg = NULL; |
bbd8cdaf0ad5
[gaim-migrate @ 9570]
Christian Hammond <chipx86@chipx86.com>
parents:
8669
diff
changeset
|
487 char **params; |
bbd8cdaf0ad5
[gaim-migrate @ 9570]
Christian Hammond <chipx86@chipx86.com>
parents:
8669
diff
changeset
|
488 |
bbd8cdaf0ad5
[gaim-migrate @ 9570]
Christian Hammond <chipx86@chipx86.com>
parents:
8669
diff
changeset
|
489 session = cmdproc->session; |
bbd8cdaf0ad5
[gaim-migrate @ 9570]
Christian Hammond <chipx86@chipx86.com>
parents:
8669
diff
changeset
|
490 account = session->account; |
bbd8cdaf0ad5
[gaim-migrate @ 9570]
Christian Hammond <chipx86@chipx86.com>
parents:
8669
diff
changeset
|
491 gc = gaim_account_get_connection(account); |
bbd8cdaf0ad5
[gaim-migrate @ 9570]
Christian Hammond <chipx86@chipx86.com>
parents:
8669
diff
changeset
|
492 params = g_strsplit(trans->params, " ", 0); |
bbd8cdaf0ad5
[gaim-migrate @ 9570]
Christian Hammond <chipx86@chipx86.com>
parents:
8669
diff
changeset
|
493 |
bbd8cdaf0ad5
[gaim-migrate @ 9570]
Christian Hammond <chipx86@chipx86.com>
parents:
8669
diff
changeset
|
494 list = params[0]; |
bbd8cdaf0ad5
[gaim-migrate @ 9570]
Christian Hammond <chipx86@chipx86.com>
parents:
8669
diff
changeset
|
495 passport = params[1]; |
bbd8cdaf0ad5
[gaim-migrate @ 9570]
Christian Hammond <chipx86@chipx86.com>
parents:
8669
diff
changeset
|
496 |
bbd8cdaf0ad5
[gaim-migrate @ 9570]
Christian Hammond <chipx86@chipx86.com>
parents:
8669
diff
changeset
|
497 if (!strcmp(list, "FL")) |
10451 | 498 msg = g_strdup_printf(_("Unable to add user on %s (%s)"), |
9900 | 499 gaim_account_get_username(account), |
500 gaim_account_get_protocol_name(account)); | |
8808
bbd8cdaf0ad5
[gaim-migrate @ 9570]
Christian Hammond <chipx86@chipx86.com>
parents:
8669
diff
changeset
|
501 else if (!strcmp(list, "BL")) |
10451 | 502 msg = g_strdup_printf(_("Unable to block user on %s (%s)"), |
9900 | 503 gaim_account_get_username(account), |
504 gaim_account_get_protocol_name(account)); | |
8808
bbd8cdaf0ad5
[gaim-migrate @ 9570]
Christian Hammond <chipx86@chipx86.com>
parents:
8669
diff
changeset
|
505 else if (!strcmp(list, "AL")) |
10451 | 506 msg = g_strdup_printf(_("Unable to permit user on %s (%s)"), |
9900 | 507 gaim_account_get_username(account), |
508 gaim_account_get_protocol_name(account)); | |
8808
bbd8cdaf0ad5
[gaim-migrate @ 9570]
Christian Hammond <chipx86@chipx86.com>
parents:
8669
diff
changeset
|
509 |
bbd8cdaf0ad5
[gaim-migrate @ 9570]
Christian Hammond <chipx86@chipx86.com>
parents:
8669
diff
changeset
|
510 if (!strcmp(list, "FL")) |
bbd8cdaf0ad5
[gaim-migrate @ 9570]
Christian Hammond <chipx86@chipx86.com>
parents:
8669
diff
changeset
|
511 { |
9900 | 512 if (error == 210) |
9897 | 513 { |
10451 | 514 reason = g_strdup_printf(_("%s could not be added because " |
515 "your buddy list is full."), passport); | |
9897 | 516 } |
8808
bbd8cdaf0ad5
[gaim-migrate @ 9570]
Christian Hammond <chipx86@chipx86.com>
parents:
8669
diff
changeset
|
517 } |
9897 | 518 |
519 if (reason == NULL) | |
8808
bbd8cdaf0ad5
[gaim-migrate @ 9570]
Christian Hammond <chipx86@chipx86.com>
parents:
8669
diff
changeset
|
520 { |
9897 | 521 if (error == 208) |
522 { | |
10451 | 523 reason = g_strdup_printf(_("%s is not a valid passport account."), |
9897 | 524 passport); |
525 } | |
526 else | |
527 { | |
10451 | 528 reason = g_strdup_printf(_("Unknown error.")); |
9897 | 529 } |
8808
bbd8cdaf0ad5
[gaim-migrate @ 9570]
Christian Hammond <chipx86@chipx86.com>
parents:
8669
diff
changeset
|
530 } |
bbd8cdaf0ad5
[gaim-migrate @ 9570]
Christian Hammond <chipx86@chipx86.com>
parents:
8669
diff
changeset
|
531 |
bbd8cdaf0ad5
[gaim-migrate @ 9570]
Christian Hammond <chipx86@chipx86.com>
parents:
8669
diff
changeset
|
532 if (msg != NULL) |
bbd8cdaf0ad5
[gaim-migrate @ 9570]
Christian Hammond <chipx86@chipx86.com>
parents:
8669
diff
changeset
|
533 { |
bbd8cdaf0ad5
[gaim-migrate @ 9570]
Christian Hammond <chipx86@chipx86.com>
parents:
8669
diff
changeset
|
534 gaim_notify_error(gc, NULL, msg, reason); |
bbd8cdaf0ad5
[gaim-migrate @ 9570]
Christian Hammond <chipx86@chipx86.com>
parents:
8669
diff
changeset
|
535 g_free(msg); |
bbd8cdaf0ad5
[gaim-migrate @ 9570]
Christian Hammond <chipx86@chipx86.com>
parents:
8669
diff
changeset
|
536 } |
bbd8cdaf0ad5
[gaim-migrate @ 9570]
Christian Hammond <chipx86@chipx86.com>
parents:
8669
diff
changeset
|
537 |
bbd8cdaf0ad5
[gaim-migrate @ 9570]
Christian Hammond <chipx86@chipx86.com>
parents:
8669
diff
changeset
|
538 if (!strcmp(list, "FL")) |
bbd8cdaf0ad5
[gaim-migrate @ 9570]
Christian Hammond <chipx86@chipx86.com>
parents:
8669
diff
changeset
|
539 { |
bbd8cdaf0ad5
[gaim-migrate @ 9570]
Christian Hammond <chipx86@chipx86.com>
parents:
8669
diff
changeset
|
540 GaimBuddy *buddy; |
bbd8cdaf0ad5
[gaim-migrate @ 9570]
Christian Hammond <chipx86@chipx86.com>
parents:
8669
diff
changeset
|
541 |
bbd8cdaf0ad5
[gaim-migrate @ 9570]
Christian Hammond <chipx86@chipx86.com>
parents:
8669
diff
changeset
|
542 buddy = gaim_find_buddy(account, passport); |
bbd8cdaf0ad5
[gaim-migrate @ 9570]
Christian Hammond <chipx86@chipx86.com>
parents:
8669
diff
changeset
|
543 |
bbd8cdaf0ad5
[gaim-migrate @ 9570]
Christian Hammond <chipx86@chipx86.com>
parents:
8669
diff
changeset
|
544 if (buddy != NULL) |
bbd8cdaf0ad5
[gaim-migrate @ 9570]
Christian Hammond <chipx86@chipx86.com>
parents:
8669
diff
changeset
|
545 gaim_blist_remove_buddy(buddy); |
bbd8cdaf0ad5
[gaim-migrate @ 9570]
Christian Hammond <chipx86@chipx86.com>
parents:
8669
diff
changeset
|
546 } |
bbd8cdaf0ad5
[gaim-migrate @ 9570]
Christian Hammond <chipx86@chipx86.com>
parents:
8669
diff
changeset
|
547 |
bbd8cdaf0ad5
[gaim-migrate @ 9570]
Christian Hammond <chipx86@chipx86.com>
parents:
8669
diff
changeset
|
548 g_free(reason); |
bbd8cdaf0ad5
[gaim-migrate @ 9570]
Christian Hammond <chipx86@chipx86.com>
parents:
8669
diff
changeset
|
549 |
bbd8cdaf0ad5
[gaim-migrate @ 9570]
Christian Hammond <chipx86@chipx86.com>
parents:
8669
diff
changeset
|
550 g_strfreev(params); |
bbd8cdaf0ad5
[gaim-migrate @ 9570]
Christian Hammond <chipx86@chipx86.com>
parents:
8669
diff
changeset
|
551 } |
bbd8cdaf0ad5
[gaim-migrate @ 9570]
Christian Hammond <chipx86@chipx86.com>
parents:
8669
diff
changeset
|
552 |
bbd8cdaf0ad5
[gaim-migrate @ 9570]
Christian Hammond <chipx86@chipx86.com>
parents:
8669
diff
changeset
|
553 static void |
bbd8cdaf0ad5
[gaim-migrate @ 9570]
Christian Hammond <chipx86@chipx86.com>
parents:
8669
diff
changeset
|
554 adg_cmd(MsnCmdProc *cmdproc, MsnCommand *cmd) |
5322
a4d017bee1de
[gaim-migrate @ 5694]
Christian Hammond <chipx86@chipx86.com>
parents:
5318
diff
changeset
|
555 { |
5518
bf2a7a7b739d
[gaim-migrate @ 5918]
Christian Hammond <chipx86@chipx86.com>
parents:
5509
diff
changeset
|
556 MsnGroup *group; |
8808
bbd8cdaf0ad5
[gaim-migrate @ 9570]
Christian Hammond <chipx86@chipx86.com>
parents:
8669
diff
changeset
|
557 MsnSession *session; |
5518
bf2a7a7b739d
[gaim-migrate @ 5918]
Christian Hammond <chipx86@chipx86.com>
parents:
5509
diff
changeset
|
558 gint group_id; |
7162 | 559 const char *group_name; |
5322
a4d017bee1de
[gaim-migrate @ 5694]
Christian Hammond <chipx86@chipx86.com>
parents:
5318
diff
changeset
|
560 |
8808
bbd8cdaf0ad5
[gaim-migrate @ 9570]
Christian Hammond <chipx86@chipx86.com>
parents:
8669
diff
changeset
|
561 session = cmdproc->session; |
5322
a4d017bee1de
[gaim-migrate @ 5694]
Christian Hammond <chipx86@chipx86.com>
parents:
5318
diff
changeset
|
562 |
8808
bbd8cdaf0ad5
[gaim-migrate @ 9570]
Christian Hammond <chipx86@chipx86.com>
parents:
8669
diff
changeset
|
563 group_id = atoi(cmd->params[3]); |
bbd8cdaf0ad5
[gaim-migrate @ 9570]
Christian Hammond <chipx86@chipx86.com>
parents:
8669
diff
changeset
|
564 |
bbd8cdaf0ad5
[gaim-migrate @ 9570]
Christian Hammond <chipx86@chipx86.com>
parents:
8669
diff
changeset
|
565 group_name = gaim_url_decode(cmd->params[2]); |
5322
a4d017bee1de
[gaim-migrate @ 5694]
Christian Hammond <chipx86@chipx86.com>
parents:
5318
diff
changeset
|
566 |
9193
502707ca1836
[gaim-migrate @ 9988]
Christian Hammond <chipx86@chipx86.com>
parents:
9158
diff
changeset
|
567 group = msn_group_new(session->userlist, group_id, group_name); |
6701
b7e113a59b51
[gaim-migrate @ 7227]
Christian Hammond <chipx86@chipx86.com>
parents:
6695
diff
changeset
|
568 |
9193
502707ca1836
[gaim-migrate @ 9988]
Christian Hammond <chipx86@chipx86.com>
parents:
9158
diff
changeset
|
569 /* There is a user that must me moved to this group */ |
502707ca1836
[gaim-migrate @ 9988]
Christian Hammond <chipx86@chipx86.com>
parents:
9158
diff
changeset
|
570 if (cmd->trans->data) |
8808
bbd8cdaf0ad5
[gaim-migrate @ 9570]
Christian Hammond <chipx86@chipx86.com>
parents:
8669
diff
changeset
|
571 { |
9193
502707ca1836
[gaim-migrate @ 9988]
Christian Hammond <chipx86@chipx86.com>
parents:
9158
diff
changeset
|
572 /* msn_userlist_move_buddy(); */ |
502707ca1836
[gaim-migrate @ 9988]
Christian Hammond <chipx86@chipx86.com>
parents:
9158
diff
changeset
|
573 MsnUserList *userlist = cmdproc->session->userlist; |
502707ca1836
[gaim-migrate @ 9988]
Christian Hammond <chipx86@chipx86.com>
parents:
9158
diff
changeset
|
574 MsnMoveBuddy *data = cmd->trans->data; |
5309 | 575 |
9193
502707ca1836
[gaim-migrate @ 9988]
Christian Hammond <chipx86@chipx86.com>
parents:
9158
diff
changeset
|
576 if (data->old_group_name != NULL) |
502707ca1836
[gaim-migrate @ 9988]
Christian Hammond <chipx86@chipx86.com>
parents:
9158
diff
changeset
|
577 { |
502707ca1836
[gaim-migrate @ 9988]
Christian Hammond <chipx86@chipx86.com>
parents:
9158
diff
changeset
|
578 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
|
579 g_free(data->old_group_name); |
502707ca1836
[gaim-migrate @ 9988]
Christian Hammond <chipx86@chipx86.com>
parents:
9158
diff
changeset
|
580 } |
9198
ab6636c5a136
[gaim-migrate @ 9993]
Christian Hammond <chipx86@chipx86.com>
parents:
9197
diff
changeset
|
581 |
9193
502707ca1836
[gaim-migrate @ 9988]
Christian Hammond <chipx86@chipx86.com>
parents:
9158
diff
changeset
|
582 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
|
583 g_free(data->who); |
5963
eb336b2c451f
[gaim-migrate @ 6410]
Christian Hammond <chipx86@chipx86.com>
parents:
5962
diff
changeset
|
584 |
5361
953aa05279f4
[gaim-migrate @ 5737]
Christian Hammond <chipx86@chipx86.com>
parents:
5358
diff
changeset
|
585 } |
953aa05279f4
[gaim-migrate @ 5737]
Christian Hammond <chipx86@chipx86.com>
parents:
5358
diff
changeset
|
586 } |
953aa05279f4
[gaim-migrate @ 5737]
Christian Hammond <chipx86@chipx86.com>
parents:
5358
diff
changeset
|
587 |
8808
bbd8cdaf0ad5
[gaim-migrate @ 9570]
Christian Hammond <chipx86@chipx86.com>
parents:
8669
diff
changeset
|
588 static void |
bbd8cdaf0ad5
[gaim-migrate @ 9570]
Christian Hammond <chipx86@chipx86.com>
parents:
8669
diff
changeset
|
589 fln_cmd(MsnCmdProc *cmdproc, MsnCommand *cmd) |
5309 | 590 { |
10296 | 591 MsnSlpLink *slplink; |
10451 | 592 MsnUser *user; |
10296 | 593 |
10451 | 594 user = msn_userlist_find_user(cmdproc->session->userlist, cmd->params[0]); |
5309 | 595 |
10451 | 596 user->status = "offline"; |
597 msn_user_update(user); | |
10296 | 598 |
599 slplink = msn_session_find_slplink(cmdproc->session, cmd->params[0]); | |
600 | |
601 if (slplink != NULL) | |
602 msn_slplink_destroy(slplink); | |
603 | |
5309 | 604 } |
605 | |
8808
bbd8cdaf0ad5
[gaim-migrate @ 9570]
Christian Hammond <chipx86@chipx86.com>
parents:
8669
diff
changeset
|
606 static void |
bbd8cdaf0ad5
[gaim-migrate @ 9570]
Christian Hammond <chipx86@chipx86.com>
parents:
8669
diff
changeset
|
607 iln_cmd(MsnCmdProc *cmdproc, MsnCommand *cmd) |
5309 | 608 { |
8808
bbd8cdaf0ad5
[gaim-migrate @ 9570]
Christian Hammond <chipx86@chipx86.com>
parents:
8669
diff
changeset
|
609 MsnSession *session; |
10010 | 610 GaimAccount *account; |
8808
bbd8cdaf0ad5
[gaim-migrate @ 9570]
Christian Hammond <chipx86@chipx86.com>
parents:
8669
diff
changeset
|
611 GaimConnection *gc; |
6800
8f228a7d5076
[gaim-migrate @ 7340]
Christian Hammond <chipx86@chipx86.com>
parents:
6779
diff
changeset
|
612 MsnUser *user; |
8f228a7d5076
[gaim-migrate @ 7340]
Christian Hammond <chipx86@chipx86.com>
parents:
6779
diff
changeset
|
613 MsnObject *msnobj; |
10451 | 614 const char *state, *passport, *friendly; |
5309 | 615 |
8808
bbd8cdaf0ad5
[gaim-migrate @ 9570]
Christian Hammond <chipx86@chipx86.com>
parents:
8669
diff
changeset
|
616 session = cmdproc->session; |
10010 | 617 account = session->account; |
618 gc = gaim_account_get_connection(account); | |
8808
bbd8cdaf0ad5
[gaim-migrate @ 9570]
Christian Hammond <chipx86@chipx86.com>
parents:
8669
diff
changeset
|
619 |
bbd8cdaf0ad5
[gaim-migrate @ 9570]
Christian Hammond <chipx86@chipx86.com>
parents:
8669
diff
changeset
|
620 state = cmd->params[1]; |
bbd8cdaf0ad5
[gaim-migrate @ 9570]
Christian Hammond <chipx86@chipx86.com>
parents:
8669
diff
changeset
|
621 passport = cmd->params[2]; |
9193
502707ca1836
[gaim-migrate @ 9988]
Christian Hammond <chipx86@chipx86.com>
parents:
9158
diff
changeset
|
622 friendly = gaim_url_decode(cmd->params[3]); |
5309 | 623 |
9193
502707ca1836
[gaim-migrate @ 9988]
Christian Hammond <chipx86@chipx86.com>
parents:
9158
diff
changeset
|
624 user = msn_userlist_find_user(session->userlist, passport); |
6858
885c6528843b
[gaim-migrate @ 7403]
Christian Hammond <chipx86@chipx86.com>
parents:
6833
diff
changeset
|
625 |
9193
502707ca1836
[gaim-migrate @ 9988]
Christian Hammond <chipx86@chipx86.com>
parents:
9158
diff
changeset
|
626 serv_got_alias(gc, passport, friendly); |
6833
ccfbd7c552ba
[gaim-migrate @ 7378]
Christian Hammond <chipx86@chipx86.com>
parents:
6830
diff
changeset
|
627 |
9193
502707ca1836
[gaim-migrate @ 9988]
Christian Hammond <chipx86@chipx86.com>
parents:
9158
diff
changeset
|
628 msn_user_set_friendly_name(user, friendly); |
6858
885c6528843b
[gaim-migrate @ 7403]
Christian Hammond <chipx86@chipx86.com>
parents:
6833
diff
changeset
|
629 |
8808
bbd8cdaf0ad5
[gaim-migrate @ 9570]
Christian Hammond <chipx86@chipx86.com>
parents:
8669
diff
changeset
|
630 if (session->protocol_ver >= 9 && cmd->param_count == 6) |
6800
8f228a7d5076
[gaim-migrate @ 7340]
Christian Hammond <chipx86@chipx86.com>
parents:
6779
diff
changeset
|
631 { |
8808
bbd8cdaf0ad5
[gaim-migrate @ 9570]
Christian Hammond <chipx86@chipx86.com>
parents:
8669
diff
changeset
|
632 msnobj = msn_object_new_from_string(gaim_url_decode(cmd->params[5])); |
6800
8f228a7d5076
[gaim-migrate @ 7340]
Christian Hammond <chipx86@chipx86.com>
parents:
6779
diff
changeset
|
633 msn_user_set_object(user, msnobj); |
8f228a7d5076
[gaim-migrate @ 7340]
Christian Hammond <chipx86@chipx86.com>
parents:
6779
diff
changeset
|
634 } |
8f228a7d5076
[gaim-migrate @ 7340]
Christian Hammond <chipx86@chipx86.com>
parents:
6779
diff
changeset
|
635 |
10451 | 636 msn_user_set_state(user, state); |
637 msn_user_update(user); | |
9193
502707ca1836
[gaim-migrate @ 9988]
Christian Hammond <chipx86@chipx86.com>
parents:
9158
diff
changeset
|
638 } |
502707ca1836
[gaim-migrate @ 9988]
Christian Hammond <chipx86@chipx86.com>
parents:
9158
diff
changeset
|
639 |
502707ca1836
[gaim-migrate @ 9988]
Christian Hammond <chipx86@chipx86.com>
parents:
9158
diff
changeset
|
640 static void |
502707ca1836
[gaim-migrate @ 9988]
Christian Hammond <chipx86@chipx86.com>
parents:
9158
diff
changeset
|
641 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
|
642 { |
502707ca1836
[gaim-migrate @ 9988]
Christian Hammond <chipx86@chipx86.com>
parents:
9158
diff
changeset
|
643 #if 0 |
502707ca1836
[gaim-migrate @ 9988]
Christian Hammond <chipx86@chipx86.com>
parents:
9158
diff
changeset
|
644 gaim_debug_misc("msn", "Incoming Page: {%s}\n", payload); |
502707ca1836
[gaim-migrate @ 9988]
Christian Hammond <chipx86@chipx86.com>
parents:
9158
diff
changeset
|
645 #endif |
5309 | 646 } |
647 | |
8808
bbd8cdaf0ad5
[gaim-migrate @ 9570]
Christian Hammond <chipx86@chipx86.com>
parents:
8669
diff
changeset
|
648 static void |
bbd8cdaf0ad5
[gaim-migrate @ 9570]
Christian Hammond <chipx86@chipx86.com>
parents:
8669
diff
changeset
|
649 ipg_cmd(MsnCmdProc *cmdproc, MsnCommand *cmd) |
5960
03bf7c905782
[gaim-migrate @ 6407]
Christian Hammond <chipx86@chipx86.com>
parents:
5933
diff
changeset
|
650 { |
8926 | 651 cmdproc->servconn->payload_len = atoi(cmd->params[0]); |
9193
502707ca1836
[gaim-migrate @ 9988]
Christian Hammond <chipx86@chipx86.com>
parents:
9158
diff
changeset
|
652 cmdproc->last_cmd->payload_cb = ipg_cmd_post; |
5309 | 653 } |
654 | |
8808
bbd8cdaf0ad5
[gaim-migrate @ 9570]
Christian Hammond <chipx86@chipx86.com>
parents:
8669
diff
changeset
|
655 static void |
bbd8cdaf0ad5
[gaim-migrate @ 9570]
Christian Hammond <chipx86@chipx86.com>
parents:
8669
diff
changeset
|
656 nln_cmd(MsnCmdProc *cmdproc, MsnCommand *cmd) |
5309 | 657 { |
8808
bbd8cdaf0ad5
[gaim-migrate @ 9570]
Christian Hammond <chipx86@chipx86.com>
parents:
8669
diff
changeset
|
658 MsnSession *session; |
10010 | 659 GaimAccount *account; |
8808
bbd8cdaf0ad5
[gaim-migrate @ 9570]
Christian Hammond <chipx86@chipx86.com>
parents:
8669
diff
changeset
|
660 GaimConnection *gc; |
6829
dff2d0a282e7
[gaim-migrate @ 7374]
Christian Hammond <chipx86@chipx86.com>
parents:
6828
diff
changeset
|
661 MsnUser *user; |
dff2d0a282e7
[gaim-migrate @ 7374]
Christian Hammond <chipx86@chipx86.com>
parents:
6828
diff
changeset
|
662 MsnObject *msnobj; |
11819
1452a3a9f07a
[gaim-migrate @ 14110]
Richard Laager <rlaager@wiktel.com>
parents:
11321
diff
changeset
|
663 int clientid; |
10451 | 664 const char *state, *passport, *friendly; |
5309 | 665 |
8808
bbd8cdaf0ad5
[gaim-migrate @ 9570]
Christian Hammond <chipx86@chipx86.com>
parents:
8669
diff
changeset
|
666 session = cmdproc->session; |
10010 | 667 account = session->account; |
668 gc = gaim_account_get_connection(account); | |
8808
bbd8cdaf0ad5
[gaim-migrate @ 9570]
Christian Hammond <chipx86@chipx86.com>
parents:
8669
diff
changeset
|
669 |
bbd8cdaf0ad5
[gaim-migrate @ 9570]
Christian Hammond <chipx86@chipx86.com>
parents:
8669
diff
changeset
|
670 state = cmd->params[0]; |
bbd8cdaf0ad5
[gaim-migrate @ 9570]
Christian Hammond <chipx86@chipx86.com>
parents:
8669
diff
changeset
|
671 passport = cmd->params[1]; |
9193
502707ca1836
[gaim-migrate @ 9988]
Christian Hammond <chipx86@chipx86.com>
parents:
9158
diff
changeset
|
672 friendly = gaim_url_decode(cmd->params[2]); |
5309 | 673 |
9193
502707ca1836
[gaim-migrate @ 9988]
Christian Hammond <chipx86@chipx86.com>
parents:
9158
diff
changeset
|
674 user = msn_userlist_find_user(session->userlist, passport); |
6858
885c6528843b
[gaim-migrate @ 7403]
Christian Hammond <chipx86@chipx86.com>
parents:
6833
diff
changeset
|
675 |
9193
502707ca1836
[gaim-migrate @ 9988]
Christian Hammond <chipx86@chipx86.com>
parents:
9158
diff
changeset
|
676 serv_got_alias(gc, passport, friendly); |
6833
ccfbd7c552ba
[gaim-migrate @ 7378]
Christian Hammond <chipx86@chipx86.com>
parents:
6830
diff
changeset
|
677 |
9193
502707ca1836
[gaim-migrate @ 9988]
Christian Hammond <chipx86@chipx86.com>
parents:
9158
diff
changeset
|
678 msn_user_set_friendly_name(user, friendly); |
6858
885c6528843b
[gaim-migrate @ 7403]
Christian Hammond <chipx86@chipx86.com>
parents:
6833
diff
changeset
|
679 |
9859 | 680 if (session->protocol_ver >= 9) |
6829
dff2d0a282e7
[gaim-migrate @ 7374]
Christian Hammond <chipx86@chipx86.com>
parents:
6828
diff
changeset
|
681 { |
9859 | 682 if (cmd->param_count == 5) |
683 { | |
684 msnobj = | |
685 msn_object_new_from_string(gaim_url_decode(cmd->params[4])); | |
686 msn_user_set_object(user, msnobj); | |
687 } | |
688 else | |
689 { | |
690 msn_user_set_object(user, NULL); | |
691 } | |
6829
dff2d0a282e7
[gaim-migrate @ 7374]
Christian Hammond <chipx86@chipx86.com>
parents:
6828
diff
changeset
|
692 } |
dff2d0a282e7
[gaim-migrate @ 7374]
Christian Hammond <chipx86@chipx86.com>
parents:
6828
diff
changeset
|
693 |
11819
1452a3a9f07a
[gaim-migrate @ 14110]
Richard Laager <rlaager@wiktel.com>
parents:
11321
diff
changeset
|
694 clientid = atoi(cmd->params[3]); |
1452a3a9f07a
[gaim-migrate @ 14110]
Richard Laager <rlaager@wiktel.com>
parents:
11321
diff
changeset
|
695 user->mobile = (clientid & MSN_CLIENT_CAP_MSNMOBILE); |
1452a3a9f07a
[gaim-migrate @ 14110]
Richard Laager <rlaager@wiktel.com>
parents:
11321
diff
changeset
|
696 |
10451 | 697 msn_user_set_state(user, state); |
698 msn_user_update(user); | |
9158
c30d81b4dd22
[gaim-migrate @ 9942]
Christian Hammond <chipx86@chipx86.com>
parents:
8926
diff
changeset
|
699 } |
c30d81b4dd22
[gaim-migrate @ 9942]
Christian Hammond <chipx86@chipx86.com>
parents:
8926
diff
changeset
|
700 |
c30d81b4dd22
[gaim-migrate @ 9942]
Christian Hammond <chipx86@chipx86.com>
parents:
8926
diff
changeset
|
701 static void |
9193
502707ca1836
[gaim-migrate @ 9988]
Christian Hammond <chipx86@chipx86.com>
parents:
9158
diff
changeset
|
702 chg_cmd(MsnCmdProc *cmdproc, MsnCommand *cmd) |
502707ca1836
[gaim-migrate @ 9988]
Christian Hammond <chipx86@chipx86.com>
parents:
9158
diff
changeset
|
703 { |
502707ca1836
[gaim-migrate @ 9988]
Christian Hammond <chipx86@chipx86.com>
parents:
9158
diff
changeset
|
704 char *state = cmd->params[1]; |
502707ca1836
[gaim-migrate @ 9988]
Christian Hammond <chipx86@chipx86.com>
parents:
9158
diff
changeset
|
705 int state_id = 0; |
502707ca1836
[gaim-migrate @ 9988]
Christian Hammond <chipx86@chipx86.com>
parents:
9158
diff
changeset
|
706 |
502707ca1836
[gaim-migrate @ 9988]
Christian Hammond <chipx86@chipx86.com>
parents:
9158
diff
changeset
|
707 if (!strcmp(state, "NLN")) |
502707ca1836
[gaim-migrate @ 9988]
Christian Hammond <chipx86@chipx86.com>
parents:
9158
diff
changeset
|
708 state_id = MSN_ONLINE; |
502707ca1836
[gaim-migrate @ 9988]
Christian Hammond <chipx86@chipx86.com>
parents:
9158
diff
changeset
|
709 else if (!strcmp(state, "BSY")) |
502707ca1836
[gaim-migrate @ 9988]
Christian Hammond <chipx86@chipx86.com>
parents:
9158
diff
changeset
|
710 state_id = MSN_BUSY; |
502707ca1836
[gaim-migrate @ 9988]
Christian Hammond <chipx86@chipx86.com>
parents:
9158
diff
changeset
|
711 else if (!strcmp(state, "IDL")) |
502707ca1836
[gaim-migrate @ 9988]
Christian Hammond <chipx86@chipx86.com>
parents:
9158
diff
changeset
|
712 state_id = MSN_IDLE; |
502707ca1836
[gaim-migrate @ 9988]
Christian Hammond <chipx86@chipx86.com>
parents:
9158
diff
changeset
|
713 else if (!strcmp(state, "BRB")) |
502707ca1836
[gaim-migrate @ 9988]
Christian Hammond <chipx86@chipx86.com>
parents:
9158
diff
changeset
|
714 state_id = MSN_BRB; |
502707ca1836
[gaim-migrate @ 9988]
Christian Hammond <chipx86@chipx86.com>
parents:
9158
diff
changeset
|
715 else if (!strcmp(state, "AWY")) |
502707ca1836
[gaim-migrate @ 9988]
Christian Hammond <chipx86@chipx86.com>
parents:
9158
diff
changeset
|
716 state_id = MSN_AWAY; |
502707ca1836
[gaim-migrate @ 9988]
Christian Hammond <chipx86@chipx86.com>
parents:
9158
diff
changeset
|
717 else if (!strcmp(state, "PHN")) |
502707ca1836
[gaim-migrate @ 9988]
Christian Hammond <chipx86@chipx86.com>
parents:
9158
diff
changeset
|
718 state_id = MSN_PHONE; |
502707ca1836
[gaim-migrate @ 9988]
Christian Hammond <chipx86@chipx86.com>
parents:
9158
diff
changeset
|
719 else if (!strcmp(state, "LUN")) |
502707ca1836
[gaim-migrate @ 9988]
Christian Hammond <chipx86@chipx86.com>
parents:
9158
diff
changeset
|
720 state_id = MSN_LUNCH; |
502707ca1836
[gaim-migrate @ 9988]
Christian Hammond <chipx86@chipx86.com>
parents:
9158
diff
changeset
|
721 else if (!strcmp(state, "HDN")) |
502707ca1836
[gaim-migrate @ 9988]
Christian Hammond <chipx86@chipx86.com>
parents:
9158
diff
changeset
|
722 state_id = MSN_HIDDEN; |
502707ca1836
[gaim-migrate @ 9988]
Christian Hammond <chipx86@chipx86.com>
parents:
9158
diff
changeset
|
723 |
502707ca1836
[gaim-migrate @ 9988]
Christian Hammond <chipx86@chipx86.com>
parents:
9158
diff
changeset
|
724 cmdproc->session->state = state_id; |
502707ca1836
[gaim-migrate @ 9988]
Christian Hammond <chipx86@chipx86.com>
parents:
9158
diff
changeset
|
725 } |
502707ca1836
[gaim-migrate @ 9988]
Christian Hammond <chipx86@chipx86.com>
parents:
9158
diff
changeset
|
726 |
502707ca1836
[gaim-migrate @ 9988]
Christian Hammond <chipx86@chipx86.com>
parents:
9158
diff
changeset
|
727 |
502707ca1836
[gaim-migrate @ 9988]
Christian Hammond <chipx86@chipx86.com>
parents:
9158
diff
changeset
|
728 static void |
502707ca1836
[gaim-migrate @ 9988]
Christian Hammond <chipx86@chipx86.com>
parents:
9158
diff
changeset
|
729 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
|
730 { |
c30d81b4dd22
[gaim-migrate @ 9942]
Christian Hammond <chipx86@chipx86.com>
parents:
8926
diff
changeset
|
731 #if 0 |
9193
502707ca1836
[gaim-migrate @ 9988]
Christian Hammond <chipx86@chipx86.com>
parents:
9158
diff
changeset
|
732 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
|
733 gaim_debug_misc("msn", "Notification: {%s}\n", payload); |
c30d81b4dd22
[gaim-migrate @ 9942]
Christian Hammond <chipx86@chipx86.com>
parents:
8926
diff
changeset
|
734 #endif |
8808
bbd8cdaf0ad5
[gaim-migrate @ 9570]
Christian Hammond <chipx86@chipx86.com>
parents:
8669
diff
changeset
|
735 } |
5309 | 736 |
8808
bbd8cdaf0ad5
[gaim-migrate @ 9570]
Christian Hammond <chipx86@chipx86.com>
parents:
8669
diff
changeset
|
737 static void |
bbd8cdaf0ad5
[gaim-migrate @ 9570]
Christian Hammond <chipx86@chipx86.com>
parents:
8669
diff
changeset
|
738 not_cmd(MsnCmdProc *cmdproc, MsnCommand *cmd) |
bbd8cdaf0ad5
[gaim-migrate @ 9570]
Christian Hammond <chipx86@chipx86.com>
parents:
8669
diff
changeset
|
739 { |
8926 | 740 cmdproc->servconn->payload_len = atoi(cmd->params[0]); |
9193
502707ca1836
[gaim-migrate @ 9988]
Christian Hammond <chipx86@chipx86.com>
parents:
9158
diff
changeset
|
741 cmdproc->last_cmd->payload_cb = not_cmd_post; |
5363
ebebc833cf77
[gaim-migrate @ 5739]
Christian Hammond <chipx86@chipx86.com>
parents:
5361
diff
changeset
|
742 } |
ebebc833cf77
[gaim-migrate @ 5739]
Christian Hammond <chipx86@chipx86.com>
parents:
5361
diff
changeset
|
743 |
8808
bbd8cdaf0ad5
[gaim-migrate @ 9570]
Christian Hammond <chipx86@chipx86.com>
parents:
8669
diff
changeset
|
744 static void |
bbd8cdaf0ad5
[gaim-migrate @ 9570]
Christian Hammond <chipx86@chipx86.com>
parents:
8669
diff
changeset
|
745 rea_cmd(MsnCmdProc *cmdproc, MsnCommand *cmd) |
5309 | 746 { |
10451 | 747 /* TODO: This might be for us too */ |
9193
502707ca1836
[gaim-migrate @ 9988]
Christian Hammond <chipx86@chipx86.com>
parents:
9158
diff
changeset
|
748 |
8808
bbd8cdaf0ad5
[gaim-migrate @ 9570]
Christian Hammond <chipx86@chipx86.com>
parents:
8669
diff
changeset
|
749 MsnSession *session; |
bbd8cdaf0ad5
[gaim-migrate @ 9570]
Christian Hammond <chipx86@chipx86.com>
parents:
8669
diff
changeset
|
750 GaimConnection *gc; |
9193
502707ca1836
[gaim-migrate @ 9988]
Christian Hammond <chipx86@chipx86.com>
parents:
9158
diff
changeset
|
751 const char *friendly; |
5309 | 752 |
8808
bbd8cdaf0ad5
[gaim-migrate @ 9570]
Christian Hammond <chipx86@chipx86.com>
parents:
8669
diff
changeset
|
753 session = cmdproc->session; |
bbd8cdaf0ad5
[gaim-migrate @ 9570]
Christian Hammond <chipx86@chipx86.com>
parents:
8669
diff
changeset
|
754 gc = session->account->gc; |
9193
502707ca1836
[gaim-migrate @ 9988]
Christian Hammond <chipx86@chipx86.com>
parents:
9158
diff
changeset
|
755 friendly = gaim_url_decode(cmd->params[3]); |
5309 | 756 |
9193
502707ca1836
[gaim-migrate @ 9988]
Christian Hammond <chipx86@chipx86.com>
parents:
9158
diff
changeset
|
757 gaim_connection_set_display_name(gc, friendly); |
5309 | 758 } |
759 | |
8808
bbd8cdaf0ad5
[gaim-migrate @ 9570]
Christian Hammond <chipx86@chipx86.com>
parents:
8669
diff
changeset
|
760 static void |
10833 | 761 prp_cmd(MsnCmdProc *cmdproc, MsnCommand *cmd) |
762 { | |
763 MsnSession *session = cmdproc->session; | |
764 const char *type, *value; | |
765 | |
766 g_return_if_fail(cmd->param_count >= 3); | |
767 | |
768 type = cmd->params[2]; | |
769 | |
770 if (cmd->param_count == 4) | |
771 { | |
772 value = cmd->params[3]; | |
773 if (!strcmp(type, "PHH")) | |
774 msn_user_set_home_phone(session->user, gaim_url_decode(value)); | |
775 else if (!strcmp(type, "PHW")) | |
776 msn_user_set_work_phone(session->user, gaim_url_decode(value)); | |
777 else if (!strcmp(type, "PHM")) | |
778 msn_user_set_mobile_phone(session->user, gaim_url_decode(value)); | |
779 } | |
780 else | |
781 { | |
782 if (!strcmp(type, "PHH")) | |
783 msn_user_set_home_phone(session->user, NULL); | |
784 else if (!strcmp(type, "PHW")) | |
785 msn_user_set_work_phone(session->user, NULL); | |
786 else if (!strcmp(type, "PHM")) | |
787 msn_user_set_mobile_phone(session->user, NULL); | |
788 } | |
789 } | |
790 | |
791 static void | |
8808
bbd8cdaf0ad5
[gaim-migrate @ 9570]
Christian Hammond <chipx86@chipx86.com>
parents:
8669
diff
changeset
|
792 reg_cmd(MsnCmdProc *cmdproc, MsnCommand *cmd) |
5318
bd98232872a3
[gaim-migrate @ 5690]
Christian Hammond <chipx86@chipx86.com>
parents:
5312
diff
changeset
|
793 { |
8808
bbd8cdaf0ad5
[gaim-migrate @ 9570]
Christian Hammond <chipx86@chipx86.com>
parents:
8669
diff
changeset
|
794 MsnSession *session; |
5518
bf2a7a7b739d
[gaim-migrate @ 5918]
Christian Hammond <chipx86@chipx86.com>
parents:
5509
diff
changeset
|
795 int group_id; |
7162 | 796 const char *group_name; |
5318
bd98232872a3
[gaim-migrate @ 5690]
Christian Hammond <chipx86@chipx86.com>
parents:
5312
diff
changeset
|
797 |
8808
bbd8cdaf0ad5
[gaim-migrate @ 9570]
Christian Hammond <chipx86@chipx86.com>
parents:
8669
diff
changeset
|
798 session = cmdproc->session; |
bbd8cdaf0ad5
[gaim-migrate @ 9570]
Christian Hammond <chipx86@chipx86.com>
parents:
8669
diff
changeset
|
799 group_id = atoi(cmd->params[2]); |
bbd8cdaf0ad5
[gaim-migrate @ 9570]
Christian Hammond <chipx86@chipx86.com>
parents:
8669
diff
changeset
|
800 group_name = gaim_url_decode(cmd->params[3]); |
5318
bd98232872a3
[gaim-migrate @ 5690]
Christian Hammond <chipx86@chipx86.com>
parents:
5312
diff
changeset
|
801 |
9193
502707ca1836
[gaim-migrate @ 9988]
Christian Hammond <chipx86@chipx86.com>
parents:
9158
diff
changeset
|
802 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
|
803 } |
bd98232872a3
[gaim-migrate @ 5690]
Christian Hammond <chipx86@chipx86.com>
parents:
5312
diff
changeset
|
804 |
8808
bbd8cdaf0ad5
[gaim-migrate @ 9570]
Christian Hammond <chipx86@chipx86.com>
parents:
8669
diff
changeset
|
805 static void |
10451 | 806 reg_error(MsnCmdProc *cmdproc, MsnTransaction *trans, int error) |
807 { | |
808 int group_id; | |
809 char **params; | |
810 | |
811 params = g_strsplit(trans->params, " ", 0); | |
812 | |
813 group_id = atoi(params[0]); | |
814 | |
815 group_error_helper(cmdproc->session, _("Unable to rename group"), group_id, error); | |
816 | |
817 g_strfreev(params); | |
818 } | |
819 | |
820 static void | |
8808
bbd8cdaf0ad5
[gaim-migrate @ 9570]
Christian Hammond <chipx86@chipx86.com>
parents:
8669
diff
changeset
|
821 rem_cmd(MsnCmdProc *cmdproc, MsnCommand *cmd) |
5322
a4d017bee1de
[gaim-migrate @ 5694]
Christian Hammond <chipx86@chipx86.com>
parents:
5318
diff
changeset
|
822 { |
8808
bbd8cdaf0ad5
[gaim-migrate @ 9570]
Christian Hammond <chipx86@chipx86.com>
parents:
8669
diff
changeset
|
823 MsnSession *session; |
9193
502707ca1836
[gaim-migrate @ 9988]
Christian Hammond <chipx86@chipx86.com>
parents:
9158
diff
changeset
|
824 MsnUser *user; |
502707ca1836
[gaim-migrate @ 9988]
Christian Hammond <chipx86@chipx86.com>
parents:
9158
diff
changeset
|
825 const char *list; |
8808
bbd8cdaf0ad5
[gaim-migrate @ 9570]
Christian Hammond <chipx86@chipx86.com>
parents:
8669
diff
changeset
|
826 const char *passport; |
9193
502707ca1836
[gaim-migrate @ 9988]
Christian Hammond <chipx86@chipx86.com>
parents:
9158
diff
changeset
|
827 MsnListId list_id; |
502707ca1836
[gaim-migrate @ 9988]
Christian Hammond <chipx86@chipx86.com>
parents:
9158
diff
changeset
|
828 int group_id; |
6772
e719379c8a79
[gaim-migrate @ 7309]
Christian Hammond <chipx86@chipx86.com>
parents:
6767
diff
changeset
|
829 |
8808
bbd8cdaf0ad5
[gaim-migrate @ 9570]
Christian Hammond <chipx86@chipx86.com>
parents:
8669
diff
changeset
|
830 session = cmdproc->session; |
9193
502707ca1836
[gaim-migrate @ 9988]
Christian Hammond <chipx86@chipx86.com>
parents:
9158
diff
changeset
|
831 list = cmd->params[1]; |
8808
bbd8cdaf0ad5
[gaim-migrate @ 9570]
Christian Hammond <chipx86@chipx86.com>
parents:
8669
diff
changeset
|
832 passport = cmd->params[3]; |
9193
502707ca1836
[gaim-migrate @ 9988]
Christian Hammond <chipx86@chipx86.com>
parents:
9158
diff
changeset
|
833 user = msn_userlist_find_user(session->userlist, passport); |
502707ca1836
[gaim-migrate @ 9988]
Christian Hammond <chipx86@chipx86.com>
parents:
9158
diff
changeset
|
834 |
502707ca1836
[gaim-migrate @ 9988]
Christian Hammond <chipx86@chipx86.com>
parents:
9158
diff
changeset
|
835 g_return_if_fail(user != NULL); |
502707ca1836
[gaim-migrate @ 9988]
Christian Hammond <chipx86@chipx86.com>
parents:
9158
diff
changeset
|
836 |
502707ca1836
[gaim-migrate @ 9988]
Christian Hammond <chipx86@chipx86.com>
parents:
9158
diff
changeset
|
837 list_id = msn_get_list_id(list); |
8808
bbd8cdaf0ad5
[gaim-migrate @ 9570]
Christian Hammond <chipx86@chipx86.com>
parents:
8669
diff
changeset
|
838 |
bbd8cdaf0ad5
[gaim-migrate @ 9570]
Christian Hammond <chipx86@chipx86.com>
parents:
8669
diff
changeset
|
839 if (cmd->param_count == 5) |
9193
502707ca1836
[gaim-migrate @ 9988]
Christian Hammond <chipx86@chipx86.com>
parents:
9158
diff
changeset
|
840 group_id = atoi(cmd->params[4]); |
502707ca1836
[gaim-migrate @ 9988]
Christian Hammond <chipx86@chipx86.com>
parents:
9158
diff
changeset
|
841 else |
502707ca1836
[gaim-migrate @ 9988]
Christian Hammond <chipx86@chipx86.com>
parents:
9158
diff
changeset
|
842 group_id = -1; |
5518
bf2a7a7b739d
[gaim-migrate @ 5918]
Christian Hammond <chipx86@chipx86.com>
parents:
5509
diff
changeset
|
843 |
9193
502707ca1836
[gaim-migrate @ 9988]
Christian Hammond <chipx86@chipx86.com>
parents:
9158
diff
changeset
|
844 msn_got_rem_user(session, user, list_id, group_id); |
10451 | 845 msn_user_update(user); |
5322
a4d017bee1de
[gaim-migrate @ 5694]
Christian Hammond <chipx86@chipx86.com>
parents:
5318
diff
changeset
|
846 } |
a4d017bee1de
[gaim-migrate @ 5694]
Christian Hammond <chipx86@chipx86.com>
parents:
5318
diff
changeset
|
847 |
8808
bbd8cdaf0ad5
[gaim-migrate @ 9570]
Christian Hammond <chipx86@chipx86.com>
parents:
8669
diff
changeset
|
848 static void |
bbd8cdaf0ad5
[gaim-migrate @ 9570]
Christian Hammond <chipx86@chipx86.com>
parents:
8669
diff
changeset
|
849 rmg_cmd(MsnCmdProc *cmdproc, MsnCommand *cmd) |
5518
bf2a7a7b739d
[gaim-migrate @ 5918]
Christian Hammond <chipx86@chipx86.com>
parents:
5509
diff
changeset
|
850 { |
8808
bbd8cdaf0ad5
[gaim-migrate @ 9570]
Christian Hammond <chipx86@chipx86.com>
parents:
8669
diff
changeset
|
851 MsnSession *session; |
9193
502707ca1836
[gaim-migrate @ 9988]
Christian Hammond <chipx86@chipx86.com>
parents:
9158
diff
changeset
|
852 int group_id; |
5518
bf2a7a7b739d
[gaim-migrate @ 5918]
Christian Hammond <chipx86@chipx86.com>
parents:
5509
diff
changeset
|
853 |
8808
bbd8cdaf0ad5
[gaim-migrate @ 9570]
Christian Hammond <chipx86@chipx86.com>
parents:
8669
diff
changeset
|
854 session = cmdproc->session; |
9193
502707ca1836
[gaim-migrate @ 9988]
Christian Hammond <chipx86@chipx86.com>
parents:
9158
diff
changeset
|
855 group_id = atoi(cmd->params[2]); |
5518
bf2a7a7b739d
[gaim-migrate @ 5918]
Christian Hammond <chipx86@chipx86.com>
parents:
5509
diff
changeset
|
856 |
9193
502707ca1836
[gaim-migrate @ 9988]
Christian Hammond <chipx86@chipx86.com>
parents:
9158
diff
changeset
|
857 msn_userlist_remove_group_id(session->userlist, group_id); |
5518
bf2a7a7b739d
[gaim-migrate @ 5918]
Christian Hammond <chipx86@chipx86.com>
parents:
5509
diff
changeset
|
858 } |
bf2a7a7b739d
[gaim-migrate @ 5918]
Christian Hammond <chipx86@chipx86.com>
parents:
5509
diff
changeset
|
859 |
8808
bbd8cdaf0ad5
[gaim-migrate @ 9570]
Christian Hammond <chipx86@chipx86.com>
parents:
8669
diff
changeset
|
860 static void |
10451 | 861 rmg_error(MsnCmdProc *cmdproc, MsnTransaction *trans, int error) |
862 { | |
863 int group_id; | |
864 char **params; | |
865 | |
866 params = g_strsplit(trans->params, " ", 0); | |
867 | |
868 group_id = atoi(params[0]); | |
869 | |
10452 | 870 group_error_helper(cmdproc->session, _("Unable to delete group"), group_id, error); |
10451 | 871 |
872 g_strfreev(params); | |
873 } | |
874 | |
875 static void | |
8808
bbd8cdaf0ad5
[gaim-migrate @ 9570]
Christian Hammond <chipx86@chipx86.com>
parents:
8669
diff
changeset
|
876 syn_cmd(MsnCmdProc *cmdproc, MsnCommand *cmd) |
6701
b7e113a59b51
[gaim-migrate @ 7227]
Christian Hammond <chipx86@chipx86.com>
parents:
6695
diff
changeset
|
877 { |
8808
bbd8cdaf0ad5
[gaim-migrate @ 9570]
Christian Hammond <chipx86@chipx86.com>
parents:
8669
diff
changeset
|
878 MsnSession *session; |
9193
502707ca1836
[gaim-migrate @ 9988]
Christian Hammond <chipx86@chipx86.com>
parents:
9158
diff
changeset
|
879 int total_users; |
8808
bbd8cdaf0ad5
[gaim-migrate @ 9570]
Christian Hammond <chipx86@chipx86.com>
parents:
8669
diff
changeset
|
880 |
bbd8cdaf0ad5
[gaim-migrate @ 9570]
Christian Hammond <chipx86@chipx86.com>
parents:
8669
diff
changeset
|
881 session = cmdproc->session; |
10269 | 882 |
883 if (cmd->param_count == 2) | |
884 { | |
885 /* | |
886 * This can happen if we sent a SYN with an up-to-date | |
887 * buddy list revision, but we send 0 to get a full list. | |
888 * So, error out. | |
889 */ | |
890 | |
10481 | 891 msn_session_set_error(cmdproc->session, MSN_ERROR_BAD_BLIST, NULL); |
10269 | 892 return; |
893 } | |
894 | |
9193
502707ca1836
[gaim-migrate @ 9988]
Christian Hammond <chipx86@chipx86.com>
parents:
9158
diff
changeset
|
895 total_users = atoi(cmd->params[2]); |
8808
bbd8cdaf0ad5
[gaim-migrate @ 9570]
Christian Hammond <chipx86@chipx86.com>
parents:
8669
diff
changeset
|
896 |
9193
502707ca1836
[gaim-migrate @ 9988]
Christian Hammond <chipx86@chipx86.com>
parents:
9158
diff
changeset
|
897 if (total_users == 0) |
502707ca1836
[gaim-migrate @ 9988]
Christian Hammond <chipx86@chipx86.com>
parents:
9158
diff
changeset
|
898 { |
10044
86a6d78b070b
[gaim-migrate @ 11003]
Luke Schierer <lschiere@pidgin.im>
parents:
10043
diff
changeset
|
899 msn_session_finish_login(session); |
9193
502707ca1836
[gaim-migrate @ 9988]
Christian Hammond <chipx86@chipx86.com>
parents:
9158
diff
changeset
|
900 } |
502707ca1836
[gaim-migrate @ 9988]
Christian Hammond <chipx86@chipx86.com>
parents:
9158
diff
changeset
|
901 else |
502707ca1836
[gaim-migrate @ 9988]
Christian Hammond <chipx86@chipx86.com>
parents:
9158
diff
changeset
|
902 { |
502707ca1836
[gaim-migrate @ 9988]
Christian Hammond <chipx86@chipx86.com>
parents:
9158
diff
changeset
|
903 /* syn_table */ |
502707ca1836
[gaim-migrate @ 9988]
Christian Hammond <chipx86@chipx86.com>
parents:
9158
diff
changeset
|
904 MsnSync *sync; |
8613
b0ceb2a9e122
[gaim-migrate @ 9364]
Christian Hammond <chipx86@chipx86.com>
parents:
8583
diff
changeset
|
905 |
9193
502707ca1836
[gaim-migrate @ 9988]
Christian Hammond <chipx86@chipx86.com>
parents:
9158
diff
changeset
|
906 sync = msn_sync_new(session); |
502707ca1836
[gaim-migrate @ 9988]
Christian Hammond <chipx86@chipx86.com>
parents:
9158
diff
changeset
|
907 sync->total_users = total_users; |
502707ca1836
[gaim-migrate @ 9988]
Christian Hammond <chipx86@chipx86.com>
parents:
9158
diff
changeset
|
908 sync->old_cbs_table = cmdproc->cbs_table; |
7289
ab2085024a29
[gaim-migrate @ 7870]
Christian Hammond <chipx86@chipx86.com>
parents:
7288
diff
changeset
|
909 |
9193
502707ca1836
[gaim-migrate @ 9988]
Christian Hammond <chipx86@chipx86.com>
parents:
9158
diff
changeset
|
910 session->sync = sync; |
502707ca1836
[gaim-migrate @ 9988]
Christian Hammond <chipx86@chipx86.com>
parents:
9158
diff
changeset
|
911 cmdproc->cbs_table = sync->cbs_table; |
6701
b7e113a59b51
[gaim-migrate @ 7227]
Christian Hammond <chipx86@chipx86.com>
parents:
6695
diff
changeset
|
912 } |
b7e113a59b51
[gaim-migrate @ 7227]
Christian Hammond <chipx86@chipx86.com>
parents:
6695
diff
changeset
|
913 } |
b7e113a59b51
[gaim-migrate @ 7227]
Christian Hammond <chipx86@chipx86.com>
parents:
6695
diff
changeset
|
914 |
5309 | 915 /************************************************************************** |
916 * Misc commands | |
917 **************************************************************************/ | |
10481 | 918 |
8808
bbd8cdaf0ad5
[gaim-migrate @ 9570]
Christian Hammond <chipx86@chipx86.com>
parents:
8669
diff
changeset
|
919 static void |
bbd8cdaf0ad5
[gaim-migrate @ 9570]
Christian Hammond <chipx86@chipx86.com>
parents:
8669
diff
changeset
|
920 url_cmd(MsnCmdProc *cmdproc, MsnCommand *cmd) |
5309 | 921 { |
8808
bbd8cdaf0ad5
[gaim-migrate @ 9570]
Christian Hammond <chipx86@chipx86.com>
parents:
8669
diff
changeset
|
922 MsnSession *session; |
bbd8cdaf0ad5
[gaim-migrate @ 9570]
Christian Hammond <chipx86@chipx86.com>
parents:
8669
diff
changeset
|
923 GaimAccount *account; |
5309 | 924 const char *rru; |
925 const char *url; | |
10684
72a5babfa8b4
[gaim-migrate @ 12231]
Luke Schierer <lschiere@pidgin.im>
parents:
10647
diff
changeset
|
926 GaimCipher *cipher; |
72a5babfa8b4
[gaim-migrate @ 12231]
Luke Schierer <lschiere@pidgin.im>
parents:
10647
diff
changeset
|
927 GaimCipherContext *context; |
11183 | 928 guchar digest[16]; |
5309 | 929 FILE *fd; |
11164 | 930 char *buf; |
5309 | 931 char buf2[3]; |
932 char sendbuf[64]; | |
933 int i; | |
934 | |
8808
bbd8cdaf0ad5
[gaim-migrate @ 9570]
Christian Hammond <chipx86@chipx86.com>
parents:
8669
diff
changeset
|
935 session = cmdproc->session; |
bbd8cdaf0ad5
[gaim-migrate @ 9570]
Christian Hammond <chipx86@chipx86.com>
parents:
8669
diff
changeset
|
936 account = session->account; |
bbd8cdaf0ad5
[gaim-migrate @ 9570]
Christian Hammond <chipx86@chipx86.com>
parents:
8669
diff
changeset
|
937 |
bbd8cdaf0ad5
[gaim-migrate @ 9570]
Christian Hammond <chipx86@chipx86.com>
parents:
8669
diff
changeset
|
938 rru = cmd->params[1]; |
bbd8cdaf0ad5
[gaim-migrate @ 9570]
Christian Hammond <chipx86@chipx86.com>
parents:
8669
diff
changeset
|
939 url = cmd->params[2]; |
5309 | 940 |
11164 | 941 buf = g_strdup_printf("%s%lu%s", |
5309 | 942 session->passport_info.mspauth, |
5566
9896e9068bc4
[gaim-migrate @ 5968]
Christian Hammond <chipx86@chipx86.com>
parents:
5564
diff
changeset
|
943 time(NULL) - session->passport_info.sl, |
10740 | 944 gaim_connection_get_password(account->gc)); |
5309 | 945 |
10684
72a5babfa8b4
[gaim-migrate @ 12231]
Luke Schierer <lschiere@pidgin.im>
parents:
10647
diff
changeset
|
946 cipher = gaim_ciphers_find_cipher("md5"); |
72a5babfa8b4
[gaim-migrate @ 12231]
Luke Schierer <lschiere@pidgin.im>
parents:
10647
diff
changeset
|
947 context = gaim_cipher_context_new(cipher, NULL); |
72a5babfa8b4
[gaim-migrate @ 12231]
Luke Schierer <lschiere@pidgin.im>
parents:
10647
diff
changeset
|
948 |
11183 | 949 gaim_cipher_context_append(context, (const guchar *)buf, strlen(buf)); |
10687
b256ce6b85b8
[gaim-migrate @ 12235]
Etan Reisner <pidgin@unreliablesource.net>
parents:
10684
diff
changeset
|
950 gaim_cipher_context_digest(context, sizeof(digest), digest, NULL); |
10684
72a5babfa8b4
[gaim-migrate @ 12231]
Luke Schierer <lschiere@pidgin.im>
parents:
10647
diff
changeset
|
951 gaim_cipher_context_destroy(context); |
5309 | 952 |
11164 | 953 g_free(buf); |
954 | |
5309 | 955 memset(sendbuf, 0, sizeof(sendbuf)); |
956 | |
8808
bbd8cdaf0ad5
[gaim-migrate @ 9570]
Christian Hammond <chipx86@chipx86.com>
parents:
8669
diff
changeset
|
957 for (i = 0; i < 16; i++) |
bbd8cdaf0ad5
[gaim-migrate @ 9570]
Christian Hammond <chipx86@chipx86.com>
parents:
8669
diff
changeset
|
958 { |
10684
72a5babfa8b4
[gaim-migrate @ 12231]
Luke Schierer <lschiere@pidgin.im>
parents:
10647
diff
changeset
|
959 g_snprintf(buf2, sizeof(buf2), "%02x", digest[i]); |
5309 | 960 strcat(sendbuf, buf2); |
961 } | |
962 | |
8808
bbd8cdaf0ad5
[gaim-migrate @ 9570]
Christian Hammond <chipx86@chipx86.com>
parents:
8669
diff
changeset
|
963 if (session->passport_info.file != NULL) |
bbd8cdaf0ad5
[gaim-migrate @ 9570]
Christian Hammond <chipx86@chipx86.com>
parents:
8669
diff
changeset
|
964 { |
10589
0f7452b1f777
[gaim-migrate @ 11994]
Daniel Atallah <daniel.atallah@gmail.com>
parents:
10568
diff
changeset
|
965 g_unlink(session->passport_info.file); |
5309 | 966 g_free(session->passport_info.file); |
967 } | |
968 | |
10203
7ff9b8b22e7d
[gaim-migrate @ 11324]
Herman Bloggs <hermanator12002@yahoo.com>
parents:
10057
diff
changeset
|
969 if ((fd = gaim_mkstemp(&session->passport_info.file, FALSE)) == NULL) |
8808
bbd8cdaf0ad5
[gaim-migrate @ 9570]
Christian Hammond <chipx86@chipx86.com>
parents:
8669
diff
changeset
|
970 { |
10345 | 971 gaim_debug_error("msn", |
972 "Error opening temp passport file: %s\n", | |
973 strerror(errno)); | |
5309 | 974 } |
8808
bbd8cdaf0ad5
[gaim-migrate @ 9570]
Christian Hammond <chipx86@chipx86.com>
parents:
8669
diff
changeset
|
975 else |
bbd8cdaf0ad5
[gaim-migrate @ 9570]
Christian Hammond <chipx86@chipx86.com>
parents:
8669
diff
changeset
|
976 { |
5309 | 977 fputs("<html>\n" |
978 "<head>\n" | |
979 "<noscript>\n" | |
980 "<meta http-equiv=\"Refresh\" content=\"0; " | |
9158
c30d81b4dd22
[gaim-migrate @ 9942]
Christian Hammond <chipx86@chipx86.com>
parents:
8926
diff
changeset
|
981 "url=http://www.hotmail.com\">\n" |
5309 | 982 "</noscript>\n" |
983 "</head>\n\n", | |
984 fd); | |
985 | |
986 fprintf(fd, "<body onload=\"document.pform.submit(); \">\n"); | |
987 fprintf(fd, "<form name=\"pform\" action=\"%s\" method=\"POST\">\n\n", | |
988 url); | |
989 fprintf(fd, "<input type=\"hidden\" name=\"mode\" value=\"ttl\">\n"); | |
990 fprintf(fd, "<input type=\"hidden\" name=\"login\" value=\"%s\">\n", | |
5564
187c740f2a4e
[gaim-migrate @ 5966]
Christian Hammond <chipx86@chipx86.com>
parents:
5520
diff
changeset
|
991 gaim_account_get_username(account)); |
5309 | 992 fprintf(fd, "<input type=\"hidden\" name=\"username\" value=\"%s\">\n", |
5564
187c740f2a4e
[gaim-migrate @ 5966]
Christian Hammond <chipx86@chipx86.com>
parents:
5520
diff
changeset
|
993 gaim_account_get_username(account)); |
5309 | 994 fprintf(fd, "<input type=\"hidden\" name=\"sid\" value=\"%s\">\n", |
995 session->passport_info.sid); | |
996 fprintf(fd, "<input type=\"hidden\" name=\"kv\" value=\"%s\">\n", | |
997 session->passport_info.kv); | |
998 fprintf(fd, "<input type=\"hidden\" name=\"id\" value=\"2\">\n"); | |
999 fprintf(fd, "<input type=\"hidden\" name=\"sl\" value=\"%ld\">\n", | |
1000 time(NULL) - session->passport_info.sl); | |
1001 fprintf(fd, "<input type=\"hidden\" name=\"rru\" value=\"%s\">\n", | |
1002 rru); | |
1003 fprintf(fd, "<input type=\"hidden\" name=\"auth\" value=\"%s\">\n", | |
1004 session->passport_info.mspauth); | |
1005 fprintf(fd, "<input type=\"hidden\" name=\"creds\" value=\"%s\">\n", | |
1006 sendbuf); /* TODO Digest me (huh? -- ChipX86) */ | |
1007 fprintf(fd, "<input type=\"hidden\" name=\"svc\" value=\"mail\">\n"); | |
7699 | 1008 fprintf(fd, "<input type=\"hidden\" name=\"js\" value=\"yes\">\n"); |
5309 | 1009 fprintf(fd, "</form></body>\n"); |
1010 fprintf(fd, "</html>\n"); | |
1011 | |
8808
bbd8cdaf0ad5
[gaim-migrate @ 9570]
Christian Hammond <chipx86@chipx86.com>
parents:
8669
diff
changeset
|
1012 if (fclose(fd)) |
bbd8cdaf0ad5
[gaim-migrate @ 9570]
Christian Hammond <chipx86@chipx86.com>
parents:
8669
diff
changeset
|
1013 { |
9158
c30d81b4dd22
[gaim-migrate @ 9942]
Christian Hammond <chipx86@chipx86.com>
parents:
8926
diff
changeset
|
1014 gaim_debug_error("msn", |
c30d81b4dd22
[gaim-migrate @ 9942]
Christian Hammond <chipx86@chipx86.com>
parents:
8926
diff
changeset
|
1015 "Error closing temp passport file: %s\n", |
c30d81b4dd22
[gaim-migrate @ 9942]
Christian Hammond <chipx86@chipx86.com>
parents:
8926
diff
changeset
|
1016 strerror(errno)); |
5309 | 1017 |
10589
0f7452b1f777
[gaim-migrate @ 11994]
Daniel Atallah <daniel.atallah@gmail.com>
parents:
10568
diff
changeset
|
1018 g_unlink(session->passport_info.file); |
5309 | 1019 g_free(session->passport_info.file); |
10240
95ca0db2d01d
[gaim-migrate @ 11377]
Herman Bloggs <hermanator12002@yahoo.com>
parents:
10225
diff
changeset
|
1020 session->passport_info.file = NULL; |
5309 | 1021 } |
10647
7d13c04387ad
[gaim-migrate @ 12163]
Daniel Atallah <daniel.atallah@gmail.com>
parents:
10629
diff
changeset
|
1022 #ifdef _WIN32 |
10629
d93621a98f12
[gaim-migrate @ 12106]
Daniel Atallah <daniel.atallah@gmail.com>
parents:
10589
diff
changeset
|
1023 else |
d93621a98f12
[gaim-migrate @ 12106]
Daniel Atallah <daniel.atallah@gmail.com>
parents:
10589
diff
changeset
|
1024 { |
10647
7d13c04387ad
[gaim-migrate @ 12163]
Daniel Atallah <daniel.atallah@gmail.com>
parents:
10629
diff
changeset
|
1025 /* |
10629
d93621a98f12
[gaim-migrate @ 12106]
Daniel Atallah <daniel.atallah@gmail.com>
parents:
10589
diff
changeset
|
1026 * Renaming file with .html extension, so that the |
d93621a98f12
[gaim-migrate @ 12106]
Daniel Atallah <daniel.atallah@gmail.com>
parents:
10589
diff
changeset
|
1027 * win32 open_url will work. |
d93621a98f12
[gaim-migrate @ 12106]
Daniel Atallah <daniel.atallah@gmail.com>
parents:
10589
diff
changeset
|
1028 */ |
d93621a98f12
[gaim-migrate @ 12106]
Daniel Atallah <daniel.atallah@gmail.com>
parents:
10589
diff
changeset
|
1029 char *tmp; |
d93621a98f12
[gaim-migrate @ 12106]
Daniel Atallah <daniel.atallah@gmail.com>
parents:
10589
diff
changeset
|
1030 |
d93621a98f12
[gaim-migrate @ 12106]
Daniel Atallah <daniel.atallah@gmail.com>
parents:
10589
diff
changeset
|
1031 if ((tmp = |
d93621a98f12
[gaim-migrate @ 12106]
Daniel Atallah <daniel.atallah@gmail.com>
parents:
10589
diff
changeset
|
1032 g_strdup_printf("%s.html", |
d93621a98f12
[gaim-migrate @ 12106]
Daniel Atallah <daniel.atallah@gmail.com>
parents:
10589
diff
changeset
|
1033 session->passport_info.file)) != NULL) |
d93621a98f12
[gaim-migrate @ 12106]
Daniel Atallah <daniel.atallah@gmail.com>
parents:
10589
diff
changeset
|
1034 { |
d93621a98f12
[gaim-migrate @ 12106]
Daniel Atallah <daniel.atallah@gmail.com>
parents:
10589
diff
changeset
|
1035 if (g_rename(session->passport_info.file, |
d93621a98f12
[gaim-migrate @ 12106]
Daniel Atallah <daniel.atallah@gmail.com>
parents:
10589
diff
changeset
|
1036 tmp) == 0) |
d93621a98f12
[gaim-migrate @ 12106]
Daniel Atallah <daniel.atallah@gmail.com>
parents:
10589
diff
changeset
|
1037 { |
d93621a98f12
[gaim-migrate @ 12106]
Daniel Atallah <daniel.atallah@gmail.com>
parents:
10589
diff
changeset
|
1038 g_free(session->passport_info.file); |
d93621a98f12
[gaim-migrate @ 12106]
Daniel Atallah <daniel.atallah@gmail.com>
parents:
10589
diff
changeset
|
1039 session->passport_info.file = tmp; |
10647
7d13c04387ad
[gaim-migrate @ 12163]
Daniel Atallah <daniel.atallah@gmail.com>
parents:
10629
diff
changeset
|
1040 } |
10629
d93621a98f12
[gaim-migrate @ 12106]
Daniel Atallah <daniel.atallah@gmail.com>
parents:
10589
diff
changeset
|
1041 else |
d93621a98f12
[gaim-migrate @ 12106]
Daniel Atallah <daniel.atallah@gmail.com>
parents:
10589
diff
changeset
|
1042 g_free(tmp); |
d93621a98f12
[gaim-migrate @ 12106]
Daniel Atallah <daniel.atallah@gmail.com>
parents:
10589
diff
changeset
|
1043 } |
d93621a98f12
[gaim-migrate @ 12106]
Daniel Atallah <daniel.atallah@gmail.com>
parents:
10589
diff
changeset
|
1044 } |
10647
7d13c04387ad
[gaim-migrate @ 12163]
Daniel Atallah <daniel.atallah@gmail.com>
parents:
10629
diff
changeset
|
1045 #endif |
5309 | 1046 } |
1047 } | |
1048 /************************************************************************** | |
1049 * Switchboards | |
1050 **************************************************************************/ | |
10481 | 1051 |
8808
bbd8cdaf0ad5
[gaim-migrate @ 9570]
Christian Hammond <chipx86@chipx86.com>
parents:
8669
diff
changeset
|
1052 static void |
bbd8cdaf0ad5
[gaim-migrate @ 9570]
Christian Hammond <chipx86@chipx86.com>
parents:
8669
diff
changeset
|
1053 rng_cmd(MsnCmdProc *cmdproc, MsnCommand *cmd) |
5309 | 1054 { |
8808
bbd8cdaf0ad5
[gaim-migrate @ 9570]
Christian Hammond <chipx86@chipx86.com>
parents:
8669
diff
changeset
|
1055 MsnSession *session; |
5309 | 1056 MsnSwitchBoard *swboard; |
1057 const char *session_id; | |
9193
502707ca1836
[gaim-migrate @ 9988]
Christian Hammond <chipx86@chipx86.com>
parents:
9158
diff
changeset
|
1058 char *host; |
5309 | 1059 int port; |
1060 | |
8808
bbd8cdaf0ad5
[gaim-migrate @ 9570]
Christian Hammond <chipx86@chipx86.com>
parents:
8669
diff
changeset
|
1061 session = cmdproc->session; |
bbd8cdaf0ad5
[gaim-migrate @ 9570]
Christian Hammond <chipx86@chipx86.com>
parents:
8669
diff
changeset
|
1062 session_id = cmd->params[0]; |
5309 | 1063 |
9193
502707ca1836
[gaim-migrate @ 9988]
Christian Hammond <chipx86@chipx86.com>
parents:
9158
diff
changeset
|
1064 msn_parse_socket(cmd->params[1], &host, &port); |
5309 | 1065 |
7288
ff9127038a5a
[gaim-migrate @ 7869]
Christian Hammond <chipx86@chipx86.com>
parents:
7274
diff
changeset
|
1066 if (session->http_method) |
ff9127038a5a
[gaim-migrate @ 7869]
Christian Hammond <chipx86@chipx86.com>
parents:
7274
diff
changeset
|
1067 port = 80; |
ff9127038a5a
[gaim-migrate @ 7869]
Christian Hammond <chipx86@chipx86.com>
parents:
7274
diff
changeset
|
1068 |
5309 | 1069 swboard = msn_switchboard_new(session); |
1070 | |
1071 msn_switchboard_set_invited(swboard, TRUE); | |
8808
bbd8cdaf0ad5
[gaim-migrate @ 9570]
Christian Hammond <chipx86@chipx86.com>
parents:
8669
diff
changeset
|
1072 msn_switchboard_set_session_id(swboard, cmd->params[0]); |
bbd8cdaf0ad5
[gaim-migrate @ 9570]
Christian Hammond <chipx86@chipx86.com>
parents:
8669
diff
changeset
|
1073 msn_switchboard_set_auth_key(swboard, cmd->params[3]); |
9193
502707ca1836
[gaim-migrate @ 9988]
Christian Hammond <chipx86@chipx86.com>
parents:
9158
diff
changeset
|
1074 swboard->im_user = g_strdup(cmd->params[4]); |
502707ca1836
[gaim-migrate @ 9988]
Christian Hammond <chipx86@chipx86.com>
parents:
9158
diff
changeset
|
1075 /* msn_switchboard_add_user(swboard, cmd->params[4]); */ |
5309 | 1076 |
10568 | 1077 if (!msn_switchboard_connect(swboard, host, port)) |
1078 msn_switchboard_destroy(swboard); | |
5309 | 1079 |
1080 g_free(host); | |
1081 } | |
1082 | |
8808
bbd8cdaf0ad5
[gaim-migrate @ 9570]
Christian Hammond <chipx86@chipx86.com>
parents:
8669
diff
changeset
|
1083 static void |
bbd8cdaf0ad5
[gaim-migrate @ 9570]
Christian Hammond <chipx86@chipx86.com>
parents:
8669
diff
changeset
|
1084 xfr_cmd(MsnCmdProc *cmdproc, MsnCommand *cmd) |
5309 | 1085 { |
1086 char *host; | |
1087 int port; | |
1088 | |
8808
bbd8cdaf0ad5
[gaim-migrate @ 9570]
Christian Hammond <chipx86@chipx86.com>
parents:
8669
diff
changeset
|
1089 if (strcmp(cmd->params[1], "SB") && strcmp(cmd->params[1], "NS")) |
bbd8cdaf0ad5
[gaim-migrate @ 9570]
Christian Hammond <chipx86@chipx86.com>
parents:
8669
diff
changeset
|
1090 { |
10481 | 1091 /* Maybe we can have a generic bad command error. */ |
1092 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
|
1093 return; |
5309 | 1094 } |
1095 | |
9193
502707ca1836
[gaim-migrate @ 9988]
Christian Hammond <chipx86@chipx86.com>
parents:
9158
diff
changeset
|
1096 msn_parse_socket(cmd->params[2], &host, &port); |
5309 | 1097 |
8808
bbd8cdaf0ad5
[gaim-migrate @ 9570]
Christian Hammond <chipx86@chipx86.com>
parents:
8669
diff
changeset
|
1098 if (!strcmp(cmd->params[1], "SB")) |
bbd8cdaf0ad5
[gaim-migrate @ 9570]
Christian Hammond <chipx86@chipx86.com>
parents:
8669
diff
changeset
|
1099 { |
9193
502707ca1836
[gaim-migrate @ 9988]
Christian Hammond <chipx86@chipx86.com>
parents:
9158
diff
changeset
|
1100 gaim_debug_error("msn", "This shouldn't be handled here.\n"); |
5385
150cf1615098
[gaim-migrate @ 5761]
Christian Hammond <chipx86@chipx86.com>
parents:
5375
diff
changeset
|
1101 } |
8808
bbd8cdaf0ad5
[gaim-migrate @ 9570]
Christian Hammond <chipx86@chipx86.com>
parents:
8669
diff
changeset
|
1102 else if (!strcmp(cmd->params[1], "NS")) |
bbd8cdaf0ad5
[gaim-migrate @ 9570]
Christian Hammond <chipx86@chipx86.com>
parents:
8669
diff
changeset
|
1103 { |
9193
502707ca1836
[gaim-migrate @ 9988]
Christian Hammond <chipx86@chipx86.com>
parents:
9158
diff
changeset
|
1104 MsnSession *session; |
8646
1e211dde3cae
[gaim-migrate @ 9398]
Christian Hammond <chipx86@chipx86.com>
parents:
8614
diff
changeset
|
1105 |
9193
502707ca1836
[gaim-migrate @ 9988]
Christian Hammond <chipx86@chipx86.com>
parents:
9158
diff
changeset
|
1106 session = cmdproc->session; |
5309 | 1107 |
10519 | 1108 msn_session_set_login_step(session, MSN_LOGIN_STEP_TRANSFER); |
10481 | 1109 |
9193
502707ca1836
[gaim-migrate @ 9988]
Christian Hammond <chipx86@chipx86.com>
parents:
9158
diff
changeset
|
1110 msn_notification_connect(session->notification, host, port); |
5309 | 1111 } |
1112 | |
1113 g_free(host); | |
1114 } | |
1115 | |
1116 /************************************************************************** | |
1117 * Message Types | |
1118 **************************************************************************/ | |
10481 | 1119 |
8808
bbd8cdaf0ad5
[gaim-migrate @ 9570]
Christian Hammond <chipx86@chipx86.com>
parents:
8669
diff
changeset
|
1120 static void |
bbd8cdaf0ad5
[gaim-migrate @ 9570]
Christian Hammond <chipx86@chipx86.com>
parents:
8669
diff
changeset
|
1121 profile_msg(MsnCmdProc *cmdproc, MsnMessage *msg) |
5309 | 1122 { |
8808
bbd8cdaf0ad5
[gaim-migrate @ 9570]
Christian Hammond <chipx86@chipx86.com>
parents:
8669
diff
changeset
|
1123 MsnSession *session; |
5309 | 1124 const char *value; |
1125 | |
8808
bbd8cdaf0ad5
[gaim-migrate @ 9570]
Christian Hammond <chipx86@chipx86.com>
parents:
8669
diff
changeset
|
1126 session = cmdproc->session; |
bbd8cdaf0ad5
[gaim-migrate @ 9570]
Christian Hammond <chipx86@chipx86.com>
parents:
8669
diff
changeset
|
1127 |
9193
502707ca1836
[gaim-migrate @ 9988]
Christian Hammond <chipx86@chipx86.com>
parents:
9158
diff
changeset
|
1128 if (strcmp(msg->remote_user, "Hotmail")) |
5333
bbbf616bd924
[gaim-migrate @ 5708]
Christian Hammond <chipx86@chipx86.com>
parents:
5327
diff
changeset
|
1129 /* This isn't an official message. */ |
8808
bbd8cdaf0ad5
[gaim-migrate @ 9570]
Christian Hammond <chipx86@chipx86.com>
parents:
8669
diff
changeset
|
1130 return; |
5333
bbbf616bd924
[gaim-migrate @ 5708]
Christian Hammond <chipx86@chipx86.com>
parents:
5327
diff
changeset
|
1131 |
5309 | 1132 if ((value = msn_message_get_attr(msg, "kv")) != NULL) |
10284 | 1133 { |
1134 if (session->passport_info.kv != NULL) | |
1135 g_free(session->passport_info.kv); | |
1136 | |
5309 | 1137 session->passport_info.kv = g_strdup(value); |
10284 | 1138 } |
5309 | 1139 |
1140 if ((value = msn_message_get_attr(msg, "sid")) != NULL) | |
10284 | 1141 { |
1142 if (session->passport_info.sid != NULL) | |
1143 g_free(session->passport_info.sid); | |
1144 | |
5309 | 1145 session->passport_info.sid = g_strdup(value); |
10284 | 1146 } |
5309 | 1147 |
1148 if ((value = msn_message_get_attr(msg, "MSPAuth")) != NULL) | |
10284 | 1149 { |
1150 if (session->passport_info.mspauth != NULL) | |
1151 g_free(session->passport_info.mspauth); | |
1152 | |
5309 | 1153 session->passport_info.mspauth = g_strdup(value); |
10284 | 1154 } |
5309 | 1155 |
6701
b7e113a59b51
[gaim-migrate @ 7227]
Christian Hammond <chipx86@chipx86.com>
parents:
6695
diff
changeset
|
1156 if ((value = msn_message_get_attr(msg, "ClientIP")) != NULL) |
10284 | 1157 { |
1158 if (session->passport_info.client_ip != NULL) | |
1159 g_free(session->passport_info.client_ip); | |
1160 | |
6701
b7e113a59b51
[gaim-migrate @ 7227]
Christian Hammond <chipx86@chipx86.com>
parents:
6695
diff
changeset
|
1161 session->passport_info.client_ip = g_strdup(value); |
10284 | 1162 } |
6701
b7e113a59b51
[gaim-migrate @ 7227]
Christian Hammond <chipx86@chipx86.com>
parents:
6695
diff
changeset
|
1163 |
b7e113a59b51
[gaim-migrate @ 7227]
Christian Hammond <chipx86@chipx86.com>
parents:
6695
diff
changeset
|
1164 if ((value = msn_message_get_attr(msg, "ClientPort")) != NULL) |
b7e113a59b51
[gaim-migrate @ 7227]
Christian Hammond <chipx86@chipx86.com>
parents:
6695
diff
changeset
|
1165 session->passport_info.client_port = ntohs(atoi(value)); |
10275 | 1166 |
1167 if ((value = msn_message_get_attr(msg, "LoginTime")) != NULL) | |
1168 session->passport_info.sl = atol(value); | |
5309 | 1169 } |
1170 | |
8808
bbd8cdaf0ad5
[gaim-migrate @ 9570]
Christian Hammond <chipx86@chipx86.com>
parents:
8669
diff
changeset
|
1171 static void |
bbd8cdaf0ad5
[gaim-migrate @ 9570]
Christian Hammond <chipx86@chipx86.com>
parents:
8669
diff
changeset
|
1172 initial_email_msg(MsnCmdProc *cmdproc, MsnMessage *msg) |
5309 | 1173 { |
8808
bbd8cdaf0ad5
[gaim-migrate @ 9570]
Christian Hammond <chipx86@chipx86.com>
parents:
8669
diff
changeset
|
1174 MsnSession *session; |
bbd8cdaf0ad5
[gaim-migrate @ 9570]
Christian Hammond <chipx86@chipx86.com>
parents:
8669
diff
changeset
|
1175 GaimConnection *gc; |
5309 | 1176 GHashTable *table; |
1177 const char *unread; | |
1178 | |
8808
bbd8cdaf0ad5
[gaim-migrate @ 9570]
Christian Hammond <chipx86@chipx86.com>
parents:
8669
diff
changeset
|
1179 session = cmdproc->session; |
bbd8cdaf0ad5
[gaim-migrate @ 9570]
Christian Hammond <chipx86@chipx86.com>
parents:
8669
diff
changeset
|
1180 gc = session->account->gc; |
bbd8cdaf0ad5
[gaim-migrate @ 9570]
Christian Hammond <chipx86@chipx86.com>
parents:
8669
diff
changeset
|
1181 |
9193
502707ca1836
[gaim-migrate @ 9988]
Christian Hammond <chipx86@chipx86.com>
parents:
9158
diff
changeset
|
1182 if (strcmp(msg->remote_user, "Hotmail")) |
5333
bbbf616bd924
[gaim-migrate @ 5708]
Christian Hammond <chipx86@chipx86.com>
parents:
5327
diff
changeset
|
1183 /* This isn't an official message. */ |
8808
bbd8cdaf0ad5
[gaim-migrate @ 9570]
Christian Hammond <chipx86@chipx86.com>
parents:
8669
diff
changeset
|
1184 return; |
5333
bbbf616bd924
[gaim-migrate @ 5708]
Christian Hammond <chipx86@chipx86.com>
parents:
5327
diff
changeset
|
1185 |
8808
bbd8cdaf0ad5
[gaim-migrate @ 9570]
Christian Hammond <chipx86@chipx86.com>
parents:
8669
diff
changeset
|
1186 if (session->passport_info.file == NULL) |
bbd8cdaf0ad5
[gaim-migrate @ 9570]
Christian Hammond <chipx86@chipx86.com>
parents:
8669
diff
changeset
|
1187 { |
9193
502707ca1836
[gaim-migrate @ 9988]
Christian Hammond <chipx86@chipx86.com>
parents:
9158
diff
changeset
|
1188 MsnTransaction *trans; |
10225 | 1189 trans = msn_transaction_new(cmdproc, "URL", "%s", "INBOX"); |
9193
502707ca1836
[gaim-migrate @ 9988]
Christian Hammond <chipx86@chipx86.com>
parents:
9158
diff
changeset
|
1190 msn_transaction_queue_cmd(trans, msg->cmd); |
5506
4f72b611f0ee
[gaim-migrate @ 5905]
Christian Hammond <chipx86@chipx86.com>
parents:
5498
diff
changeset
|
1191 |
9193
502707ca1836
[gaim-migrate @ 9988]
Christian Hammond <chipx86@chipx86.com>
parents:
9158
diff
changeset
|
1192 msn_cmdproc_send_trans(cmdproc, trans); |
5506
4f72b611f0ee
[gaim-migrate @ 5905]
Christian Hammond <chipx86@chipx86.com>
parents:
5498
diff
changeset
|
1193 |
8808
bbd8cdaf0ad5
[gaim-migrate @ 9570]
Christian Hammond <chipx86@chipx86.com>
parents:
8669
diff
changeset
|
1194 return; |
5358
91db34a45cbe
[gaim-migrate @ 5734]
Christian Hammond <chipx86@chipx86.com>
parents:
5353
diff
changeset
|
1195 } |
91db34a45cbe
[gaim-migrate @ 5734]
Christian Hammond <chipx86@chipx86.com>
parents:
5353
diff
changeset
|
1196 |
11321 | 1197 if (!gaim_account_get_check_mail(session->account)) |
1198 return; | |
1199 | |
5309 | 1200 table = msn_message_get_hashtable_from_body(msg); |
1201 | |
1202 unread = g_hash_table_lookup(table, "Inbox-Unread"); | |
1203 | |
8808
bbd8cdaf0ad5
[gaim-migrate @ 9570]
Christian Hammond <chipx86@chipx86.com>
parents:
8669
diff
changeset
|
1204 if (unread != NULL) |
bbd8cdaf0ad5
[gaim-migrate @ 9570]
Christian Hammond <chipx86@chipx86.com>
parents:
8669
diff
changeset
|
1205 { |
7190
13c725566078
[gaim-migrate @ 7759]
Christian Hammond <chipx86@chipx86.com>
parents:
7188
diff
changeset
|
1206 int count = atoi(unread); |
13c725566078
[gaim-migrate @ 7759]
Christian Hammond <chipx86@chipx86.com>
parents:
7188
diff
changeset
|
1207 |
9193
502707ca1836
[gaim-migrate @ 9988]
Christian Hammond <chipx86@chipx86.com>
parents:
9158
diff
changeset
|
1208 if (count > 0) |
7190
13c725566078
[gaim-migrate @ 7759]
Christian Hammond <chipx86@chipx86.com>
parents:
7188
diff
changeset
|
1209 { |
9158
c30d81b4dd22
[gaim-migrate @ 9942]
Christian Hammond <chipx86@chipx86.com>
parents:
8926
diff
changeset
|
1210 const char *passport; |
9193
502707ca1836
[gaim-migrate @ 9988]
Christian Hammond <chipx86@chipx86.com>
parents:
9158
diff
changeset
|
1211 const char *url; |
9158
c30d81b4dd22
[gaim-migrate @ 9942]
Christian Hammond <chipx86@chipx86.com>
parents:
8926
diff
changeset
|
1212 |
c30d81b4dd22
[gaim-migrate @ 9942]
Christian Hammond <chipx86@chipx86.com>
parents:
8926
diff
changeset
|
1213 passport = msn_user_get_passport(session->user); |
9193
502707ca1836
[gaim-migrate @ 9988]
Christian Hammond <chipx86@chipx86.com>
parents:
9158
diff
changeset
|
1214 url = session->passport_info.file; |
502707ca1836
[gaim-migrate @ 9988]
Christian Hammond <chipx86@chipx86.com>
parents:
9158
diff
changeset
|
1215 |
502707ca1836
[gaim-migrate @ 9988]
Christian Hammond <chipx86@chipx86.com>
parents:
9158
diff
changeset
|
1216 gaim_notify_emails(gc, atoi(unread), FALSE, NULL, NULL, |
502707ca1836
[gaim-migrate @ 9988]
Christian Hammond <chipx86@chipx86.com>
parents:
9158
diff
changeset
|
1217 &passport, &url, NULL, NULL); |
7190
13c725566078
[gaim-migrate @ 7759]
Christian Hammond <chipx86@chipx86.com>
parents:
7188
diff
changeset
|
1218 } |
5520
11be8ae32937
[gaim-migrate @ 5920]
Christian Hammond <chipx86@chipx86.com>
parents:
5518
diff
changeset
|
1219 } |
5309 | 1220 |
1221 g_hash_table_destroy(table); | |
1222 } | |
1223 | |
8808
bbd8cdaf0ad5
[gaim-migrate @ 9570]
Christian Hammond <chipx86@chipx86.com>
parents:
8669
diff
changeset
|
1224 static void |
bbd8cdaf0ad5
[gaim-migrate @ 9570]
Christian Hammond <chipx86@chipx86.com>
parents:
8669
diff
changeset
|
1225 email_msg(MsnCmdProc *cmdproc, MsnMessage *msg) |
5309 | 1226 { |
8808
bbd8cdaf0ad5
[gaim-migrate @ 9570]
Christian Hammond <chipx86@chipx86.com>
parents:
8669
diff
changeset
|
1227 MsnSession *session; |
bbd8cdaf0ad5
[gaim-migrate @ 9570]
Christian Hammond <chipx86@chipx86.com>
parents:
8669
diff
changeset
|
1228 GaimConnection *gc; |
5309 | 1229 GHashTable *table; |
8657
4a1e87c50d6f
[gaim-migrate @ 9409]
Christian Hammond <chipx86@chipx86.com>
parents:
8652
diff
changeset
|
1230 char *from, *subject, *tmp; |
8808
bbd8cdaf0ad5
[gaim-migrate @ 9570]
Christian Hammond <chipx86@chipx86.com>
parents:
8669
diff
changeset
|
1231 |
bbd8cdaf0ad5
[gaim-migrate @ 9570]
Christian Hammond <chipx86@chipx86.com>
parents:
8669
diff
changeset
|
1232 session = cmdproc->session; |
bbd8cdaf0ad5
[gaim-migrate @ 9570]
Christian Hammond <chipx86@chipx86.com>
parents:
8669
diff
changeset
|
1233 gc = session->account->gc; |
8657
4a1e87c50d6f
[gaim-migrate @ 9409]
Christian Hammond <chipx86@chipx86.com>
parents:
8652
diff
changeset
|
1234 |
9193
502707ca1836
[gaim-migrate @ 9988]
Christian Hammond <chipx86@chipx86.com>
parents:
9158
diff
changeset
|
1235 if (strcmp(msg->remote_user, "Hotmail")) |
5333
bbbf616bd924
[gaim-migrate @ 5708]
Christian Hammond <chipx86@chipx86.com>
parents:
5327
diff
changeset
|
1236 /* This isn't an official message. */ |
8808
bbd8cdaf0ad5
[gaim-migrate @ 9570]
Christian Hammond <chipx86@chipx86.com>
parents:
8669
diff
changeset
|
1237 return; |
5333
bbbf616bd924
[gaim-migrate @ 5708]
Christian Hammond <chipx86@chipx86.com>
parents:
5327
diff
changeset
|
1238 |
8808
bbd8cdaf0ad5
[gaim-migrate @ 9570]
Christian Hammond <chipx86@chipx86.com>
parents:
8669
diff
changeset
|
1239 if (session->passport_info.file == NULL) |
bbd8cdaf0ad5
[gaim-migrate @ 9570]
Christian Hammond <chipx86@chipx86.com>
parents:
8669
diff
changeset
|
1240 { |
9193
502707ca1836
[gaim-migrate @ 9988]
Christian Hammond <chipx86@chipx86.com>
parents:
9158
diff
changeset
|
1241 MsnTransaction *trans; |
10225 | 1242 trans = msn_transaction_new(cmdproc, "URL", "%s", "INBOX"); |
9193
502707ca1836
[gaim-migrate @ 9988]
Christian Hammond <chipx86@chipx86.com>
parents:
9158
diff
changeset
|
1243 msn_transaction_queue_cmd(trans, msg->cmd); |
5506
4f72b611f0ee
[gaim-migrate @ 5905]
Christian Hammond <chipx86@chipx86.com>
parents:
5498
diff
changeset
|
1244 |
9193
502707ca1836
[gaim-migrate @ 9988]
Christian Hammond <chipx86@chipx86.com>
parents:
9158
diff
changeset
|
1245 msn_cmdproc_send_trans(cmdproc, trans); |
5506
4f72b611f0ee
[gaim-migrate @ 5905]
Christian Hammond <chipx86@chipx86.com>
parents:
5498
diff
changeset
|
1246 |
8808
bbd8cdaf0ad5
[gaim-migrate @ 9570]
Christian Hammond <chipx86@chipx86.com>
parents:
8669
diff
changeset
|
1247 return; |
5358
91db34a45cbe
[gaim-migrate @ 5734]
Christian Hammond <chipx86@chipx86.com>
parents:
5353
diff
changeset
|
1248 } |
91db34a45cbe
[gaim-migrate @ 5734]
Christian Hammond <chipx86@chipx86.com>
parents:
5353
diff
changeset
|
1249 |
11321 | 1250 if (!gaim_account_get_check_mail(session->account)) |
1251 return; | |
1252 | |
5309 | 1253 table = msn_message_get_hashtable_from_body(msg); |
1254 | |
9193
502707ca1836
[gaim-migrate @ 9988]
Christian Hammond <chipx86@chipx86.com>
parents:
9158
diff
changeset
|
1255 from = subject = NULL; |
502707ca1836
[gaim-migrate @ 9988]
Christian Hammond <chipx86@chipx86.com>
parents:
9158
diff
changeset
|
1256 |
8657
4a1e87c50d6f
[gaim-migrate @ 9409]
Christian Hammond <chipx86@chipx86.com>
parents:
8652
diff
changeset
|
1257 tmp = g_hash_table_lookup(table, "From"); |
4a1e87c50d6f
[gaim-migrate @ 9409]
Christian Hammond <chipx86@chipx86.com>
parents:
8652
diff
changeset
|
1258 if (tmp != NULL) |
4a1e87c50d6f
[gaim-migrate @ 9409]
Christian Hammond <chipx86@chipx86.com>
parents:
8652
diff
changeset
|
1259 from = gaim_mime_decode_field(tmp); |
4a1e87c50d6f
[gaim-migrate @ 9409]
Christian Hammond <chipx86@chipx86.com>
parents:
8652
diff
changeset
|
1260 |
4a1e87c50d6f
[gaim-migrate @ 9409]
Christian Hammond <chipx86@chipx86.com>
parents:
8652
diff
changeset
|
1261 tmp = g_hash_table_lookup(table, "Subject"); |
4a1e87c50d6f
[gaim-migrate @ 9409]
Christian Hammond <chipx86@chipx86.com>
parents:
8652
diff
changeset
|
1262 if (tmp != NULL) |
4a1e87c50d6f
[gaim-migrate @ 9409]
Christian Hammond <chipx86@chipx86.com>
parents:
8652
diff
changeset
|
1263 subject = gaim_mime_decode_field(tmp); |
5309 | 1264 |
9158
c30d81b4dd22
[gaim-migrate @ 9942]
Christian Hammond <chipx86@chipx86.com>
parents:
8926
diff
changeset
|
1265 gaim_notify_email(gc, |
c30d81b4dd22
[gaim-migrate @ 9942]
Christian Hammond <chipx86@chipx86.com>
parents:
8926
diff
changeset
|
1266 (subject != NULL ? subject : ""), |
c30d81b4dd22
[gaim-migrate @ 9942]
Christian Hammond <chipx86@chipx86.com>
parents:
8926
diff
changeset
|
1267 (from != NULL ? from : ""), |
c30d81b4dd22
[gaim-migrate @ 9942]
Christian Hammond <chipx86@chipx86.com>
parents:
8926
diff
changeset
|
1268 msn_user_get_passport(session->user), |
c30d81b4dd22
[gaim-migrate @ 9942]
Christian Hammond <chipx86@chipx86.com>
parents:
8926
diff
changeset
|
1269 session->passport_info.file, NULL, NULL); |
5309 | 1270 |
8657
4a1e87c50d6f
[gaim-migrate @ 9409]
Christian Hammond <chipx86@chipx86.com>
parents:
8652
diff
changeset
|
1271 if (from != NULL) |
4a1e87c50d6f
[gaim-migrate @ 9409]
Christian Hammond <chipx86@chipx86.com>
parents:
8652
diff
changeset
|
1272 g_free(from); |
4a1e87c50d6f
[gaim-migrate @ 9409]
Christian Hammond <chipx86@chipx86.com>
parents:
8652
diff
changeset
|
1273 |
4a1e87c50d6f
[gaim-migrate @ 9409]
Christian Hammond <chipx86@chipx86.com>
parents:
8652
diff
changeset
|
1274 if (subject != NULL) |
4a1e87c50d6f
[gaim-migrate @ 9409]
Christian Hammond <chipx86@chipx86.com>
parents:
8652
diff
changeset
|
1275 g_free(subject); |
7817 | 1276 |
5309 | 1277 g_hash_table_destroy(table); |
1278 } | |
1279 | |
8808
bbd8cdaf0ad5
[gaim-migrate @ 9570]
Christian Hammond <chipx86@chipx86.com>
parents:
8669
diff
changeset
|
1280 static void |
bbd8cdaf0ad5
[gaim-migrate @ 9570]
Christian Hammond <chipx86@chipx86.com>
parents:
8669
diff
changeset
|
1281 system_msg(MsnCmdProc *cmdproc, MsnMessage *msg) |
5333
bbbf616bd924
[gaim-migrate @ 5708]
Christian Hammond <chipx86@chipx86.com>
parents:
5327
diff
changeset
|
1282 { |
bbbf616bd924
[gaim-migrate @ 5708]
Christian Hammond <chipx86@chipx86.com>
parents:
5327
diff
changeset
|
1283 GHashTable *table; |
bbbf616bd924
[gaim-migrate @ 5708]
Christian Hammond <chipx86@chipx86.com>
parents:
5327
diff
changeset
|
1284 const char *type_s; |
bbbf616bd924
[gaim-migrate @ 5708]
Christian Hammond <chipx86@chipx86.com>
parents:
5327
diff
changeset
|
1285 |
9193
502707ca1836
[gaim-migrate @ 9988]
Christian Hammond <chipx86@chipx86.com>
parents:
9158
diff
changeset
|
1286 if (strcmp(msg->remote_user, "Hotmail")) |
5333
bbbf616bd924
[gaim-migrate @ 5708]
Christian Hammond <chipx86@chipx86.com>
parents:
5327
diff
changeset
|
1287 /* This isn't an official message. */ |
8808
bbd8cdaf0ad5
[gaim-migrate @ 9570]
Christian Hammond <chipx86@chipx86.com>
parents:
8669
diff
changeset
|
1288 return; |
5333
bbbf616bd924
[gaim-migrate @ 5708]
Christian Hammond <chipx86@chipx86.com>
parents:
5327
diff
changeset
|
1289 |
bbbf616bd924
[gaim-migrate @ 5708]
Christian Hammond <chipx86@chipx86.com>
parents:
5327
diff
changeset
|
1290 table = msn_message_get_hashtable_from_body(msg); |
bbbf616bd924
[gaim-migrate @ 5708]
Christian Hammond <chipx86@chipx86.com>
parents:
5327
diff
changeset
|
1291 |
8808
bbd8cdaf0ad5
[gaim-migrate @ 9570]
Christian Hammond <chipx86@chipx86.com>
parents:
8669
diff
changeset
|
1292 if ((type_s = g_hash_table_lookup(table, "Type")) != NULL) |
bbd8cdaf0ad5
[gaim-migrate @ 9570]
Christian Hammond <chipx86@chipx86.com>
parents:
8669
diff
changeset
|
1293 { |
5333
bbbf616bd924
[gaim-migrate @ 5708]
Christian Hammond <chipx86@chipx86.com>
parents:
5327
diff
changeset
|
1294 int type = atoi(type_s); |
bbbf616bd924
[gaim-migrate @ 5708]
Christian Hammond <chipx86@chipx86.com>
parents:
5327
diff
changeset
|
1295 char buf[MSN_BUF_LEN]; |
6308 | 1296 int minutes; |
5333
bbbf616bd924
[gaim-migrate @ 5708]
Christian Hammond <chipx86@chipx86.com>
parents:
5327
diff
changeset
|
1297 |
8808
bbd8cdaf0ad5
[gaim-migrate @ 9570]
Christian Hammond <chipx86@chipx86.com>
parents:
8669
diff
changeset
|
1298 switch (type) |
bbd8cdaf0ad5
[gaim-migrate @ 9570]
Christian Hammond <chipx86@chipx86.com>
parents:
8669
diff
changeset
|
1299 { |
5333
bbbf616bd924
[gaim-migrate @ 5708]
Christian Hammond <chipx86@chipx86.com>
parents:
5327
diff
changeset
|
1300 case 1: |
6308 | 1301 minutes = atoi(g_hash_table_lookup(table, "Arg1")); |
1302 g_snprintf(buf, sizeof(buf), ngettext( | |
9158
c30d81b4dd22
[gaim-migrate @ 9942]
Christian Hammond <chipx86@chipx86.com>
parents:
8926
diff
changeset
|
1303 "The MSN server will shut down for maintenance " |
c30d81b4dd22
[gaim-migrate @ 9942]
Christian Hammond <chipx86@chipx86.com>
parents:
8926
diff
changeset
|
1304 "in %d minute. You will automatically be " |
10816
c94f40ffcafb
[gaim-migrate @ 12471]
Luke Schierer <lschiere@pidgin.im>
parents:
10812
diff
changeset
|
1305 "signed out at that time. Please finish any " |
9158
c30d81b4dd22
[gaim-migrate @ 9942]
Christian Hammond <chipx86@chipx86.com>
parents:
8926
diff
changeset
|
1306 "conversations in progress.\n\nAfter the " |
c30d81b4dd22
[gaim-migrate @ 9942]
Christian Hammond <chipx86@chipx86.com>
parents:
8926
diff
changeset
|
1307 "maintenance has been completed, you will be " |
c30d81b4dd22
[gaim-migrate @ 9942]
Christian Hammond <chipx86@chipx86.com>
parents:
8926
diff
changeset
|
1308 "able to successfully sign in.", |
c30d81b4dd22
[gaim-migrate @ 9942]
Christian Hammond <chipx86@chipx86.com>
parents:
8926
diff
changeset
|
1309 "The MSN server will shut down for maintenance " |
c30d81b4dd22
[gaim-migrate @ 9942]
Christian Hammond <chipx86@chipx86.com>
parents:
8926
diff
changeset
|
1310 "in %d minutes. You will automatically be " |
10816
c94f40ffcafb
[gaim-migrate @ 12471]
Luke Schierer <lschiere@pidgin.im>
parents:
10812
diff
changeset
|
1311 "signed out at that time. Please finish any " |
9158
c30d81b4dd22
[gaim-migrate @ 9942]
Christian Hammond <chipx86@chipx86.com>
parents:
8926
diff
changeset
|
1312 "conversations in progress.\n\nAfter the " |
c30d81b4dd22
[gaim-migrate @ 9942]
Christian Hammond <chipx86@chipx86.com>
parents:
8926
diff
changeset
|
1313 "maintenance has been completed, you will be " |
c30d81b4dd22
[gaim-migrate @ 9942]
Christian Hammond <chipx86@chipx86.com>
parents:
8926
diff
changeset
|
1314 "able to successfully sign in.", minutes), |
c30d81b4dd22
[gaim-migrate @ 9942]
Christian Hammond <chipx86@chipx86.com>
parents:
8926
diff
changeset
|
1315 minutes); |
5333
bbbf616bd924
[gaim-migrate @ 5708]
Christian Hammond <chipx86@chipx86.com>
parents:
5327
diff
changeset
|
1316 default: |
bbbf616bd924
[gaim-migrate @ 5708]
Christian Hammond <chipx86@chipx86.com>
parents:
5327
diff
changeset
|
1317 break; |
bbbf616bd924
[gaim-migrate @ 5708]
Christian Hammond <chipx86@chipx86.com>
parents:
5327
diff
changeset
|
1318 } |
bbbf616bd924
[gaim-migrate @ 5708]
Christian Hammond <chipx86@chipx86.com>
parents:
5327
diff
changeset
|
1319 |
5436
ad445074d239
[gaim-migrate @ 5818]
Christian Hammond <chipx86@chipx86.com>
parents:
5406
diff
changeset
|
1320 if (*buf != '\0') |
8808
bbd8cdaf0ad5
[gaim-migrate @ 9570]
Christian Hammond <chipx86@chipx86.com>
parents:
8669
diff
changeset
|
1321 gaim_notify_info(cmdproc->session->account->gc, NULL, buf, NULL); |
5333
bbbf616bd924
[gaim-migrate @ 5708]
Christian Hammond <chipx86@chipx86.com>
parents:
5327
diff
changeset
|
1322 } |
bbbf616bd924
[gaim-migrate @ 5708]
Christian Hammond <chipx86@chipx86.com>
parents:
5327
diff
changeset
|
1323 |
bbbf616bd924
[gaim-migrate @ 5708]
Christian Hammond <chipx86@chipx86.com>
parents:
5327
diff
changeset
|
1324 g_hash_table_destroy(table); |
bbbf616bd924
[gaim-migrate @ 5708]
Christian Hammond <chipx86@chipx86.com>
parents:
5327
diff
changeset
|
1325 } |
5793
952710ac6635
[gaim-migrate @ 6218]
Christian Hammond <chipx86@chipx86.com>
parents:
5768
diff
changeset
|
1326 |
9193
502707ca1836
[gaim-migrate @ 9988]
Christian Hammond <chipx86@chipx86.com>
parents:
9158
diff
changeset
|
1327 void |
502707ca1836
[gaim-migrate @ 9988]
Christian Hammond <chipx86@chipx86.com>
parents:
9158
diff
changeset
|
1328 msn_notification_add_buddy(MsnNotification *notification, const char *list, |
502707ca1836
[gaim-migrate @ 9988]
Christian Hammond <chipx86@chipx86.com>
parents:
9158
diff
changeset
|
1329 const char *who, const char *store_name, |
502707ca1836
[gaim-migrate @ 9988]
Christian Hammond <chipx86@chipx86.com>
parents:
9158
diff
changeset
|
1330 int group_id) |
502707ca1836
[gaim-migrate @ 9988]
Christian Hammond <chipx86@chipx86.com>
parents:
9158
diff
changeset
|
1331 { |
502707ca1836
[gaim-migrate @ 9988]
Christian Hammond <chipx86@chipx86.com>
parents:
9158
diff
changeset
|
1332 MsnCmdProc *cmdproc; |
502707ca1836
[gaim-migrate @ 9988]
Christian Hammond <chipx86@chipx86.com>
parents:
9158
diff
changeset
|
1333 cmdproc = notification->servconn->cmdproc; |
502707ca1836
[gaim-migrate @ 9988]
Christian Hammond <chipx86@chipx86.com>
parents:
9158
diff
changeset
|
1334 |
9204
6478190b36a9
[gaim-migrate @ 9999]
Christian Hammond <chipx86@chipx86.com>
parents:
9198
diff
changeset
|
1335 if (group_id < 0 && !strcmp(list, "FL")) |
9194
364aa73323b5
[gaim-migrate @ 9989]
Christian Hammond <chipx86@chipx86.com>
parents:
9193
diff
changeset
|
1336 group_id = 0; |
364aa73323b5
[gaim-migrate @ 9989]
Christian Hammond <chipx86@chipx86.com>
parents:
9193
diff
changeset
|
1337 |
9204
6478190b36a9
[gaim-migrate @ 9999]
Christian Hammond <chipx86@chipx86.com>
parents:
9198
diff
changeset
|
1338 if (group_id >= 0) |
6478190b36a9
[gaim-migrate @ 9999]
Christian Hammond <chipx86@chipx86.com>
parents:
9198
diff
changeset
|
1339 { |
6478190b36a9
[gaim-migrate @ 9999]
Christian Hammond <chipx86@chipx86.com>
parents:
9198
diff
changeset
|
1340 msn_cmdproc_send(cmdproc, "ADD", "%s %s %s %d", |
6478190b36a9
[gaim-migrate @ 9999]
Christian Hammond <chipx86@chipx86.com>
parents:
9198
diff
changeset
|
1341 list, who, store_name, group_id); |
6478190b36a9
[gaim-migrate @ 9999]
Christian Hammond <chipx86@chipx86.com>
parents:
9198
diff
changeset
|
1342 } |
6478190b36a9
[gaim-migrate @ 9999]
Christian Hammond <chipx86@chipx86.com>
parents:
9198
diff
changeset
|
1343 else |
6478190b36a9
[gaim-migrate @ 9999]
Christian Hammond <chipx86@chipx86.com>
parents:
9198
diff
changeset
|
1344 { |
6478190b36a9
[gaim-migrate @ 9999]
Christian Hammond <chipx86@chipx86.com>
parents:
9198
diff
changeset
|
1345 msn_cmdproc_send(cmdproc, "ADD", "%s %s %s", list, who, store_name); |
6478190b36a9
[gaim-migrate @ 9999]
Christian Hammond <chipx86@chipx86.com>
parents:
9198
diff
changeset
|
1346 } |
9193
502707ca1836
[gaim-migrate @ 9988]
Christian Hammond <chipx86@chipx86.com>
parents:
9158
diff
changeset
|
1347 } |
502707ca1836
[gaim-migrate @ 9988]
Christian Hammond <chipx86@chipx86.com>
parents:
9158
diff
changeset
|
1348 |
502707ca1836
[gaim-migrate @ 9988]
Christian Hammond <chipx86@chipx86.com>
parents:
9158
diff
changeset
|
1349 void |
502707ca1836
[gaim-migrate @ 9988]
Christian Hammond <chipx86@chipx86.com>
parents:
9158
diff
changeset
|
1350 msn_notification_rem_buddy(MsnNotification *notification, const char *list, |
502707ca1836
[gaim-migrate @ 9988]
Christian Hammond <chipx86@chipx86.com>
parents:
9158
diff
changeset
|
1351 const char *who, int group_id) |
502707ca1836
[gaim-migrate @ 9988]
Christian Hammond <chipx86@chipx86.com>
parents:
9158
diff
changeset
|
1352 { |
502707ca1836
[gaim-migrate @ 9988]
Christian Hammond <chipx86@chipx86.com>
parents:
9158
diff
changeset
|
1353 MsnCmdProc *cmdproc; |
502707ca1836
[gaim-migrate @ 9988]
Christian Hammond <chipx86@chipx86.com>
parents:
9158
diff
changeset
|
1354 cmdproc = notification->servconn->cmdproc; |
502707ca1836
[gaim-migrate @ 9988]
Christian Hammond <chipx86@chipx86.com>
parents:
9158
diff
changeset
|
1355 |
502707ca1836
[gaim-migrate @ 9988]
Christian Hammond <chipx86@chipx86.com>
parents:
9158
diff
changeset
|
1356 if (group_id >= 0) |
502707ca1836
[gaim-migrate @ 9988]
Christian Hammond <chipx86@chipx86.com>
parents:
9158
diff
changeset
|
1357 { |
502707ca1836
[gaim-migrate @ 9988]
Christian Hammond <chipx86@chipx86.com>
parents:
9158
diff
changeset
|
1358 msn_cmdproc_send(cmdproc, "REM", "%s %s %d", list, who, group_id); |
502707ca1836
[gaim-migrate @ 9988]
Christian Hammond <chipx86@chipx86.com>
parents:
9158
diff
changeset
|
1359 } |
502707ca1836
[gaim-migrate @ 9988]
Christian Hammond <chipx86@chipx86.com>
parents:
9158
diff
changeset
|
1360 else |
502707ca1836
[gaim-migrate @ 9988]
Christian Hammond <chipx86@chipx86.com>
parents:
9158
diff
changeset
|
1361 { |
502707ca1836
[gaim-migrate @ 9988]
Christian Hammond <chipx86@chipx86.com>
parents:
9158
diff
changeset
|
1362 msn_cmdproc_send(cmdproc, "REM", "%s %s", list, who); |
502707ca1836
[gaim-migrate @ 9988]
Christian Hammond <chipx86@chipx86.com>
parents:
9158
diff
changeset
|
1363 } |
5309 | 1364 } |
1365 | |
10463 | 1366 /************************************************************************** |
1367 * Init | |
1368 **************************************************************************/ | |
10481 | 1369 |
8808
bbd8cdaf0ad5
[gaim-migrate @ 9570]
Christian Hammond <chipx86@chipx86.com>
parents:
8669
diff
changeset
|
1370 void |
bbd8cdaf0ad5
[gaim-migrate @ 9570]
Christian Hammond <chipx86@chipx86.com>
parents:
8669
diff
changeset
|
1371 msn_notification_init(void) |
bbd8cdaf0ad5
[gaim-migrate @ 9570]
Christian Hammond <chipx86@chipx86.com>
parents:
8669
diff
changeset
|
1372 { |
9193
502707ca1836
[gaim-migrate @ 9988]
Christian Hammond <chipx86@chipx86.com>
parents:
9158
diff
changeset
|
1373 /* TODO: check prp, blp */ |
502707ca1836
[gaim-migrate @ 9988]
Christian Hammond <chipx86@chipx86.com>
parents:
9158
diff
changeset
|
1374 |
8808
bbd8cdaf0ad5
[gaim-migrate @ 9570]
Christian Hammond <chipx86@chipx86.com>
parents:
8669
diff
changeset
|
1375 cbs_table = msn_table_new(); |
bbd8cdaf0ad5
[gaim-migrate @ 9570]
Christian Hammond <chipx86@chipx86.com>
parents:
8669
diff
changeset
|
1376 |
10310 | 1377 /* Synchronous */ |
9193
502707ca1836
[gaim-migrate @ 9988]
Christian Hammond <chipx86@chipx86.com>
parents:
9158
diff
changeset
|
1378 msn_table_add_cmd(cbs_table, "CHG", "CHG", chg_cmd); |
8808
bbd8cdaf0ad5
[gaim-migrate @ 9570]
Christian Hammond <chipx86@chipx86.com>
parents:
8669
diff
changeset
|
1379 msn_table_add_cmd(cbs_table, "CHG", "ILN", iln_cmd); |
bbd8cdaf0ad5
[gaim-migrate @ 9570]
Christian Hammond <chipx86@chipx86.com>
parents:
8669
diff
changeset
|
1380 msn_table_add_cmd(cbs_table, "ADD", "ADD", add_cmd); |
bbd8cdaf0ad5
[gaim-migrate @ 9570]
Christian Hammond <chipx86@chipx86.com>
parents:
8669
diff
changeset
|
1381 msn_table_add_cmd(cbs_table, "ADD", "ILN", iln_cmd); |
bbd8cdaf0ad5
[gaim-migrate @ 9570]
Christian Hammond <chipx86@chipx86.com>
parents:
8669
diff
changeset
|
1382 msn_table_add_cmd(cbs_table, "REM", "REM", rem_cmd); |
bbd8cdaf0ad5
[gaim-migrate @ 9570]
Christian Hammond <chipx86@chipx86.com>
parents:
8669
diff
changeset
|
1383 msn_table_add_cmd(cbs_table, "USR", "USR", usr_cmd); |
bbd8cdaf0ad5
[gaim-migrate @ 9570]
Christian Hammond <chipx86@chipx86.com>
parents:
8669
diff
changeset
|
1384 msn_table_add_cmd(cbs_table, "USR", "XFR", xfr_cmd); |
bbd8cdaf0ad5
[gaim-migrate @ 9570]
Christian Hammond <chipx86@chipx86.com>
parents:
8669
diff
changeset
|
1385 msn_table_add_cmd(cbs_table, "SYN", "SYN", syn_cmd); |
bbd8cdaf0ad5
[gaim-migrate @ 9570]
Christian Hammond <chipx86@chipx86.com>
parents:
8669
diff
changeset
|
1386 msn_table_add_cmd(cbs_table, "CVR", "CVR", cvr_cmd); |
bbd8cdaf0ad5
[gaim-migrate @ 9570]
Christian Hammond <chipx86@chipx86.com>
parents:
8669
diff
changeset
|
1387 msn_table_add_cmd(cbs_table, "VER", "VER", ver_cmd); |
bbd8cdaf0ad5
[gaim-migrate @ 9570]
Christian Hammond <chipx86@chipx86.com>
parents:
8669
diff
changeset
|
1388 msn_table_add_cmd(cbs_table, "REA", "REA", rea_cmd); |
10833 | 1389 msn_table_add_cmd(cbs_table, "PRP", "PRP", prp_cmd); |
8808
bbd8cdaf0ad5
[gaim-migrate @ 9570]
Christian Hammond <chipx86@chipx86.com>
parents:
8669
diff
changeset
|
1390 /* msn_table_add_cmd(cbs_table, "BLP", "BLP", blp_cmd); */ |
9194
364aa73323b5
[gaim-migrate @ 9989]
Christian Hammond <chipx86@chipx86.com>
parents:
9193
diff
changeset
|
1391 msn_table_add_cmd(cbs_table, "BLP", "BLP", NULL); |
8808
bbd8cdaf0ad5
[gaim-migrate @ 9570]
Christian Hammond <chipx86@chipx86.com>
parents:
8669
diff
changeset
|
1392 msn_table_add_cmd(cbs_table, "REG", "REG", reg_cmd); |
bbd8cdaf0ad5
[gaim-migrate @ 9570]
Christian Hammond <chipx86@chipx86.com>
parents:
8669
diff
changeset
|
1393 msn_table_add_cmd(cbs_table, "ADG", "ADG", adg_cmd); |
bbd8cdaf0ad5
[gaim-migrate @ 9570]
Christian Hammond <chipx86@chipx86.com>
parents:
8669
diff
changeset
|
1394 msn_table_add_cmd(cbs_table, "RMG", "RMG", rmg_cmd); |
bbd8cdaf0ad5
[gaim-migrate @ 9570]
Christian Hammond <chipx86@chipx86.com>
parents:
8669
diff
changeset
|
1395 msn_table_add_cmd(cbs_table, "XFR", "XFR", xfr_cmd); |
bbd8cdaf0ad5
[gaim-migrate @ 9570]
Christian Hammond <chipx86@chipx86.com>
parents:
8669
diff
changeset
|
1396 |
10310 | 1397 /* Asynchronous */ |
8808
bbd8cdaf0ad5
[gaim-migrate @ 9570]
Christian Hammond <chipx86@chipx86.com>
parents:
8669
diff
changeset
|
1398 msn_table_add_cmd(cbs_table, NULL, "IPG", ipg_cmd); |
bbd8cdaf0ad5
[gaim-migrate @ 9570]
Christian Hammond <chipx86@chipx86.com>
parents:
8669
diff
changeset
|
1399 msn_table_add_cmd(cbs_table, NULL, "MSG", msg_cmd); |
bbd8cdaf0ad5
[gaim-migrate @ 9570]
Christian Hammond <chipx86@chipx86.com>
parents:
8669
diff
changeset
|
1400 msn_table_add_cmd(cbs_table, NULL, "NOT", not_cmd); |
bbd8cdaf0ad5
[gaim-migrate @ 9570]
Christian Hammond <chipx86@chipx86.com>
parents:
8669
diff
changeset
|
1401 |
bbd8cdaf0ad5
[gaim-migrate @ 9570]
Christian Hammond <chipx86@chipx86.com>
parents:
8669
diff
changeset
|
1402 msn_table_add_cmd(cbs_table, NULL, "CHL", chl_cmd); |
bbd8cdaf0ad5
[gaim-migrate @ 9570]
Christian Hammond <chipx86@chipx86.com>
parents:
8669
diff
changeset
|
1403 msn_table_add_cmd(cbs_table, NULL, "REM", rem_cmd); |
bbd8cdaf0ad5
[gaim-migrate @ 9570]
Christian Hammond <chipx86@chipx86.com>
parents:
8669
diff
changeset
|
1404 msn_table_add_cmd(cbs_table, NULL, "ADD", add_cmd); |
bbd8cdaf0ad5
[gaim-migrate @ 9570]
Christian Hammond <chipx86@chipx86.com>
parents:
8669
diff
changeset
|
1405 |
bbd8cdaf0ad5
[gaim-migrate @ 9570]
Christian Hammond <chipx86@chipx86.com>
parents:
8669
diff
changeset
|
1406 msn_table_add_cmd(cbs_table, NULL, "QRY", NULL); |
bbd8cdaf0ad5
[gaim-migrate @ 9570]
Christian Hammond <chipx86@chipx86.com>
parents:
8669
diff
changeset
|
1407 msn_table_add_cmd(cbs_table, NULL, "QNG", NULL); |
bbd8cdaf0ad5
[gaim-migrate @ 9570]
Christian Hammond <chipx86@chipx86.com>
parents:
8669
diff
changeset
|
1408 msn_table_add_cmd(cbs_table, NULL, "FLN", fln_cmd); |
bbd8cdaf0ad5
[gaim-migrate @ 9570]
Christian Hammond <chipx86@chipx86.com>
parents:
8669
diff
changeset
|
1409 msn_table_add_cmd(cbs_table, NULL, "NLN", nln_cmd); |
8832
c313e3b1f2c0
[gaim-migrate @ 9596]
Christian Hammond <chipx86@chipx86.com>
parents:
8808
diff
changeset
|
1410 msn_table_add_cmd(cbs_table, NULL, "ILN", iln_cmd); |
8808
bbd8cdaf0ad5
[gaim-migrate @ 9570]
Christian Hammond <chipx86@chipx86.com>
parents:
8669
diff
changeset
|
1411 msn_table_add_cmd(cbs_table, NULL, "OUT", out_cmd); |
bbd8cdaf0ad5
[gaim-migrate @ 9570]
Christian Hammond <chipx86@chipx86.com>
parents:
8669
diff
changeset
|
1412 msn_table_add_cmd(cbs_table, NULL, "RNG", rng_cmd); |
bbd8cdaf0ad5
[gaim-migrate @ 9570]
Christian Hammond <chipx86@chipx86.com>
parents:
8669
diff
changeset
|
1413 |
bbd8cdaf0ad5
[gaim-migrate @ 9570]
Christian Hammond <chipx86@chipx86.com>
parents:
8669
diff
changeset
|
1414 msn_table_add_cmd(cbs_table, NULL, "URL", url_cmd); |
9194
364aa73323b5
[gaim-migrate @ 9989]
Christian Hammond <chipx86@chipx86.com>
parents:
9193
diff
changeset
|
1415 |
10043
700f8fb9e581
[gaim-migrate @ 11002]
Luke Schierer <lschiere@pidgin.im>
parents:
10010
diff
changeset
|
1416 msn_table_add_cmd(cbs_table, "fallback", "XFR", xfr_cmd); |
8808
bbd8cdaf0ad5
[gaim-migrate @ 9570]
Christian Hammond <chipx86@chipx86.com>
parents:
8669
diff
changeset
|
1417 |
bbd8cdaf0ad5
[gaim-migrate @ 9570]
Christian Hammond <chipx86@chipx86.com>
parents:
8669
diff
changeset
|
1418 msn_table_add_error(cbs_table, "ADD", add_error); |
10451 | 1419 msn_table_add_error(cbs_table, "REG", reg_error); |
1420 msn_table_add_error(cbs_table, "RMG", rmg_error); | |
9193
502707ca1836
[gaim-migrate @ 9988]
Christian Hammond <chipx86@chipx86.com>
parents:
9158
diff
changeset
|
1421 /* msn_table_add_error(cbs_table, "REA", rea_error); */ |
10568 | 1422 msn_table_add_error(cbs_table, "USR", usr_error); |
10403 | 1423 |
8808
bbd8cdaf0ad5
[gaim-migrate @ 9570]
Christian Hammond <chipx86@chipx86.com>
parents:
8669
diff
changeset
|
1424 msn_table_add_msg_type(cbs_table, |
9158
c30d81b4dd22
[gaim-migrate @ 9942]
Christian Hammond <chipx86@chipx86.com>
parents:
8926
diff
changeset
|
1425 "text/x-msmsgsprofile", |
c30d81b4dd22
[gaim-migrate @ 9942]
Christian Hammond <chipx86@chipx86.com>
parents:
8926
diff
changeset
|
1426 profile_msg); |
8808
bbd8cdaf0ad5
[gaim-migrate @ 9570]
Christian Hammond <chipx86@chipx86.com>
parents:
8669
diff
changeset
|
1427 msn_table_add_msg_type(cbs_table, |
9158
c30d81b4dd22
[gaim-migrate @ 9942]
Christian Hammond <chipx86@chipx86.com>
parents:
8926
diff
changeset
|
1428 "text/x-msmsgsinitialemailnotification", |
c30d81b4dd22
[gaim-migrate @ 9942]
Christian Hammond <chipx86@chipx86.com>
parents:
8926
diff
changeset
|
1429 initial_email_msg); |
8808
bbd8cdaf0ad5
[gaim-migrate @ 9570]
Christian Hammond <chipx86@chipx86.com>
parents:
8669
diff
changeset
|
1430 msn_table_add_msg_type(cbs_table, |
9158
c30d81b4dd22
[gaim-migrate @ 9942]
Christian Hammond <chipx86@chipx86.com>
parents:
8926
diff
changeset
|
1431 "text/x-msmsgsemailnotification", |
c30d81b4dd22
[gaim-migrate @ 9942]
Christian Hammond <chipx86@chipx86.com>
parents:
8926
diff
changeset
|
1432 email_msg); |
8808
bbd8cdaf0ad5
[gaim-migrate @ 9570]
Christian Hammond <chipx86@chipx86.com>
parents:
8669
diff
changeset
|
1433 msn_table_add_msg_type(cbs_table, |
9158
c30d81b4dd22
[gaim-migrate @ 9942]
Christian Hammond <chipx86@chipx86.com>
parents:
8926
diff
changeset
|
1434 "application/x-msmsgssystemmessage", |
c30d81b4dd22
[gaim-migrate @ 9942]
Christian Hammond <chipx86@chipx86.com>
parents:
8926
diff
changeset
|
1435 system_msg); |
8808
bbd8cdaf0ad5
[gaim-migrate @ 9570]
Christian Hammond <chipx86@chipx86.com>
parents:
8669
diff
changeset
|
1436 } |
bbd8cdaf0ad5
[gaim-migrate @ 9570]
Christian Hammond <chipx86@chipx86.com>
parents:
8669
diff
changeset
|
1437 |
bbd8cdaf0ad5
[gaim-migrate @ 9570]
Christian Hammond <chipx86@chipx86.com>
parents:
8669
diff
changeset
|
1438 void |
bbd8cdaf0ad5
[gaim-migrate @ 9570]
Christian Hammond <chipx86@chipx86.com>
parents:
8669
diff
changeset
|
1439 msn_notification_end(void) |
bbd8cdaf0ad5
[gaim-migrate @ 9570]
Christian Hammond <chipx86@chipx86.com>
parents:
8669
diff
changeset
|
1440 { |
bbd8cdaf0ad5
[gaim-migrate @ 9570]
Christian Hammond <chipx86@chipx86.com>
parents:
8669
diff
changeset
|
1441 msn_table_destroy(cbs_table); |
bbd8cdaf0ad5
[gaim-migrate @ 9570]
Christian Hammond <chipx86@chipx86.com>
parents:
8669
diff
changeset
|
1442 } |