ObjXMPP  Check-in [39a1c76b23]

Overview
Comment:Fix namespace handling.
Downloads: Tarball | ZIP archive | SQL archive
Timelines: family | ancestors | descendants | both | trunk
Files: files | file ages | folders
SHA3-256: 39a1c76b237091244200189ba2041767c489a2f4efbce34ee3c75ad7410c668d
User & Date: js on 2011-05-12 17:49:58
Other Links: manifest | tags
Context
2011-05-12
20:51
Move namespaces to namespaces.h and add missing files to Xcode project. check-in: 12e4f83535 user: js tags: trunk
17:49
Fix namespace handling. check-in: 39a1c76b23 user: js tags: trunk
2011-04-25
23:04
Improve +[XMPPStanza stanzaWithElement:]. check-in: 29d84637d6 user: js tags: trunk
Changes

Modified src/XMPPConnection.m from [a3f2e17a8e] to [268210e651].

691
692
693
694
695
696
697

698
699
700
701
702
703
704
			     ID: bindID];

	bind = [OFXMLElement elementWithName: @"bind"
				   namespace: XMPP_NS_BIND];

	if (resource != nil)
		[bind addChild: [OFXMLElement elementWithName: @"resource"

						  stringValue: resource]];

	[iq addChild: bind];

	[self sendStanza: iq];
}








>







691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
			     ID: bindID];

	bind = [OFXMLElement elementWithName: @"bind"
				   namespace: XMPP_NS_BIND];

	if (resource != nil)
		[bind addChild: [OFXMLElement elementWithName: @"resource"
						    namespace: XMPP_NS_BIND
						  stringValue: resource]];

	[iq addChild: bind];

	[self sendStanza: iq];
}

Modified src/XMPPMessage.m from [44752eb874] to [8540bdc9fe].

18
19
20
21
22
23
24

25
26
27
28
29
30
31
 * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
 * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
 * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
 * POSSIBILITY OF SUCH DAMAGE.
 */

#import "XMPPMessage.h"


@implementation XMPPMessage
+ message
{
	return [[[self alloc] init] autorelease];
}








>







18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
 * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
 * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
 * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
 * POSSIBILITY OF SUCH DAMAGE.
 */

#import "XMPPMessage.h"
#import "XMPPConnection.h"

@implementation XMPPMessage
+ message
{
	return [[[self alloc] init] autorelease];
}

71
72
73
74
75
76
77

78
79
80
			      type: type_
				ID: ID_];
}

- (void)addBody: (OFString*)body
{
	[self addChild: [OFXMLElement elementWithName: @"body"

					  stringValue: body]];
}
@end







>



72
73
74
75
76
77
78
79
80
81
82
			      type: type_
				ID: ID_];
}

- (void)addBody: (OFString*)body
{
	[self addChild: [OFXMLElement elementWithName: @"body"
					    namespace: XMPP_NS_CLIENT
					  stringValue: body]];
}
@end

Modified src/XMPPPresence.m from [50c4416518] to [dad887eaee].

18
19
20
21
22
23
24

25
26
27
28
29
30
31
 * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
 * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
 * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
 * POSSIBILITY OF SUCH DAMAGE.
 */

#import "XMPPPresence.h"


@implementation XMPPPresence
+ presence
{
	return [[[self alloc] init] autorelease];
}








>







18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
 * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
 * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
 * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
 * POSSIBILITY OF SUCH DAMAGE.
 */

#import "XMPPPresence.h"
#import "XMPPConnection.h"

@implementation XMPPPresence
+ presence
{
	return [[[self alloc] init] autorelease];
}

71
72
73
74
75
76
77

78
79
80
81
82
83

84
85
86
87
88
89
90

91
92
93
			      type: type_
				ID: ID_];
}

- (void)addShow: (OFString*)show
{
	[self addChild: [OFXMLElement elementWithName: @"show"

					  stringValue: show]];
}

- (void)addStatus: (OFString*)status
{
	[self addChild: [OFXMLElement elementWithName: @"status"

					  stringValue: status]];
}

- (void)addPriority: (int8_t)priority
{
	OFString* prio = [OFString stringWithFormat: @"%" @PRId8, priority];
	[self addChild: [OFXMLElement elementWithName: @"priority"

					  stringValue: prio]];
}
@end







>






>







>



72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
			      type: type_
				ID: ID_];
}

- (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]];
}

- (void)addPriority: (int8_t)priority
{
	OFString* prio = [OFString stringWithFormat: @"%" @PRId8, priority];
	[self addChild: [OFXMLElement elementWithName: @"priority"
					    namespace: XMPP_NS_CLIENT
					  stringValue: prio]];
}
@end

Modified src/XMPPStanza.m from [6749e640ea] to [e142fdac99].

82
83
84
85
86
87
88
89

90
91
92
93
94
95
96
			       ID: ID_];
}

- initWithName: (OFString*)name_
	  type: (OFString*)type_
	    ID: (OFString*)ID_
{
	self = [super initWithName: name_];


	@try {
		if (![name_ isEqual: @"iq"] && ![name_ isEqual: @"message"] &&
		    ![name_ isEqual: @"presence"])
			@throw [OFInvalidArgumentException newWithClass: isa
							       selector: _cmd];








|
>







82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
			       ID: ID_];
}

- initWithName: (OFString*)name_
	  type: (OFString*)type_
	    ID: (OFString*)ID_
{
	self = [super initWithName: name_
			 namespace: XMPP_NS_CLIENT];

	@try {
		if (![name_ isEqual: @"iq"] && ![name_ isEqual: @"message"] &&
		    ![name_ isEqual: @"presence"])
			@throw [OFInvalidArgumentException newWithClass: isa
							       selector: _cmd];