Quantcast
Channel: Ignite Realtime : Discussion List - All Communities
Viewing all articles
Browse latest Browse all 10742

OpenArchive: Get last message

$
0
0
How i can retrieve last conversation and last message in conversation?
According to "XEP-0059: Result Set Management", i need to send this requests:
For last conversation:
<iq type='get' id='juliet1'>
  <list xmlns='urn:xmpp:archive'
        with='juliet@capulet.com'>
    <set xmlns='http://jabber.org/protocol/rsm'>
      <max>1</max>
      <before/>
    </set>
  </list>
</iq>
For last message in conversation:
<iq type='get' id='page1'>
  <retrieve xmlns='urn:xmpp:archive'
            with='juliet@capulet.com/chamber'
            start='1469-07-21T02:56:15Z'>
    <set xmlns='http://jabber.org/protocol/rsm'>
      <max>1</max>
      <before/>
    </set>
  </retrieve>
</iq>
But both requests returns first record record instead of last...
Does OpenArchive plugin handle XEP-0059 requests correctly?
After some kind of experiments i figured out that i can request last conversation using this request:
<iq type='get' id='juliet1'>
  <list xmlns='urn:xmpp:archive'
        with='juliet@capulet.com'>
    <set xmlns='http://jabber.org/protocol/rsm'>
      <max>1</max>
      <before>999999999999</before>
    </set>
  </list>
</iq>
But i can't retrieve last message using this method... It returns only empty answer.
PS: Please help me figure out how to retrieve last message in conversation using only one request. Thank you.

Viewing all articles
Browse latest Browse all 10742

Trending Articles