diff libpurple/protocols/jabber/pep.h @ 17566:0370da969e8a

Implemented adding callbacks for PEP events. Moved the feature list to be application-global instead of per-connection (makes more sense).
author Andreas Monitzer <pidgin@monitzer.com>
date Wed, 06 Jun 2007 02:07:53 +0000
parents 2f67cb504a51
children df5bb342b10e
line wrap: on
line diff
--- a/libpurple/protocols/jabber/pep.h	Wed Jun 06 01:37:28 2007 +0000
+++ b/libpurple/protocols/jabber/pep.h	Wed Jun 06 02:07:53 2007 +0000
@@ -25,8 +25,25 @@
 #include "jabber.h"
 #include "message.h"
 
-/* called when the own server supports pep */
-void jabber_pep_init(JabberStream *js);
+void jabber_pep_init(void);
+
+/*
+ * Callback for receiving PEP events.
+ *
+ * @parameter js    The JabberStream this item was received on
+ * @parameter items The &lt;items/>-tag with the &lt;item/>-children
+ */
+typedef void (JabberPEPHandler)(JabberStream *js, xmlnode *items);
+
+/*
+ * Registers a callback for PEP events. Also automatically announces this receiving capability via disco#info.
+ * Don't forget to use jabber_add_feature when supporting the sending of PEP events of this type.
+ *
+ * @parameter shortname   A short name for this feature for XEP-0115. It has no semantic meaning, it just has to be unique.
+ * @parameter xmlns       The namespace for this event
+ * @parameter handlerfunc The callback to be used when receiving an event with this namespace
+ */
+void jabber_pep_register_handler(const char *shortname, const char *xmlns, JabberPEPHandler handlerfunc);
 
 void jabber_handle_event(JabberMessage *jm);