| 17 #define MSN_BUF_LEN 8192 |
17 #define MSN_BUF_LEN 8192 |
| 18 #define MIME_HEADER "MIME-Version: 1.0\r\n" \ |
18 #define MIME_HEADER "MIME-Version: 1.0\r\n" \ |
| 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 |
| |
23 #define HOTMAIL_URL "http://www.hotmail.com/cgi-bin/folders" |
| 22 |
24 |
| 23 #define MSN_ONLINE 1 |
25 #define MSN_ONLINE 1 |
| 24 #define MSN_BUSY 2 |
26 #define MSN_BUSY 2 |
| 25 #define MSN_IDLE 3 |
27 #define MSN_IDLE 3 |
| 26 #define MSN_BRB 4 |
28 #define MSN_BRB 4 |
| 267 { |
269 { |
| 268 if (strstr(data, "Content-Type: text/x-msmsgsinitialemailnotification;")) { |
270 if (strstr(data, "Content-Type: text/x-msmsgsinitialemailnotification;")) { |
| 269 char *x = strstr(data, "Inbox-Unread:"); |
271 char *x = strstr(data, "Inbox-Unread:"); |
| 270 if (!x) return; |
272 if (!x) return; |
| 271 x += strlen("Inbox-Unread: "); |
273 x += strlen("Inbox-Unread: "); |
| 272 connection_has_mail(gc, atoi(x), NULL, NULL); |
274 connection_has_mail(gc, atoi(x), NULL, NULL, HOTMAIL_URL); |
| 273 } else if (strstr(data, "Content-Type: text/x-msmsgsemailnotification;")) { |
275 } else if (strstr(data, "Content-Type: text/x-msmsgsemailnotification;")) { |
| 274 char *from = strstr(data, "From:"); |
276 char *from = strstr(data, "From:"); |
| 275 char *subject = strstr(data, "Subject:"); |
277 char *subject = strstr(data, "Subject:"); |
| 276 char *x; |
278 char *x; |
| 277 if (!from || !subject) { |
279 if (!from || !subject) { |
| 278 connection_has_mail(gc, 1, NULL, NULL); |
280 connection_has_mail(gc, 1, NULL, NULL, HOTMAIL_URL); |
| 279 return; |
281 return; |
| 280 } |
282 } |
| 281 from += strlen("From: "); |
283 from += strlen("From: "); |
| 282 x = strstr(from, "\r\n"); *x = 0; |
284 x = strstr(from, "\r\n"); *x = 0; |
| 283 subject += strlen("Subject: "); |
285 subject += strlen("Subject: "); |
| 284 x = strstr(subject, "\r\n"); *x = 0; |
286 x = strstr(subject, "\r\n"); *x = 0; |
| 285 connection_has_mail(gc, -1, from, subject); |
287 connection_has_mail(gc, -1, from, subject, HOTMAIL_URL); |
| 286 } |
288 } |
| 287 } |
289 } |
| 288 |
290 |
| 289 static struct msn_switchboard *msn_find_switch(struct gaim_connection *gc, char *id) |
291 static struct msn_switchboard *msn_find_switch(struct gaim_connection *gc, char *id) |
| 290 { |
292 { |
| 829 } |
831 } |
| 830 |
832 |
| 831 serv_got_update(gc, user, 1, 0, 0, 0, status, 0); |
833 serv_got_update(gc, user, 1, 0, 0, 0, status, 0); |
| 832 } else if (!g_strncasecmp(buf, "OUT", 3)) { |
834 } else if (!g_strncasecmp(buf, "OUT", 3)) { |
| 833 } else if (!g_strncasecmp(buf, "PRP", 3)) { |
835 } else if (!g_strncasecmp(buf, "PRP", 3)) { |
| |
836 } else if (!g_strncasecmp(buf, "QNG", 3)) { |
| 834 } else if (!g_strncasecmp(buf, "QRY", 3)) { |
837 } else if (!g_strncasecmp(buf, "QRY", 3)) { |
| 835 } else if (!g_strncasecmp(buf, "REA", 3)) { |
838 } else if (!g_strncasecmp(buf, "REA", 3)) { |
| 836 char *friend, *tmp = buf; |
839 char *friend, *tmp = buf; |
| 837 |
840 |
| 838 GET_NEXT(tmp); |
841 GET_NEXT(tmp); |
| 1436 } |
1439 } |
| 1437 |
1440 |
| 1438 static void msn_do_action(struct gaim_connection *gc, char *act) |
1441 static void msn_do_action(struct gaim_connection *gc, char *act) |
| 1439 { |
1442 { |
| 1440 if (!strcmp(act, "Set Friendly Name")) { |
1443 if (!strcmp(act, "Set Friendly Name")) { |
| 1441 do_prompt_dialog("Set Friendly Name:", gc, msn_act_id, NULL); |
1444 do_prompt_dialog("Set Friendly Name:", gc->displayname, gc, msn_act_id, NULL); |
| 1442 } |
1445 } |
| 1443 } |
1446 } |
| 1444 |
1447 |
| 1445 static GList *msn_actions() |
1448 static GList *msn_actions() |
| 1446 { |
1449 { |