मैं एक बहु उपयोगकर्ता चैट बनाने की कोशिश कर रहा हूं। कमरे में शामिल होने पर मुझे त्रुटि मिल रही है। उपयोगकर्ता द्वाराXMPP (smack) में एमयूसी कक्ष में शामिल होने में त्रुटि
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 कमरे में शामिल होने के बाद ही पूरा हो गया है। हालांकि, शायद एक पर्सन रूम के लिए आपको कॉन्फ़िगरेशन निर्माता को मालिक के रूप में भी भेजना होगा (muC# roomconfig_roomowners -> सूची मालिकों की सूची) –
MrPk
मैं चैट रूम के लिए यहां सदस्य से जुड़ने की कोशिश कर रहा हूं। तो इसके लिए मुझे रूमownर्स जोड़ने की ज़रूरत है? मुझे बाद में कमरे के सदस्यों को जोड़ने की जरूरत है ताकि एमयूसी रूम – Jennifer