Hello all,
I am trying to impl packet listener, such that when ever somebody tries to initate chat, I got the event for it.? Not sure PacketListener is the right choice. I can send the messages and initate chat myself, but I’m not getting event when somebody else tries to initate chat with me.I’ve code like this:
connection.addPacketListener(new MyPacketListener(), new OrFilter());
class MyPacketListener implements PacketListener {
public void processPacket(Packet packet) {
if (packet instanceof Message) {
Message msg = (Message) packet;
// Process message
System.out.println("Subj: “msg.getSubject()”, Body: "+msg.getBody()
*", Type: "*msg.getType());
} else {
System.out.println("=== Got a packet === "+packet);
}
}
}