changeset 30371:1a81e5b64779

Adium guys need the itmsurl stuff, which I erroneously removed without thinking twice. Shame on me.
author ivan.komarov@soc.pidgin.im
date Thu, 24 Jun 2010 16:56:01 +0000
parents 47392e1f491d
children 5bfef3338383
files libpurple/protocols/oscar/family_oservice.c libpurple/protocols/oscar/oscar.c libpurple/protocols/oscar/oscar.h
diffstat 3 files changed, 16 insertions(+), 9 deletions(-) [+]
line wrap: on
line diff
--- a/libpurple/protocols/oscar/family_oservice.c	Wed Jun 23 22:32:45 2010 +0000
+++ b/libpurple/protocols/oscar/family_oservice.c	Thu Jun 24 16:56:01 2010 +0000
@@ -883,7 +883,7 @@
 int
 aim_srv_setextrainfo(OscarData *od,
 		gboolean seticqstatus, guint32 icqstatus,
-		gboolean setstatusmsg, const char *statusmsg)
+		gboolean setstatusmsg, const char *statusmsg, const char *itmsurl)
 {
 	FlapConnection *conn;
 	ByteStream bs;
@@ -911,15 +911,18 @@
 
 	if (setstatusmsg)
 	{
-		size_t statusmsglen;
+		size_t statusmsglen, itmsurllen;
 		ByteStream tmpbs;
 
 		statusmsglen = (statusmsg != NULL) ? strlen(statusmsg) : 0;
+		itmsurllen = (itmsurl != NULL) ? strlen(itmsurl) : 0;
 
-		byte_stream_new(&tmpbs, statusmsglen + 8);
+		byte_stream_new(&tmpbs, statusmsglen + 8 + itmsurllen + 8);
 		byte_stream_put_bart_asset_str(&tmpbs, 0x0002, statusmsg);
+		byte_stream_put_bart_asset_str(&tmpbs, 0x0009, itmsurl);
 
-		aim_tlvlist_add_raw(&tlvlist, 0x001d, byte_stream_curpos(&tmpbs), tmpbs.data);
+		aim_tlvlist_add_raw(&tlvlist, 0x001d,
+				byte_stream_curpos(&tmpbs), tmpbs.data);
 		byte_stream_destroy(&tmpbs);
 	}
 
--- a/libpurple/protocols/oscar/oscar.c	Wed Jun 23 22:32:45 2010 +0000
+++ b/libpurple/protocols/oscar/oscar.c	Thu Jun 24 16:56:01 2010 +0000
@@ -3238,7 +3238,7 @@
 	PurpleStatus *status;
 	gboolean is_available;
 	PurplePresence *presence;
-	const char *username, *message;
+	const char *username, *message, *itmsurl;
 	char *tmp;
 	va_list ap;
 	guint16 maxpermits, maxdenies;
@@ -3279,7 +3279,8 @@
 	else
 		message = NULL;
 	tmp = purple_markup_strip_html(message);
-	aim_srv_setextrainfo(od, FALSE, 0, is_available, tmp);
+	itmsurl = purple_status_get_attr_string(status, "itmsurl");
+	aim_srv_setextrainfo(od, FALSE, 0, is_available, tmp, itmsurl);
 	g_free(tmp);
 
 	presence = purple_status_get_presence(status);
@@ -3904,7 +3905,7 @@
 static void
 oscar_set_extended_status(PurpleConnection *gc)
 {
-	aim_srv_setextrainfo(purple_connection_get_protocol_data(gc), TRUE, oscar_get_extended_status(gc), FALSE, NULL);
+	aim_srv_setextrainfo(purple_connection_get_protocol_data(gc), TRUE, oscar_get_extended_status(gc), FALSE, NULL, NULL);
 }
 
 static void
@@ -3925,6 +3926,7 @@
 	gsize awaylen = 0;
 
 	char *status_text = NULL;
+	const char *itmsurl = NULL;
 
 	status_type = purple_status_get_type(status);
 	primitive = purple_status_type_get_primitive(status_type);
@@ -4017,7 +4019,9 @@
 			}
 		}
 
-		aim_srv_setextrainfo(od, TRUE, oscar_get_extended_status(gc), TRUE, status_text);
+		itmsurl = purple_status_get_attr_string(status, "itmsurl");
+		
+		aim_srv_setextrainfo(od, TRUE, oscar_get_extended_status(gc), TRUE, status_text, itmsurl);
 		g_free(status_text);
 	}
 }
--- a/libpurple/protocols/oscar/oscar.h	Wed Jun 23 22:32:45 2010 +0000
+++ b/libpurple/protocols/oscar/oscar.h	Thu Jun 24 16:56:01 2010 +0000
@@ -723,7 +723,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 setstatusmsg, const char *statusmsg);
+/* 0x001e */ int aim_srv_setextrainfo(OscarData *od, gboolean seticqstatus, guint32 icqstatus, gboolean setstatusmsg, const char *statusmsg, const char *itmsurl);
 
 
 void aim_bos_reqrights(OscarData *od, FlapConnection *conn);