There is probably a simple answer to this, but:
If I do like:
Chat c = conn1.createChat("user@server.org");
c.sendMessage(“Hi”);
System.out.println(c.nextMessage().getBody());
And in the other end:
conn2.addPacketListener(new PacketListener() {
public void processPacket(Packet packet) {
Chat chat = conn2.createChat(packet.getFrom());
chat.sendMessage(“got it”);
}
}, new MessageTypeFilter(Message.Type.CHAT));
But nextMessage() never returns. If i put a packetListener on conn1 it works, but nextMessage() doesn’'t.
Here goes the question: How do I reply to a chat, in a way that nextMessage() will understand?