I'm reading http://xmpp.org/extensions/xep-0313.html to query Ejabberd for messages archived with a certain user.
This is the xml that I'm sending:
<iq type='get' id='get_archive_user1'>
<query xmlns='urn:xmpp:mam:tmp'>
<with>user1@localhost</with>
<set xmlns='http://jabber.org/protocol/rsm'>
<max>20</max>
</set>
</query>
</iq>
I'm receiving the first 20 messages correctly. To request again I'm adding the tag:
<after>(id in element "Last" from last request)</after>
and this also work fine. What I need is to receive the last 20 messages, not the first 20 messages. How can I achieve this?