I want to create group chat like whatsapp. i am using MUC service with ejabberd server. I have created group successfully but i unable to add member permanentantly in a group. I have also tried using send invitation and join group but it not work when user is offline. it is autometically remove user from group when it is offline.
So i have tried belove code to add member in a group but it gives error :
Couldn't find a field for the specified variable.
Here is my code :
EntityBareJid mucJid = JidCreate.entityBareFrom("groupname@conference.servicename");
MultiUserChatManager manager = MultiUserChatManager.getInstanceFor(conn);
MultiUserChat muc = manager.getMultiUserChat(mucJid);
Resourcepart nickname = Resourcepart.from("admin");
List<String> owners = new ArrayList<>();
owners.add("user1@servicename");
owners.add("user2@servicename");
muc.create(nickname);
Form form = muc.getConfigurationForm().createAnswerForm();
form.setAnswer("muc#roomconfig_roomowners", owners);
muc.sendConfigurationForm(form);
Can anyone help me ?