Muc

from documentation:

MultiUserChat muc = new MultiUserChat(conn1, "myroom@conference.jabber.org");

// Create the room

muc.create(“testbot”);

why does method to create muc room take a nickname for argument (from docs: create(String nickname) )? whose nickname? what if you’'re creating chat room before anyone has logged in?

(I need to:

  1. find out if muc room exists, 2) create muc room if it doesn’'t, 3) if muc room exists already connect user(s) to muc room…)

so: muc.create(nickname);

muc.join(nickname)

next user logs in, muc room exists already… so just do

muc.join(nickname2)?

how do you create nickname? (I thought create(nickname) created nickname, but according to documentation it creates muc room, how do you crate nickname for user to enter a room that already exists?

from docs:

create(String nickname)

Creates the room according to some default configuration, assign the requesting user as the room owner, and add the owner to the room but not allow anyone else to enter the room (effectively “locking” the room).

but I need to create a room that other users can join (it’'s a Multi-user chat room, after all…:wink:

how do I do this, pls? very confused about muc rooms, have created, still can’'t connect user(s) to it… get a 502 error… (am connected to server ok…) thank you very much…

You need a nickname when you join or create a room. The best way to check to see if a room exists is to get its info and if there is an exception it doesn’'t exist.

“get its info” meaning exactly? (I mean how to do…:wink:

thank you very much for your response…

there is a stream to find out if room exists…

what is Smack code to send this stream, pls? thank you…

I need a nickname to create /ia group chat???

this code does not create it?

MultiUserChat muc = new MultiUserChat(conn1, "myroom@conference.jabber.org");

so: how do you create a nickname for someone? (I had thought muc.create(“testbot”); creates NICKNAME, not room…

so a USER has to create a group chat? (only dealing w/group chat rooms, we won’'t have any private chats…)

I’'m having a real hard time w/this… this is my exact code now to create room, login user, connect them to group chat…

// ***************** create room **********************

nickname = sUsername + “n”;

theRoom = event + “@”;

aChatRoom = new MultiUserChat(conn, theRoom);

// ************** login new user *****************

try {

conn.login(sUsername,pswd);

} catch (XMPPException e) {

System.out.println("Exception Caught: " + e.getMessage() + " " + e);

}

//************** connect user to the ChatRoom…

try {

// aChatRoom.sendConfigurationForm(new Form(Form.TYPE_SUBMIT));

// do I need this line?

aChatRoom.create(nickname);

aChatRoom.join(nickname);

} catch (XMPPException e) {

System.out.println("Exception Caught: " + e.getMessage() + " " + e);

}

get this error in console: (this is for an applet)

Exception Caught: No response from server. No response from server.:

was wondering what I’'m doing wrong… would very much appreciate help here… thank you…

well when you are logged onto the server through smack you are a user. You are just providing a nickname to represent yourself, or in this case, your bot in the chat room.

Are you specifying the name of the conference server as part of serverName? Also, when you create the room, you are joining it as well. So calling the create and join would have unexepected results.

You should send the configuration form after you create the room as well. The room is locked until the configuration form is sent so you needant worry about people joining before you have a chance to set it up.

there is a stream to find out if room exists…

<presence type=‘‘probe’’

to=‘‘theRoom@conference.’’

from=‘‘me@’’

what is Smack code to send this stream, pls? thank

you…

you just need to create the presence packet and send it, I don’'t think there is a direct method to do this. Someone correct me if I am wrong on this. Perhaps, it should be added for convience because I know several people, including myself, have trouble determining if a room exists or not.

oh man, thank you… didn’‘t know don’'t have to connect user to room if (s)he creates it…

now I have exact same sequence as pointed out here, in documenation: (muc.html):

// Create a MultiUserChat using an XMPPConnection for a room

  MultiUserChat muc = new MultiUserChat(conn1, "myroom@conference.jabber.org");

// Create the room

muc.create(“testbot”); // (so u make up nickname on the fly?)

// Send an empty room configuration form which indicates that we want

// an instant room

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

but get 502 error on both muc.create() method and the method to send the form… why is this (exceptions don’'t tell you WHY the error (like when u get errors when compiling) just 502, which means ‘‘remote server error’’ …

(Jesus I solve one problem and as soon as I move to next step get problems there also…:(…)

(yes, I’'m specifying ‘‘conference’’ in name of room, to answer yr question…)

PLS, what is ‘‘bot’’ ???[/b]

many many thanks for yr help…

Hmm… I’'m not sure about the 502 error. I am probably missing something obvious here but does anyone else have any ideas?

I keep getting this error whether I do

Form form = new Form(Form.TYPE_SUBMIT);

EventChat.sendConfigurationForm(form);

or

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

get error 502… pls, can anybody tell me why?

(again, am using exact same code it says in documentation, as pointed out in my previous post…) thank you very much…

how does Smack (or jabber server ) know here

muc.create(nickname);

that ‘‘nickname’’ is nickname for user?

I create nickname thus… String nickname = sUsername + “N”;

but still don’'t know how Smack associates this newly-created nickname w/user… since am getting error on muc.create(nickname) this is why am also getting error on sendConfigurationForm() and getRoomInfo()… thank you very much…

Hola Kali,

Are you trying to create a room in a remote server? The 502 error means that there was an error in a remote server.

Saludos,

– Gato

well, it’'s our own jabber server here at work… but when this applet runs in the ‘‘real world’’ our clients will be doing this remotely, yes… (since applet will run on their browsers I guess this qualifies as ‘‘remote’’…)

(our system will be for a very specific purpose, not general IM use… users will already be reg’‘d/logged with us, we will pass info w/a query string, then create a jabber acct and log them in, THEN they will create muc (or join existing muc if it exists already…) all this happens ‘‘backend’’, no interface action on their part at all… they click a ‘‘chat’’ button in browser to launch chat, next thing they know they’'re inside muc…)

Gato, muchas gracias x tu ayuda… me urge esto un poco, llevo dias tratando de crear muc…

under constructor for GroupChat it says in docs:

Creates a new group chat with the specified connection and room name.[/i]

constructor for MultiUserChat:

Creates a new multi user chat with the specified connection and room name.[/i]

however, only muc has create() method, and under this create() method is says in docs:

void create(String nickname)

Creates the room according to some default configuration, assign the requesting user as the room owner, and add the owner to the room but not allow anyone else to enter the room (effectively “locking” the room).[/i]

after owner creates muc nobody else can join muc? what would be point of creating muc, then???

(class GroupChat doesn’'t have this method… I have been advised here to use muc instead of groupChat class, what is reason for that exactly?)

TIA

The javadoc could be perhaps a little more explicit but what it is trying to say, as I said earlier in this thread, is that no one can join until you configure the room.

AWenckus, thank you very much for yr help… I do have same sequence as it says in documentation, to wit:

// Create a MultiUserChat using an XMPPConnection for a room

  MultiUserChat muc = new MultiUserChat(conn1, "myroom@conference.jabber.org");

// Create the room

muc.create(“testbot”); // (’‘testbot’’? this is nickname, right?)

// Send an empty room configuration form which indicates that we want

// an instant room

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

but get error on both create() and sendConfigurationForm() (error 502 in both cases… someone said you can’‘t create muc remotely, but if only users can create muc’'s and users are usu logged in remotely, then well… how does this work…) again thank you very much…

When he said “remotely” he was refering to if you were logged onto jabber.org directly or did you logon to another server and were connecting to jabber.org via that server. Which is the case?

AWenckus, again many thanks for yr help…

am not connecting to jabber.org at all, but directly to our own jabber server here at work… and this is how it will be in ‘‘real’’ setup… our customers will connect from wherever to our own jabber server… thank you again…

AWenckus, again many thanks for yr help…

m not connecting to jabber.org at all, but directly

to our own jabber server here at work… and this is

how it will be in ‘‘real’’ setup… our customers will

connect from wherever to our own jabber server…

thank you again…

Not to distract from solving this bug… but if you want to provide customer support through chat, why not use Jive Live Assistant? It will plug in to your existing Jive Messenger server seamlessly and add in the customer support features.

Regards,

Matt

Matt, many thanks for yr response… it’‘s not for customer support, it’‘s for presenters to chat with each other during a live webcast… (there will be no private chats, no changing of someone’‘s presence… it will be actually be a very simple setting… when presenter is in our ‘‘producer console’’ they will launch chat (their uid will passed in a query string and converted to JID, they won’‘t have to either reg or log in), at that point muc will be created then joined by other producers (when producer launches chat they will either create muc or join existing muc if they’‘re not the first one to launch chat… and so on, for every live event there will be one muc – created when a presenter for a given event 1st launches chat…) Matt since you’'re author of Smack package (I think) can u pls explain why under muc.create() method it says:

create(String nickname)

Creates the room according to some default configuration, assign the requesting user as the room owner, and add the owner to the room but not allow anyone else to enter the room (effectively “locking” the room).

no one else can join muc after it’‘s created? I don’'t get this… what would be purpose of creating muc then? again many thanks for yr response…