I’‘ve encountered some strange behavior when using the smack library to chat with an Exodus jabber client. The scenario is as follows: my Jabber client (which uses smack) initiates a chat with another user (who happens to be using an Exodus client). everything is fine so far. then my client, closes the Chat object it was using and opens up a new one to the same user. This time, the Exodus user receives the instant messages from my client, but my client doesn’'t receive any replies.
After some investigation, I discovered that the reason is that the Exodus client is sending messages with the same Chat id (or Thread id) that it used for the first chat. However, the smack library assigns a new chat id for each new Chat object, so the replies with the old chat id get filtered out by the ThreadFilter.
This could be a problem only the Exodus client - I haven’'t experimented yet with other clients. Is there a well-defined expected behavior for use of chat ids?
One workaround I am considering is to keep track of the initial chat id that is assigned and then reuse it when restarting a chat to the same user. An alternative is to have a different constructor for the Chat object that uses a FromContainsFilter instead of a ThreadFilter.
Any advice or ideas?
thanks,
Elisha