I see there is a Smack PacketExtension that allows xhtml formatted messages but is there a means to accomplish this from a plugin?
I have a plugin that has a PacketInterceptor and if a certain condition exists, I return a message to the user in the PacketRejectedException that is thrown. I have a need to format this message in a table or something similar.
The problem I have is that I am not returning a Message but rather a PacketRejectedException thus I cannot see a way of calling XHTMLManager.addBody(Message message, String body) on an Exception.
public void interceptPacket(Packet packet, Session session, boolean incoming, boolean processed) throws PacketRejectedException {
PacketRejectedException pre = new PacketRejectedException();
if {//check for something
pre.setRejectionMessage("my message"); }
else {
pre.setRejectionMessage("my other message");
}
throw pre;