Route Message to MUC Room

Hi,

I’m sure this is an easy one for someone out there, but I can’t get it to work. I have a plugin I’m writing and I just can’t seem to get it to send a message out to a MUC room.

Let’s say I have a room with the name “123” here’s the code that doesn’t get anywhere:

MessageRouter router = XMPPServer.getInstance().getMessageRouter();

**
**

PacketExtension ext = new PacketExtension(“x”,“test:ext:room”);

Message message = new Message();

**message.setTo(“33@conference.localhost”); **

message.setFrom(“33@conference.localhost”);

message.addExtension(ext);

message.setType(Message.Type.groupchat);

**
**

router.route(message );

Any ideas?

Thanks,

Brian

In the example above let’s say the room is “33” instead of “123”. I know in my example code I put “33”… but it’s still not arriving to room “33”

I removed the setFrom() method call and that did the trick.