git-svn-id: file:///home/ksmith/gitmigration/svn/xmpp/trunk@172 4b5297f7-1745-476d-ba37-a9c6900126ab
This commit is contained in:
Peter Saint-Andre 2006-11-06 16:29:29 +00:00
parent 64a72f81ca
commit 71a7aaa31a
1 changed files with 80 additions and 37 deletions

View File

@ -22,6 +22,12 @@
<supersededby>None</supersededby>
<shortname>blocking</shortname>
&stpeter;
<revision>
<version>0.4</version>
<date>2006-11-06</date>
<initials>psa</initials>
<remark><p>Added push notifications (a la roster pushes).</p></remark>
</revision>
<revision>
<version>0.3</version>
<date>2006-10-16</date>
@ -81,13 +87,13 @@
<section2 topic='User Discovers Support' anchor='disco'>
<p>In order for a client to discover whether its server supports the protocol defined herein, it MUST send a &xep0030; information request to the server:</p>
<example caption='Service discovery request'><![CDATA[
<iq from='bilbo@tolkien.lit/shire' to='tolkien.lit' type='get' id='disco1'>
<iq from='juliet@capulet.com/chamber' to='capulet.com' type='get' id='disco1'>
<query xmlns='http://jabber.org/protocol/disco#info'/>
</iq>
]]></example>
<p>If the server supports the protocol defined herein, it MUST return a feature of "http://jabber.org/protocol/blocking":</p>
<example caption='Service discovery response'><![CDATA[
<iq from='bilbo@tolkien.lit/shire' to='tolkien.lit' type='result' id='disco1'>
<iq from='capulet.com' to='juliet@capulet.com/chamber' type='result' id='disco1'>
<query xmlns='http://jabber.org/protocol/disco#info'>
...
<feature var='http://jabber.org/protocol/blocking'/>
@ -96,40 +102,6 @@
</iq>
]]></example>
</section2>
<section2 topic='User Blocks Contact' anchor='block'>
<p>In order for a user to block communications with a contact, the user's client shall send an IQ-set with no 'to' address (thus handled by the user's server) containing a &lt;block/&gt; element qualified by the 'http://jabber.org/protocol/blocking' namespace, where the JID to be blocked is encapsulated as the 'jid' attribute of the &lt;item/&gt; child element:</p>
<example caption='Block command'><![CDATA[
<iq type='set' id='block1'>
<block xmlns='http://jabber.org/protocol/blocking'>
<item jid='romeo@montague.net'/>
</block>
</iq>
]]></example>
<p>If the server can successfully process the block command, it MUST return an IQ-result:</p>
<example caption='Block command is successful'><![CDATA[
<iq type='result' id='block1'/>
]]></example>
<p>If the &lt;block/&gt; element does not contain at least one &lt;item/&gt; child element, the server MUST return a &badrequest; error. Other standard XMPP stanza errors also apply; see &xmppcore; and &xep0086;.</p>
<p>Note: The &lt;block/&gt; element MAY contain more than one &lt;item/&gt; child.</p>
<p>When the user blocks communications with the contact, the user's server MUST send unavailable presence information to the contact (but only if the contact is allowed to receive presence notifications from the user in accordance with the rules defined in <cite>RFC 3921</cite>).</p>
<p>Once the user has blocked communications with the contact, the user's server MUST NOT deliver any XML stanzas from the contact to the user. The block remains in force until the user subsequently unblocks commmunications with the contact (i.e., the duration of the block is potentially unlimited and applies across sessions).</p>
<p>If the contact attempts to send a stanza to the user (i.e., an inbound stanza from the user's perspective), the user's server shall handle the stanza according to the following rules:</p>
<ul>
<li>For message stanzas and presence stanzas (including notifications, subscriptions, and probes), the user's server MUST NOT respond and MUST NOT return an error.</li>
<li>For IQ stanzas, the server MUST return an error, which SHOULD be &unavailable;.</li>
</ul>
<p>If the foregoing suggestions are followed, the user will appear offline to the contact.</p>
<p>If the user attempts to send an outbound stanza to the contact, the user's server MUST NOT route the stanza to the contact but instead MUST return a &notacceptable; error containing an application-specific error condition of &lt;blocked/&gt; qualified by the 'http://jabber.org/protocol/blocking#errors' namespace:</p>
<example caption='Error: contact is blocked'><![CDATA[
<message type='error' from='romeo@montague.net' to='juliet@capulet.com'>
<body>Can you hear me now?</body>
<error type='cancel'>
<not-acceptable xmlns='urn:ietf:params:xml:ns:xmpp-stanzas'/>
<blocked xmlns='http://jabber.org/protocol/blocking#errors'/>
</error>
</message>
]]></example>
</section2>
<section2 topic='User Retrieves Block List' anchor='blocklist'>
<p>In order for a client to request a user's list of blocked contacts (e.g., in order to determine whether to unblock a contact), it shall send an IQ-get with no 'to' address (thus handled by the user's server) containing a &lt;blocklist/&gt; element qualified by the 'http://jabber.org/protocol/blocking' namespace:</p>
<example caption='Client requests blocklist'><![CDATA[
@ -152,7 +124,54 @@
<blocklist xmlns='http://jabber.org/protocol/blocking'/>
</iq>
]]></example>
<p>A client SHOULD retrieve the block list after authenticating with its server.</p>
<p>A client SHOULD retrieve the block list after authenticating with its server and before completing any blocking or unblocking operations.</p>
</section2>
<section2 topic='User Blocks Contact' anchor='block'>
<p>In order for a user to block communications with a contact, the user's client shall send an IQ-set with no 'to' address (thus handled by the user's server) containing a &lt;block/&gt; element qualified by the 'http://jabber.org/protocol/blocking' namespace, where the JID to be blocked is encapsulated as the 'jid' attribute of the &lt;item/&gt; child element:</p>
<example caption='Block command'><![CDATA[
<iq from='juliet@capulet.com/chamber' type='set' id='block1'>
<block xmlns='http://jabber.org/protocol/blocking'>
<item jid='romeo@montague.net'/>
</block>
</iq>
]]></example>
<p>If the server can successfully process the block command, it MUST return an IQ-result:</p>
<example caption='Block command is successful'><![CDATA[
<iq type='result' id='block1'/>
]]></example>
<p>The server MUST also send an IQ-set to all of the user's resources that have requested the blocklist, containing the blocked item(s):</p>
<example caption='Block &quot;push&quot;'><![CDATA[
<iq to='juliet@capulet.com/chamber' type='set' id='push1'>
<block xmlns='http://jabber.org/protocol/blocking'>
<item jid='romeo@montague.net'/>
</block>
</iq>
<iq to='juliet@capulet.com/balcony' type='set' id='push2'>
<block xmlns='http://jabber.org/protocol/blocking'>
<item jid='romeo@montague.net'/>
</block>
</iq>
]]></example>
<p>If the &lt;block/&gt; element does not contain at least one &lt;item/&gt; child element, the server MUST return a &badrequest; error. The &lt;block/&gt; element MAY contain more than one &lt;item/&gt; child. Other standard XMPP stanza errors also apply; see &xmppcore; and &xep0086;.</p>
<p>When the user blocks communications with the contact, the user's server MUST send unavailable presence information to the contact (but only if the contact is allowed to receive presence notifications from the user in accordance with the rules defined in <cite>RFC 3921</cite>).</p>
<p>Once the user has blocked communications with the contact, the user's server MUST NOT deliver any XML stanzas from the contact to the user. The block remains in force until the user subsequently unblocks commmunications with the contact (i.e., the duration of the block is potentially unlimited and applies across sessions).</p>
<p>If the contact attempts to send a stanza to the user (i.e., an inbound stanza from the user's perspective), the user's server shall handle the stanza according to the following rules:</p>
<ul>
<li>For message stanzas and presence stanzas (including notifications, subscriptions, and probes), the user's server MUST NOT respond and MUST NOT return an error.</li>
<li>For IQ stanzas, the server MUST return an error, which SHOULD be &unavailable;.</li>
</ul>
<p>If the foregoing suggestions are followed, the user will appear offline to the contact.</p>
<p>If the user attempts to send an outbound stanza to the contact, the user's server MUST NOT route the stanza to the contact but instead MUST return a &notacceptable; error containing an application-specific error condition of &lt;blocked/&gt; qualified by the 'http://jabber.org/protocol/blocking#errors' namespace:</p>
<example caption='Error: contact is blocked'><![CDATA[
<message type='error' from='romeo@montague.net' to='juliet@capulet.com'>
<body>Can you hear me now?</body>
<error type='cancel'>
<not-acceptable xmlns='urn:ietf:params:xml:ns:xmpp-stanzas'/>
<blocked xmlns='http://jabber.org/protocol/blocking#errors'/>
</error>
</message>
]]></example>
</section2>
<section2 topic='User Unblocks Contact' anchor='unblock'>
<p>In order for a user to unblock communications with a contact, the user's client shall send an IQ-set with no 'to' address (thus handled by the user's server) containing an &lt;unblock/&gt; element qualified by the 'http://jabber.org/protocol/blocking' namespace, where the JID to be unblocked is encapsulated as the 'jid' attribute of the &lt;item/&gt; child element:</p>
@ -166,6 +185,20 @@
<p>If the server can successfully process the unblock command, it MUST return an IQ-result:</p>
<example caption='Unblock contact command is successful'><![CDATA[
<iq type='result' id='unblock1'/>
]]></example>
<p>The server MUST also send an IQ-set to all of the user's resources that have requested the blocklist, containing the unblocked item(s):</p>
<example caption='Unblock &quot;push&quot;'><![CDATA[
<iq to='juliet@capulet.com/chamber' type='set' id='push3'>
<unblock xmlns='http://jabber.org/protocol/blocking'>
<item jid='romeo@montague.net'/>
</unblock>
</iq>
<iq to='juliet@capulet.com/balcony' type='set' id='push4'>
<unblock xmlns='http://jabber.org/protocol/blocking'>
<item jid='romeo@montague.net'/>
</unblock>
</iq>
]]></example>
<p>When the user unblocks communications with the contact, the user's server MUST send the user's current presence information to the contact (but only if the contact is allowed to receive presence notifications from the user in accordance with the rules defined in <cite>RFC 3921</cite>).</p>
<p>After the user has unblocked communications with the contact, the user's server MUST deliver any subsequent XML stanzas from the contact to the user.</p>
@ -180,6 +213,16 @@
<p>If the server can successfully process the unblock command, it MUST return an IQ-result:</p>
<example caption='Unblock all command is successful'><![CDATA[
<iq type='result' id='unblock2'/>
]]></example>
<p>The server MUST also send an IQ-set to all of the user's resources that have requested the blocklist, containing notification of global unblocking:</p>
<example caption='Unblock all &quot;push&quot;'><![CDATA[
<iq to='juliet@capulet.com/chamber' type='set' id='push5'>
<unblock xmlns='http://jabber.org/protocol/blocking'/>
</iq>
<iq to='juliet@capulet.com/balcony' type='set' id='push6'>
<unblock xmlns='http://jabber.org/protocol/blocking'/>
</iq>
]]></example>
<p>Once the user has unblocked communications with all contacts, the user's server MUST deliver any XML stanzas from those contacts to the user.</p>
</section2>