Can't retrieve XMPP messages by MAM after a specified id

609 Views Asked by At

I'm writing an xmpp messenger. By my design it stores local message history. When the user comes online and opens the dialog with someone my program requests archive (XEP-313) from the last locally stored message to the last message the server archive has, using "after" tag. However it isn't working the way I expected it to.

The request

<iq id="qxmpp21" type="set">
    <query xmlns="urn:xmpp:mam:1" queryid="qxmpp21">
        <x xmlns="jabber:x:data" type="submit">
            <field type="hidden" var="FORM_TYPE"><value>urn:xmpp:mam:1</value></field>
            <field type="text-single" var="with"><value>[email protected]</value></field>
        </x>
        <set xmlns="http://jabber.org/protocol/rsm">
            <max>100</max>
            <after>5d10ba97-9ce8-46d4-9547-4f5e91e4ac19</after>
        </set>
    </query>
</iq>

The response

<iq xmlns="jabber:client" id="qxmpp21" xml:lang="en" xmlns:xml="http://www.w3.org/XML/1998/namespace" type="result" from="[email protected]" to="[email protected]/QXmpp">
    <fin xmlns="urn:xmpp:mam:1" queryid="qxmpp21" complete="true">
        <set xmlns="http://jabber.org/protocol/rsm">
            <count xmlns="http://jabber.org/protocol/rsm">465</count>
        </set>
    </fin>
</iq>

I use qxmpp library and ejabberd as a server.

Am I doing anything wrong? Thanks in advance!

0

There are 0 best solutions below