简体   繁体   English

XMPP - 如何加入现有的MUC会议室

[英]XMPP - How to join an existing MUC room

How do I join an existing MUC on my openfire server? 如何加入我的openfire服务器上的现有MUC?

I have managed to join the server with my credentials and all. 我已经设法加入了我的凭据和所有的服务器。

But I cant seem to find any code samples for how to join a MUC? 但我似乎无法找到任何代码样本如何加入MUC?

0045 http://xmpp.org/extensions/xep-0045.html 0045 http://xmpp.org/extensions/xep-0045.html

JUst follow all the steps and you are able to do Multi user chat. JUst遵循所有步骤,您可以进行多用户聊天。 HOpe it works for you :) 希望这对你有用 :)

Try this 尝试这个

- (void)joinRoomWithRoomName:(NSString *)roomName nickName:(NSString *)nickName 
    {
        if(roomName && nickName)
        {
            _xmppRoomStorage = [XMPPRoomHybridStorage sharedInstance];
            XMPPJID *roomJid = [XMPPJID jidWithString:[NSString stringWithFormat:@"%@@%@.%@",roomName,@"conference",self.hostName]];
            _xmppRoom = [[XMPPRoom alloc] initWithRoomStorage:_xmppRoomStorage jid:roomJid];
            [_xmppRoom addDelegate:self delegateQueue:dispatch_get_main_queue()];
            [_xmppRoom activate:_xmppStream];
            NSXMLElement *history = [NSXMLElement elementWithName:@"history"];
            [history addAttributeWithName:@"maxstanzas" stringValue:MAX_ROOM_HISTORY];
            [_xmppRoom joinRoomUsingNickname:nickName history:history];
        }
        else
        {
            NSLog(@"room creation arguments missing");
        }
    }

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM