comparison src/protocols/msn/msn.c @ 2932:3827e4cd665c

[gaim-migrate @ 2945] I kind of like this a little more... for now? committer: Tailor Script <tailor@pidgin.im>
author Rob Flynn <gaim@robflynn.com>
date Wed, 16 Jan 2002 17:55:57 +0000
parents fccda160c078
children 7a32dca869a8
comparison
equal deleted inserted replaced
2931:10a2d4d5bcf2 2932:3827e4cd665c
19 "Content-Type: text/plain; charset=UTF-8\r\n" \ 19 "Content-Type: text/plain; charset=UTF-8\r\n" \
20 "User-Agent: Gaim/" VERSION "\r\n" \ 20 "User-Agent: Gaim/" VERSION "\r\n" \
21 "X-MMS-IM-Format: FN=MS%20Sans%20Serif; EF=; CO=0; PF=0\r\n\r\n" 21 "X-MMS-IM-Format: FN=MS%20Sans%20Serif; EF=; CO=0; PF=0\r\n\r\n"
22 22
23 #define HOTMAIL_URL "http://www.hotmail.com/cgi-bin/folders" 23 #define HOTMAIL_URL "http://www.hotmail.com/cgi-bin/folders"
24 #define PASSPORT_URL "http://lc1.law13.hotmail.passport.com/cgi-bin/dologin?login="
24 25
25 #define MSN_ONLINE 1 26 #define MSN_ONLINE 1
26 #define MSN_BUSY 2 27 #define MSN_BUSY 2
27 #define MSN_IDLE 3 28 #define MSN_IDLE 3
28 #define MSN_BRB 4 29 #define MSN_BRB 4
283 return msg; 284 return msg;
284 } 285 }
285 286
286 static void handle_hotmail(struct gaim_connection *gc, char *data) 287 static void handle_hotmail(struct gaim_connection *gc, char *data)
287 { 288 {
289 char login_url[2048];
290
291 snprintf(login_url, sizeof(login_url), "%s%s&passwd=%s", PASSPORT_URL, gc->username, gc->password);
292
288 if (strstr(data, "Content-Type: text/x-msmsgsinitialemailnotification;")) { 293 if (strstr(data, "Content-Type: text/x-msmsgsinitialemailnotification;")) {
289 char *x = strstr(data, "Inbox-Unread:"); 294 char *x = strstr(data, "Inbox-Unread:");
290 if (!x) return; 295 if (!x) return;
291 x += strlen("Inbox-Unread: "); 296 x += strlen("Inbox-Unread: ");
292 connection_has_mail(gc, atoi(x), NULL, NULL, HOTMAIL_URL); 297 connection_has_mail(gc, atoi(x), NULL, NULL, login_url);
293 } else if (strstr(data, "Content-Type: text/x-msmsgsemailnotification;")) { 298 } else if (strstr(data, "Content-Type: text/x-msmsgsemailnotification;")) {
294 char *from = strstr(data, "From:"); 299 char *from = strstr(data, "From:");
295 char *subject = strstr(data, "Subject:"); 300 char *subject = strstr(data, "Subject:");
296 char *x; 301 char *x;
297 if (!from || !subject) { 302 if (!from || !subject) {
298 connection_has_mail(gc, 1, NULL, NULL, HOTMAIL_URL); 303 connection_has_mail(gc, 1, NULL, NULL, login_url);
299 return; 304 return;
300 } 305 }
301 from += strlen("From: "); 306 from += strlen("From: ");
302 x = strstr(from, "\r\n"); *x = 0; 307 x = strstr(from, "\r\n"); *x = 0;
303 subject += strlen("Subject: "); 308 subject += strlen("Subject: ");
304 x = strstr(subject, "\r\n"); *x = 0; 309 x = strstr(subject, "\r\n"); *x = 0;
305 connection_has_mail(gc, -1, from, subject, HOTMAIL_URL); 310 connection_has_mail(gc, -1, from, subject, login_url);
306 } 311 }
307 } 312 }
308 313
309 static struct msn_switchboard *msn_find_switch(struct gaim_connection *gc, char *id) 314 static struct msn_switchboard *msn_find_switch(struct gaim_connection *gc, char *id)
310 { 315 {