git-svn-id: file:///home/ksmith/gitmigration/svn/xmpp/trunk@1936 4b5297f7-1745-476d-ba37-a9c6900126ab
This commit is contained in:
Peter Saint-Andre 2008-06-10 03:07:49 +00:00
parent bd1eb3b0b3
commit 357d445193
1 changed files with 40 additions and 14 deletions

View File

@ -26,6 +26,12 @@
&jer;
&temas;
&stpeter;
<revision>
<version>1.3pre1</version>
<date>in progress, last updated 2008-06-09</date>
<initials>psa</initials>
<remark><p>Corrected server processing rules to block queries to a full JID when the requesting entity is not authorized to view the presence of the user.</p></remark>
</revision>
<revision>
<version>1.2</version>
<date>2007-02-15</date>
@ -87,41 +93,61 @@
<iq from='romeo@montague.net/orchard' to='juliet@capulet.com' type='get' id='last1'>
<query xmlns='jabber:iq:last'/>
</iq>
]]></example>
<p>As specified in &xmppcore; and &xmppim;, an IQ stanza of type "get" sent to a bare JID &LOCALBARE; is handled by the user's server on the user's behalf, not delivered to one or more active resources.</p>
<p>If the requesting entity is not authorized to view the user's presence information (normally via a presence subscription as defined in <cite>XMPP-IM</cite>), the user's server MUST NOT return last activity information but instead MUST return a &forbidden; error in response to the last activity request.</p>
<example caption='Requesting Entity is Not Authorized to Retrieve Last Activity Information'><![CDATA[
<iq from='juliet@capulet.com' to='romeo@montague.net/orchard' type='result' id='last1'>
<error type='auth'>
<forbidden xmlns='urn:ietf:params:xml:ns:xmpp-stanzas'/>
</error>
</iq>
]]></example>
<p>If the requesting entity is authorized to view the user's presence information, the server shall return information about the last presence activity recorded by the server for that user.</p>
<example caption='Last Activity Response by Server'><![CDATA[
<iq from='juliet@capulet.com' to='romeo@montague.net/orchard' type='result' id='last1'>
<query xmlns='jabber:iq:last' seconds='903'>Heading Home</query>
</iq>
]]></example>
<p>In this example, the user logged out fifteen minutes and three seconds ago, and when they logged out they sent a presence packet of type='unavailable' whose &lt;status/&gt; element contained the text "Heading Home".</p>
<p>In this example, the user logged out fifteen minutes and three seconds ago, and when they logged out they sent a presence stanza of type='unavailable' whose &lt;status/&gt; element contained the text "Heading Home".</p>
<p>If the user has at least one available resource when the server receives the request, the response SHOULD contain an empty &lt;query/&gt; element whose 'seconds' attribute is set to a value of '0'.</p>
<p>Note well that, as specified in &xmppcore; and &xmppim;, an IQ query sent to a JID of the form user@host is handled by a server on the user's behalf, not forwarded to one or more active resources. In addition, a server MUST NOT return last activity information to an entity that is not authorized to view the user's presence information (normally via presence subscription), and MUST return a "Forbidden" error in response to such a request (for information about error conditions, refer to &xep0086;).</p>
</section1>
<section1 topic='Online User Query' anchor='online'>
<p>When the IQ-get is sent to a full JID (&LOCALFULL;), the responding entity MAY respond with the idle time of the user.</p>
<example caption='Online User Last Query'><![CDATA[
<p>A requesting entity may send a last activity query to a full JID &LOCALFULL;.</p>
<example caption='Last Activity Query Sent to Full JID'><![CDATA[
<iq from='romeo@montague.net/orchard' to='juliet@capulet.com/balcony' type='get' id='last2'>
<query xmlns='jabber:iq:last'/>
</iq>
]]></example>
<p>In this case, the user's server shall either deliver the IQ to an available resource or respond on behalf of the user.</p>
<p>In particular, as with the offline query use case above, if the requesting entity is not authorized to view the user's presence information (normally via a presence subscription as defined in <cite>XMPP IM</cite>), the user's server MUST NOT deliver the IQ-get to an available resource but instead MUST return a &forbidden; error in response to the last activity request.</p>
<example caption='Requesting Entity is Not Authorized to Retrieve Last Activity Information'><![CDATA[
<iq from='juliet@capulet.com' to='romeo@montague.net/orchard' type='result' id='last1'>
<error type='auth'>
<forbidden xmlns='urn:ietf:params:xml:ns:xmpp-stanzas'/>
</error>
</iq>
]]></example>
<p>If the user's server delivers the IQ-get to one of the user's available resources, the user's client MAY respond with the idle time of the user (i.e., the last time that the user interacted with the client application).</p>
<example caption='Last Activity Response by Client'><![CDATA[
<iq from='juliet@capulet.com/balcony' to='romeo@montague.net/orchard' type='result' id='last2'>
<query xmlns='jabber:iq:last' seconds='123'/>
</iq>
]]></example>
<p>In this example, the user has been idle for about two minutes.</p>
<p>Support for this functionality is OPTIONAL (a client that does not support the protocol, or that does not wish to divulge this information, SHOULD return a &unavailable; error).</p>
<p>Support for this functionality is OPTIONAL. A client that does not support the protocol, or that does not wish to divulge this information, MUST return a &unavailable; error.</p>
<example caption='Service Unavailable Error'><![CDATA[
<iq from='juliet@capulet.com/balcony' to='romeo@montague.net/orchard' type='error' id='last2'>
<query xmlns='jabber:iq:last'/>
<error code='503' type='cancel'>
<error type='cancel'>
<service-unavailable xmlns='urn:ietf:params:xml:ns:xmpp-stanzas'/>
</error>
</iq>
]]></example>
<p>If there is no available resource matching the user@host/resource in the 'to' attribute of the request, the server MUST follow the rules in <strong>XMPP IM</strong> in order to determine what error stanza to return.</p>
<p>If there is no available resource matching the user@host/resource in the 'to' attribute of the request, the server MUST follow the rules in <cite>XMPP IM</cite> in order to determine what error stanza to return.</p>
</section1>
<section1 topic='Server and Component Query' anchor='server'>
<p>When the IQ-get namespace is sent to a server or component (i.e., to a JID of the form 'host'), the information contained in the IQ reply reflects the uptime of the JID sending the reply. The seconds attribute is how long the host has been up. The &QUERY; element SHOULD NOT contain XML character data.</p>
<example caption='Server/Component Last Query'><![CDATA[
<p>When the last activity query is sent to a server or component (i.e., to a JID of the form &DOMAINBARE;), the information contained in the IQ reply reflects the uptime of the JID sending the reply. The seconds attribute specifies how long the host has been up and running. The &QUERY; element SHOULD NOT contain XML character data.</p>
<example caption='Last Activity Query Sent to Server or Service'><![CDATA[
<iq from='romeo@montague.net/orchard' to='capulet.com' type='get' id='last3'>
<query xmlns='jabber:iq:last'/>
</iq>
@ -133,7 +159,7 @@
<p>In this example, the server has been up for a little more than 34 hours.</p>
</section1>
<section1 topic='Determining Support' anchor='disco'>
<p>In order for a requesting entity to determine if a responding entity supports result set management, it SHOULD send a &xep0030; information request to the responding entity:</p>
<p>In order for a requesting entity to determine if a responding entity supports the last activity protocol, it SHOULD send a &xep0030; information request to the responding entity:</p>
<example caption='Requesting entity queries responding entity regarding protocol support'><![CDATA[
<iq from='stpeter@jabber.org/roundabout'
to='jabber.org'
@ -164,7 +190,7 @@
<p>This document requires no interaction with &IANA;.</p>
</section1>
<section1 topic='XMPP Registrar Considerations' anchor='registrar'>
<p>No action on the part of the &REGISTRAR; is necessary as a result of this document, since 'jabber:iq:last' is already a registered protocol namespace.</p>
<p>No action on the part of the &REGISTRAR; is necessary as a result of this document, since 'jabber:iq:last' is already registered in the protocol namespaces registry located at &NAMESPACES;.</p>
</section1>
<section1 topic='XML Schema' anchor='schema'>
<code><![CDATA[