mirror of
https://github.com/moparisthebest/xeps
synced 2024-12-21 15:18:51 -05:00
0.0.2
This commit is contained in:
parent
48f4fc74c8
commit
b94ed19b7b
@ -34,6 +34,12 @@
|
||||
<email>im@spencermacdonald.com</email>
|
||||
<jid>im@spencermacdonald.com</jid>
|
||||
</author>
|
||||
<revision>
|
||||
<version>0.0.2</version>
|
||||
<date>2013-06-11</date>
|
||||
<initials>sdm</initials>
|
||||
<remark><p>Change to a message based protocol.</p></remark>
|
||||
</revision>
|
||||
<revision>
|
||||
<version>0.0.1</version>
|
||||
<date>2013-05-24</date>
|
||||
@ -46,15 +52,13 @@
|
||||
These services provide a visual indication of when a message has been delivered to any of the recipients resources and (optionally) when it has been read.
|
||||
These visual indications (referred to herein as "Chat Markers") are synced between all of the sender's
|
||||
and recipient's resources automatically so the state of a chat is always consistent and
|
||||
if one of the resources is not connected it will sync up upon reconnecting to the server.</p>
|
||||
if one of the resources is not connected it can fetch Chat Marker from the Message Archive.</p>
|
||||
|
||||
<p>&xep0184; currently provides delivery receipts on a per message basis,
|
||||
but it does not provide any mechanism for the user to indicate that they have read or acknowledged the message.
|
||||
As delivery receipts are sent on a per message basis it would require multiple messages to "sync" up delivery receipts between resources.</p>
|
||||
<p>Moreover by using &xep0085; you could infer that a message has been read if the recipient becomes active at any point after the message has been delivered, but again it would require multiple messages to "sync" up chat states between resources .</p>
|
||||
<p>However, both Delivery Receipts and Chat States are sent as messages without a body element, meaning they will not be archived by &xep0136; or &xep0313;.
|
||||
This means both the sender and the recipient must be connected at the same time for Chat Markers to propagate correctly.</p>
|
||||
<p>This XEP outlines an efficient iq based protocol to provide this functionally using Chat Markers.</p>
|
||||
<p>Moreover by using &xep0085; you could infer that a message has been read if the recipient becomes active at any point after the message has been delivered, but again it would require multiple messages to "sync" up chat states between resources.</p>
|
||||
<p>This XEP outlines an efficient message based protocol to provide this functionally using Chat Markers.</p>
|
||||
</section1>
|
||||
|
||||
<section1 topic='Terminology' anchor='terms'>
|
||||
@ -79,498 +83,51 @@
|
||||
<li>read -- the message the user has viewed it in a active chat.</li>
|
||||
<li>acknowledged -- the message has been acknowledged by some user interaction e.g. pressing a button.</li>
|
||||
</ul>
|
||||
<p>The Chat Marker MUST have either a 'to' or 'from' attribute with the bare JID of the other contact.</p>
|
||||
<ul>
|
||||
<li>'to' -- the marker is sent to the other connect i.e. where YOU have marked.</li>
|
||||
<li>'from' -- the marker is sent from the other contact. i.e. where THEY have marked.</li>
|
||||
</ul>
|
||||
<p>The Chat Marker MUST have a 'stamp' which is the timestamp of the Chat Marker. If one isn't supplied the server should set the stamp to the current server time.</p>
|
||||
<p>The Chat Marker MUST have an 'message-id' which is the 'id' of the message being marked.</p>
|
||||
<p>The Chat Marker SHOULD have an 'message-stamp' which is the timestamp of the message being marked. This MUST only be set by the server.</p>
|
||||
<p>The Chat Marker MUST have a 'room' if it is from a MUC.</p>
|
||||
|
||||
<p>The Chat Marker MAY have a 'stamp' which is the timestamp of the Chat Marker.</p>
|
||||
<p>The Chat Marker MUST have an 'id' which is the 'id' of the message being marked.</p>
|
||||
<p>A Chat Marker Indicates that all messages up to and including that message 'id' have been marked.</p>
|
||||
<example caption='Example Chat Marker'>
|
||||
<![CDATA[
|
||||
<received from='juliet@example.net'
|
||||
stamp='2013-03-14T23:58:49Z'
|
||||
message-id='message-1'
|
||||
message-stamp='2013-03-13T23:58:49Z'
|
||||
xmlns='urn:xmpp:chat-markers:tmp'/>
|
||||
<![CDATA[
|
||||
<message
|
||||
from='kingrichard@royalty.england.lit/throne'
|
||||
id='bi29sg183b4v'
|
||||
to='northumberland@shakespeare.lit/westminster'>
|
||||
<received xmlns='urn:xmpp:chat-markers:tmp'
|
||||
id='richard2-4.1.247'
|
||||
stamp='2002-10-13T23:58:43Z'/>
|
||||
</message>
|
||||
]]>
|
||||
</example>
|
||||
</section1>
|
||||
|
||||
<section1 topic='Business Rules' anchor='rules'>
|
||||
<p>Messages that are marked as acknowledged are also assumed to be read and received. Messages Marked as read are also assumed to be delivered.</p>
|
||||
<p>Less Significant Chat Markers should only be sent if they are later than the more significant Chat Marker i.e. if a Message has been marked as read,
|
||||
a delivered Chat Marker should only be sent if it has a later timestamp than the read Chat Marker.</p>
|
||||
<p>All messages MUST have an 'id' to use Chat Markers.</p>
|
||||
<p>Clients SHOULD make sure that each message has a unique 'id' so that the can be uniquely identified.
|
||||
If the server cannot uniquely identify a message by its 'id' it can chose not to add a 'message-stamp' or to add the stamp of the latest message with the matching 'id' for the appropriate chat.</p>
|
||||
</section1>
|
||||
<section1 topic='When to send Chat Markers' anchor='when'>
|
||||
|
||||
<section1 topic='Use Cases' anchor='usecases'>
|
||||
|
||||
<section2 topic='Chat Marker Subscription' anchor='chat-marker-subscription'>
|
||||
<section3 topic='Subscribing to Chat Markers' anchor='subscribe'>
|
||||
<p>Servers MUST NOT auto subscribe clients to Chat Markers by default, since unmodified clients might be confused by the new protocol.
|
||||
When a client wants to participate in the Chat Marker Subscription protocol, it sends an IQ set to enable the protocol.</p>
|
||||
<example caption='Client enables Chat Marker Subscription'><![CDATA[
|
||||
<iq xmlns='jabber:client'
|
||||
type='set'
|
||||
id='subscribe1'>
|
||||
<subscribe xmlns='urn:xmpp:chat-markers:tmp'/>
|
||||
</iq>
|
||||
]]></example>
|
||||
<example caption='Server acknowledges Subscription to Chat Marker'><![CDATA[
|
||||
<iq xmlns='jabber:client'
|
||||
type='result'
|
||||
id='subscribe1'>
|
||||
<subscribe xmlns='urn:xmpp:chat-markers:tmp'/>
|
||||
</iq>
|
||||
]]></example>
|
||||
</section3>
|
||||
|
||||
<section3 topic='Unsubscribe from Chat Markers' anchor='unsubscribe'>
|
||||
<p>Some clients might want to unsubscribe from Chat Markers. To unsubscribe from Chat Markers, clients send an IQ set:</p>
|
||||
<example caption='Client disables Chat Marker Subscription'><![CDATA[
|
||||
<iq xmlns='jabber:client'
|
||||
type='set'
|
||||
id='unsubscribe1'>
|
||||
<unsubscribe xmlns='urn:xmpp:chat-markers:tmp'/>
|
||||
</iq>
|
||||
]]></example>
|
||||
<p>The server will respond with an IQ result after unsubscribing from Chat Markers:</p>
|
||||
<example caption='Server acknowledges Unsubscrive from Chat Marker Subscription'><![CDATA[
|
||||
<iq xmlns='jabber:client'
|
||||
type='result'
|
||||
id='unsubscribe1'>
|
||||
<unsubscribe xmlns='urn:xmpp:chat-markers:tmp'/>
|
||||
</iq>
|
||||
]]></example>
|
||||
</section3>
|
||||
|
||||
<section3 topic='Error Cases' anchor='subscribe-errors'>
|
||||
<p>Subscribing or unsubscribing from Chat Marker may fail in the several ways.
|
||||
If one of these errors is returned, the server MUST keep the previous state, where the initial state is no Chat Marker Subscription.
|
||||
For example, if the first enable returns an error, the server MUST NOT enable Chat Marker Subscription.</p>
|
||||
<section4 topic='bad-request' anchor='subscribe-bad-request'>
|
||||
<p>The sender has sent a stanza containing XML that does not conform to the appropriate schema or that cannot be processed.
|
||||
One example is an IQ stanza that includes an unrecognized value of the 'type' attribute.
|
||||
Another is changing to the state that is already in effect (enabling Chat Marker Subscription a second time).</p>
|
||||
<example caption='Error: bad-request'><![CDATA[
|
||||
<iq xmlns='jabber:client'
|
||||
id='subscribe1'
|
||||
type='error'>
|
||||
<subscribe xmlns='urn:xmpp:chat-markers:tmp'/>
|
||||
<error type='modify'>
|
||||
<bad-request xmlns='urn:ietf:params:xml:ns:xmpp-stanzas'/>
|
||||
</error>
|
||||
</iq>
|
||||
]]></example>
|
||||
</section4>
|
||||
<section4 topic='feature-not-implemented' anchor='subscribe-feature-not-implemented'>
|
||||
<p>The sender has sent an subscribe or unsubscribe request to a server
|
||||
that does not support the protocol. This SHOULD NOT happen in
|
||||
practice, because clients MUST check for server support before
|
||||
sending their request.</p>
|
||||
<example caption='Error: feature-not-implemented'><![CDATA[
|
||||
<iq xmlns='jabber:client'
|
||||
id='subscribe1'
|
||||
type='error'>
|
||||
<subscribe xmlns='urn:xmpp:chat-markers:tmp'/>
|
||||
<error type='cancel'>
|
||||
<feature-not-implemented xmlns='urn:ietf:params:xml:ns:xmpp-stanzas'/>
|
||||
</error>
|
||||
</iq>
|
||||
]]></example>
|
||||
</section4>
|
||||
<section4 topic='forbidden' anchor='subscribe-forbidden'>
|
||||
<p>The sender is forbidden by policy from subscribing or
|
||||
unsubscribing the resource from Chat Markers.</p>
|
||||
<example caption='Error: forbidden'><![CDATA[
|
||||
<iq xmlns='jabber:client'
|
||||
id='subscribe1'
|
||||
type='error'>
|
||||
<subscribe xmlns='urn:xmpp:chat-markers:tmp'/>
|
||||
<error type='auth'>
|
||||
<forbidden xmlns='urn:ietf:params:xml:ns:xmpp-stanzas'/>
|
||||
</error>
|
||||
</iq>
|
||||
]]></example>
|
||||
</section4>
|
||||
<section4 topic='not-allowed' anchor='subscribe-not-allowed'>
|
||||
<p>The receiver does not allow any entity to turn on Chat Marker Subscription.
|
||||
This might occur in a multi-domain deployment, where
|
||||
administrators of one domain allow Chat Marker Subscription, but another does
|
||||
not.</p>
|
||||
<example caption='Error: not-allowed'><![CDATA[
|
||||
<iq xmlns='jabber:client'
|
||||
id='subscribe1'
|
||||
type='error'>
|
||||
<subscribe xmlns='urn:xmpp:chat-markers:tmp'/>
|
||||
<error type='cancel'>
|
||||
<not-allowed xmlns='urn:ietf:params:xml:ns:xmpp-stanzas'/>
|
||||
</error>
|
||||
</iq>
|
||||
]]></example>
|
||||
</section4>
|
||||
</section3>
|
||||
</section2>
|
||||
|
||||
<section2 topic='Updating Chat Markers' anchor='updating-chat-markers'>
|
||||
|
||||
<example caption='Update Chat Marker'><![CDATA[
|
||||
<iq type='set' id='chat-marker-update1'>
|
||||
<chat-markers xmlns='urn:xmpp:chat-markers:tmp'>
|
||||
<read to='juliet@example.net'
|
||||
stamp='2013-03-21T11:12:13Z'
|
||||
message-id='message-10'
|
||||
xmlns="urn:xmpp:chat-markers:tmp"/>
|
||||
</chat-markers>
|
||||
</iq>
|
||||
]]></example>
|
||||
|
||||
<p>The server will respond with an IQ to say that the Chat Marker has been updated, with the inserted 'message-stamp' if known.</p>
|
||||
<example caption='Server acknowledges Chat Marker has been updated'><![CDATA[
|
||||
<iq xmlns='jabber:client'
|
||||
type='result'
|
||||
id='chat-marker-update1'>
|
||||
<chat-markers xmlns='urn:xmpp:chat-markers:tmp'>
|
||||
<read to='juliet@example.net'
|
||||
stamp='2013-03-21T11:12:13Z'
|
||||
message-id='message-10'
|
||||
message-stamp='2013-03-20T11:12:13Z'
|
||||
xmlns="urn:xmpp:chat-markers:tmp"/>
|
||||
</chat-markers>
|
||||
</iq>
|
||||
]]></example>
|
||||
|
||||
<example caption='Chat Marker is Pushed to other resources who are Subscribed to Chat Markers'><![CDATA[
|
||||
<iq to='romeo@example.com/garden' type='set' id='chat-markers-update-push1'>
|
||||
<query xmlns='urn:xmpp:chat-marker:tmp'>
|
||||
<read to='juliet@example.net'
|
||||
stamp='2013-03-21T11:12:13Z'
|
||||
message-id='message-10'
|
||||
message-stamp='2013-03-20T11:12:13Z'
|
||||
xmlns="urn:xmpp:chat-markers:tmp"/>
|
||||
</query>
|
||||
</iq>
|
||||
]]></example>
|
||||
|
||||
<example caption='Chat Marker is Pushed to the other JIDs resource who are Subscribed to Chat Markers'><![CDATA[
|
||||
|
||||
<iq to='juliet@example.com/balcony' type='set' id='chat-markers-update-push2'>
|
||||
<query xmlns='urn:xmpp:chat-marker:tmp'>
|
||||
<read from='romeo@example.net'
|
||||
stamp='2013-03-21T11:12:13Z'
|
||||
message-id='message-10'
|
||||
message-stamp='2013-03-20T11:12:13Z'
|
||||
xmlns="urn:xmpp:chat-markers:tmp"/>
|
||||
</query>
|
||||
</iq>
|
||||
]]></example>
|
||||
|
||||
<section3 topic='Error Cases' anchor='updating-errors'>
|
||||
<p>Chat Marker updating may fail in the several ways. If one of these errors is returned,
|
||||
the server MUST keep the previous Chat Marker.</p>
|
||||
<section4 topic='bad-request' anchor='updating-bad-request'>
|
||||
<p>The sender has sent a stanza containing XML that does not conform to the appropriate schema or that cannot be processed.
|
||||
One example is an IQ stanza that includes an unrecognized value of the 'type' attribute.
|
||||
Another is a Chat Marker with a latter message message is already in effect.</p>
|
||||
<example caption='Error: bad-request'><![CDATA[
|
||||
<iq xmlns='jabber:client'
|
||||
id='chat-marker-update1'
|
||||
type='error'>
|
||||
<query xmlns='urn:xmpp:chat-marker:tmp'>
|
||||
<read from='romeo@example.net'
|
||||
message-id='message-10'
|
||||
xmlns="urn:xmpp:chat-markers:tmp"/>
|
||||
</query>
|
||||
<error type='modify'>
|
||||
<bad-request xmlns='urn:ietf:params:xml:ns:xmpp-stanzas'/>
|
||||
</error>
|
||||
</iq>
|
||||
]]></example>
|
||||
</section4>
|
||||
<section4 topic='feature-not-implemented' anchor='updating-feature-not-implemented'>
|
||||
<p>The sender has sent a Chat Marker update to a server
|
||||
that does not support the protocol. This SHOULD NOT happen in
|
||||
practice, because clients MUST check for server support before
|
||||
sending their request.</p>
|
||||
<example caption='Error: feature-not-implemented'><![CDATA[
|
||||
<iq xmlns='jabber:client'
|
||||
id='chat-marker-update1'
|
||||
type='error'>
|
||||
<query xmlns='urn:xmpp:chat-marker:tmp'>
|
||||
<read from='romeo@example.net'
|
||||
message-id='message-10'
|
||||
xmlns="urn:xmpp:chat-markers:tmp"/>
|
||||
</query>
|
||||
<error type='cancel'>
|
||||
<feature-not-implemented xmlns='urn:ietf:params:xml:ns:xmpp-stanzas'/>
|
||||
</error>
|
||||
</iq>
|
||||
]]></example>
|
||||
</section4>
|
||||
<section4 topic='forbidden' anchor='updating-forbidden'>
|
||||
<p>The sender is forbidden from updating Chat Markers.</p>
|
||||
<example caption='Error: forbidden'><![CDATA[
|
||||
<iq xmlns='jabber:client'
|
||||
id='chat-marker-update1'
|
||||
type='error'>
|
||||
<query xmlns='urn:xmpp:chat-marker:tmp'>
|
||||
<read from='romeo@example.net'
|
||||
message-id='message-10'
|
||||
xmlns="urn:xmpp:chat-markers:tmp"/>
|
||||
</query>
|
||||
<error type='auth'>
|
||||
<forbidden xmlns='urn:ietf:params:xml:ns:xmpp-stanzas'/>
|
||||
</error>
|
||||
</iq>
|
||||
]]></example>
|
||||
</section4>
|
||||
<section4 topic='not-allowed' anchor='updating-not-allowed'>
|
||||
<p>The receiver does not allow any entity to turn on Chat Marker Subscription.
|
||||
This might occur in a multi-domain deployment, where
|
||||
administrators of one domain allow Chat Marker Subscription, but another does
|
||||
not.</p>
|
||||
<example caption='Error: not-allowed'><![CDATA[
|
||||
<iq xmlns='jabber:client'
|
||||
id='chat-marker-update1'
|
||||
type='error'>
|
||||
<query xmlns='urn:xmpp:chat-marker:tmp'>
|
||||
<read from='romeo@example.net'
|
||||
message-id='message-10'
|
||||
xmlns="urn:xmpp:chat-markers:tmp"/>
|
||||
</query>
|
||||
<error type='cancel'>
|
||||
<not-allowed xmlns='urn:ietf:params:xml:ns:xmpp-stanzas'/>
|
||||
</error>
|
||||
</iq>
|
||||
]]></example>
|
||||
</section4>
|
||||
</section3>
|
||||
</section2>
|
||||
|
||||
|
||||
<section2 topic='Querying Chat Markers'>
|
||||
<p>A client is able to query for all Chat Markers, optionally
|
||||
restricting results to those to/from a particular JID and/or time. To allow limiting the results or paging
|
||||
through them a client may use &xep0059;, which MUST be supported by servers.</p>
|
||||
<p>A query consists of an <iq/> stanza addressed to the entity hosting
|
||||
the Chat Markers, with a 'query' payload. On receiving the query, the server pushes the Chat Markers
|
||||
that match the client's given criteria.</p>
|
||||
<p>Typically you would query for all Chat Markers as soon as you have enabled Chat Marker Subscription.</p>
|
||||
<example caption='Querying Chat Markers'>
|
||||
<![CDATA[
|
||||
<iq type='get' id='fetch-all1'>
|
||||
<query xmlns='urn:xmpp:chat-markers:tmp'/>
|
||||
</iq>
|
||||
]]>
|
||||
</example>
|
||||
|
||||
<example caption='Results'>
|
||||
<![CDATA[
|
||||
<iq to='romeo@example.com/balcony' type='result' id='fetch-all1'>
|
||||
<query xmlns='urn:xmpp:chat-markers:tmp'>
|
||||
<read to='juliet@example.net'
|
||||
stamp='2013-01-01T00:01:03Z''
|
||||
message-id='message-3'
|
||||
message-stamp='2013-01-01T00:00:03Z'
|
||||
xmlns="urn:xmpp:chat-markers:tmp"/>
|
||||
|
||||
<received to='friar@example.net'
|
||||
stamp='2013-01-01T00:01:04Z''
|
||||
message-id='message-4'
|
||||
message-stamp='2013-01-01T00:00:04Z'
|
||||
xmlns="urn:xmpp:chat-markers:tmp"/>
|
||||
|
||||
<read from='juliet@example.net'
|
||||
stamp='2013-01-01T00:01:01Z''
|
||||
message-id='message-1'
|
||||
message-stamp='2013-01-01T00:00:01Z'
|
||||
xmlns="urn:xmpp:chat-markers:tmp"/>
|
||||
|
||||
<received from='juliet@example.net'
|
||||
stamp='2013-01-01T00:02:01Z''
|
||||
message-id='message-2'
|
||||
message-stamp='2013-01-01T00:00:02Z'
|
||||
xmlns="urn:xmpp:chat-markers:tmp"/>
|
||||
|
||||
<received from='friar@example.net'
|
||||
stamp='2013-01-01T00:01:05Z''
|
||||
message-idid='message-5'
|
||||
message-stamp='2013-01-01T00:00:05Z'
|
||||
xmlns="urn:xmpp:chat-markers:tmp"/>
|
||||
</query>
|
||||
</iq>
|
||||
]]>
|
||||
</example>
|
||||
|
||||
<section3 topic="Filtering by contact">
|
||||
<p>If a <with/> element is present in the <query/>, it contains a JID against which
|
||||
to match the Chat Marker. The server MUST only return Chat Markers if they match the supplied JID.</p>
|
||||
|
||||
<example caption='Querying for all Chat Markers to/from a particular JID'>
|
||||
<![CDATA[
|
||||
<iq type='get' id='fetch-juliet1'>
|
||||
<query xmlns='urn:xmpp:chat-markers:tmp'>
|
||||
<with>juliet@capulet.com</with>
|
||||
</query>
|
||||
</iq>
|
||||
]]>
|
||||
</example>
|
||||
|
||||
<p>If (and only if) the supplied JID is a bare JID (i.e. no resource is present), then
|
||||
the server SHOULD return Chat Markers if their bare to/from address would match it. It SHOULD NOT return Chat Markers
|
||||
from that are from a MUC.</p>
|
||||
|
||||
<example caption='Results for particular JID'>
|
||||
<![CDATA[
|
||||
<iq to='romeo@example.com/balcony' type='result' id='fetch-juliet1'>
|
||||
<query xmlns='urn:xmpp:chat-markers:tmp'>
|
||||
|
||||
<read to='juliet@example.net'
|
||||
stamp='2013-01-01T00:01:03Z''
|
||||
message-id='message-3'
|
||||
message-stamp='2013-01-01T00:00:03Z'
|
||||
xmlns="urn:xmpp:chat-markers:tmp"/>
|
||||
|
||||
<read from='juliet@example.net'
|
||||
stamp='2013-01-01T00:01:01Z''
|
||||
message-id='message-1'
|
||||
message-stamp='2013-01-01T00:00:01Z'
|
||||
xmlns="urn:xmpp:chat-markers:tmp"/>
|
||||
|
||||
<received from='juliet@example.net'
|
||||
stamp='2013-01-01T00:02:01Z''
|
||||
message-id='message-2'
|
||||
message-stamp='2013-01-01T00:00:02Z'
|
||||
xmlns="urn:xmpp:chat-markers:tmp"/>
|
||||
</query>
|
||||
</iq>
|
||||
]]>
|
||||
</example>
|
||||
|
||||
</section3>
|
||||
|
||||
<section3 topic="Filtering by room">
|
||||
<p>If the <with/> element is present in the <query/> and it is that of a room,
|
||||
the server MUST only return Chat Markers if they match the supplied JID</p>
|
||||
<example caption='Querying for all chat makers for a particular room'>
|
||||
<![CDATA[
|
||||
<iq type='get' id='fetch-room1'>
|
||||
<query xmlns='urn:xmpp:chat-markers:tmp'>
|
||||
<with>room@example.net</with>
|
||||
</query>
|
||||
</iq>
|
||||
]]>
|
||||
</example>
|
||||
|
||||
<p>If the jid of a room is supplied,
|
||||
the server MUST return Chat Markers if their room address would match it.</p>
|
||||
|
||||
<example caption='Results for particular room'>
|
||||
<![CDATA[
|
||||
<iq to='romeo@example.com/balcony' type='result' id='fetch-room1'>
|
||||
<query xmlns='urn:xmpp:chat-markers:tmp'>
|
||||
|
||||
<read room='room@example.com'
|
||||
to='room@example.net'
|
||||
stamp='2013-01-01T00:01:03Z''
|
||||
message-id='message-muc-3'
|
||||
message-stamp='2013-01-01T00:00:03Z'
|
||||
xmlns="urn:xmpp:chat-markers:tmp"/>
|
||||
|
||||
<read room='room@example.com'
|
||||
from='juliet@example.net'
|
||||
stamp='2013-01-01T00:01:01Z''
|
||||
message-id='message-muc-1'
|
||||
message-stamp='2013-01-01T00:00:01Z'
|
||||
xmlns="urn:xmpp:chat-markers:tmp"/>
|
||||
|
||||
<received room='room@example.com'
|
||||
from='juliet@example.net'
|
||||
stamp='2013-01-01T00:02:01Z''
|
||||
message-id='message-muc-2'
|
||||
message-stamp='2013-01-01T00:00:02Z'
|
||||
xmlns="urn:xmpp:chat-markers:tmp"/>
|
||||
</query>
|
||||
</iq>
|
||||
]]>
|
||||
</example>
|
||||
|
||||
</section3>
|
||||
<section3 topic="Filtering by time">
|
||||
<p>The <start/> and <end/> elements, if provided, MUST contain timestamps
|
||||
formatted according to the DateTime profile defined in &xep0082;</p>
|
||||
<p>The <start/> element is used to filter out Chat Markers before a certain date/time.
|
||||
If specified, a server MUST only return Chat Markers whose 'stamp' is equal to or later
|
||||
than the given timestamp.</p>
|
||||
<p>If omitted, the server SHOULD assume the value of <start/> to be equal to the
|
||||
date/time of the earliest Chat Marker stored in the archive.</p>
|
||||
<p>Conversely, the <end/> element is used to exclude from the results Chat Markers
|
||||
after a certain point in time. If specified, a server MUST only return Chat Markers whose
|
||||
timestamp is equal to or earlier than the timestamp given in the <end/> element.</p>
|
||||
<p>If omitted, the server SHOULD assume the value of <end/> to be equal to the
|
||||
date/time of the most recent chat Marker stored in the archive.</p>
|
||||
<example caption='Querying the archive for all messages in a certain timespan'><![CDATA[
|
||||
<iq type='get' id='date1'>
|
||||
<query xmlns='urn:xmpp:chat-markers:tmp'>
|
||||
<start>2013-01-01T00:0:01Z</start>
|
||||
<end>2013-01-10T00:00:0Z</end>
|
||||
</query>
|
||||
</iq>
|
||||
]]></example>
|
||||
|
||||
</section3>
|
||||
<section3 topic='Limiting results'>
|
||||
<p>Finally, in order for the client or server to limit the number of results transmitted at
|
||||
a time a server MUST support &xep0059; and SHOULD support the paging mechanism defined therein.
|
||||
A client MAY include a <set/> element in its query.</p>
|
||||
<p>For the purposes of this protocol, the UIDs used by RSM correspond with the UIDs of the
|
||||
stanzas stored in the archive.</p>
|
||||
<example caption='A query using Result Set Management'>
|
||||
<![CDATA[
|
||||
<iq type='get' id='fetch-set-rsm1'>
|
||||
<query xmlns='urn:xmpp:chat-markers:tmp'>
|
||||
<set xmlns='http://jabber.org/protocol/rsm'>
|
||||
<max>10</max>
|
||||
</set>
|
||||
</query>
|
||||
</iq>
|
||||
]]>
|
||||
</example>
|
||||
|
||||
<p>To conserve resources, a server MAY place a reasonable limit on how many Chat Markers may be
|
||||
pushed to a client in one request. If a query returns a number of Chat Markers greater than this
|
||||
limit and either the client did not specify a limit using RSM then the server should return
|
||||
a policy-violation error to the client. If the query did include a <set/> element then
|
||||
the server SHOULD simply return its limited results and adjust the <before/> and <after/>
|
||||
in its reply to allow the client to page through them by timestamp.</p>
|
||||
<example caption='Client without RSM requests too many results'>
|
||||
<![CDATA[
|
||||
<iq type='error' id='fetch-set-rsm1'>
|
||||
<query xmlns='urn:xmpp:chat-markers:tmp'>
|
||||
<set xmlns='http://jabber.org/protocol/rsm'>
|
||||
<max>10</max>
|
||||
</set>
|
||||
</query>
|
||||
<error type='modify'>
|
||||
<policy-violation xmlns='urn:ietf:params:xml:ns:xmpp-stanzas'/>
|
||||
<text>Too many results</text>
|
||||
</error>
|
||||
</iq>
|
||||
]]>
|
||||
</example>
|
||||
</section3>
|
||||
<section2 topic='Bare JID' anchor='when-bare'>
|
||||
<p>If the sender knows only the recipient's bare JID, it cannot cannot determine (via &xep0030; or &xep0115;) whether the intended recipient supports the Chat Markers protocol. In this case, the sender MAY send a chat marker.</p>
|
||||
</section2>
|
||||
<section2 topic='Full JID' anchor='when-full'>
|
||||
<p>If the sender knows a full JID for the recipient (e.g., via presence), it SHOULD attempt to determine (via service disco or entity capabilities) whether the client at that full JID supports the Chat Markers protocol before attempting to send a Chat Marker.</p>
|
||||
<p>If the sender determines that the recipient's client does not support the Chat Markers protocol then it SHOULD NOT send Chat Markers.</p>
|
||||
<p>If the sender determines that the recipient's client supports the Chat Markers protocol then it MAY send a Chat Marker to that full JID.</p>
|
||||
</section2>
|
||||
<section2 topic='Ack Messages' anchor='when-ack'>
|
||||
<p>To prevent looping, an entity MUST NOT send a Chat Maker to mark up to a Chat Marker.</p>
|
||||
</section2>
|
||||
</section1>
|
||||
|
||||
<section1 topic='Requirements' anchor='requirements'>
|
||||
<p>Clients SHOULD use &xep0280; to support multiple online resources.</p>
|
||||
<p>Clients SHOULD use &xep0136; or &xep0313; to support offline updating of Chat Markers. Chat Markers SHOULD be archived, so they can be updated regardless of the recipients current presence.</p>
|
||||
<p>All messages MUST have an 'id' to use Chat Markers.</p>
|
||||
</section1>
|
||||
|
||||
<section1 topic='Business Rules' anchor='rules'>
|
||||
<section2 topic='Interaction with Delivery Receipts' anchor='chatstates'>
|
||||
<section2 topic='Optimizations' anchor='chatstates'>
|
||||
<p>Less Significant Chat Markers should only be sent if they are later than the more significant Chat Marker i.e. if a Message has been marked as read,
|
||||
a delivered Chat Marker should only be sent if it has a later timestamp than the read Chat Marker.</p>
|
||||
</section2>
|
||||
<section2 topic='Interaction with Delivery Receipts' anchor='receipts'>
|
||||
<p>If a delivery receipt is sent to a resource that advertises support,
|
||||
then a delivery receipt MUST be sent if it is satisfies &xep0184;.</p>
|
||||
<p>If a resource advertises both Chat Maker and Delivery Receipt support it
|
||||
@ -583,8 +140,7 @@
|
||||
<p>Clients MUST NEVER mark a message as acknowledged without any user interaction.</p>
|
||||
</section2>
|
||||
<section2 topic='Mobile Considerations' anchor='mobile'>
|
||||
<p>Since mobile devices often must pay for network traffic based
|
||||
on usage, you may wish not to enable Chat Marker Subscription.</p>
|
||||
<p>Since mobile devices often must pay for network traffic based on usage, you may wish not to enable Chat Marker Subscription.</p>
|
||||
</section2>
|
||||
</section1>
|
||||
|
||||
@ -640,64 +196,37 @@
|
||||
</xs:documentation>
|
||||
</xs:annotation>
|
||||
|
||||
|
||||
<xs:complexType name='Received'>
|
||||
<xs:simpleContent>
|
||||
<xs:extension base="xs:string">
|
||||
<xs:attribute type="xs:string" name="message-id" use="optional"/>
|
||||
<xs:attribute type="xs:string" name="message-stamp" use="optional"/>
|
||||
<xs:attribute type="xs:string" name="to" use="optional"/>
|
||||
<xs:attribute type="xs:string" name="from" use="optional"/>
|
||||
<xs:attribute type="xs:string" name="stamp" use="optional"/>
|
||||
<xs:attribute type="xs:string" name="room" use="optional"/>
|
||||
</xs:extension>
|
||||
</xs:simpleContent>
|
||||
</xs:complexType>
|
||||
|
||||
<xs:complexType name='Read'>
|
||||
<xs:simpleContent>
|
||||
<xs:extension base="xs:string">
|
||||
<xs:attribute type="xs:string" name="message-id" use="optional"/>
|
||||
<xs:attribute type="xs:string" name="message-stamp" use="optional"/>
|
||||
<xs:attribute type="xs:string" name="to" use="optional"/>
|
||||
<xs:attribute type="xs:string" name="from" use="optional"/>
|
||||
<xs:attribute type="xs:string" name="stamp" use="optional"/>
|
||||
<xs:attribute type="xs:string" name="room" use="optional"/>
|
||||
</xs:extension>
|
||||
</xs:simpleContent>
|
||||
</xs:complexType>
|
||||
|
||||
<xs:complexType name='Acknowledged'>
|
||||
<xs:simpleContent>
|
||||
<xs:extension base="xs:string">
|
||||
<xs:attribute type="xs:string" name="message-id" use="optional"/>
|
||||
<xs:attribute type="xs:string" name="message-stamp" use="optional"/>
|
||||
<xs:attribute type="xs:string" name="to" use="optional"/>
|
||||
<xs:attribute type="xs:string" name="from" use="optional"/>
|
||||
<xs:attribute type="xs:string" name="stamp" use="optional"/>
|
||||
<xs:attribute type="xs:string" name="room" use="optional"/>
|
||||
</xs:extension>
|
||||
</xs:simpleContent>
|
||||
</xs:complexType>
|
||||
|
||||
<xs:element name="chat-markers">
|
||||
<xs:element name="received">
|
||||
<xs:complexType>
|
||||
<xs:choice maxOccurs="unbounded" minOccurs="0">
|
||||
<xs:element name="received" type='Received'>
|
||||
<xs:element name="read" type='Read'>
|
||||
<xs:element name="acknowledged" type='Acknowledged'>
|
||||
</xs:choice>
|
||||
<xs:simpleContent>
|
||||
<xs:extension base="xs:string">
|
||||
<xs:attribute type="xs:string" name="id"/>
|
||||
<xs:attribute type="xs:dateTime" name="stamp"/>
|
||||
</xs:extension>
|
||||
</xs:simpleContent>
|
||||
</xs:complexType>
|
||||
</xs:element>
|
||||
|
||||
<xs:element name="query">
|
||||
|
||||
<xs:element name="read">
|
||||
<xs:complexType>
|
||||
<xs:choice maxOccurs="unbounded" minOccurs="0">
|
||||
<xs:element name='with' type='xs:string' use='optional'/>
|
||||
<xs:element name="received" type='Received'>
|
||||
<xs:element name="read" type='Read'>
|
||||
<xs:element name="acknowledged" type='Acknowledged'>
|
||||
</xs:choice>
|
||||
<xs:simpleContent>
|
||||
<xs:extension base="xs:string">
|
||||
<xs:attribute type="xs:string" name="id"/>
|
||||
<xs:attribute type="xs:dateTime" name="stamp"/>
|
||||
</xs:extension>
|
||||
</xs:simpleContent>
|
||||
</xs:complexType>
|
||||
</xs:element>
|
||||
|
||||
|
||||
<xs:element name="acknowledged">
|
||||
<xs:complexType>
|
||||
<xs:simpleContent>
|
||||
<xs:extension base="xs:string">
|
||||
<xs:attribute type="xs:string" name="id"/>
|
||||
<xs:attribute type="xs:dateTime" name="stamp"/>
|
||||
</xs:extension>
|
||||
</xs:simpleContent>
|
||||
</xs:complexType>
|
||||
</xs:element>
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user