On errors, don't pretend we did fetch something, pass NULL.

Sun, 03 May 2009 06:38:16 +0000

author
Paul Aurich <darkrain42@pidgin.im>
date
Sun, 03 May 2009 06:38:16 +0000
changeset 27016
1e21b1e058c0
parent 27015
3d6982f39a5b
child 27017
02ddb8e8c3d2

On errors, don't pretend we did fetch something, pass NULL.

libpurple/protocols/jabber/pep.c file | annotate | diff | comparison | revisions
libpurple/protocols/jabber/usernick.c file | annotate | diff | comparison | revisions
--- a/libpurple/protocols/jabber/pep.c	Sun May 03 06:36:05 2009 +0000
+++ b/libpurple/protocols/jabber/pep.c	Sun May 03 06:38:16 2009 +0000
@@ -67,12 +67,15 @@
                                 JabberIqType type, const char *id,
                                 xmlnode *packet, gpointer data)
 {
-	xmlnode *pubsub = xmlnode_get_child_with_namespace(packet,"pubsub","http://jabber.org/protocol/pubsub");
+	xmlnode *pubsub;
 	xmlnode *items = NULL;
 	JabberPEPHandler *cb = data;
 
-	if(pubsub)
-		items = xmlnode_get_child(pubsub, "items");
+	if (type == JABBER_IQ_RESULT) {
+		pubsub = xmlnode_get_child_with_namespace(packet, "pubsub", "http://jabber.org/protocol/pubsub");
+		if(pubsub)
+			items = xmlnode_get_child(pubsub, "items");
+	}
 
 	cb(js, from, items);
 }
--- a/libpurple/protocols/jabber/usernick.c	Sun May 03 06:36:05 2009 +0000
+++ b/libpurple/protocols/jabber/usernick.c	Sun May 03 06:38:16 2009 +0000
@@ -65,7 +65,10 @@
 
 static void do_nick_got_own_nick_cb(JabberStream *js, const char *from, xmlnode *items) {
 	char *oldnickname = NULL;
-	xmlnode *item = xmlnode_get_child(items,"item");
+	xmlnode *item = NULL;
+	
+	if (items)
+		item = xmlnode_get_child(items,"item");
 
 	if(item) {
 		xmlnode *nick = xmlnode_get_child_with_namespace(item,"nick","http://jabber.org/protocol/nick");

mercurial