changeset 17866:759cd72bd2ff

Replaced a clean and simple API with a very weird hack due to vivid request on #pidgin by multiple devs. This avoids the change in PurplePluginProtocolInfo, but requires complicated change tracking in every prpl. The others prpl should add this change tracking, too (since otherwise the status gets changed even though nothing they care about changed), but that's not up to me.
author Andreas Monitzer <pidgin@monitzer.com>
date Mon, 18 Jun 2007 12:37:29 +0000
parents f2686bec13c0
children b748e602c951
files libpurple/account.c libpurple/account.h libpurple/protocols/gg/gg.c libpurple/protocols/irc/irc.c libpurple/protocols/jabber/buddy.h libpurple/protocols/jabber/jabber.c libpurple/protocols/jabber/jabber.h libpurple/protocols/jabber/libxmpp.c libpurple/protocols/jabber/presence.c libpurple/protocols/jabber/usertune.c libpurple/protocols/jabber/usertune.h libpurple/protocols/msn/msn.c libpurple/protocols/novell/novell.c libpurple/protocols/oscar/libaim.c libpurple/protocols/oscar/libicq.c libpurple/protocols/qq/qq.c libpurple/protocols/sametime/sametime.c libpurple/protocols/simple/simple.c libpurple/protocols/yahoo/yahoo.c libpurple/protocols/zephyr/zephyr.c libpurple/prpl.h libpurple/status.h
diffstat 22 files changed, 181 insertions(+), 104 deletions(-) [+]
line wrap: on
line diff
--- a/libpurple/account.c	Mon Jun 18 03:25:22 2007 +0000
+++ b/libpurple/account.c	Mon Jun 18 12:37:29 2007 +0000
@@ -2153,18 +2153,6 @@
 }
 
 void
-purple_account_set_tune(PurpleAccount *account, const PurpleTuneInfo *info) {
-	PurplePluginProtocolInfo *prpl_info = NULL;
-	PurpleConnection *gc = purple_account_get_connection(account);
-	
-	if (gc != NULL && gc->prpl != NULL)
-		prpl_info = PURPLE_PLUGIN_PROTOCOL_INFO(gc->prpl);
-	
-	if (prpl_info && prpl_info->publish_tune)
-		prpl_info->publish_tune(gc, info);
-}
-
-void
 purple_accounts_add(PurpleAccount *account)
 {
 	g_return_if_fail(account != NULL);
--- a/libpurple/account.h	Mon Jun 18 03:25:22 2007 +0000
+++ b/libpurple/account.h	Mon Jun 18 12:37:29 2007 +0000
@@ -841,14 +841,6 @@
  */
 gboolean purple_account_supports_offline_message(PurpleAccount *account, PurpleBuddy *buddy);
 
-/**
- * Sets the current tune playing on the machine (if the prpl support setting this information)
- *
- * @param account	The account
- * @param info		The tune information
- */
-void purple_account_set_tune(PurpleAccount *account, const PurpleTuneInfo *info);
-
 /*@}*/
 
 /**************************************************************************/
--- a/libpurple/protocols/gg/gg.c	Mon Jun 18 03:25:22 2007 +0000
+++ b/libpurple/protocols/gg/gg.c	Mon Jun 18 12:37:29 2007 +0000
@@ -2123,11 +2123,11 @@
 	NULL,				/* whiteboard_prpl_ops */
 	NULL,				/* send_raw */
 	NULL,				/* roomlist_room_serialize */
-	NULL,				/* publish_tune */
 
 	/* padding */
 	NULL,
 	NULL,
+	NULL,
 	NULL
 };
 /* }}} */
--- a/libpurple/protocols/irc/irc.c	Mon Jun 18 03:25:22 2007 +0000
+++ b/libpurple/protocols/irc/irc.c	Mon Jun 18 12:37:29 2007 +0000
@@ -876,11 +876,11 @@
 	NULL,					/* whiteboard_prpl_ops */
 	irc_send_raw,			/* send_raw */
 	NULL,					/* roomlist_room_serialize */
-	NULL,				/* publish_tune */
 
 	/* padding */
 	NULL,
 	NULL,
+	NULL,
 	NULL
 };
 
