"secs" attribute of "from" and "to" Elements in Monitoring Plugin (Message Archiving / XEP-0136)

Document created by Linus on Dec 3, 2014Last modified by Linus on Dec 3, 2014
Version 2Show Document
  • View in full screen mode

In XEP-0136: Message Archiving 4.6 section.


Quote: "The time in whole seconds of the message relative to the previous message in the collection (or, for the first message, relative to the start of the collection) SHOULD be specified with a 'secs' attribute."


See the example 44. Receiving the first page of a collection


    <from secs='0'><body>Art thou not Romeo, and a Montague?</body></from>
<to secs='11'><body>Neither, fair saint, if either thee dislike.</body></to>

    [97 more messages]
<from secs='9'><body>How cam'st thou hither, tell me, and wherefore?</body></from>


The "secs" attribute is relative to the previous message, not always to the "start" in the "chat" element.


See com.reucon.openfire.plugin.archive.xep0136.IQRetrieveHandler line 96. (Openfire 3.9.3)

    secs = (message.getTime().getTime() - conversation.getStart().getTime()) / 1000;

It should be

    secs = (message.getTime().getTime() - previousMessage.getTime().getTime()) / 1000;