Message.Type

Warm Greetings

I’'m trying to send messages from smack by attaching Java objects. This is working fine but could I set the message type to a custom value so that I can write a proper messaging filter at the receiving end ?

I think that the Message.Type use final and private modifiers so extending may be out !

FYI: I’'m using Smack at either end for the communication.

Thanks.

-Rajesh

Rajesh,

A small workaround could be setting a property indicating the type of object attached to the message and create a packetfilter to look for that property…

Just a suggestion

Hugo

Hugo

Yes this is possible, i could do something like

PacketFilter myFilter = new PacketFilter() {
     public boolean accept(Packet packet) {
         return packet.getProperty("RefObject").equals("MyObject");
     } };

Thanks again !

-Rajesh