diff libpurple/protocols/jabber/iq.h @ 25648:050052891c55

Pass IQ handlers type, from, id, and the child node As QuLogic pointed out in 8a80f271, it's pointless for the handlers to re-get the information from the IQ stanza. Additionally, instead of string-matching the type everywhere, pass around a JabberIqType. Last, 'child' cannot be NULL, but 'from' may be.
author Paul Aurich <paul@darkrain42.org>
date Sun, 08 Feb 2009 06:31:18 +0000
parents 969c89c09ad7
children d7c195489af3
line wrap: on
line diff
--- a/libpurple/protocols/jabber/iq.h	Sun Feb 08 04:30:23 2009 +0000
+++ b/libpurple/protocols/jabber/iq.h	Sun Feb 08 06:31:18 2009 +0000
@@ -22,10 +22,6 @@
 #ifndef _PURPLE_JABBER_IQ_H_
 #define _PURPLE_JABBER_IQ_H_
 
-#include "jabber.h"
-
-typedef struct _JabberIq JabberIq;
-
 typedef enum {
 	JABBER_IQ_SET,
 	JABBER_IQ_GET,
@@ -34,7 +30,13 @@
 	JABBER_IQ_NONE
 } JabberIqType;
 
-typedef void (JabberIqHandler)(JabberStream *js, xmlnode *packet);
+#include "jabber.h"
+
+typedef struct _JabberIq JabberIq;
+
+typedef void (JabberIqHandler)(JabberStream *js, const char *from,
+                               JabberIqType type, const char *id,
+                               xmlnode *child);
 
 typedef void (JabberIqCallback)(JabberStream *js, xmlnode *packet, gpointer data);