From 4cd1853729271fc477ef1e74fdbcfda2b53f68fc Mon Sep 17 00:00:00 2001 From: Florian Zeitz Date: Sun, 13 Feb 2011 02:07:36 +0100 Subject: [PATCH] Add support for requesting a certain resource --- src/XMPPConnection.m | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/src/XMPPConnection.m b/src/XMPPConnection.m index 5ac0aed..fd5e23d 100644 --- a/src/XMPPConnection.m +++ b/src/XMPPConnection.m @@ -207,8 +207,12 @@ - (void)_sendResourceBind { XMPPIQ *iq = [XMPPIQ IQWithType: @"set" ID: @"bind0"]; - [iq addChild: [OFXMLElement elementWithName: @"bind" - namespace: NS_BIND]]; + OFXMLElement *bind = [OFXMLElement elementWithName: @"bind" + namespace: NS_BIND]; + if (resource) + [bind addChild: [OFXMLElement elementWithName: @"resource" + stringValue: resource]]; + [iq addChild: bind]; [self sendStanza: iq]; }