In my PacketInteceptor impl I throw PacketRejectedException. Most clients do not signal that anything happened, so in effect its a silent rejection. I would like to notify the sender (in the same converation window/room window) that his message was not sent and to provide some information.
Whats the best way to do this or is it possible?
Also is there a difference between one 2 one conversations and group chat handling?
Currently the server is returning a new Message of type ERROR to the sender of the rejected message. I filled this issue JM-313 for your enhancement request. So the idea would be to include “recovery” information in PacketRejectedException that will be used by SocketReader when building the response due to the rejection.
Yep. That would be the result. I will try to make the modification today so you can use the next nightly build. Will update this thread when the enhancement is available.
The enhancement is now in CVS so you can use the next nightly build. So if you now set the rejection message (#setRejectionMessage(String)) to the PacketRejectedException being thrown then the server will send a notification message to the sender of the reject packet.
In summary, if the rejected packet is an IQ or a Presence then the user will get an IQ/Presence of type error and may also get a notification message depending if you set the rejection message to the exception. But if the rejected packet is of type Message then no message will be sent back unless you specify a rejection message in the thrown exception.
The limit of a property value is determined by the type of field in the database. Currently we are using a 4000 characters limit so that should be enough. Let me know if you are planning to store a bigger value.