and it return response with count, but how i can get the messages, as i can see those messages in the smack debug, when it is set to enabled true.
How do i listen for group messages that are archived ?
I understand that, so, what i am doing is,i am sending a custom IQ with start and end date and it returns me all the archived messages, and i dont know how do parse that sort of structure.
the message packet that i get as a result from the above IQ is : - >
You could still try what happens, if you use the MamManager.
Maybe it just works in your case.
You could also take a look at queryArchive(MamQueryIQ) to see, how the MamManager handles returning results.
I get an error saying error and cancel, the only way that seems possible in that case, is using custom iq, and the problem is if we enable the mam manager it will archive every message in the database and it will make it hard to persist that amount of data, so we need to parse that sort of message packet.
Smack is currently lacking an API to query different MamArchives besides the current user’s archive. So it is not yet perfect for the non-self-user case, but I expect that to change in future release.
I’ve to correct myself here. Smack has already an API to query different MAM archives. Just use MamManager's getInstanceFor(XMPPConnection connection, Jid archiveAddress) method, and use the MUC address as archive address.
And no, queryArchive(Jid) does not what you want (as explained in the javadoc).