Hello all,
I am attempting to intercept a packet that is an invite to a MUC room.
Seems that it is an instanceof Message but I cannot seem to further filter unless I parse the body (which I am trying to avoid).
Here is my Listener code
private class MyPacketInterceptor implements PacketInterceptor {
public void interceptPacket(Packet packet, Session session, boolean incoming, boolean processed) throws PacketRejectedException {
if(packet instanceof Message) {
Message message = (Message) packet;
Type type = message.getType();
Log.info("Message type="+message.getType().toString());
}
}
Here is the Packet.toString() results:
zzzzzzzzzzzt<message from="testroom@conference.mymachine" to="user1@mymachine">
<x xmlns="http://jabber.org/protocol/muc#user">
<invite>
<reason>testroom</reason>
</invite>
</x>
<x xmlns="jabber:x:conference" jid="testroom@conference.mymachine"/>
The Type.toString() results:
normal
Is there a way to filter further to determine if this is an invite?
Thanks!