I am using Smack for one of my project for chat module. I succeed in implementation. Also got chat history. using below code:
CoroutineScope(Dispatchers.IO).launch {
var mamManager = MamManager.getInstanceFor(mConnection)
var result = async { mamManager.queryMostRecentPage(jId, 50) }.await()
withContext(Dispatchers.Main){
chatList.clear()
for(message in result.messages){
chatList.add(message)
}
mMsgAdapter?.notifyDataSetChanged()
}
}
In response, I get list of all messages. Below are xml response of one of the message from list:
<message xmlns='jabber:client' to='raju@testing.com' from='nit@testing.com/562197503342225256402' id='RC0CL-101' xml:lang='en' type='chat'><archived xmlns='urn:xmpp:mam:tmp' by='nit@testing.com' id='1596112104059'></archived><stanza-id xmlns='urn:xmpp:sid:0' id='1596112104054539' by=''nit@testing.com'/><body>Hello there.</body></message>
Here, I am not getting delay tag in that. I tried almost everything but didn’t get anything.