4

如何在我的 openfire 服务器上加入现有的 MUC?

我已设法使用我的凭据和所有凭据加入服务器。

但我似乎找不到任何关于如何加入 MUC 的代码示例?

4

2 回答 2

0

尝试这个

- (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");
        }
    }
于 2014-07-04T10:15:25.607 回答
0

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

只需按照所有步骤操作,您就可以进行多用户聊天。希望这对你有用 :)

于 2014-07-03T07:04:34.017 回答