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?
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
refer to this thread: ejabberd MAM does not work for MUC