changeset 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 3bc7bd545a0b
children caca74a75e4c
files src/protocols/oscar/email.c src/protocols/oscar/oscar.c
diffstat 2 files changed, 17 insertions(+), 1 deletions(-) [+]
line wrap: on
line diff
--- a/src/protocols/oscar/email.c	Sat Oct 18 02:43:41 2003 +0000
+++ b/src/protocols/oscar/email.c	Sat Oct 18 03:34:14 2003 +0000
@@ -82,6 +82,8 @@
 	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 @@
 	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);
 
--- a/src/protocols/oscar/oscar.c	Sat Oct 18 02:43:41 2003 +0000
+++ b/src/protocols/oscar/oscar.c	Sat Oct 18 03:34:14 2003 +0000
@@ -3394,10 +3394,13 @@
 	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 @@
 			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;
 }