-
Notifications
You must be signed in to change notification settings - Fork 0
/
xep-0023.xml
181 lines (168 loc) · 8.71 KB
/
xep-0023.xml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
<?xml version='1.0' encoding='UTF-8'?>
<!DOCTYPE xep SYSTEM 'xep.dtd' [
<!ENTITY % ents SYSTEM 'xep.ent'>
%ents;
]>
<?xml-stylesheet type='text/xsl' href='xep.xsl'?>
<xep>
<header>
<title>Message Expiration</title>
<abstract>This specification documents an historical protocol that was used to specify expiration dates for messages; this protocol has been deprecated in favor of XEP-0079: Advanced Message Processing.</abstract>
&LEGALNOTICE;
<number>0023</number>
<status>Obsolete</status>
<type>Historical</type>
<sig>Standards</sig>
<dependencies>
<spec>XMPP Core</spec>
</dependencies>
<supersedes/>
<supersededby>
<spec>XEP-0079</spec>
</supersededby>
<shortname>x-expire</shortname>
<schemaloc>
<url>http://www.xmpp.org/schemas/x-expire.xsd</url>
</schemaloc>
&jer;
<author>
<firstname>DJ</firstname>
<surname>Adams</surname>
<email>[email protected]</email>
<jid>[email protected]</jid>
</author>
<author>
<firstname>Harold</firstname>
<surname>Gottschalk</surname>
<email>[email protected]</email>
<jid>[email protected]</jid>
</author>
<revision>
<version>1.3</version>
<date>2009-06-03</date>
<initials>psa</initials>
<remark><p>Per a vote of the XMPP Council, changed status to Obsolete.</p></remark>
</revision>
<revision>
<version>1.2</version>
<date>2004-10-18</date>
<initials>psa</initials>
<remark><p>Per a vote of the Jabber Council, changed status to Deprecated since message expiration functionality should be implemented via XEP-0079: Advanced Message Processing.</p></remark>
</revision>
<revision>
<version>1.1</version>
<date>2004-01-06</date>
<initials>psa</initials>
<remark><p>Added XML schema; added security, IANA, and XMPP Registrar considerations.</p></remark>
</revision>
<revision>
<version>1.0</version>
<date>2002-07-15</date>
<initials>psa</initials>
<remark><p>Changed status to Active.</p></remark>
</revision>
<revision>
<version>0.9</version>
<date>2002-03-19</date>
<initials>dja</initials>
<remark><p>Added remarks about client-end expiry.</p></remark>
</revision>
<revision>
<version>0.1</version>
<date>2002-03-07</date>
<initials>dja</initials>
<remark><p>Initial draft.</p></remark>
</revision>
</header>
<section1 topic='Introduction'>
<p><em>Note Well: The protocol described herein has been deprecated by the &XSF;. The recommended protocol for implementing message expiration functionality is now &xep0079;.</em></p>
<p>It is sometimes helpful to indicate that a piece of information has a finite useful life or time-to-live (TTL). In the context of instant messaging, the main use of a TTL is to indicate that a message must or should be used by or read by a certain time, usually because the message has meaning or purpose only within a finite amount of time. In normal usage, such a message should be discarded after the specified time has passed if it has not been used or read by that time.</p>
<p>In Jabber, TTL functionality has been implemented informally using the jabber:x:expire namespace. Support for this namespace was added to the &jabberd; server as well as some clients and components in early 2001. Specifically, that support has involved the following two areas of responsibility:</p>
<ul>
<li>The sender of the message is responsible for attaching a jabber:x:expire extension to the XML stanza (usually a message).</li>
<li>Mechanisms involved in the store-and-forward of such a stanza
<note>The best-known example of a mechanism that handles storing and forwarding of XML stanzas is the Jabber Session Manager (JSM) within current Jabber server implementations, specifically the mod_offline module. However, expiration of an XML stanza could also be handled by a Jabber client.</note>
en route to its intended recipient are responsible for checking the remaining time to live and expiring (discarding) the XML stanza if necessary.</li>
</ul>
</section1>
<section1 topic='Specifying a TTL'>
<p>An Endpoint can specify a TTL for an XML stanza that it wishes to send by attaching an <x/> extension qualified by the jabber:x:expire namespace. The extension contains no children, only a 'seconds' attribute that contains a value representing the stanza's TTL, in seconds.</p>
<example caption='Specifying a 30-minute TTL for a message'>
SEND: <message to='[email protected]' id='msg811'>
<subject>Eccles cakes!</subject>
<body>
I've got some freshly made Eccles cakes here, come
round for one before they all disappear!
</body>
<x xmlns='jabber:x:expire' seconds='1800'/>
</message>
</example>
</section1>
<section1 topic='Handling XML Stanzas with a TTL'>
<p>Any mechanism that is involved in the storage, forwarding, and general handling of XML stanzas must check for the presence of such an extension and act accordingly, expiring (discarding) any stanzas that have exceeded their TTL lifetime. The jabber:x:expire namespace allows for a further attribute inside the <x/> extension: 'stored'. Here, the mechanism can record a value representing when the stanza was committed to storage, so that when the stanza is eventually retrieved for forwarding to the intended recipient, the elapsed time of storage can be calculated. This is to prevent the stanza from being held in 'suspended animation'.</p>
<p>Here we see what the original message looks like after the stanza has been committed to storage and the time of storage recorded:</p>
<example caption='Recording a storage-time in the extension'>
SEND: <message to='[email protected]' id='msg811'>
<subject>Eccles cakes!</subject>
<body>
I've got some freshly made Eccles cakes here, come
round for one before they all disappear!
</body>
<x xmlns='jabber:x:expire'
seconds='1800'
stored='912830221'/>
</message>
</example>
<p>When Sabine attempts to retrieve her offline messages, the store-and-forward mechanism (e.g., mod_offline) compares the current time against the stored attribute. If the 1800 seconds have passed, the mechanism should simply drop the message, without notifying either the sender or the intended recipient. No Eccles cakes for Sabine!</p>
<section2 topic='Usage in client space'>
<p>Although current usage of jabber:x:expire is most commonly seen in server implementations to address any TTL requirements of stored messages, Jabber clients can also be seen as handlers of messages that may contain expiration extension information. If a message is received by a Jabber client, and not immediately displayed to the user, the client must check for TTL information and expire the message (rather than display it to the user) if appropriate.</p>
</section2>
</section1>
<section1 topic='Security Considerations'>
<p>There are no security features or concerns related to this proposal.</p>
</section1>
<section1 topic='IANA Considerations'>
<p>This document requires no interaction with &IANA;.</p>
</section1>
<section1 topic='XMPP Registrar Considerations'>
<p>No action on the part of the ®ISTRAR; is necessary as a result of this document, since 'jabber:x:expire' is already a registered protocol namespace.</p>
</section1>
<section1 topic='XML Schema'>
<code><![CDATA[
<?xml version='1.0' encoding='UTF-8'?>
<xs:schema
xmlns:xs='http://www.w3.org/2001/XMLSchema'
targetNamespace='jabber:x:expire'
xmlns='jabber:x:expire'
elementFormDefault='qualified'>
<xs:annotation>
<xs:documentation>
The protocol documented by this schema is defined in
XEP-0023: http://www.xmpp.org/extensions/xep-0023.html
</xs:documentation>
</xs:annotation>
<xs:element name='x'>
<xs:complexType>
<xs:simpleContent>
<xs:extension base='empty'>
<xs:attribute name='seconds' type='xs:unsignedLong' use='required'/>
<xs:attribute name='stored' type='xs:unsignedLong' use='optional'/>
</xs:extension>
</xs:simpleContent>
</xs:complexType>
</xs:element>
<xs:simpleType name='empty'>
<xs:restriction base='xs:string'>
<xs:enumeration value=''/>
</xs:restriction>
</xs:simpleType>
</xs:schema>
]]></code>
</section1>
<section1 topic='Open Issues'>
<ol>
<li>The jabber:x:expire namespace is processed only for delayed messages and only by servers and subsystems which support this informational draft. Therefore it is possible or even likely that a TTL will not be properly handled from the user perspective.</li>
<li>A physical, time-based TTL is not implemented by this document, and would not be possible across systems without synchronized time.</li>
</ol>
</section1>
</xep>