mirror of
https://github.com/moparisthebest/xeps
synced 2024-12-12 19:02:16 -05:00
PubSub Filter: change allow/block to include/exclude
Signed-off-by: Maxime “pep” Buquet <pep@bouah.net>
This commit is contained in:
parent
da38ae50c5
commit
58ec7af726
@ -54,7 +54,7 @@
|
||||
<section1 anchor="reqs" topic="Requirements">
|
||||
|
||||
<ul>
|
||||
<li>Allow querying only a subset of nodes in a disco items request, in the form of allow/block</li>
|
||||
<li>Allow querying only a subset of nodes in a disco items request, in the form of include/exclude</li>
|
||||
</ul>
|
||||
|
||||
</section1>
|
||||
@ -66,13 +66,13 @@
|
||||
</section2>
|
||||
<section2 anchor="sending-a-disco-request" topic="Sending a disco request">
|
||||
|
||||
<p>While requesting disco#items on a PubSub service, an entity might want to only get nodes of certain <tt>pubsub#type</tt>. To do so, it may add a filter child of namespace <tt>urn:xmpp:pubsub-filter:0</tt> to the query element, containing a &xep0004; form with FORM_TYPE set to <tt>urn:xmpp:pubsub-filter:0</tt> and an <tt>allowed-types</tt> or <tt>blocked-types</tt> list-multi type field containing the various types it wants to filter.</p>
|
||||
<p>While requesting disco#items on a PubSub service, an entity might want to only get nodes of certain <tt>pubsub#type</tt>. To do so, it may add a filter child of namespace <tt>urn:xmpp:pubsub-filter:0</tt> to the query element, containing a &xep0004; form with FORM_TYPE set to <tt>urn:xmpp:pubsub-filter:0</tt> and an <tt>included-types</tt> or <tt>excluded-types</tt> list-multi type field containing the various types it wants to filter.</p>
|
||||
|
||||
<p>When <tt>allowed-types</tt> is specified, a PubSub service MUST return nodes of matching <tt>pubsub#type</tt> in its response.</p>
|
||||
<p>When <tt>included-types</tt> is specified, a PubSub service MUST return nodes of matching <tt>pubsub#type</tt> in its response.</p>
|
||||
|
||||
<p>When <tt>blocked-types</tt> is specified, a PubSub service MUST return every node but those of matching <tt>pubsub#types</tt> in its response.</p>
|
||||
<p>When <tt>excluded-types</tt> is specified, a PubSub service MUST return every node but those of matching <tt>pubsub#types</tt> in its response.</p>
|
||||
|
||||
<p>Both allowed and blocked fields MAY contain an empty value to designate nodes with an empty <tt>pubsub#type</tt>.</p>
|
||||
<p>Both included and excluded fields MAY contain an empty value to designate nodes with an empty <tt>pubsub#type</tt>.</p>
|
||||
|
||||
<example caption='Requesting disco#items with only nodes of the following types, including empty ones'><![CDATA[<iq type='get'
|
||||
from='rosa@com.int/desktop'
|
||||
@ -84,7 +84,7 @@
|
||||
<field var='FORM_TYPE' type='hidden'>
|
||||
<value>urn:xmpp:pubsub-filter:0</value>
|
||||
</field>
|
||||
<field type='list-multi' var='allowed-types'>
|
||||
<field type='list-multi' var='included-types'>
|
||||
<value>urn:xmpp:microblog:0</value>
|
||||
<value/>
|
||||
</field>
|
||||
@ -93,7 +93,7 @@
|
||||
</query>
|
||||
</iq>]]></example>
|
||||
|
||||
<p>If both the allowed and blocked fields are specified, a service MUST return an error of type <tt>modify</tt> containing a <tt>bad-request</tt> element in the <tt>urn:ietf:params:xml:ns:xmpp-stanzas</tt> namespace.</p>
|
||||
<p>If both the included and excluded fields are specified, a service MUST return an error of type <tt>modify</tt> containing a <tt>bad-request</tt> element in the <tt>urn:ietf:params:xml:ns:xmpp-stanzas</tt> namespace.</p>
|
||||
|
||||
<example caption='Error returned when a requesting entity includes both fields'><![CDATA[<iq type='error'
|
||||
from='news.com.int'
|
||||
|
Loading…
Reference in New Issue
Block a user