XMPP创建房间

请求

    //创建一个新的群聊房间,roomName是房间名 fullName是房间里自己所用的昵称
    NSString *jidRoom = [NSString stringWithFormat:@"%@@conference.siteviewwzp", roomName];
    XMPPJID *jid = [XMPPJID jidWithString:jidRoom];

    XMPPRoomCoreDataStorage *roomstorage = [[XMPPRoomCoreDataStorage alloc] init];
    XMPPRoom *room = [[XMPPRoom alloc] initWithRoomStorage:roomstorage jid:jid dispatchQueue:dispatch_get_main_queue()];
    
    XMPPStream *stream = [self xmppStream];
    [room activate:stream];
    
    [room joinRoomUsingNickname:jabberID_ history:nil];
    
    [room addDelegate:self delegateQueue:dispatch_get_main_queue()];

创建成功

            // 服务承认房间新建成功
            /*
             
             
             
                
                
             
             
             */

服务器锁定消息

AppDelegate:xmppStream:didReceiveMessage: 确认配置之前已锁住该房间,禁止进入。


查询房间默认设置

- (void)xmppRoomDidCreate:(XMPPRoom *)sender
{
	DDLogInfo(@"%@: %@", THIS_FILE, THIS_METHOD);
    [sender fetchConfigurationForm];
}
报文

加入房间委托

AppDelegate: xmppRoomDidJoin:
AppDelegate: xmppRoom:didReceiveMessage:fromOccupant:

房间配置

房间配置已创建房间“efa”。要接受缺省配置,请单击“确定”按钮。或填写以下表单以完成设置:http://jabber.org/protocol/muc#roomconfigefaefa030moderator2013-08-12 15:30:15.123 ChatTest[3132:c07] 确认配置之前已锁住该房间,禁止进入。
participantvisitor1000注意:缺省情况下,只有管理员才可以在仅用于邀请的房间中发送邀请。00如果需要密码才能进入房间,则您必须在下面指定密码。anyone001允许用户注册房间1您可以指定该房间的管理员。请在每行提供一个 JID。您可以指定该房间的其他拥有者。请在每行提供一个 JID。57787d89@siteviewwzp






你可能感兴趣的:(IOS,XMPP)