Hi,
i try to write a plugin for Openfire. With this Plugin i want to send Messages to MultiUserChatRooms (MUCRoom).
I have written this lines of code:
Message newMessage = new Message();
newMessage.setType(Type.groupchat);
newMessage.setBody(mucRoomEntity.getMessage());
MultiUserChatService multiUserChatService = XMPPServer.getInstance().getMultiUserChatManager().getMultiUserChatService("conference");
MUCRoom chatRoom = multiUserChatService.getChatRoom(muc);
//To Jid
JID tojid = chatRoom.getJID();
newMessage.setTo(tojid);
//From Jid
String fromJid = serviceName+"."+componentManager.getServerName();
newMessage.setFrom(fromJid);
componentManager.sendPacket(this, newMessage);
This will send a Message like:
<message type="groupchat" to="muc@conference.test" from="component.test">
<body>hello world</body>
</message>
The Problem is that the message will not send to the Chatroom.
But a Message is send back to my component:
<message type="error" to="component.test" from="muc@conference.test">
<body>hello world</body>
<error code="406" type="modify">
<not-acceptable xmlns="urn:ietf:params:xml:ns:xmpp-stanzas"/>
</error>
</message>
How do you do it right?