ejabberd: retrieve chat history from mysql db

非 Y 不嫁゛ 提交于 2019-12-31 22:59:16

问题


I'm building a chat system based on ejabberd using an iOS client (and XMPPFramework).

My current chat system supports only one-on-one conversations between users saving a chat history on a MySQL database.

In order to recreate the same chat system, i'd need ejabberd to retrieve chat history from my database so the users don't lose previous conversations when switching to the new chat system.

I'd like not to save the conversation client-side since the iOS app can be deleted and reinstalled (or the user could switch device).

Is it possible to make ejabberd read chat history from my MySQL db?


回答1:


This should be possible with mod_archive_odbc. It's an additional ejabberd module that you can find by checking out http://svn.process-one.net/ejabberd-modules/ with SVN. An example on how to build and install a module on Debian can be found here.




回答2:


The question is a bit old, but if anyone is still interested.

This could be achieved by Message Archive Management (http://xmpp.org/extensions/xep-0313.html).

Most complete implementation of this XEP is in MongooseIM (fork of ejabberd). https://github.com/esl/MongooseIM/blob/master/apps/ejabberd/src/mod_mam.erl

ProcessOne page claims to have support for archiving on this page: http://www.process-one.net/en/ejabberd/#getejabberd, but there is no mention on this page: http://www.process-one.net/en/ejabberd/protocols/. Looks like they are using their custom specification.

Please note, that you won't be able to use mod_mam from MongooseIM directly with processone ejabberd, because of small differences in function arguments that module is calling.



来源:https://stackoverflow.com/questions/9911210/ejabberd-retrieve-chat-history-from-mysql-db

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