--- a/libpurple/protocols/jabber/buddy.h	Mon Jun 18 03:25:22 2007 +0000
+++ b/libpurple/protocols/jabber/buddy.h	Mon Jun 18 12:37:29 2007 +0000
@@ -22,11 +22,6 @@
 #ifndef _PURPLE_JABBER_BUDDY_H_
 #define _PURPLE_JABBER_BUDDY_H_
 
-#include "jabber.h"
-
-#define AVATARNAMESPACEDATA "http://www.xmpp.org/extensions/xep-0084.html#ns-data"
-#define AVATARNAMESPACEMETA "http://www.xmpp.org/extensions/xep-0084.html#ns-metadata"
-
 typedef enum {
 	JABBER_BUDDY_STATE_UNKNOWN = -2,
 	JABBER_BUDDY_STATE_ERROR = -1,
@@ -38,6 +33,11 @@
 	JABBER_BUDDY_STATE_DND
 } JabberBuddyState;
 
+#include "jabber.h"
+
+#define AVATARNAMESPACEDATA "http://www.xmpp.org/extensions/xep-0084.html#ns-data"
+#define AVATARNAMESPACEMETA "http://www.xmpp.org/extensions/xep-0084.html#ns-metadata"
+
 typedef struct _JabberBuddy {
 	GList *resources;
 	char *error_msg;
--- a/libpurple/protocols/jabber/jabber.c	Mon Jun 18 03:25:22 2007 +0000
+++ b/libpurple/protocols/jabber/jabber.c	Mon Jun 18 12:37:29 2007 +0000
@@ -562,6 +562,7 @@
 	js->user = jabber_id_new(purple_account_get_username(account));
 	js->next_id = g_random_int();
 	js->write_buffer = purple_circ_buffer_new(512);
+	js->old_length = -1;
 
 	if(!js->user) {
 		purple_connection_error(gc, _("Invalid XMPP ID"));
@@ -912,6 +913,7 @@
 			g_free, g_free);
 	js->user = jabber_id_new(purple_account_get_username(account));
 	js->next_id = g_random_int();
+	js->old_length = -1;
 
 	if(!js->user) {
 		purple_connection_error(gc, _("Invalid XMPP ID"));
@@ -1030,6 +1032,21 @@
 	g_free(js->server_name);
 	g_free(js->gmail_last_time);
 	g_free(js->gmail_last_tid);
+	if(js->old_msg)
+		g_free(js->old_msg);
+	if(js->old_avatarhash)
+		g_free(js->old_avatarhash);
+	if(js->old_artist)
+		g_free(js->old_artist);
+	if(js->old_title)
+		g_free(js->old_title);
+	if(js->old_source)
+		g_free(js->old_source);
+	if(js->old_uri)
+		g_free(js->old_uri);
+	if(js->old_track)
+		g_free(js->old_track);
+	
 	g_free(js);
 
 	gc->proto_data = NULL;
--- a/libpurple/protocols/jabber/jabber.h	Mon Jun 18 03:25:22 2007 +0000
+++ b/libpurple/protocols/jabber/jabber.h	Mon Jun 18 12:37:29 2007 +0000
@@ -22,23 +22,6 @@
 #ifndef _PURPLE_JABBER_H_
 #define _PURPLE_JABBER_H_
 
-#include <libxml/parser.h>
-#include <glib.h>
-#include "circbuffer.h"
-#include "connection.h"
-#include "dnssrv.h"
-#include "roomlist.h"
-#include "sslconn.h"
-
-#include "jutil.h"
-#include "xmlnode.h"
-
-#ifdef HAVE_CYRUS_SASL
-#include <sasl/sasl.h>
-#endif
-
-#define CAPS0115_NODE "http://pidgin.im/caps"
-
 typedef enum {
 	JABBER_CAP_NONE			  = 0,
 	JABBER_CAP_XHTML		  = 1 << 0,
@@ -50,18 +33,38 @@
 	JABBER_CAP_CHAT_STATES	  = 1 << 6,
 	JABBER_CAP_IQ_SEARCH	  = 1 << 7,
 	JABBER_CAP_IQ_REGISTER	  = 1 << 8,
-
+	
 	/* Google Talk extensions: 
-	 * http://code.google.com/apis/talk/jep_extensions/extensions.html
-	 */
+	* http://code.google.com/apis/talk/jep_extensions/extensions.html
+	*/
 	JABBER_CAP_GMAIL_NOTIFY	  = 1 << 9,
 	JABBER_CAP_GOOGLE_ROSTER  = 1 << 10,
-
+	
 	JABBER_CAP_PING			  = 1 << 11,
-
+	
 	JABBER_CAP_RETRIEVED	  = 1 << 31
 } JabberCapabilities;
 
+typedef struct _JabberStream JabberStream;
+
+#include <libxml/parser.h>
+#include <glib.h>
+#include "circbuffer.h"
+#include "connection.h"
+#include "dnssrv.h"
+#include "roomlist.h"
+#include "sslconn.h"
+
+#include "jutil.h"
+#include "xmlnode.h"
+#include "buddy.h"
+
+#ifdef HAVE_CYRUS_SASL
+#include <sasl/sasl.h>
+#endif
+
+#define CAPS0115_NODE "http://pidgin.im/caps"
+
 typedef enum {
 	JABBER_STREAM_OFFLINE,
 	JABBER_STREAM_CONNECTING,
@@ -71,7 +74,7 @@
 	JABBER_STREAM_CONNECTED
 } JabberStreamState;
 
-typedef struct _JabberStream
+struct _JabberStream
 {
 	int fd;
 
@@ -152,7 +155,21 @@
 	
 	/* does the local server support PEP? */
 	gboolean pep;
-} JabberStream;
+	
+	/* last presence update to check for differences */
+	JabberBuddyState old_state;
+	char *old_msg;
+	int old_priority;
+	char *old_avatarhash;
+	
+	/* same for user tune */
+	char *old_artist;
+	char *old_title;
+	char *old_source;
+	char *old_uri;
+	int old_length;
+	char *old_track;
+};
 
 typedef gboolean (JabberFeatureEnabled)(JabberStream *js, const gchar *shortname, const gchar *namespace);
 
--- a/libpurple/protocols/jabber/libxmpp.c	Mon Jun 18 03:25:22 2007 +0000
+++ b/libpurple/protocols/jabber/libxmpp.c	Mon Jun 18 12:37:29 2007 +0000
@@ -110,11 +110,11 @@
 	NULL,							/* whiteboard_prpl_ops */
 	jabber_prpl_send_raw,			/* send_raw */
 	jabber_roomlist_room_serialize, /* roomlist_room_serialize */
-	jabber_tune_set,				/* publish_tune */
 
 	/* padding */
 	NULL,
 	NULL,
+	NULL,
 	NULL
 };
 
