Problem (Bug?) with ChatManager when disconnecting/reconnecting


I have a problem with the ChatManager: I need to do something everytime a chat is created by another server, so I use a ChatManagerListener, which works fine. The problem is that when I use disconnect() and then connect() on the connection, I no longer receive the ChatCreated events…

I add a new ChatManagerListener after the disconnect() / connect(). I also know that I receive messages because they use a custom extension and I can see in the logs that my parser is called with the right messages.

I looked at the sources, and I think I found a problem:

In the ChatManager constructor, line 100, there is a call to connection.addPacketListener(). This is done only the first time we call connection.getChatManager(). So I think the problem is that when I call disconnect(), the packet listener is removed, and as the call to addPacketListener() is in the constructor and that the ChatManager instance is kept when we disconnect, the packet listener is never set again when I do the connect()…

Or am I wrong?

Thank you,