XMPP For The Web/Win ::: XMPP-FTW (1.16.8)

XEP-0203 Delayed Delivery

Usage

Delayed delivery will always be set under the delay property of any data objects.

For more information please see XEP-0203.

XML to JSON

    ...
    <delay xmlns="urn:xmpp:delay" stamp="2013-08-23T21:45:00Z"
              from="evilprofessor.co.uk">
        Offline Storage
    </delay>
    ...
    

Will be turned into the following:

    {
        delay: {
            when: "2013-08-23T21:45:00Z",
            from: "evilprofessor.co.uk",
            reason: "Offline Storage"
         }
    }
    

The only required attribute is stamp meaning, at a minimum, only the when property may be present.

JSON to XML

Should the need arise delayed delivery elements can also be build from JSON object by providing a delay property (where supported):

    {
        delay: {
            when: "2013-08-23T21:45:00Z",
         /* from: "evilprofessor.co.uk", */
         /* reason: "Offline Storage" */
        }
    }
    

This will be added to a stanza as follows:

    ...
    <delay xmlns="urn:xmpp:delay" stamp="2013-08-23T21:45:00Z"
              from="evilprofessor.co.uk">
        Offline Storage
    </delay>
    ...
    

Pages

Fork me on GitHub