diff libpurple/protocols/jabber/pep.c @ 17855:0f0e98978d66

Turns out the example in XEP-0084 is wrong. Fixed my implementation to not try to work around an issue that isn't one.
author Andreas Monitzer <pidgin@monitzer.com>
date Sun, 17 Jun 2007 04:05:28 +0000
parents 5ab3c6bb95b4
children beaeb7fb4dbd
line wrap: on
line diff
--- a/libpurple/protocols/jabber/pep.c	Sun Jun 17 03:51:19 2007 +0000
+++ b/libpurple/protocols/jabber/pep.c	Sun Jun 17 04:05:28 2007 +0000
@@ -49,20 +49,13 @@
 static void do_pep_iq_request_item_callback(JabberStream *js, xmlnode *packet, gpointer data) {
 	const char *from = xmlnode_get_attrib(packet,"from");
 	xmlnode *pubsub = xmlnode_get_child_with_namespace(packet,"pubsub","http://jabber.org/protocol/pubsub#event");
-	xmlnode *item = NULL;
+	xmlnode *items = NULL;
 	JabberPEPHandler *cb = data;
 	
-	if(pubsub) {
-		item = xmlnode_get_child(pubsub, "item");
-		if(!item) {
-			/* does not follow the spec, but the ejabberd PEP implementation behaves that way */
-			xmlnode *items = xmlnode_get_child(pubsub, "items");
-			if(items)
-				item = xmlnode_get_child(items, "item");
-		}
-	}
+	if(pubsub)
+		items = xmlnode_get_child(pubsub, "items");
 	
-	cb(js, from, item);
+	cb(js, from, items);
 }
 
 void jabber_pep_request_item(JabberStream *js, const char *to, const char *node, const char *id, JabberPEPHandler cb) {