59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
|
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
|
-
+
|
[pres setFrom: [XMPPJID JIDWithString: @"bob@example.org"]];
assert([[pres XMLString] isEqual: @"<presence to='alice@example.com' "
@"from='bob@example.org'><show>chat</show>"
@"<status>Bored</status><priority>20</priority>"
@"</presence>"]);
XMPPMessage *msg = [XMPPMessage messageWithType: @"chat"];
[msg addBody: @"Hello everyone"];
[msg setBody: @"Hello everyone"];
[msg setTo: [XMPPJID JIDWithString: @"jdev@conference.jabber.org"]];
[msg setFrom: [XMPPJID JIDWithString: @"alice@example.com"]];
assert([[msg XMLString] isEqual: @"<message type='chat' "
@"to='jdev@conference.jabber.org' "
@"from='alice@example.com'><body>Hello everyone</body>"
@"</message>"]);
|