<?xml version="1.0" encoding="UTF-8"?>
<?xml-stylesheet type='text/xsl' href='xep.xsl'?>
<xep xmlns="">
<header>
  <title>Forums</title>
  <abstract>This specification describes how to implement XMPP-based discussion forums.</abstract>
  
<legal>
<copyright>This XMPP Extension Protocol is copyright © 1999 – 2024 by the <link url="https://xmpp.org/">XMPP Standards Foundation</link> (XSF).</copyright>
<permissions>Permission is hereby granted, free of charge, to any person obtaining a copy of this specification (the "Specification"), to make use of the Specification without restriction, including without limitation the rights to implement the Specification in a software program, deploy the Specification in a network service, and copy, modify, merge, publish, translate, distribute, sublicense, or sell copies of the Specification, and to permit persons to whom the Specification is furnished to do so, subject to the condition that the foregoing copyright notice and this permission notice shall be included in all copies or substantial portions of the Specification. Unless separate permission is granted, modified works that are redistributed shall not contain misleading information regarding the authors, title, number, or publisher of the Specification, and shall not claim endorsement of the modified works by the authors, any organization or project to which the authors belong, or the XMPP Standards Foundation.</permissions>
<warranty>## NOTE WELL: This Specification is provided on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, express or implied, including, without limitation, any warranties or conditions of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A PARTICULAR PURPOSE. ##</warranty>
<liability>In no event and under no legal theory, whether in tort (including negligence), contract, or otherwise, unless required by applicable law (such as deliberate and grossly negligent acts) or agreed to in writing, shall the XMPP Standards Foundation or any author of this Specification be liable for damages, including any direct, indirect, special, incidental, or consequential damages of any character arising from, out of, or in connection with the Specification or the implementation, deployment, or other use of the Specification (including but not limited to damages for loss of goodwill, work stoppage, computer failure or malfunction, or any and all other commercial damages or losses), even if the XMPP Standards Foundation or such author has been advised of the possibility of such damages.</liability>
<conformance>This XMPP Extension Protocol has been contributed in full conformance with the XSF's Intellectual Property Rights Policy (a copy of which can be found at &lt;<link url="https://xmpp.org/about/xsf/ipr-policy">https://xmpp.org/about/xsf/ipr-policy</link>&gt; or obtained by writing to XMPP Standards Foundation, P.O. Box 787, Parker, CO 80134 USA).</conformance>
</legal>
  <number>xxxx</number>
  <status>ProtoXEP</status>
  <type>Standards Track</type>
  <sig>Standards</sig>
  <approver>Council</approver>
  <dependencies>
    <spec>XMPP Core</spec>
    <spec>XEP-0060</spec>
    <spec>XEP-0472</spec>
  </dependencies>
  <supersedes/>
  <supersededby/>
  <shortname>forums</shortname>
  <tags>
    <tag>Pubsub</tag>
    <tag>Pubsub Social Feed</tag>
    <tag>Forums</tag>
  </tags>
  
  <author>
    <firstname>Jérôme</firstname>
    <surname>Poisson</surname>
    <email>goffi@goffi.org</email>
    <jid>goffi@jabber.fr</jid>
    <uri>https://www.goffi.org</uri>
  </author>

  <revision>
    <version>0.0.1</version>
    <date>2025-10-14</date>
    <initials>jp</initials>
    <remark><p>First draft.</p></remark>
  </revision>
</header>

