How to get the chat history via Smack API?

UserA talks to UserB, and then UserA wants to retrieve the chat history, how to do it via Smack api?

I go through all the tables of Openfire and can not find any data of chat history, just find the offline chat in table ‘JIVEOFFLINE’.

Are those chat history saved in database of openfire? if yes, saved in which table?


There is currently no way to get chat history from Smack, other than offline messages. The only option for using Smack is to keep track of chat history yourself using a custom client similar to what Spark does. On the Openfire side of things, you can use the option called: Server Settings->Message Audit Policy->Enable Message Auditing to turn on a kind of chat history. This feature just logs all the packets to a flat file on disk, which may or may not help you.