--- a/libpurple/protocols/jabber/presence.c	Mon Jun 18 03:25:22 2007 +0000
+++ b/libpurple/protocols/jabber/presence.c	Mon Jun 18 12:37:29 2007 +0000
@@ -37,6 +37,8 @@
 #include "iq.h"
 #include "jutil.h"
 
+#include "usertune.h"
+
 
 static void chats_send_presence_foreach(gpointer key, gpointer val,
 		gpointer user_data)
@@ -101,6 +103,8 @@
 	char *stripped = NULL;
 	JabberBuddyState state;
 	int priority;
+	const char *artist, *title, *source, *uri, *track;
+	int length;
 
 	if(!purple_status_is_active(status))
 		return;
@@ -116,23 +120,80 @@
 	js = gc->proto_data;
 
 	purple_status_to_jabber(status, &state, &stripped, &priority);
-
+	
+#define CHANGED(a,b) ((!a && b) || (a && a[0] == '\0' && b && b[0] != '\0') || \
+					  (a && !b) || (a && a[0] != '\0' && b && b[0] == '\0') || (a && b && strcmp(a,b)))
+	/* check if there are any differences to the <presence> and send them in that case */
+	if (js->old_state != state || CHANGED(js->old_msg, stripped) ||
+		js->old_priority != priority || CHANGED(js->old_avatarhash, js->avatar_hash)) {
+		presence = jabber_presence_create_js(js, state, stripped, priority);
+		g_free(stripped);
 
-	presence = jabber_presence_create_js(js, state, stripped, priority);
-	g_free(stripped);
+		if(js->avatar_hash) {
+			x = xmlnode_new_child(presence, "x");
+			xmlnode_set_namespace(x, "vcard-temp:x:update");
+			photo = xmlnode_new_child(x, "photo");
+			xmlnode_insert_data(photo, js->avatar_hash, -1);
+		}
+
+		jabber_send(js, presence);
 
-	if(js->avatar_hash) {
-		x = xmlnode_new_child(presence, "x");
-		xmlnode_set_namespace(x, "vcard-temp:x:update");
-		photo = xmlnode_new_child(x, "photo");
-		xmlnode_insert_data(photo, js->avatar_hash, -1);
+		g_hash_table_foreach(js->chats, chats_send_presence_foreach, presence);
+		xmlnode_free(presence);
+		
+		/* update old values */
+		
+		if(js->old_msg)
+			g_free(js->old_msg);
+		if(js->old_avatarhash)
+			g_free(js->old_avatarhash);
+		js->old_msg = g_strdup(stripped);
+		js->old_avatarhash = g_strdup(js->avatar_hash);
+		js->old_state = state;
+		js->old_priority = priority;
 	}
-
-	jabber_send(js, presence);
-
-	g_hash_table_foreach(js->chats, chats_send_presence_foreach, presence);
-	xmlnode_free(presence);
-
+	
+	/* next, check if there are any changes to the tune values */
+	artist = purple_status_get_attr_string(status, PURPLE_TUNE_ARTIST);
+	title = purple_status_get_attr_string(status, PURPLE_TUNE_TITLE);
+	source = purple_status_get_attr_string(status, PURPLE_TUNE_ALBUM);
+	uri = purple_status_get_attr_string(status, PURPLE_TUNE_URL);
+	track = purple_status_get_attr_string(status, PURPLE_TUNE_TRACK);
+	length = (!purple_status_get_attr_value(status, PURPLE_TUNE_TIME))?-1:purple_status_get_attr_int(status, PURPLE_TUNE_TIME);
+	
+	if(CHANGED(artist, js->old_artist) || CHANGED(title, js->old_title) || CHANGED(source, js->old_source) ||
+	   CHANGED(uri, js->old_uri) || CHANGED(track, js->old_track) || (length != js->old_length)) {
+		PurpleJabberTuneInfo tuneinfo = {
+			(char*)artist,
+			(char*)title,
+			(char*)source,
+			(char*)track,
+			length,
+			(char*)uri
+		};
+		jabber_tune_set(js->gc, &tuneinfo);
+		
+		/* update old values */
+		if(js->old_artist)
+			g_free(js->old_artist);
+		if(js->old_title)
+			g_free(js->old_title);
+		if(js->old_source)
+			g_free(js->old_source);
+		if(js->old_uri)
+			g_free(js->old_uri);
+		if(js->old_track)
+			g_free(js->old_track);
+		js->old_artist = g_strdup(artist);
+		js->old_title = g_strdup(title);
+		js->old_source = g_strdup(source);
+		js->old_uri = g_strdup(uri);
+		js->old_length = length;
+		js->old_track = g_strdup(track);
+	}
+	
+#undef CHANGED(a,b)
+	
 	jabber_presence_fake_to_self(js, status);
 }
 
