Get room chat history on demand

828 views Asked by At

From the xep-0045: http://xmpp.org/extensions/xep-0045.html#enter-history It seems that user can only get room history messages when he is joining the room. For example, user can get 20 messages when joining the room.

But after joined the room, If user want more history messages, there seems no way achieve this.

Any ideas?

1

There are 1 answers

0
xhsoldier On BEST ANSWER

I have resolve this issue. There are two solutions: 1. Current ejabberd MAM does not support MAM MUC. But there is a branch that you can use for testing. Remember it is not public released yet. https://github.com/processone/ejabberd/blob/master/src/mod_mam.erl

  1. write a module to hook the user_send_packet, in the hook, store the MUC messagess in SQL. Then provide a http API to request the MUC messages. From the client side point of view, I use the HTTP API to query the MUC history messages.

refer to this thread: ejabberd MAM does not work for MUC