<section1 topic="Introduction" anchor="intro">
  <p>XMPP has offered more than instant messaging since its early days. It notably provides a powerful <span class="ref"><link url="https://xmpp.org/extensions/xep-0060.html">Publish-Subscribe (XEP-0060)</link></span> <note>XEP-0060: Publish-Subscribe &lt;<link url="https://xmpp.org/extensions/xep-0060.html">https://xmpp.org/extensions/xep-0060.html</link>&gt;.</note> foundation, which serves as the basis for many features.</p>
  <p>Blogging is one such feature, initially implemented through direct use of <span class="ref"><link url="http://tools.ietf.org/html/rfc4287">RFC 4287</link></span> <note>RFC 4287: The Atom Syndication Format &lt;<link url="http://tools.ietf.org/html/rfc4287">http://tools.ietf.org/html/rfc4287</link>&gt;.</note> in Pubsub items, then via <span class="ref"><link url="https://xmpp.org/extensions/xep-0277.html">Microblogging Over XMPP (XEP-0277)</link></span> <note>XEP-0277: Microblogging over XMPP &lt;<link url="https://xmpp.org/extensions/xep-0277.html">https://xmpp.org/extensions/xep-0277.html</link>&gt;.</note>, and more recently with <span class="ref"><link url="https://xmpp.org/extensions/xep-0472.html">PubSub Social Feed (XEP-0472)</link></span> <note>XEP-0472: PubSub Social Feed &lt;<link url="https://xmpp.org/extensions/xep-0472.html">https://xmpp.org/extensions/xep-0472.html</link>&gt;.</note>, a more generic basis for Atom-based features.</p>
  <p>While blogging is ideal for one-to-many communication, it’s not well-adapted to multi-party, topic-specific discussions. Forums have therefore been used in various forms since the early days of the Internet – from Usenet and mailing lists to web-based platforms.</p>
  <p>This specification describes how to implement forums with XMPP in a flexible way, allowing for feature-rich forums and the building of gateways to existing ones.</p>
</section1>