--- a/libpurple/protocols/jabber/usertune.c	Mon Jun 18 03:25:22 2007 +0000
+++ b/libpurple/protocols/jabber/usertune.c	Mon Jun 18 12:37:29 2007 +0000
@@ -25,13 +25,14 @@
 #include <string.h>
 #include "internal.h"
 #include "request.h"
+#include "status.h"
 
 static void jabber_tune_cb(JabberStream *js, const char *from, xmlnode *items) {
 	/* it doesn't make sense to have more than one item here, so let's just pick the first one */
 	xmlnode *item = xmlnode_get_child(items, "item");
 	JabberBuddy *buddy = jabber_buddy_find(js, from, FALSE);
 	xmlnode *tuneinfo, *tune;
-	PurpleTuneInfo tuneinfodata;
+	PurpleJabberTuneInfo tuneinfodata;
 	
 	/* ignore the tune of people not on our buddy list */
 	if (!buddy || !item)
@@ -40,11 +41,8 @@
 	tuneinfodata.artist = "";
 	tuneinfodata.title = "";
 	tuneinfodata.album = "";
-	tuneinfodata.genre = "";
-	tuneinfodata.comment = "";
 	tuneinfodata.track = "";
 	tuneinfodata.time = -1;
-	tuneinfodata.year = -1;
 	tuneinfodata.url = "";
 	
 	tune = xmlnode_get_child_with_namespace(item, "tune", "http://jabber.org/protocol/tune");
@@ -79,7 +77,7 @@
 	JabberBuddyResource *resource = jabber_buddy_find_resource(buddy, NULL);
 	const char *status_id = jabber_buddy_state_get_status_id(resource->state);
 
-	purple_prpl_got_user_status(js->gc->account, from, status_id, "tune_artist", tuneinfodata.artist, "tune_title", tuneinfodata.title, "tune_album", tuneinfodata.album, "tune_genre", tuneinfodata.genre, "tune_comment", tuneinfodata.comment, "tune_track", tuneinfodata.track, "tune_time", tuneinfodata.time, "tune_year", tuneinfodata.year, "tune_url", tuneinfodata.url, NULL);
+	purple_prpl_got_user_status(js->gc->account, from, status_id, PURPLE_TUNE_ARTIST, tuneinfodata.artist, PURPLE_TUNE_TITLE, tuneinfodata.title, PURPLE_TUNE_ALBUM, tuneinfodata.album, PURPLE_TUNE_TRACK, tuneinfodata.track, PURPLE_TUNE_TIME, tuneinfodata.time, PURPLE_TUNE_URL, tuneinfodata.url, NULL);
 }
 
 void jabber_tune_init(void) {
@@ -87,7 +85,7 @@
 	jabber_pep_register_handler("tunen", "http://jabber.org/protocol/tune", jabber_tune_cb);
 }
 
