changeset 15629:68798ffeb321

merge of '12df03445c45ddd504a76c52aa7a78e633426dbe' and 'd7cd3990c80b359b4542dfad2ffc0a3f4fb3cac7'
author Daniel Atallah <daniel.atallah@gmail.com>
date Wed, 14 Feb 2007 02:28:44 +0000
parents 0b16a4aa4e2b (current diff) 2f0f563b3579 (diff)
children 593534b724b0 a830f9756f23
files
diffstat 3 files changed, 24 insertions(+), 11 deletions(-) [+]
line wrap: on
line diff
--- a/libpurple/protocols/oscar/family_oservice.c	Tue Feb 13 22:19:26 2007 +0000
+++ b/libpurple/protocols/oscar/family_oservice.c	Wed Feb 14 02:28:44 2007 +0000
@@ -800,7 +800,7 @@
 int
 aim_srv_setextrainfo(OscarData *od,
 		gboolean seticqstatus, guint32 icqstatus,
-		gboolean setavailmsg, const char *availmsg)
+		gboolean setavailmsg, const char *availmsg, const char *itmsurl)
 {
 	FlapConnection *conn;
 	FlapFrame *frame;
@@ -828,20 +828,29 @@
 
 	if (setavailmsg)
 	{
-		int availmsglen;
+		int availmsglen, itmsurllen;
 		ByteStream tmpbs;
 
 		availmsglen = (availmsg != NULL) ? strlen(availmsg) : 0;
+		itmsurllen = (itmsurl != NULL) ? strlen(itmsurl) : 0;
 
-		byte_stream_new(&tmpbs, availmsglen + 8);
+		byte_stream_new(&tmpbs, availmsglen + 8 + itmsurllen + 8);
 		byte_stream_put16(&tmpbs, 0x0002);
-		byte_stream_put8(&tmpbs, 0x04);
+		byte_stream_put8(&tmpbs, 0x04); /* Flags */
 		byte_stream_put8(&tmpbs, availmsglen + 4);
 		byte_stream_put16(&tmpbs, availmsglen);
 		if (availmsglen > 0)
 			byte_stream_putstr(&tmpbs, availmsg);
 		byte_stream_put16(&tmpbs, 0x0000);
 
+		byte_stream_put16(&tmpbs, 0x0009);
+		byte_stream_put8(&tmpbs, 0x04); /* Flags */
+		byte_stream_put8(&tmpbs, itmsurllen + 4);
+		byte_stream_put16(&tmpbs, itmsurllen);
+		if (itmsurllen > 0)
+			byte_stream_putstr(&tmpbs, itmsurl);
+		byte_stream_put16(&tmpbs, 0x0000);
+
 		aim_tlvlist_add_raw(&tl, 0x001d,
 				byte_stream_curpos(&tmpbs), tmpbs.data);
 		g_free(tmpbs.data);
--- a/libpurple/protocols/oscar/oscar.c	Tue Feb 13 22:19:26 2007 +0000
+++ b/libpurple/protocols/oscar/oscar.c	Wed Feb 14 02:28:44 2007 +0000
@@ -3569,7 +3569,7 @@
 	GaimConnection *gc;
 	GaimAccount *account;
 	GaimStatus *status;
-	const char *message;
+	const char *message, *itmsurl;
 	char *tmp;
 	va_list ap;
 	guint16 maxpermits, maxdenies;
@@ -3605,7 +3605,8 @@
 	else
 		message = NULL;
 	tmp = gaim_markup_strip_html(message);
-	aim_srv_setextrainfo(od, FALSE, 0, TRUE, tmp);
+	itmsurl = gaim_status_get_attr_string(status, "itmsurl");
+	aim_srv_setextrainfo(od, FALSE, 0, TRUE, tmp, itmsurl);
 	g_free(tmp);
 
 	aim_srv_setidle(od, 0);
@@ -4411,7 +4412,7 @@
 	else if (!strcmp(status_id, OSCAR_STATUS_ID_CUSTOM))
 		data |= AIM_ICQ_STATE_OUT | AIM_ICQ_STATE_AWAY;
 
-	aim_srv_setextrainfo(od, TRUE, data, FALSE, NULL);
+	aim_srv_setextrainfo(od, TRUE, data, FALSE, NULL, NULL);
 }
 
 static void
@@ -4477,7 +4478,7 @@
 	}
 	else if (primitive == GAIM_STATUS_AVAILABLE)
 	{
-		const char *status_html;
+		const char *status_html, *itmsurl;
 		char *status_text = NULL;
 
 		status_html = gaim_status_get_attr_string(status, "message");
@@ -4491,8 +4492,9 @@
 				strcpy(tmp, "...");
 			}
 		}
-
-		aim_srv_setextrainfo(od, FALSE, 0, TRUE, status_text);
+		itmsurl = gaim_status_get_attr_string(status, "itmsurl");
+
+		aim_srv_setextrainfo(od, FALSE, 0, TRUE, status_text, itmsurl);
 		g_free(status_text);
 
 		/* This is needed for us to un-set any previous away message. */
@@ -5702,6 +5704,8 @@
 										   OSCAR_STATUS_ID_AVAILABLE,
 										   NULL, TRUE, TRUE, FALSE,
 										   "message", _("Message"),
+										   gaim_value_new(GAIM_TYPE_STRING),
+										   "itmsurl", _("iTunes Music Store Link"),
 										   gaim_value_new(GAIM_TYPE_STRING), NULL);
 	status_types = g_list_prepend(status_types, type);
 
--- a/libpurple/protocols/oscar/oscar.h	Tue Feb 13 22:19:26 2007 +0000
+++ b/libpurple/protocols/oscar/oscar.h	Wed Feb 14 02:28:44 2007 +0000
@@ -625,7 +625,7 @@
 /* 0x0014 */ void aim_srv_setprivacyflags(OscarData *od, FlapConnection *conn, guint32);
 /* 0x0016 */ void aim_srv_nop(OscarData *od, FlapConnection *conn);
 /* 0x0017 */ void aim_srv_setversions(OscarData *od, FlapConnection *conn);
-/* 0x001e */ int aim_srv_setextrainfo(OscarData *od, gboolean seticqstatus, guint32 icqstatus, gboolean setavailmsg, const char *availmsg);
+/* 0x001e */ int aim_srv_setextrainfo(OscarData *od, gboolean seticqstatus, guint32 icqstatus, gboolean setavailmsg, const char *availmsg, const char *itmsurl);
 
 
 void aim_bos_reqrights(OscarData *od, FlapConnection *conn);