comparison src/protocols/oscar/oscar.c @ 7297:ceda503e55a6

[gaim-migrate @ 7881] This is AIM Alerts and Reminders (alerts.aol.com). I think this is kinda a cool thing. And it was totally easy to do. Unfortunately, though, it seems that AOL won't give your browser the alert unless you send an X-Aim header in your HTML request. I could parse the HTML myself, but it has, like forms and stuff in it... and some alerts have images... it wouldn't be worth it. So this just prints stuff to the debug window. Maybe someday someone will be able to do something with it. Mark's going to make sure I didn't screw anything up. committer: Tailor Script <tailor@pidgin.im>
author Sean Egan <seanegan@gmail.com>
date Sat, 18 Oct 2003 03:34:14 +0000
parents a50eea7628cb
children 0ed0ac132b1b
comparison
equal deleted inserted replaced
7296:3bc7bd545a0b 7297:ceda503e55a6
3392 static int gaim_email_parseupdate(aim_session_t *sess, aim_frame_t *fr, ...) { 3392 static int gaim_email_parseupdate(aim_session_t *sess, aim_frame_t *fr, ...) {
3393 va_list ap; 3393 va_list ap;
3394 GaimConnection *gc = sess->aux_data; 3394 GaimConnection *gc = sess->aux_data;
3395 struct aim_emailinfo *emailinfo; 3395 struct aim_emailinfo *emailinfo;
3396 int havenewmail; 3396 int havenewmail;
3397 char *alertitle, *alerturl;
3397 3398
3398 va_start(ap, fr); 3399 va_start(ap, fr);
3399 emailinfo = va_arg(ap, struct aim_emailinfo *); 3400 emailinfo = va_arg(ap, struct aim_emailinfo *);
3400 havenewmail = va_arg(ap, int); 3401 havenewmail = va_arg(ap, int);
3402 alertitle = va_arg(ap, char*);
3403 alerturl = va_arg(ap, char*);
3401 va_end(ap); 3404 va_end(ap);
3402 3405
3403 if (emailinfo && gaim_account_get_check_mail(gc->account)) { 3406 if (emailinfo && gaim_account_get_check_mail(gc->account)) {
3404 gchar *to = g_strdup_printf("%s@%s", gaim_account_get_username(gaim_connection_get_account(gc)), emailinfo->domain); 3407 gchar *to = g_strdup_printf("%s@%s", gaim_account_get_username(gaim_connection_get_account(gc)), emailinfo->domain);
3405 if (emailinfo->unread && havenewmail) 3408 if (emailinfo->unread && havenewmail)
3406 gaim_notify_emails(gc, emailinfo->nummsgs, FALSE, NULL, NULL, (const char **)&to, (const char **)&emailinfo->url, NULL, NULL); 3409 gaim_notify_emails(gc, emailinfo->nummsgs, FALSE, NULL, NULL, (const char **)&to, (const char **)&emailinfo->url, NULL, NULL);
3407 g_free(to); 3410 g_free(to);
3408 } 3411 }
3412
3413 if (alertitle) {
3414 gaim_debug(GAIM_DEBUG_MISC, "oscar", "Got an alert '%s' %s\n", alertitle, alerturl);
3415 g_free(alertitle);
3416 }
3417 if (alerturl)
3418 g_free(alerturl);
3419
3409 3420
3410 return 1; 3421 return 1;
3411 } 3422 }
3412 3423
3413 static int gaim_icon_error(aim_session_t *sess, aim_frame_t *fr, ...) { 3424 static int gaim_icon_error(aim_session_t *sess, aim_frame_t *fr, ...) {