-void jabber_tune_set(PurpleConnection *gc, const PurpleTuneInfo *tuneinfo) {
+void jabber_tune_set(PurpleConnection *gc, const PurpleJabberTuneInfo *tuneinfo) {
 	xmlnode *publish, *tunenode;
 	JabberStream *js = gc->proto_data;
 	
@@ -97,20 +95,20 @@
 	xmlnode_set_namespace(tunenode, "http://jabber.org/protocol/tune");
 	
 	if(tuneinfo) {
-		if(tuneinfo->artist)
+		if(tuneinfo->artist && tuneinfo->artist[0] != '\0')
 			xmlnode_insert_data(xmlnode_new_child(tunenode, "artist"),tuneinfo->artist,-1);
-		if(tuneinfo->title)
+		if(tuneinfo->title && tuneinfo->title[0] != '\0')
 			xmlnode_insert_data(xmlnode_new_child(tunenode, "title"),tuneinfo->title,-1);
-		if(tuneinfo->album)
+		if(tuneinfo->album && tuneinfo->album[0] != '\0')
 			xmlnode_insert_data(xmlnode_new_child(tunenode, "source"),tuneinfo->album,-1);
-		if(tuneinfo->url)
+		if(tuneinfo->url && tuneinfo->url[0] != '\0')
 			xmlnode_insert_data(xmlnode_new_child(tunenode, "uri"),tuneinfo->url,-1);
 		if(tuneinfo->time >= 0) {
 			char *length = g_strdup_printf("%d", tuneinfo->time);
 			xmlnode_insert_data(xmlnode_new_child(tunenode, "length"),length,-1);
 			g_free(length);
 		}
-		if(tuneinfo->track)
+		if(tuneinfo->track && tuneinfo->track[0] != '\0')
 			xmlnode_insert_data(xmlnode_new_child(tunenode, "track"),tuneinfo->track,-1);
 	}
 	
--- a/libpurple/protocols/jabber/usertune.h	Mon Jun 18 03:25:22 2007 +0000
+++ b/libpurple/protocols/jabber/usertune.h	Mon Jun 18 12:37:29 2007 +0000
@@ -26,8 +26,18 @@
 
 /* Implementation of XEP-0118 */
 
+typedef struct _PurpleJabberTuneInfo PurpleJabberTuneInfo;
+struct _PurpleJabberTuneInfo {
+	char *artist;
+	char *title;
+	char *album;
+	char *track; /* either the index of the track in the album or the URL for a stream */
+	int time; /* in seconds, -1 for unknown */
+	char *url;
+};
+
 void jabber_tune_init(void);
 
-void jabber_tune_set(PurpleConnection *gc, const PurpleTuneInfo *tuneinfo);
+void jabber_tune_set(PurpleConnection *gc, const PurpleJabberTuneInfo *tuneinfo);
 
 #endif /* _PURPLE_JABBER_USERTUNE_H_ */
--- a/libpurple/protocols/msn/msn.c	Mon Jun 18 03:25:22 2007 +0000
+++ b/libpurple/protocols/msn/msn.c	Mon Jun 18 12:37:29 2007 +0000
@@ -2082,11 +2082,11 @@
 	NULL,					/* whiteboard_prpl_ops */
 	NULL,					/* send_raw */
 	NULL,					/* roomlist_room_serialize */
-	NULL,					/* publish_tune */
 
 	/* padding */
 	NULL,
 	NULL,
+	NULL,
 	NULL
 };
 
--- a/libpurple/protocols/novell/novell.c	Mon Jun 18 03:25:22 2007 +0000
+++ b/libpurple/protocols/novell/novell.c	Mon Jun 18 12:37:29 2007 +0000
@@ -3494,11 +3494,11 @@
 	NULL,						/* whiteboard_prpl_ops */
 	NULL,						/* send_raw */
 	NULL,						/* roomlist_room_serialize */
-	NULL,						/* publish_tune */
 
 	/* padding */
 	NULL,
 	NULL,
+	NULL,
 	NULL
 };
 
