MUC questions

so i’‘m already onto doing the multi-user chat of our application. but i have some certain questions that i’‘d like to ask regarding muc. i didn’‘t find any high-relevant match in the search so i’‘m posting this. (and i’'d probably be using this thread to post my other muc question–if ever)

  1. if the constructor MultiUserChat(XMPPConnection xmpp, String roomName) creates the room, what’‘s the point of using the create(String nickname) function? please clarify because i don’'t understand its use.

  2. i’‘m using the latest version of wildfire server as our server for the development process and the jabber.org server for implementations and demos. i was just thinking if i could change the number of users in a room and if it’‘s possible, what’‘s the function to use? wildfire has a limit of 30 users, but what if i wanted a higher upper limit? i don’‘t know about jabber.org though. generally speaking, if there’'s a possibility that i could change the settings of a room?

thanks a lot!

Message was edited by: mbacarra

Hey,

Q1: The constructor in the the MUC class does not create a new room. It creates an object for you to work with of an already existing room on the server. So if you tried

MultiUserChat(XMPPConnection xmpp, String roomName)

And the room name did not exist the method would fail.

MUC#createRoom(String jid) however, actually creates a new room on the server and sets the jid as the room owner.

See the Javadocs for a full explanation.

Q2: I’‘d check the Javadocs.You can do a large amount of room configuration so I’'d imagine its possible

hth

Jon

Q1: The constructor in the the MUC class does not create a new room. It creates an object for you to work with of an already existing room on the server. So if you tried

> MultiUserChat(XMPPConnection xmpp, String roomName)

And the room name did not exist the method would fail.

ah so if i want to create a room, i have to create an instance of the MultiUserChat and indicate the roomName there and then use the create(String username) function to create the room? please correct me if i’'m wrong. and what if i wanted to make more rooms?

MUC#createRoom(String jid) however, actually creates a new room on the server and sets the jid as the room owner.

huh? i didn’‘t see any createRoom function in the MUC class… there’'s create but not createRoom

Nope, if you try and do

MultiUserChat(XMPPConnection xmpp, String roomName)

On a room name that does not exist the call will fail afaik

You would need to do

MultiUserChat#create(String jid)

And then use a Form to add the Room information.

MUC#createRoom(String jid) however, actually creates a new room on the server and sets the jid as the room owner.

Sorry, its early and createRoom was just on the top of my head. You’'d want to use

create

yeah that’‘s what i meant. my only question is why do you use # in the code part “MUC#create”? isn’'t that supposed to be a dot?

Message was edited by: mbacarra

back to MultiUserChat questions. how come an owner can’'t be an administrator in a room that he has created?

Message was edited by: mbacarra

i have a new muc question. i think this was mentioned in another thread but the answer wasn’'t clear enough so i was thinking of asking it again.

so i get it now how to “create” a room using MultiUserChat. my issue is with “joining” a room. so i’‘ve done the “join room” part of my application, but i can’‘t seem to fix the part where a user joins a room that does not exist or hasn’‘t been created yet. you see, it doesn’‘t throw the error message 404 (room does not exist or is locked). instead it creates the room and makes the user who “joins” the room the owner of the room (i know because i’‘m using wildfire as the local server, so i could keep track of what’'s happening). the constructor description in the javadocs said that “…no information is sent to or received from the server until a user attempts to join…”

thanks!

This method works fine for me.

//ALLOW A USER TO JOIN AN EXISTING MULTI USER CHAT ROOM

public MultiUserChat joinExistingMUC(Object conn,String room_name)

{

MultiUserChat muc = null;

try

{

XMPPConnection connx = (XMPPConnection) conn;

muc = new MultiUserChat(connx,room_name+CONFERENCE_SERVICE_NAME);

DiscussionHistory history = new DiscussionHistory();

history.setMaxStanzas(200);

muc.join(connx.getUser(),“password”,history,SmackConfiguration.getPacketReplyTi meout());

}

catch(XMPPException xmpe){xmpe.printStackTrace();}

return muc;

}

/code

I am using this in a http environment hence the use of Object conn cast.

Hope this helps.