@@ -24,10 +24,11 @@ #include #import #import "XMPPConnection.h" +#import "XMPPJID.h" #import "XMPPStanza.h" #import "XMPPIQ.h" #import "XMPPMessage.h" #import "XMPPPresence.h" @@ -46,29 +47,29 @@ XMPPPresence *pres = [XMPPPresence presence]; [pres addShow: @"chat"]; [pres addStatus: @"Bored"]; [pres addPriority: 20]; - pres.to = @"alice@example.com"; - pres.from = @"bob@example.org"; + pres.to = [XMPPJID JIDWithString: @"alice@example.com"]; + pres.from = [XMPPJID JIDWithString: @"bob@example.org"]; assert([[pres stringValue] isEqual: @"chat" @"Bored20" @""]); XMPPMessage *msg = [XMPPMessage messageWithType: @"chat"]; [msg addBody: @"Hello everyone"]; - msg.to = @"jdev@conference.jabber.org"; - msg.from = @"alice@example.com"; + msg.to = [XMPPJID JIDWithString: @"jdev@conference.jabber.org"]; + msg.from = [XMPPJID JIDWithString: @"alice@example.com"]; assert([[msg stringValue] isEqual: @"Hello everyone" @""]); XMPPIQ *iq = [XMPPIQ IQWithType: @"set" ID: @"128"]; - iq.to = @"juliet@capulet.lit"; - iq.from = @"romeo@montague.lit"; + iq.to = [XMPPJID JIDWithString: @"juliet@capulet.lit"]; + iq.from = [XMPPJID JIDWithString: @"romeo@montague.lit"]; assert([[iq stringValue] isEqual: @""]); OFXMLElement *elem = [OFXMLElement elementWithName: @"iq"];