我已经安装了带有基本配置的 tigase7.0.2。
现在我正在使用已安装的服务器执行 MUC,代码如下:
用于创建房间
MultiUserChatManager manager = MultiUserChatManager.getInstanceFor(connection);
MultiUserChat muc = MainActivity.manager.getMultiUserChat("myroom@muc." + connection.getServiceName());
加入房间
muc = MainActivity.manager.getMultiUserChat("myroom@muc." + connection.getServiceName());
muc.join(connection.getUser().split("@")[0]);
muc.addMessageListener(new MessageListener() {
@Override
public void processMessage(final Message message) {
runOnUiThread(new Runnable() {
@Override
public void run() {
Toast.makeText(UserListActivity.this, message.getFrom() + ":" + message.getBody(), Toast.LENGTH_SHORT).show();
}
});
}
});
当我加入房间时,Toast 中会出现以下消息。
: Room is locked. Please configure.
: Welcome! You created new Multi User Chat Room. Room is locked now. Configure it please!
当我加入房间时,它会在日志中出现以下错误。