--- a/libpurple/protocols/oscar/libaim.c	Mon Jun 18 03:25:22 2007 +0000
+++ b/libpurple/protocols/oscar/libaim.c	Mon Jun 18 12:37:29 2007 +0000
@@ -92,11 +92,11 @@
 	NULL,					/* whiteboard_prpl_ops */
 	NULL,					/* send_raw */
 	NULL,					/* roomlist_room_serialize */
-	NULL,					/* publish_tune */
 
 	/* padding */
 	NULL,
 	NULL,
+	NULL,
 	NULL
 };
 
--- a/libpurple/protocols/oscar/libicq.c	Mon Jun 18 03:25:22 2007 +0000
+++ b/libpurple/protocols/oscar/libicq.c	Mon Jun 18 12:37:29 2007 +0000
@@ -92,11 +92,11 @@
 	NULL,					/* whiteboard_prpl_ops */
 	NULL,					/* send_raw */
 	NULL,					/* roomlist_room_serialize */
-	NULL,					/* publish_tune */
 
 	/* padding */
 	NULL,
 	NULL,
+	NULL,
 	NULL
 };
 
--- a/libpurple/protocols/qq/qq.c	Mon Jun 18 03:25:22 2007 +0000
+++ b/libpurple/protocols/qq/qq.c	Mon Jun 18 12:37:29 2007 +0000
@@ -698,11 +698,11 @@
 	NULL,							/* PurpleWhiteboardPrplOps */
 	NULL,							/* send_raw */
 	NULL,							/* roomlist_room_serialize */
-	NULL,							/* publish_tune */
 
 	/* padding */
 	NULL,
 	NULL,
+	NULL,
 	NULL
 };
 
--- a/libpurple/protocols/sametime/sametime.c	Mon Jun 18 03:25:22 2007 +0000
+++ b/libpurple/protocols/sametime/sametime.c	Mon Jun 18 12:37:29 2007 +0000
@@ -5132,8 +5132,7 @@
   .new_xfer                  = mw_prpl_new_xfer,
   .offline_message           = NULL,
   .whiteboard_prpl_ops       = NULL,
-  .send_raw                  = NULL,
-  .publish_tune              = NULL
+  .send_raw                  = NULL
 };
 
 
