There is 10 messages in archive
Client:
<iq type="get" id="list12"> <list xmlns="urn:xmpp:archive" with="room@conference.voximplant.com"> <set xmlns="http://jabber.org/protocol/rsm"></set> </list></iq>
Result:
<iq type="result" id="list12" to="111(app.shmakov)@voximplant.com/QIP"> <list xmlns="urn:xmpp:archive"> <chat with="room@conference.voximplant.com" start="2015-06-03T12:05:19.525Z" /> <chat with="room@conference.voximplant.com" start="2015-06-03T11:10:59.872Z" /> <chat with="room@conference.voximplant.com" start="2015-06-03T12:14:14.979Z" /> <chat with="room@conference.voximplant.com" start="2015-06-03T12:11:36.096Z" /> <chat with="room@conference.voximplant.com" start="2015-06-03T13:31:19.933Z" /> <chat with="room@conference.voximplant.com" start="2015-06-03T12:39:07.797Z" /> <chat with="room@conference.voximplant.com" start="2015-06-03T13:55:33.761Z" /> <chat with="room@conference.voximplant.com" start="2015-06-03T13:49:50.126Z" /> <chat with="room@conference.voximplant.com" start="2015-06-03T14:20:39.356Z" /> <chat with="room@conference.voximplant.com" start="2015-06-03T10:49:32.785Z" /> <set xmlns="http://jabber.org/protocol/rsm"> <first index="0">15</first> <last>24</last> <count>10</count> </set></list></iq>
But when I add <max> tag, result is not correct
Client:
<iq type="get" id="list13"> <list xmlns="urn:xmpp:archive" with="room@conference.voximplant.com"> <set xmlns="http://jabber.org/protocol/rsm"> <max>5</max> </set></list></iq>
Result:
<iq type="result" id="list13" to="111(app.shmakov)@voximplant.com/QIP"> <list xmlns="urn:xmpp:archive"> <chat with="room@conference.voximplant.com" start="2015-06-03T12:05:19.525Z" /> <chat with="room@conference.voximplant.com" start="2015-06-03T11:10:59.872Z" /> <chat with="room@conference.voximplant.com" start="2015-06-03T10:49:32.785Z" /> <set xmlns="http://jabber.org/protocol/rsm"> <first index="0">15</first> <last>17</last> <count>10</count> </set> </list></iq>
There is 3 <chat/> result, but should be 5 (!!!)
XEP-0059: Result Set Management
2. Use Cases
2.1 Limiting the Number of Items
In order to limit the number of items of a result set to be returned, the requesting entity specifies a request type of "set" and the maximum size of the desired subset (via the XML character data of the <max/> element):
Example 1. Requesting a Limit to the Result Set
<iqtype='set'from='stpeter@jabber.org/roundabout'to='users.jabber.org'id='limit1'>
<queryxmlns='jabber:iq:search'>
<nick>Pete</nick>
<setxmlns='http://jabber.org/protocol/rsm'>
<max>10</max>
</set>
</query>
</iq>
The responding entity then returns the first items of the result set in order. The number of items is limited to the requested size:
Example 2. Returning a Limited Result Set
<iqtype='result'from='users.jabber.org'to='stpeter@jabber.org/roundabout'id='limit1'>
<queryxmlns='jabber:iq:search'>
<itemjid='stpeter@jabber.org'>
<first>Peter</first>
<last>Saint-Andre</last>
<nick>Pete</nick>
</item>
.
[8 more items]
.
<itemjid='peterpan@neverland.lit'>
<first>Peter</first>
<last>Pan</last>
<nick>Pete</nick>
</item>
</query>
</iq>