<abstract>This specification provides a way to filter PubSub nodes in a disco query.</abstract>
&LEGALNOTICE;
<number>xxxx</number>
<status>ProtoXEP</status>
<type>Standards Track</type>
<sig>Standards</sig>
<approver>Council</approver>
<dependencies>
<spec>XEP-0004</spec>
<spec>XEP-0030</spec>
<spec>XEP-0060</spec>
</dependencies>
<supersedes/>
<supersededby/>
<shortname>NOT_YET_ASSIGNED</shortname>
<author>
<firstname>Timothée</firstname>
<surname>Jaussoin</surname>
<email>edhelas@movim.eu</email>
<jid>edhelas@movim.eu</jid>
</author>
<author>
<firstname>Maxime</firstname>
<surname>Buquet</surname>
<email>pep@bouah.net</email>
<jid>pep@bouah.net</jid>
</author>
<revision>
<version>0.0.1</version>
<date>2022-02-01</date>
<initials>edhelas, pep</initials>
<remark><p>First draft.</p></remark>
</revision>
</header>
<section1anchor="intro"topic="Introduction">
<p>Implementations have been able to declare a <tt>pubsub#type</tt> attribute on PubSub nodes for about as long as &xep0060; has existed. This attribute doesn’t seem to be widely used in the community though, maybe due to the vagueness of its description, that has recently changed, or the lack of features associated with it.</p>
<p>This specification provides a way for implementations to allow filtering on this attribute when discovering items on a PubSub service.</p>
<p>Filtering is particularly useful for example combined with &xep0277; and comment nodes that are created on the same service. When listing content nodes of a service, one may want to filter out comment nodes.</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>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>