I have 2 clients running on my laptop. One of them is a Smack client I’m developing, the other is a standard Spark client. Their both connecting to Jabber.org. My issue, is that the inital ThreadId being sent in the first Smack message is not being sent in the response from the Spark client.
So, the Smack client would send something like this:
I read in another forum post that this may be an issue with the Server name of OpenFire, but I’m using here Jabber.org.
Is this normal behavior that I’m experiencing? I would imagine the reply should be with the inital ThreadId.
Any insight would be greatly appreciated,
I looked into the Smack code and saw that when a message is recieved, if the ThreadId is not found, then ChatManager calls:
chat = getUserChat(StringUtils.parseBareAddress(message.getFrom()));
to get the Chat object. The thing here is that it removes the resource information and uses the bare XMPP address. But when I looked at what happens when a message is sent, it simply uses whatever JID was passed in by the user and uses that to store the chat object as is:
So in there is the problem, when a message is sent the full JID with the resource is used to store the chat object, but when a message is recieved the JID is parsed to remove the resource, and that email is used to lookup the chat object.
I would imagine if the resource is removed when a message is recieved to lookup a chat object, it should be removed when the message is being sent and the chat object is being created. Obviously Smack is an established project, so I have a feeling this is done for a reason, if someone can please enlighten me, I would appreciate it.
I’m also getting this problem. Did you ever find the reason why?
It would be very useful for my application to have the threadid remain the same for the duration of the chat. Has anyone found a way to achieve this?