Mercurial > pidgin
comparison 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 |
comparison
equal
deleted
inserted
replaced
25647:969c89c09ad7 | 25648:050052891c55 |
---|---|
20 * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02111-1301 USA | 20 * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02111-1301 USA |
21 */ | 21 */ |
22 #ifndef _PURPLE_JABBER_IQ_H_ | 22 #ifndef _PURPLE_JABBER_IQ_H_ |
23 #define _PURPLE_JABBER_IQ_H_ | 23 #define _PURPLE_JABBER_IQ_H_ |
24 | 24 |
25 #include "jabber.h" | |
26 | |
27 typedef struct _JabberIq JabberIq; | |
28 | |
29 typedef enum { | 25 typedef enum { |
30 JABBER_IQ_SET, | 26 JABBER_IQ_SET, |
31 JABBER_IQ_GET, | 27 JABBER_IQ_GET, |
32 JABBER_IQ_RESULT, | 28 JABBER_IQ_RESULT, |
33 JABBER_IQ_ERROR, | 29 JABBER_IQ_ERROR, |
34 JABBER_IQ_NONE | 30 JABBER_IQ_NONE |
35 } JabberIqType; | 31 } JabberIqType; |
36 | 32 |
37 typedef void (JabberIqHandler)(JabberStream *js, xmlnode *packet); | 33 #include "jabber.h" |
34 | |
35 typedef struct _JabberIq JabberIq; | |
36 | |
37 typedef void (JabberIqHandler)(JabberStream *js, const char *from, | |
38 JabberIqType type, const char *id, | |
39 xmlnode *child); | |
38 | 40 |
39 typedef void (JabberIqCallback)(JabberStream *js, xmlnode *packet, gpointer data); | 41 typedef void (JabberIqCallback)(JabberStream *js, xmlnode *packet, gpointer data); |
40 | 42 |
41 struct _JabberIq { | 43 struct _JabberIq { |
42 JabberIqType type; | 44 JabberIqType type; |