From d80aa353d3789e089b1f6fed8e5c6205d6824be4 Mon Sep 17 00:00:00 2001 From: Jonathan Schleifer Date: Thu, 12 May 2011 19:49:58 +0200 Subject: [PATCH] Fix namespace handling. --- src/XMPPConnection.m | 1 + src/XMPPMessage.m | 2 ++ src/XMPPPresence.m | 4 ++++ src/XMPPStanza.m | 3 ++- 4 files changed, 9 insertions(+), 1 deletion(-) diff --git a/src/XMPPConnection.m b/src/XMPPConnection.m index 662da6e..4d98100 100644 --- a/src/XMPPConnection.m +++ b/src/XMPPConnection.m @@ -695,6 +695,7 @@ if (resource != nil) [bind addChild: [OFXMLElement elementWithName: @"resource" + namespace: XMPP_NS_BIND stringValue: resource]]; [iq addChild: bind]; diff --git a/src/XMPPMessage.m b/src/XMPPMessage.m index e4e2b5f..67b3bd1 100644 --- a/src/XMPPMessage.m +++ b/src/XMPPMessage.m @@ -22,6 +22,7 @@ */ #import "XMPPMessage.h" +#import "XMPPConnection.h" @implementation XMPPMessage + message @@ -75,6 +76,7 @@ - (void)addBody: (OFString*)body { [self addChild: [OFXMLElement elementWithName: @"body" + namespace: XMPP_NS_CLIENT stringValue: body]]; } @end diff --git a/src/XMPPPresence.m b/src/XMPPPresence.m index acab4a7..da4f2a8 100644 --- a/src/XMPPPresence.m +++ b/src/XMPPPresence.m @@ -22,6 +22,7 @@ */ #import "XMPPPresence.h" +#import "XMPPConnection.h" @implementation XMPPPresence + presence @@ -75,12 +76,14 @@ - (void)addShow: (OFString*)show { [self addChild: [OFXMLElement elementWithName: @"show" + namespace: XMPP_NS_CLIENT stringValue: show]]; } - (void)addStatus: (OFString*)status { [self addChild: [OFXMLElement elementWithName: @"status" + namespace: XMPP_NS_CLIENT stringValue: status]]; } @@ -88,6 +91,7 @@ { OFString* prio = [OFString stringWithFormat: @"%" @PRId8, priority]; [self addChild: [OFXMLElement elementWithName: @"priority" + namespace: XMPP_NS_CLIENT stringValue: prio]]; } @end diff --git a/src/XMPPStanza.m b/src/XMPPStanza.m index 4d6b139..6886b27 100644 --- a/src/XMPPStanza.m +++ b/src/XMPPStanza.m @@ -86,7 +86,8 @@ type: (OFString*)type_ ID: (OFString*)ID_ { - self = [super initWithName: name_]; + self = [super initWithName: name_ + namespace: XMPP_NS_CLIENT]; @try { if (![name_ isEqual: @"iq"] && ![name_ isEqual: @"message"] &&