powered by Jive Software

IncomingChatMessageListener Problem

smack42
android

#1

I am stuck in a problem for days. The thing is I have that IncomingChatMessageListener implemented in a class which is being set after connection, So when user A send messages to user B and user is offline or not connected and when that user B connect he receives those messages and causes duplicacy in chat_listing as I have already fetched the chat -history from db using a REST_API. So my question is how to make sure that when the user comes online he don’t get the old messages without being sen in real time by other user. Please suggest some solution