Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- @IBAction func CreateGroupBtn(sender: UIButton)
- {
- var roomJID = XMPPJID.jidWithString("testRoom@conference.orange.local")
- var roomMemoryStorage = XMPPRoomMemoryStorage()
- var xmppRoom = XMPPRoom(roomStorage: roomMemoryStorage, jid: roomJID, dispatchQueue: dispatch_get_main_queue())
- xmppRoom.activate(xmppStream())
- xmppRoom.addDelegate(self, delegateQueue: dispatch_get_main_queue())
- xmppRoom.joinRoomUsingNickname("admin", history: nil);
- }
- func xmppRoomDidCreate(sender: XMPPRoom!)
- {
- println("room created (sender.description)");
- }
- func xmppRoomDidJoin(sender: XMPPRoom!) {
- println("romm joined")
- sender.fetchConfigurationForm()
- sender.configureRoomUsingOptions(nil)
- sender.fetchMembersList();
- sender.sendMessageWithBody("null");
- var strInvitedUserName = XMPPJID.jidWithString("mihir@orange.local");
- sender.inviteUser(strInvitedUserName, withMessage: "greetings");
- }
- override func viewDidLoad()
- {
- super.viewDidLoad()
- var server = "conference.orange.local";
- var id = xmppStream().generateUUID();
- var serverJID = XMPPJID.jidWithString(server)
- var iq = XMPPIQ.iqWithType("get", to: serverJID, elementID: id)
- iq.addAttributeWithName("from", stringValue: "admin@orange.local")
- var query = DDXMLElement.elementWithName("query") as! DDXMLElement;
- query.addAttributeWithName("xmlns", stringValue: "http://jabber.org/protocol/disco#items" )
- iq.addChild(query);
- xmppStream().addDelegate(self, delegateQueue: dispatch_get_main_queue())
- xmppStream().sendElement(iq);
- }
- <iq xmlns="jabber:client" from="admin@orange.local"
- to="admin@orange.local/35441594471443421711351344"
- id="3F9B0234-0233-4DF0-9174-34CC82FF6B70" type="result">
- <query xmlns="jabber:iq:roster">
- <item subscription="both" jid="mihir@orange.local">
- <group>Buddies</group>
- </item>
- <item subscription="both" jid="kalpesh@orange.local">
- </item>
- </query>
- </iq>
- func xmppRoom(sender: XMPPRoom!, didFetchMembersList items: [AnyObject]!) {
- println("members= (items)");
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement