From 5b9eb619d37e11047e0c2ff97f695b22e62712d8 Mon Sep 17 00:00:00 2001 From: Jonathan Schleifer Date: Thu, 26 May 2011 00:03:39 +0200 Subject: [PATCH] Ignore whitespace elements. --- src/XMPPConnection.m | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/src/XMPPConnection.m b/src/XMPPConnection.m index 3841517..3864a01 100644 --- a/src/XMPPConnection.m +++ b/src/XMPPConnection.m @@ -315,6 +315,10 @@ - (void)elementBuilder: (OFXMLElementBuilder*)builder didBuildElement: (OFXMLElement*)element { + /* Ignore whitespace elements */ + if ([element name] == nil) + return; + [element setDefaultNamespace: XMPP_NS_CLIENT]; [element setPrefix: @"stream" forNamespace: XMPP_NS_STREAM]; @@ -590,8 +594,8 @@ handled = [delegate connection: self didReceiveIQ: iq]; - if (!handled && ![[iq type] isEqual: @"error"] - && ![[iq type] isEqual: @"result"]) { + if (!handled && ![[iq type] isEqual: @"error"] && + ![[iq type] isEqual: @"result"]) { [self sendStanza: [iq errorIQWithType: @"cancel" condition: @"service-unavailable"]]; }