Hi everyone,
I have encountered a requirement quite frequently, that client should be able
not only to fetch all messages from MAM or messages for specific conversation,
but also get a list of conversations (both 1-1 and MUC) that have any messages
after certain timestamp + last message for each conversation to display in UI.
Me and colleagues had a discussion on this issue and we think XEP-0313 could
use a new parameter for queries, that will tell the server to return only N
last messages for every conversation (i.e. remote JID). Example:
<iq type='set' id='juliet1'>
<query xmlns='urn:xmpp:mam:0' queryid='1'>
<x xmlns='jabber:x:data'>
<field var='FORM_TYPE'>
<value>urn:xmpp:mam:0</value>
</field>
<field var='start'>
<value>2010-08-07T00:00:00Z</value>
</field>
<field var='last-per-jid'>
<value>1</value>
</field>
</x>
</query>
</iq>
This would allow to easily and quickly update client-side archive and UI. More
messages can be fetched from conversation on-demand, e.g. when user opens the
conversation in the app.
What do you think?
Regards,
Piotr