--- a/libpurple/protocols/simple/simple.c	Mon Jun 18 03:25:22 2007 +0000
+++ b/libpurple/protocols/simple/simple.c	Mon Jun 18 12:37:29 2007 +0000
@@ -1798,11 +1798,11 @@
 	NULL,					/* whiteboard_prpl_ops */
 	simple_send_raw,		/* send_raw */
 	NULL,					/* roomlist_room_serialize */
-	NULL,					/* publish_tune */
 
 	/* padding */
 	NULL,
 	NULL,
+	NULL,
 	NULL
 };
 
--- a/libpurple/protocols/yahoo/yahoo.c	Mon Jun 18 03:25:22 2007 +0000
+++ b/libpurple/protocols/yahoo/yahoo.c	Mon Jun 18 12:37:29 2007 +0000
@@ -4019,11 +4019,11 @@
 	&yahoo_whiteboard_prpl_ops,
 	NULL, /* send_raw */
 	NULL, /* roomlist_room_serialize */
-	NULL, /* publish_tune */
 
 	/* padding */
 	NULL,
 	NULL,
+	NULL,
 	NULL
 };
 
--- a/libpurple/protocols/zephyr/zephyr.c	Mon Jun 18 03:25:22 2007 +0000
+++ b/libpurple/protocols/zephyr/zephyr.c	Mon Jun 18 12:37:29 2007 +0000
@@ -2921,11 +2921,11 @@
 	NULL,					/* whiteboard_prpl_ops */
 	NULL,					/* send_raw */
 	NULL,					/* roomlist_room_serialize */
-	NULL,					/* publish_tune */
 
 	/* padding */
 	NULL,
 	NULL,
+	NULL,
 	NULL
 };
 
--- a/libpurple/prpl.h	Mon Jun 18 03:25:22 2007 +0000
+++ b/libpurple/prpl.h	Mon Jun 18 12:37:29 2007 +0000
@@ -47,7 +47,6 @@
  * Dimensions less than 1 should be ignored and the image not scaled.
  */
 typedef struct _PurpleBuddyIconSpec PurpleBuddyIconSpec;
-typedef struct _PurpleTuneInfo PurpleTuneInfo;
 
 /**
  * This \#define exists just to make it easier to fill out the buddy icon
@@ -92,18 +91,6 @@
 	gboolean secret;
 };
 
-struct _PurpleTuneInfo {
-	char *artist;
-	char *title;
-	char *album;
-	char *genre;
-	char *comment;
-	char *track; /* either the index of the track in the album or the URL for a stream */
-	int time; /* in seconds, -1 for unknown */
-	int year; /* -1 for unknown (not compatible with very old music I guess) */
-	char *url;
-};
-
 /**
  * Protocol options
  *
@@ -331,12 +318,10 @@
 	/* room list serialize */
 	char *(*roomlist_room_serialize)(PurpleRoomlistRoom *room);
 	
-	void (*publish_tune)(PurpleConnection *gc, const PurpleTuneInfo *tuneinfo);
-
 	void (*_purple_reserved1)(void);
 	void (*_purple_reserved2)(void);
 	void (*_purple_reserved3)(void);
-/*	void (*_purple_reserved4)(void);*/
+	void (*_purple_reserved4)(void);
 };
 
 #define PURPLE_IS_PROTOCOL_PLUGIN(plugin) \
--- a/libpurple/status.h	Mon Jun 18 03:25:22 2007 +0000
+++ b/libpurple/status.h	Mon Jun 18 12:37:29 2007 +0000
@@ -113,6 +113,16 @@
 #include "conversation.h"
 #include "value.h"
 
+#define PURPLE_TUNE_ARTIST	"tune_artist"
+#define PURPLE_TUNE_TITLE	"tune_title"
+#define PURPLE_TUNE_ALBUM	"tune_album"
+#define PURPLE_TUNE_GENRE	"tune_genre"
+#define PURPLE_TUNE_COMMENT	"tune_comment"
+#define PURPLE_TUNE_TRACK	"tune_track"
+#define PURPLE_TUNE_TIME	"tune_time"
+#define PURPLE_TUNE_YEAR	"tune_year"
+#define PURPLE_TUNE_URL	"tune_url"
+
 #ifdef __cplusplus
 extern "C" {
 #endif