简体   繁体   中英

Smack API - Read Chat History from Openfire Server

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

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

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...

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM