Quantcast
Channel: Ignite Realtime: Message List
Viewing all articles
Browse latest Browse all 11593

Re: processMessage not called after updated to (a)smack 4.0, possibly a bug?

$
0
0

Thanks Flow. That answered my question.

 

There is still a situation where I am not sure how to best handle. Say Bob and Alice want to send a message to each other at the same time. Bob's client creates a new Chat object with the default thread id (say B2A) and Alice's client also creates new Chat object with a unique thread id (say A2B).

 

Bob sends messages with thread id B2A, but receive message with the thread id A2B (similarly for Alice). So there are two Chat objects, but actually there is only one conversation between Bob and Alice.

 

Before the fix, everything is taken care of in the processMessage function of the MessageListener when Bob's client created the Chat. Now there two places (Chat objects) a message can be received from Alice, the processMessage function, and also the packetListener of the XMPP connection.

 

What's the best way to consolidate all the message processing in a single place?

 

Solutions I can think of:

1) Somehow create the same thread id for both clients when Bob and Alice initiated the Chat.

2) When Bob recieved a message from Alice and if the thread id of the message is different from the Bob's thread id, pass the same MessageListener to the new Chat.


Viewing all articles
Browse latest Browse all 11593

Trending Articles