4
votes

How can I fetch chat log or chat history from Openfire server using Smack library into an Android application?

2
Have you found the answer? I have the same problem. My XMPP server supports storing the messages, but I can't find the smack clinet android API to retrieve those messages....user2924714

2 Answers

-1
votes

As far as I know, there is no storing of chat history in Openfire. You can only get offline messages sent by user (when they connect next time for example), but if you want to store the messages you can implement it yourself directly on the XMPP server (personally I did it using mongodb - it works great!).

But then, maybe I missed something in Openfire...

4
votes

Openfire server can surely save chat histories. To turn it on, you should go to Server/Server Settings/Message Audit Policy and select Enable Message Auditing. As you can see there, messages will be held under the /.../openfire/logs folder in some kind of XML format. You can parse this XML and get your messages very easily