powered by Jive Software

Trying to change the subject of a room via plugin

Hi,

I am trying to change the subject of a MUC room via an openfire plugin:

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

Message message = new Message();

message.setTo("test@conference.mydomain.com");

message.setType(Message.Type.groupchat);

message.setSubject(“MY new subject”);

router.route(message);

The code above does not change anything. Any ideas??

Figured it out by looking at how the muc-room-edit-form.jsp file does it:

Message message = new Message();

     message.setType(Message.Type.groupchat);

     message.setSubject(newSubject);

     message.setFrom(chatRoom.getRole().getRoleAddress());

     message.setTo(chatRoom.getRole().getRoleAddress());

     chatRoom.changeSubject(message, chatRoom.getRole());