changeset 26873:5872d1bc546f

On errors, don't pretend we did fetch something, pass NULL.
author Paul Aurich <paul@darkrain42.org>
date Sun, 03 May 2009 06:38:16 +0000
parents 6a177edc401e
children 76de9455154c
files libpurple/protocols/jabber/pep.c libpurple/protocols/jabber/usernick.c
diffstat 2 files changed, 10 insertions(+), 4 deletions(-) [+]
line wrap: on
line diff
--- 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");