Update of /cvsroot/gaim/gaim/src/protocols/oscar
In directory sc8-pr-cvs1:/tmp/cvs-serv2360/src/protocols/oscar
Modified Files:
email.c oscar.c
Log Message:
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.
Index: email.c
===================================================================
RCS file: /cvsroot/gaim/gaim/src/protocols/oscar/email.c,v
retrieving revision 1.10
retrieving revision 1.11
diff -u -d -p -r1.10 -r1.11
--- email.c 16 Oct 2003 06:12:43 -0000 1.10
+++ email.c 18 Oct 2003 03:34:14 -0000 1.11
@@ -82,6 +82,8 @@ static int parseinfo(aim_session_t *sess
fu8_t *cookie8, *cookie16;
int tmp, havenewmail = 0; /* Used to tell the client we have _new_ mail */
+ char *alertitle = NULL, *alerturl = NULL;
+
cookie8 = aimbs_getraw(bs, 8); /* Possibly the code used to log you in to mail? */
cookie16 = aimbs_getraw(bs, 16); /* Mail cookie sent above */
@@ -126,8 +128,11 @@ static int parseinfo(aim_session_t *sess
new->domain = aim_tlv_getstr(tlvlist, 0x0082, 1);
new->flag = aim_tlv_get16(tlvlist, 0x0084, 1);
+ alertitle = aim_tlv_getstr(tlvlist, 0x0005, 1);
+ alerturl = aim_tlv_getstr(tlvlist, 0x000d, 1);
+
if ((userfunc = aim_callhandler(sess, rx->conn, snac->family, snac->subtype)))
- ret = userfunc(sess, rx, new, havenewmail);
+ ret = userfunc(sess, rx, new, havenewmail, alertitle, alerturl + 2);
aim_tlvlist_free(&tlvlist);
Index: oscar.c
===================================================================
RCS file: /cvsroot/gaim/gaim/src/protocols/oscar/oscar.c,v
retrieving revision 1.482
retrieving revision 1.483
diff -u -d -p -r1.482 -r1.483
--- oscar.c 16 Oct 2003 22:21:55 -0000 1.482
+++ oscar.c 18 Oct 2003 03:34:14 -0000 1.483
@@ -3394,10 +3394,13 @@ static int gaim_email_parseupdate(aim_se
GaimConnection *gc = sess->aux_data;
struct aim_emailinfo *emailinfo;
int havenewmail;
+ char *alertitle, *alerturl;
va_start(ap, fr);
emailinfo = va_arg(ap, struct aim_emailinfo *);
havenewmail = va_arg(ap, int);
+ alertitle = va_arg(ap, char*);
+ alerturl = va_arg(ap, char*);
va_end(ap);
if (emailinfo && gaim_account_get_check_mail(gc->account)) {
@@ -3406,6 +3409,14 @@ static int gaim_email_parseupdate(aim_se
gaim_notify_emails(gc, emailinfo->nummsgs, FALSE, NULL, NULL, (const char **)&to, (const char **)&emailinfo->url, NULL, NULL);
g_free(to);
}
+
+ if (alertitle) {
+ gaim_debug(GAIM_DEBUG_MISC, "oscar", "Got an alert '%s' %s\n", alertitle, alerturl);
+ g_free(alertitle);
+ }
+ if (alerturl)
+ g_free(alerturl);
+
return 1;
}
|