Sending to a Conference ? Can't see it?

Hi,

I’m a newbie on this, so could do with some help on something I’m trying to put together using SMACK:

First , the following works:

  1. I have a simple ‘alarm’ mechanism written in Java which works and does this:

i. Connects to my OpenFire, Logs is an ‘usera’ and waits for the alarm condition.

ii. When the alarm triggers, it sends a message to ‘userb’ (getChatManager()…which an empty implementation of ‘processMessage’ - so its one-way communication). The receiving user is connected via Spark client.

ii. When shut down it does a disconnect.

All works fine and dandy.

Now what I would like to do is instead of sending a message to a specific user I need to target a ‘conference’.

I set up the conference using a Spark client, and keep the conference room dialogue open: this provides the JID for the conference, something like:

‘alarms@host’. The room is open and any client (testing this - works fine with interactive human users) can join the room.

I changed the alarm-sender to send a message to the new JID - but none of the clients in the conference room either see the presence of this user or the message. The sender program does not error.

Do you have to code differently when sending to a conference-room or have I messed up the JIDs I wonder ?

(I notice that the conference room JID is actually something ‘alarms@host.company.com’ whereas the JIDs of the users are just ‘alarms@host’.)?

Thanks,

John

To illustrate this better, here’s a code-stub I’m using, and some trace information, Thanks. John

//

XMPPConnection.DEBUG_ENABLED=true;
connection=new XMPPConnection(“macbook”);
connection.connect();
connection.login(“user1”,“user1”);
chat=connection.getChatManager().createChat(“test@conference.macbook”, this);
Message message=new Message();
message.setType(Message.Type.groupchat);
message.setBody(“blah blah”);
chat.sendMessage(message);

//

Here’s the packet sent:

//

blah blah Tubgu0 //

And the error I get:

//

blah blah Tubgu0

//

Additionally I note that if aim at the conference JID the messageListener receives a copy of the message sent, but when I address a single user’s JID, it does not…

It looks like I need to something else to see who is in the conference or something like this ?

That echo is just the error coming back:

//

public void processMessage(Chat chat, Message message) {
System.out.println(message.getBody());
System.out.println(“Message Type is:”+message.getType().toString());
pleaseQuit=message.getBody().equals(“quit”);
}

//

//

run:
blah blah
Message Type is:error

//

Got it…almost anyway…

Code changed to:

//
connection.login(“user1”,“user1”,“test@conference.macbook”);
chat=connection.getChatManager().createChat(“jpw@macbook”, this);

//

That is : target the conference room as the resource at login…now to change the ‘createChat’ to a broadcast type message I think…