jabber:x:expire
The jabber:x:expire is a simple namespace to
add a “use by” or “read by” stamp to a message. If you wish to send a
message and impose a finite lifetime upon it, attach an expiry extension thus:
SEND: <message to='piers@pipetree.com' id='M24'>
<subject>Twinkies!</subject>
<body>
I've got some fresh Twinkies here, stop
by for one before they all disappear!
</body>
<x xmlns='jabber:x:expire' seconds='1800'/>
</message>
If Piers was not connected when the message was sent, the
mod_offline module would hold the message ready
for when he reconnects. But before storing it, an extra attribute (stored) is added with the current
time.
Example 6-7 shows what the relevant section of Piers’ spool file would look like.
<foo xmlns='jabber:x:offline' xdbns='jabber:x:offline'>
<message to='piers@pipetree.com' id='M24' from='dj@pipetree.com/kitchen'>
<subject>Twinkies!</subject>
<body>
I've got some fresh Twinkies here, stop
by for one before they all disappear!
</body>
<x xmlns='jabber:x:expire' seconds='600' stored='993038415'/>
<x xmlns='jabber:x:delay' from='dj@pipetree.com' stamp='20010620T12:00:15'>
Offline Storage
</x>
</message>
</foo>
When Piers reconnects, mod_offline retrieves the message
and compares the current time with the value in the
stored attribute. If the difference exceeds the
desired lifetime of the message, as specified in the
seconds attribute, the message is discarded. Otherwise, ...
Become an O’Reilly member and get unlimited access to this title plus top books and audiobooks from O’Reilly and nearly 200 top publishers, thousands of courses curated by job role, 150+ live events each month,
and much more.
Read now
Unlock full access