powered by Jive Software

Using MultiUserChat and invite users to a chatroom


I’'m creating a plugin of some sort that allows to popup the messenger to notify the dev if an error occurs on the main program.

MultiUserChat muc = new MultiUserChat(_connection, "room@chat.example.com");


muc.sendConfigurationForm(new Form(Form.TYPE_SUBMIT));

// userarraylist is a list of selected user

for (int i = 0; i < userarraylist.size(); i++) {

Message message = new Message(userarraylist.get(i));

message.setBody(“Join me for a group chat!”);

message.addExtension(new GroupChatInvitation("room@chat.example.com"););



it works on one user request. but i need to send to many accounts, is this possible? how can i invite multiple users?

Thanks a lot.





I’'ve tried to use MultiUserChat.invite

but it only invites 2 users…

more than that, it just finish the program and doesn’'t

pop any invitation.

Weird, after I added the “XMPPConnection.DEBUG_ENABLED = true;” to debug my code, it now seems to send all the invitations.

XMPPConnection.DEBUG_ENABLED = true;

// assume i have already a _connection

MultiUserChat muc = new MultiUserChat(_connection, “room@conference.localhost”);

// Create the room


muc.sendConfigurationForm(new Form(Form.TYPE_SUBMIT));

muc.invite(“user1@localhost”,“some message”);

muc.invite(“user2@localhost”,“some message”);

muc.invite(“user3@localhost”,“some message”);

Do you guys have any idea what happen?