Smack API - Read Chat History from Openfire Server

只愿长相守 提交于 2019-12-17 18:33:48

问题


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


回答1:


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




回答2:


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



来源:https://stackoverflow.com/questions/6635034/smack-api-read-chat-history-from-openfire-server

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!