<section1 topic="Requirements" anchor="reqs">
  <p>The design goals of this XEP are:</p>
  <ul>
    <li>Based on <span class="ref"><link url="https://xmpp.org/extensions/xep-0060.html">Publish-Subscribe (XEP-0060)</link></span> <note>XEP-0060: Publish-Subscribe &lt;<link url="https://xmpp.org/extensions/xep-0060.html">https://xmpp.org/extensions/xep-0060.html</link>&gt;.</note> and compatible with pubsub-based features (<span class="ref"><link url="https://xmpp.org/extensions/xep-0470.html">Pubsub Attachments (XEP-0470)</link></span> <note>XEP-0470: Pubsub Attachments &lt;<link url="https://xmpp.org/extensions/xep-0470.html">https://xmpp.org/extensions/xep-0470.html</link>&gt;.</note>, end-to-end encryption, etc).</li>
    <li>Support hierarchical organization of forums.</li>
    <li>Reuse existing specifications, notably Atom (<span class="ref"><link url="http://tools.ietf.org/html/rfc4287">RFC 4287</link></span> <note>RFC 4287: The Atom Syndication Format &lt;<link url="http://tools.ietf.org/html/rfc4287">http://tools.ietf.org/html/rfc4287</link>&gt;.</note>) via <span class="ref"><link url="https://xmpp.org/extensions/xep-0472.html">PubSub Social Feed (XEP-0472)</link></span> <note>XEP-0472: PubSub Social Feed &lt;<link url="https://xmpp.org/extensions/xep-0472.html">https://xmpp.org/extensions/xep-0472.html</link>&gt;.</note> and <span class="ref"><link url="https://xmpp.org/extensions/xep-0496.html">Pubsub Node Relationships (XEP-0496)</link></span><note>XEP-0496: Pubsub Node Relationships &lt;<link url="https://xmpp.org/extensions/xep-0496.html">https://xmpp.org/extensions/xep-0496.html</link>&gt;.</note> for the optional hierarchy.</li>
    <li>Allow creation of the two main types of forums: Flat and Threaded.</li>
    <li>Flexible enough to build gateways to most common third-party forums.</li>
  </ul>
</section1>

<section1 topic="Glossary" anchor="glossary">
    <ul>

        <li><strong>Forum</strong>: A themed grouping of discussions.</li>
        <li><strong>Topic</strong>: A discussion subject within a forum.</li>
        <li><strong>Replies</strong>: Messages posted in response to a topic.</li>
        <li><strong>Root Post</strong>: First message of a topic, to which other messages will reply.</li>
        <li><strong>Flat Forum</strong>: A forum where all replies to a topic are displayed chronologically in a single linear thread. While messages can reference and reply to other messages, they maintain their chronological order regardless of the reply hierarchy.</li>
        <li><strong>Threaded Forum</strong>: A forum where replies can be added to any message within a topic, creating nested reply structures that form multiple threads or continuations of existing threads.</li>
    </ul>
</section1>

<section1 topic="Overview" anchor="overview">
  <p>A forum is based on a node using one of the two dedicated <span class="ref"><link url="https://xmpp.org/extensions/xep-0472.html">PubSub Social Feed (XEP-0472)</link></span> <note>XEP-0472: PubSub Social Feed &lt;<link url="https://xmpp.org/extensions/xep-0472.html">https://xmpp.org/extensions/xep-0472.html</link>&gt;.</note> profiles. This node items are the forum topics. Each topic has a comments node where replies can be posted.</p>
  <p>This specification describes two forum profiles for <span class="ref"><link url="https://xmpp.org/extensions/xep-0472.html">PubSub Social Feed (XEP-0472)</link></span> <note>XEP-0472: PubSub Social Feed &lt;<link url="https://xmpp.org/extensions/xep-0472.html">https://xmpp.org/extensions/xep-0472.html</link>&gt;.</note>: one for flat forums, and one for threaded forums. The payload of those items uses Atom (<span class="ref"><link url="http://tools.ietf.org/html/rfc4287">RFC 4287</link></span> <note>RFC 4287: The Atom Syndication Format &lt;<link url="http://tools.ietf.org/html/rfc4287">http://tools.ietf.org/html/rfc4287</link>&gt;.</note>) via <span class="ref"><link url="https://xmpp.org/extensions/xep-0472.html">PubSub Social Feed (XEP-0472)</link></span> <note>XEP-0472: PubSub Social Feed &lt;<link url="https://xmpp.org/extensions/xep-0472.html">https://xmpp.org/extensions/xep-0472.html</link>&gt;.</note>.</p>
  <p>Forums can be optionally organized in hierarchy using <span class="ref"><link url="https://xmpp.org/extensions/xep-0496.html">Pubsub Node Relationships (XEP-0496)</link></span><note>XEP-0496: Pubsub Node Relationships &lt;<link url="https://xmpp.org/extensions/xep-0496.html">https://xmpp.org/extensions/xep-0496.html</link>&gt;.</note>, allowing for better organisation and easier discovery.</p>
  <p>Advanced features such as reactions are implemented using <span class="ref"><link url="https://xmpp.org/extensions/xep-0470.html">Pubsub Attachments (XEP-0470)</link></span> <note>XEP-0470: Pubsub Attachments &lt;<link url="https://xmpp.org/extensions/xep-0470.html">https://xmpp.org/extensions/xep-0470.html</link>&gt;.</note> and end-to-end encrypted forums are possible via standard pubsub e2ee specifications such as <span class="ref"><link url="https://xmpp.org/extensions/xep-0473.html">OpenPGP for XMPP Pubsub (XEP-0473)</link></span> <note>XEP-0473: OpenPGP for XMPP Pubsub &lt;<link url="https://xmpp.org/extensions/xep-0473.html">https://xmpp.org/extensions/xep-0473.html</link>&gt;.</note>.</p>
</section1>

<section1 topic="Forums Hierarchy" anchor="hierarchy">
  <p>To organize the forums, a service can optionally have a hierarchy. This is done by using <span class="ref"><link url="https://xmpp.org/extensions/xep-0496.html">Pubsub Node Relationships (XEP-0496)</link></span><note>XEP-0496: Pubsub Node Relationships &lt;<link url="https://xmpp.org/extensions/xep-0496.html">https://xmpp.org/extensions/xep-0496.html</link>&gt;.</note>, which defines the 'parent' relationship used in this specification. The <em>pubsub#type</em> and <em>pubsub#title</em> refer to the configuration fields of a pubsub node as described at <link url="https://xmpp.org/extensions/xep-0060.html#owner-configure">XEP-0060 §8.2</link>.</p>

  <p>Two types of nodes are used for the hierarchy: <em>root nodes</em> and <em>category nodes</em>.</p>

  <section2 topic="Root Nodes" anchor="root-nodes">
    <p>Root nodes serve as the entry point for forums.</p>
    <ul>
      <li>A root node MUST NOT have any parent and MUST have a <em>pubsub#type</em> set to 'urn:xmpp:forums:root:0'.</li>
      <li>This node MUST NOT have any items.</li>
      <li>If a service provides a single forum hierarchy without user-created hierarchies, it MUST use the well-known name 'urn:xmpp:forums:0' for its root node and MUST advertise the feature 'urn:xmpp:forums:0' in response to <span class="ref"><link url="https://xmpp.org/extensions/xep-0030.html">Service Discovery (XEP-0030)</link></span> <note>XEP-0030: Service Discovery &lt;<link url="https://xmpp.org/extensions/xep-0030.html">https://xmpp.org/extensions/xep-0030.html</link>&gt;.</note> disco#info requests.</li>
      <li>In other cases (e.g., a generic pubsub service where users can create new forum hierarchies), any node name may be used; root nodes are then found by checking the value of the 'pubsub#type' attribute.</li>
      <li>Root nodes SHOULD have a <em>pubsub#title</em> set to explain what the forum hierarchy is about.</li>
    </ul>
  </section2>

  <section2 topic="Category Nodes" anchor="category-nodes">
    <p>Category nodes organize forums and function as folders containing other categories or forums.</p>
    <ul>
      <li>A category node MUST have a parent set to either a root node or another category node.</li>
      <li>Category depth may be arbitrary, but it is recommended to keep it low to avoid confusion from excessive subcategories.</li>
      <li>A category node MUST have a <em>pubsub#type</em> set to 'urn:xmpp:forums:category:0' and MUST NOT have any items.</li>
      <li>Category node names MUST follow the 'urn:xmpp:forums:category:0:&lt;UNIQUE ID&gt;' scheme, where '&lt;UNIQUE ID&gt;' is an identifier that MUST be unique across the service.</li>
      <li>A category node MUST have a <em>pubsub#title</em> set to a suitable label for the category, which will be displayed to end-users.</li>
    </ul>
  </section2>

  <p>A client can find forum hierarchies by either checking the well-known node (if the service announces the feature 'urn:xmpp:forums:0' in response to <span class="ref"><link url="https://xmpp.org/extensions/xep-0030.html">Service Discovery (XEP-0030)</link></span> <note>XEP-0030: Service Discovery &lt;<link url="https://xmpp.org/extensions/xep-0030.html">https://xmpp.org/extensions/xep-0030.html</link>&gt;.</note> disco#info requests) or by looking for nodes with the 'pubsub#type' attribute set to 'urn:xmpp:forums:root:0'. <span class="ref"><link url="https://xmpp.org/extensions/xep-0462.html">PubSub Type Filtering (XEP-0462)</link></span> <note>XEP-0462: PubSub Type Filtering &lt;<link url="https://xmpp.org/extensions/xep-0462.html">https://xmpp.org/extensions/xep-0462.html</link>&gt;.</note> can be used in the later case if the pubsub service supports it.</p>
</section1>

<section1 topic="Forums Profiles" anchor="profiles">
  <p>Forums are based on <span class="ref"><link url="https://xmpp.org/extensions/xep-0472.html">PubSub Social Feed (XEP-0472)</link></span> <note>XEP-0472: PubSub Social Feed &lt;<link url="https://xmpp.org/extensions/xep-0472.html">https://xmpp.org/extensions/xep-0472.html</link>&gt;.</note>. Two profiles are defined: one for flat forums and one for threaded forums. In both cases, a forum consists of a forum node in which each item consists of a root post. Each root post MUST:</p>
  <ul>
    <li>include a &lt;title&gt; element (the topic title) as defined in <span class="ref"><link url="http://tools.ietf.org/html/rfc4287">RFC 4287</link></span> <note>RFC 4287: The Atom Syndication Format &lt;<link url="http://tools.ietf.org/html/rfc4287">http://tools.ietf.org/html/rfc4287</link>&gt;.</note>;</li>
    <li>include a &lt;content&gt; element (the topic root post) as defined in <span class="ref"><link url="http://tools.ietf.org/html/rfc4287">RFC 4287</link></span> <note>RFC 4287: The Atom Syndication Format &lt;<link url="http://tools.ietf.org/html/rfc4287">http://tools.ietf.org/html/rfc4287</link>&gt;.</note>;</li>
    <li>include a single comments node (as specified in <link url="https://xmpp.org/extensions/xep-0277.xml#comments">XEP-0277 §3 Comments</link>), where replies are published.</li>
  </ul>
  <p>The organization of replies depends on the forum type.</p>
  <section2 topic="Flat Forums" anchor="flat-forums">
    <ul>
      <li>Flat forums MUST set the 'pubsub#type' to "urn:xmpp:pubsub-social-feed:flat-forums:0".</li>
      <li>All replies MUST be posted to the comments node of the root post.</li>
      <li>A reply MAY reference another reply by using a &lt;in-reply-to/&gt; element as specified in <link url="https://xmpp.org/extensions/xep-0472.html#reply">XEP-0472 §4.4 Replying to a Post</link>.</li>
    </ul>
    <p>With this profile, the XMPP client knows that the view is flat, and can detect the links between replies with the &lt;in-reply-to/&gt; element, and show them with whatever user interface is appropriate.</p>
  </section2>
  <section2 topic="Threaded Forums" anchor="threaded-forums">
    <ul>
      <li>Threaded forums MUST set the 'pubsub#type' to "urn:xmpp:pubsub-social-feed:threaded-forums:0".</li>
      <li>All published replies MUST link to a comments node (which can be created in advance, or automatically if the pubsub service supports auto-create as specified in <link url="https://xmpp.org/extensions/xep-0060.html#publisher-publish-autocreate">XEP-0060 §7.1.4 Automatic Node Creation</link>).</li>
      <li>All replies MUST be posted to the comments node of the items they are replying to.</li>
      <li>The &lt;in-reply-to/&gt; element as specified in <link url="https://xmpp.org/extensions/xep-0472.html#reply">XEP-0472 §4.4 Replying to a Post</link> MUST NOT be used.</li>
    </ul>
    <p>With this profile, the XMPP client knows that the view is a tree-like view of nested threads.</p>
  </section2>
</section1>

<section1 topic="Business Rules" anchor="rules">
  <p>In forums, publications can often be edited, and with <span class="ref"><link url="https://xmpp.org/extensions/xep-0060.html">Publish-Subscribe (XEP-0060)</link></span> <note>XEP-0060: Publish-Subscribe &lt;<link url="https://xmpp.org/extensions/xep-0060.html">https://xmpp.org/extensions/xep-0060.html</link>&gt;.</note> alone, this will overwrite the old item with a new one, causing it to appear before items published later. However, for forums we often want chronological order; this can be achieved by using <span class="ref"><link url="https://xmpp.org/extensions/xep-0413.html">Order-By (XEP-0413)</link></span> <note>XEP-0413: Order-By &lt;<link url="https://xmpp.org/extensions/xep-0413.html">https://xmpp.org/extensions/xep-0413.html</link>&gt;.</note> to order by date of creation.</p>
  <p>Forums (i.e., the nodes with one of the two profiles defined in <link url="#profiles">Forums Profiles</link>) can have no parent (mostly used in pubsub services which do not support <span class="ref"><link url="https://xmpp.org/extensions/xep-0496.html">Pubsub Node Relationships (XEP-0496)</link></span><note>XEP-0496: Pubsub Node Relationships &lt;<link url="https://xmpp.org/extensions/xep-0496.html">https://xmpp.org/extensions/xep-0496.html</link>&gt;.</note>), have a category node as parent, or have a root node as parent. They can also be siblings to category nodes (i.e., have the same parent as a category node) if it makes sense for them to appear at the same level as some categories.</p>
  <p>Root posts must include both a &lt;title&gt; and a &lt;content&gt; element. Replies may include both a &lt;title&gt; and a &lt;content&gt; (where the &lt;title&gt; serves as the reply's title), or only a &lt;title&gt; (which will be used as the body, resulting in a reply without a distinct title). The XMPP client determines whether to require a title for replies.</p>
</section1>

<section1 topic="Discovering Support" anchor="disco">
  <p>Forums can be created on a generic pubsub service, in which case no forums-specific discovery feature is advertised. A client can discover a forum by looking for root nodes (i.e., nodes with the type "urn:xmpp:forums:root:0") if the server supports <span class="ref"><link url="https://xmpp.org/extensions/xep-0496.html">Pubsub Node Relationships (XEP-0496)</link></span><note>XEP-0496: Pubsub Node Relationships &lt;<link url="https://xmpp.org/extensions/xep-0496.html">https://xmpp.org/extensions/xep-0496.html</link>&gt;.</note>. Otherwise, the client can look directly for forums profiles as defined in <link url="#profiles">Forums Profiles</link>. In both cases, <span class="ref"><link url="https://xmpp.org/extensions/xep-0462.html">PubSub Type Filtering (XEP-0462)</link></span> <note>XEP-0462: PubSub Type Filtering &lt;<link url="https://xmpp.org/extensions/xep-0462.html">https://xmpp.org/extensions/xep-0462.html</link>&gt;.</note> can be used to make discovery easier, if the pubsub service supports it.</p>
  <p>If a service has a built-in forums support (e.g., a gateway to an existing forum), it MUST advertise it by including the "urn:xmpp:forums:0" discovery feature in response to a <span class="ref"><link url="https://xmpp.org/extensions/xep-0030.html">Service Discovery (XEP-0030)</link></span> <note>XEP-0030: Service Discovery &lt;<link url="https://xmpp.org/extensions/xep-0030.html">https://xmpp.org/extensions/xep-0030.html</link>&gt;.</note> information request:</p>

  <example caption="Service Discovery information request"><![CDATA[
<iq type='get'
    from='juliet@example.org/balcony'
    to='forums.example.org'
    id='disco1'>
  <query xmlns='http://jabber.org/protocol/disco#info'/>
</iq>]]></example>
  <example caption="Service Discovery information response"><![CDATA[
<iq type='result'
    from='forums.example.org'
    to='juliet@example.org/balcony'
    id='disco1'>
  <query xmlns='http://jabber.org/protocol/disco#info'>
    ...
    <feature var='urn:xmpp:forums:0'/>
    ...
  </query>
</iq>]]></example>
  <p>In this case the service MUST have a root node with the well-known name "urn:xmpp:forums:0" and MUST implement <span class="ref"><link url="https://xmpp.org/extensions/xep-0496.html">Pubsub Node Relationships (XEP-0496)</link></span><note>XEP-0496: Pubsub Node Relationships &lt;<link url="https://xmpp.org/extensions/xep-0496.html">https://xmpp.org/extensions/xep-0496.html</link>&gt;.</note>.</p>
</section1>

<section1 topic="Security Considerations" anchor="security">
  <p>There are many inherent risks in using forums, primarily depending on their public visibility and popularity. Forum services should implement robust moderation tools and monitor content for spam, aggressive behavior, inappropriate content, bullying, sexism, racism, and other toxic behavior.</p>
  <p>General security considerations related to PubSub services apply, notably impersonation risks (which can be mitigated by services supporting the 'publisher' attribute and the use of <span class="ref"><link url="https://xmpp.org/extensions/xep-0475.html">Pubsub Signing (XEP-0475)</link></span> <note>XEP-0475: Pubsub Signing &lt;<link url="https://xmpp.org/extensions/xep-0475.html">https://xmpp.org/extensions/xep-0475.html</link>&gt;.</note>), attacks such as excessive node or item creation, and so forth.</p>
</section1>

<section1 topic="IANA Considerations" anchor="iana">
  <p>This document does not require interaction with the <span class="ref"><link url="http://www.iana.org/">Internet Assigned Numbers Authority (IANA)</link></span> <note>The Internet Assigned Numbers Authority (IANA) is the central coordinator for the assignment of unique parameter values for Internet protocols, such as port numbers and URI schemes. For further information, see &lt;<link url="http://www.iana.org/">http://www.iana.org/</link>&gt;.</note>.</p>
</section1>

<section1 topic="XMPP Registrar Considerations" anchor="registrar">
  <p>TODO</p>
</section1>

<section1 topic="XML Schema" anchor="schema">
  <p>TODO</p>
</section1>

</xep>
