From c591ca3547ff3b4ccc9a10a8a7148f000660ceba Mon Sep 17 00:00:00 2001 From: Florian Zeitz Date: Thu, 10 Feb 2011 16:36:09 +0100 Subject: [PATCH] Handle resource binding --- XMPPConnection.m | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/XMPPConnection.m b/XMPPConnection.m index aa84e2f..0c42b0c 100644 --- a/XMPPConnection.m +++ b/XMPPConnection.m @@ -188,6 +188,17 @@ of_log(@"Auth failed!"); // FIXME: Handle! } + + if ([elem.name isEqual: @"iq"] && + [elem.namespace isEqual: NS_CLIENT]) { + XMPPIQ *iq = [XMPPIQ stanzaWithElement: elem]; + if ([iq.ID isEqual: @"bind0"] && [iq.type isEqual: @"result"]) { + OFXMLElement *bindElem = iq.children.firstObject; + OFXMLElement *jidElem = bindElem.children.firstObject; + of_log(@"Bound to JID: %@", + [jidElem.children.firstObject stringValue]); + } + } } - (void)elementBuilder: (OFXMLElementBuilder*)b