5
다중 사용자 채팅을 만들려고합니다. 방에 들어가는 중에 오류가 발생했습니다. 사용자가 합류 방MUC 룸에 XMPP (메아리)로 참여하는 중 오류가 발생했습니다.
public void joinMultiUserChatRoom(String userName, String roomName) {
// Get the MultiUserChatManager
MultiUserChatManager manager = MultiUserChatManager.getInstanceFor(connection);
// Create a MultiUserChat using an XMPPConnection for a room
MultiUserChat multiUserChat = manager.getMultiUserChat(roomName + "@conference.localhost");
DiscussionHistory history = new DiscussionHistory();
history.setMaxStanzas(-1);
try {
multiUserChat.join(userName, "", history, connection.getPacketReplyTimeout());
} catch (Exception e) {
e.printStackTrace();
}
}
얻기 목록 : MUC 방에 합류하기위한
public void createMultiUserChatRoom(String roomName, String nickName) {
// Get the MultiUserChatManager
MultiUserChatManager multiUserChatManager = MultiUserChatManager.getInstanceFor(connection);
// Get a MultiUserChat using MultiUserChatManager
MultiUserChat multiUserChat = multiUserChatManager.getMultiUserChat(roomName+"@conference.localhost");
try {
multiUserChat.create(nickName);
Form form = multiUserChat.getConfigurationForm();
Form submitForm = form.createAnswerForm();
List<FormField> formFieldList = submitForm.getFields();
for (FormField formField : formFieldList) {
if(!FormField.Type.hidden.equals(formField.getType()) && formField.getVariable() != null) {
submitForm.setDefaultAnswer(formField.getVariable());
}
}
submitForm.setAnswer("muc#roomconfig_persistentroom", true);
submitForm.setAnswer("muc#roomconfig_publicroom", true);
multiUserChat.sendConfigurationForm(submitForm);
} catch (Exception e) {
e.printStackTrace();
}
}
방법 : 채팅방을 만들기위한 방법
public List<String> getJoinedGroupByUserName(String userName) {
// Get the MultiUserChatManager
MultiUserChatManager manager = MultiUserChatManager.getInstanceFor(connection);
List<String> joinedRooms = null;
try {
// Get the rooms where [email protected] has joined
joinedRooms = manager.getJoinedRooms(userName+"@conference.localhost");
} catch (Exception e) {
e.printStackTrace();
}
return joinedRooms;
}
사용자 내가이 얻을 방에 참여하는 동안 메시지 : "이 회의실은 구성이 확인 될 때까지 잠겨 있습니다." 이 구성을 보낸 후 (확인) 정말 사용할 수없는
방을 만드는 동안 구성을 보내드립니다. 방에 들어가는 동안 구성을 다시 보내야합니까? 그리고 방이 존재합니다 (데이터베이스에 방을 넣는 항목이 있습니다). – Jennifer
아니요, 단지 시간을 만들지 만 CREATOR가 방에 들어온 후에 만 "작성"합니다. 그러나 persitance room의 경우 구성 작성자를 소유자 (muC# roomconfig_roomowners -> List 소유자)로 보내야합니다. –
MrPk
여기 채팅방에 가입하려고합니다. 그래서 이것을 위해서 나는 방 소유자를 추가해야합니까? 나중에 회의실 구성원을 추가하여 MUC 룸을 만들 때 추가 할 수 없습니다. – Jennifer