diff libpurple/protocols/jabber/jabber.h @ 17593: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 e49b259fc7dd
children 8c3fbc353a9c
line wrap: on
line diff
--- 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);