I installed Openfire 3.9.1 with Smack 3.4.1 (standard installaion of Openfire with in memory database).
The basic example does not work with Smack 3.4.1, but does with 3.2.1. I can send messages with both versions, but the MessageListener is not called with 3.4.1. The example I run:
Connection connection = new XMPPConnection(“jabber.org”);
connection.connect();
connection.login(“mtucker”, “password”);
Chat chat = connection.getChatManager().createChat("jsmith@jivesoftware.com", new MessageListener() {
Hi, sure I changed the credentials for my test (I just copy pasted the example straight from the docs):
----- …
connection.login(“jose”, “gogogo”);
Chat chat = connection.
getChatManager().createChat(“adrian@haf”, new MessageListener() {
----- …
I just cloned the git project and found the point in time where it stopped working for me:
5bbf6cf22471a6f6c767881395ffdc1e583a9b61 broken
(Added some configuration to the ChatManager to allow for different matching modes on incoming messages with no thread id.)
782448b3ec668c4b10d4d1626d05d7beb4924793 works
With the commit 5bbf6cf the following code was removed from the ChatManager which causes the example to fail:
if (chat == null) {
// Try to locate the chat based on the sender of the message
chat = getUserChat(message.getFrom());
}
I’m using the latest Spark client to respond to the example java chat sender. I’m not the expert, but maybe the Spark client is not returning the threadId back to Smack in the same field, or not at all?