From 59cb0a7954143a15c2435855deb7eeeae43e5f89 Mon Sep 17 00:00:00 2001 From: Jonathan Schleifer Date: Wed, 30 Mar 2011 20:35:02 +0200 Subject: [PATCH] Set the default namespace and prefixes when creating a new XMPPStanza. --- src/XMPPStanza.m | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/src/XMPPStanza.m b/src/XMPPStanza.m index 09f4c44..5f15237 100644 --- a/src/XMPPStanza.m +++ b/src/XMPPStanza.m @@ -21,6 +21,7 @@ * POSSIBILITY OF SUCH DAMAGE. */ +#import "XMPPConnection.h" #import "XMPPStanza.h" #import "XMPPJID.h" @@ -93,7 +94,9 @@ @throw [OFInvalidArgumentException newWithClass: isa selector: _cmd]; - [self setDefaultNamespace: @"jabber:client"]; + [self setDefaultNamespace: XMPP_NS_CLIENT]; + [self setPrefix: @"stream" + forNamespace: XMPP_NS_STREAM]; if (type_ != nil) [self setType: type_]; @@ -137,6 +140,10 @@ enumerator = [[elem children] objectEnumerator]; while ((el = [enumerator nextObject]) != nil) [self addChild: el]; + + [self setDefaultNamespace: XMPP_NS_CLIENT]; + [self setPrefix: @"stream" + forNamespace: XMPP_NS_STREAM]; } @catch (id e) { [self release]; @throw e;