检索历史聊天Openfire XMPP框架



我使用Robbie Hanson的xmppframework和Openfire服务器开发了一个聊天应用程序。我可以成功地进行一对一和群聊。但是当我得到聊天记录时,我不能得到整个记录。我使用XEP-0136来存档历史记录:

发送智商:

 <iq type="get" id="hichic@macintosh">
    <retrieve
        xmlns="urn:xmpp:archive" with="group12@conference.macintosh">
        <set
            xmlns="http://jabber.org/protocol/rsm">
            <max>100</max>
        </set>
    </retrieve>
</iq>

收到:

<iq type="result" id="hichic@macintosh" to="admin@macintosh/Macintosh">
    <chat
        xmlns="urn:xmpp:archive" with="group12@conference.macintosh" start="2016-08-23T08:42:55.777Z">
        <to secs="0">
            <body>asdf</body>
        </to>
        <to secs="5">
            <body>aafs</body>
        </to>
        <from secs="2" jid="haha@macintosh">
            <body>sax</body>
        </from>
        <set
            xmlns="http://jabber.org/protocol/rsm">
            <first index="0">0</first>
            <last>2</last>
            <count>3</count>
        </set>
    </chat>
</iq>

但是当我打开数据库时,ofMessageArchive表,我可以看到更多的消息与group12(~20消息),而在结果中,我只得到3。我能错过什么吗?

遵循这个格式,它对我来说很好,

<iq id='a5sV8-21' type='set'>
    <query xmlns='urn:xmpp:mam:0' queryid="12345678">
        <x xmlns="jabber:x:data" type="submit">
            <field var="FORM_TYPE" type="hidden"><value>urn:xmpp:mam:0</value></field>
            <field var="with"><value>id@domain</value></field>
        </x>
        <set xmlns="http://jabber.org/protocol/rsm">
            <max>message_count</max>
        </set>
    </query>
</iq>

* *如果 xmpp:老妈:0 没用使用 xmpp:老妈:1

最新更新