问题
I'm using ejabberd XMPP server for a chat client, which also has a group-chat function. My problem is, that when a new user joins a group room, he only gets the first 20 messages from the room, although the history_size is set to 200(for now). On the client side, when a new user joins the room, the presence stanza contains the history element, asking for messages sent after 1970. The server time is at 2014, so theoretically it should send out all the message, or at least 200.
ejabberd.cfg muc fragment:
{mod_muc, [
%%{host, "conference.@HOST@"},
{access, muc},
{access_create, muc},
{access_persistent, muc},
{access_admin, muc_admin},
{history_size, 50},
{max_users, 500}
]}
XMPP stanza sent to join a room:
<presence
from='someusername@host'
id='someid'
to='somegroup@ccc.host/somenickname'>
<x xmlns='http://jabber.org/protocol/muc'>
<history since='1970-01-01T00:00:00Z'/>
</x>
</presence>
来源:https://stackoverflow.com/questions/22508250/ejabberd-muc-message-history