<?xml version="1.0" encoding="UTF-8"?>
<?xml-stylesheet type='text/xsl' href='xep.xsl'?>
<xep xmlns="">
  <header>
    <title>Explicit Mentions</title>
    <abstract>This specification defines a way to explicitly mention a person or groups of people.</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>0513</number>
    <status>Experimental</status>
    <type>Standards Track</type>
    <sig>Standards</sig>
    <approver>Council</approver>
    <dependencies>
      <spec>XMPP Core</spec>
      <spec>XEP-0001</spec>
      <spec>XEP-0004</spec>
      <spec>XEP-0030</spec>
      <spec>XEP-0045</spec>
      <spec>XEP-0068</spec>
      <spec>XEP-0317</spec>
      <spec>XEP-0421</spec>
      <spec>XEP-0503</spec>
    </dependencies>
    <supersedes/>
    <supersededby/>
    <shortname>mentions</shortname>
    <tags>
      <tag>mention</tag>
    </tags>
    <author>
      <firstname>Snit</firstname>
      <surname>Guckfung</surname>
      <email>snit@cock.li</email>
      <jid>snit@isekai.rocks</jid>
    </author>
    <revision>
      <version>0.1.0</version>
      <date>2026-04-01</date>
      <initials>dg</initials>
      <remark>
        <p>Accepted as Experimental by council vote on 2026-03-31</p>
      </remark>
    </revision>
    <revision>
      <version>0.0.2</version>
      <date>2026-02-25</date>
      <initials>snit</initials>
      <remark><p>Proposal handover</p></remark>
    </revision>
    <revision>
      <version>0.0.1</version>
      <date>2023-03-23</date>
      <initials>pep</initials>
      <remark><p>First draft.</p></remark>
    </revision>
  </header>

  <section1 topic="Introduction" anchor="intro">
    <p>A common feature in online communication is ability to explicitly address a message to a specific person or a group of people, and have their clients notify them on the way. This document provides a mechanism to allow users to explicitly reference individual users, as well as entire groups based on roles, affiliations, and hats in their messages. Furthermore, it provides a way for <span class="ref"><link url="https://xmpp.org/extensions/xep-0045.html">Multi-User Chat (XEP-0045)</link></span> <note>XEP-0045: Multi-User Chat &lt;<link url="https://xmpp.org/extensions/xep-0045.html">https://xmpp.org/extensions/xep-0045.html</link>&gt;.</note> room owners to specify permissions related to mentions.</p>
  </section1>

  <section1 topic="Discovering Support" anchor="disco">
    <p>An entity implementing this specification MUST advertise <tt>urn:xmpp:mentions:0</tt> as 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> feature. Subsequent features in this document may also be required to advertise support, if implemented.</p>
  </section1>

  <section1 topic="Use Cases" anchor="usecases">
    <section2 topic="Mentioning an Individual" anchor="individual">
      <p>There are two ways to mention an individual, depending on context. In both cases, a mention element with the <tt>urn:xmpp:mentions:0</tt> type is sent, which MUST NOT contain a <tt>mentions</tt> attribute.</p>
      <p>In <span class="ref"><link url="https://xmpp.org/extensions/xep-0045.html">Multi-User Chat (XEP-0045)</link></span> <note>XEP-0045: Multi-User Chat &lt;<link url="https://xmpp.org/extensions/xep-0045.html">https://xmpp.org/extensions/xep-0045.html</link>&gt;.</note> rooms, an <tt>occupantid</tt> attribute MUST be present, containing the mentioned user's <span class="ref"><link url="https://xmpp.org/extensions/xep-0421.html">Anonymous unique occupant identifiers for MUCs (XEP-0421)</link></span> <note>XEP-0421: Anonymous unique occupant identifiers for MUCs &lt;<link url="https://xmpp.org/extensions/xep-0421.html">https://xmpp.org/extensions/xep-0421.html</link>&gt;.</note> identifier, if the room supports them. Otherwise, a <tt>jid</tt> attribute MUST be present, containing the mentioned user's JID.</p>

      <example caption="Mentioning a user in a room"><![CDATA[
<message to='news@chat.commons.example' type='groupchat'>
  <body>Hello, Alice!</body>
  <mention xmlns='urn:xmpp:mentions:0'
    begin='7'
    end='12'
    occupantid='alice@occupant-id'/>
  </message>]]></example>
    </section2>

    <section2 topic="Mentioning Groups" anchor="groups">
      <p>Users may wish to mention whole groups of users at once. The following subsections specify several types of groups that may be mentioned, all of which are OPTIONAL.</p>
      <p>To mention a group, the <tt>mentions</tt> attribute MUST be present, containing a URI denoting the group type. The same URI MUST be advertised via service discovery on supported implementations. Custom group types not specified in this document MAY be used, provided they follow the same rules.</p>

      <section3 topic="Mentions via Memberships" anchor="membership">
        <p>The following table lists groups based on membership or occupancy of an entity, such as channels, spaces, or servers.</p>

        <table caption="Groups">
          <tr>
            <th>Mention type</th>
            <th>Description</th>
          </tr>
          <tr>
            <td>urn:xmpp:mentions:0#channel</td>
            <td>Mention all occupants of a <span class="ref"><link url="https://xmpp.org/extensions/xep-0045.html">Multi-User Chat (XEP-0045)</link></span> <note>XEP-0045: Multi-User Chat &lt;<link url="https://xmpp.org/extensions/xep-0045.html">https://xmpp.org/extensions/xep-0045.html</link>&gt;.</note> room.</td>
          </tr>
          <tr>
            <td>urn:xmpp:mentions:0#space</td>
            <td>Mention all members of a <span class="ref"><link url="https://xmpp.org/extensions/xep-0503.html">Server-side spaces (XEP-0503)</link></span><note>XEP-0503: Server-side spaces &lt;<link url="https://xmpp.org/extensions/xep-0503.html">https://xmpp.org/extensions/xep-0503.html</link>&gt;.</note> space.</td>
          </tr>
          <tr>
            <td>urn:xmpp:mentions:0#server</td>
            <td>Mention all users of a server.</td>
          </tr>
        </table>

        <section4 topic="Channel" anchor="channel">
          <p>Channel mentions are used to mention all users in a <span class="ref"><link url="https://xmpp.org/extensions/xep-0045.html">Multi-User Chat (XEP-0045)</link></span> <note>XEP-0045: Multi-User Chat &lt;<link url="https://xmpp.org/extensions/xep-0045.html">https://xmpp.org/extensions/xep-0045.html</link>&gt;.</note> room, similarly to <tt>@everyone</tt> or <tt>@room</tt> on legacy platforms. If no <tt>uri</tt> attribute is present, and the current context is a MUC, then the room being mentioned is assumed to be the current room. The <tt>uri</tt> attribute MAY be used to specify a different room whose members should be mentioned, and MUST be included when used outside of a MUC.</p>
          <example caption="Mention all users in a room"><![CDATA[
  <message to='news@chat.commons.example' type='groupchat'>
    <body>Hey all!</body>
    <mention xmlns='urn:xmpp:mentions:0' mentions='urn:xmpp:mentions:0#channel' />
  </message>]]></example>
        </section4>

        <section4 topic="Space" anchor="space">
          <p>Space mentions are used to mention all users of a <span class="ref"><link url="https://xmpp.org/extensions/xep-0503.html">Server-side spaces (XEP-0503)</link></span><note>XEP-0503: Server-side spaces &lt;<link url="https://xmpp.org/extensions/xep-0503.html">https://xmpp.org/extensions/xep-0503.html</link>&gt;.</note> space. If no <tt>uri</tt> attribute is present, and the current MUC advertises a space that it is part of, then the space being mentioned is assumed to be the one advertised by the room. The <tt>uri</tt> attribute MAY be used to specify a different space, and MUST be used outside of MUCs or if the MUC does not advertise a parent space.</p>
          <example caption="Mention all users of a space"><![CDATA[
  <message to='news@chat.commons.example' type='groupchat'>
    <body>The rules for all rooms within this space have been updated.</body>
    <mention xmlns='urn:xmpp:mentions:0' mentions='urn:xmpp:mentions:0#space'
      uri='xmpp:spaces.commons.example;node=space'/>
  </message>]]></example>
        </section4>

        <section4 topic="Server" anchor="server">
          <p>Server mentions are used to mention all users of a particular server. This SHOULD NOT be used within semi-anonymous rooms, when responses to a server mention could reveal which users have accounts on that server, and may reveal your own account's server. All server mentions MUST include a <tt>uri</tt> attribute containing a URI to the server being mentioned, and MAY contain servers other than your own.</p>
          <example caption="Mention all users of a server"><![CDATA[
  <message to='news@chat.commons.example' type='groupchat'>
    <body>We will be upgrading the server in two hours.</body>
    <mention xmlns='urn:xmpp:mentions:0' mentions='urn:xmpp:mentions:0#server'
      uri='xmpp:commons.example'/>
  </message>]]></example>
        </section4>
      </section3>

      <section3 topic="Mentions via Roles and Affiliations" anchor="associations">
        <p>It is possible to mention occupants with specific <span class="ref"><link url="https://xmpp.org/extensions/xep-0045.html">Multi-User Chat (XEP-0045)</link></span> <note>XEP-0045: Multi-User Chat &lt;<link url="https://xmpp.org/extensions/xep-0045.html">https://xmpp.org/extensions/xep-0045.html</link>&gt;.</note> roles or affiliations. The mention type to use is defined in the table below. Supporting implementations MUST advertise the <tt>urn:xmpp:mentions:0#associations</tt> namespace, and all of the defined role and affiliation types MUST be implemented to support this feature.</p>

        <table caption="Mention types">
          <tr>
            <th>Type</th>
            <th>Description</th>
          </tr>
          <tr>
            <td>urn:xmpp:mentions:0#moderators</td>
            <td>Occupants with a moderator role</td>
          </tr>
          <tr>
            <td>urn:xmpp:mentions:0#participants</td>
            <td>Occupants with a participant role</td>
          </tr>
          <tr>
            <td>urn:xmpp:mentions:0#visitors</td>
            <td>Occupants with a visitor role</td>
          </tr>
          <tr>
            <td>urn:xmpp:mentions:0#owner</td>
            <td>Occupants with an owner affiliation</td>
          </tr>
          <tr>
            <td>urn:xmpp:mentions:0#admin</td>
            <td>Occupants with an admin affiliation</td>
          </tr>
          <tr>
            <td>urn:xmpp:mentions:0#member</td>
            <td>Occupants with a member affiliation</td>
          </tr>
          <tr>
            <td>urn:xmpp:mentions:0#none</td>
            <td>Occupants with no affiliation</td>
          </tr>
        </table>

        <example caption="Mention moderators in a room"><![CDATA[
  <message to='news@chat.commons.example' type='groupchat'>
    <body>Any moderator to handle the spam above please?</body>
    <mention xmlns='urn:xmpp:mentions:0' mentions='urn:xmpp:mentions:0#moderators' />
  </message>]]></example>
      </section3>

      <section3 topic="Mentions via Hats" anchor="hats">
        <p>Hats, specified in <span class="ref"><link url="https://xmpp.org/extensions/xep-0317.html">Hats (XEP-0317)</link></span> <note>XEP-0317: Hats &lt;<link url="https://xmpp.org/extensions/xep-0317.html">https://xmpp.org/extensions/xep-0317.html</link>&gt;.</note>, may also be mentioned using the <tt>urn:xmpp:mentions:0#hats</tt> namespace, with the <tt>uri</tt> attribute containing the hat's URI.</p>

        <example caption="Mentioning all (hats) students in a room"><![CDATA[
  <message to='news@chat.commons.example' type='groupchat'>
    <body>To all students, [..]</body>
    <mention xmlns='urn:xmpp:mentions:0' mentions='urn:xmpp:mentions:0#hats'
      uri='http://schemas.example.com/hats#students'/>
  </message>]]></example>
      </section3>
    </section2>

    <section2 topic="Begin and End Attributes" anchor="beginend">
      <p>If a mention element of type <tt>urn:xmpp:mentions:0</tt> or its subtypes contains both <tt>begin</tt> and <tt>end</tt> attributes, the receiving entity MAY use this as a hint that the specified range of the content is being addressed to the specified occupant. If the element doesn't contain these attributes, the mention doesn't refer to a specific part of the content, and implementations MAY check other parts of the payload to know what it refers to, (e.g., <span class="ref"><link url="https://xmpp.org/extensions/xep-0071.html">XHTML-IM (XEP-0071)</link></span> <note>XEP-0071: XHTML-IM &lt;<link url="https://xmpp.org/extensions/xep-0071.html">https://xmpp.org/extensions/xep-0071.html</link>&gt;.</note> links).</p>
      <p>Begin and end pairs in a message SHOULD NOT overlap, except in the case where they are all equal.</p>
      <example caption="Mentioning members of a loosely defined group in a channel with many occupants"><![CDATA[
<message to='news@chat.commons.example' type='groupchat'>
  <body>Hi Spartacists!</body>
  <!-- @begin and @end are equal throughout all mentions here -->
  <mention xmlns='urn:xmpp:mentions:0'
    begin='3'
    end='14'
    occupantid='rosa@occupant-id'/>
  <mention xmlns='urn:xmpp:mentions:0'
    begin='3'
    end='14'
    occupantid='clara@occupant-id'/>
  <mention xmlns='urn:xmpp:mentions:0'
    begin='3'
    end='14'
    occupantid='karl@occupant-id'/>
</message>]]></example>
    </section2>

    <section2 topic="Hreflang Attribute" anchor="hreflang">
      <p>The <tt>hreflang</tt> attribute MAY be used to target a message with the corresponding <tt>xml:lang</tt> attribute, in conjunction with <tt>begin</tt> and <tt>end</tt>.</p>

      <example caption="Mentioning a user in two languages"><![CDATA[
<message to='news@chat.commons.example' type='groupchat'>
  <!-- Supposing the stanza has been sent on a stream with xml:lang='en' -->
  <body>Hi Alice, how are you doing?</body>
  <mention xmlns='urn:xmpp:mentions:0'
    begin='3'
    end='8'
    hreflang='en'
    occupantid='ddfe47eabacabr2q1'/>
  <body xml:lang='ja'>こんにちは、アリス。お元気ですか？</body>
  <mention xmlns='urn:xmpp:mentions:0'
    begin='6'
    end='9'
    hreflang='ja'
    occupantid='ddfe47eabacabr2q1'/>
</message>]]></example>
    </section2>

    <section2 topic="Modifiers" anchor="modifiers">
      <p>Mentions may be modified in order to change their behaviour. The modifiers specified here MUST be in the <tt>urn:xmpp:mentions:0</tt> namespace, and placed as a child of the mention element. Modifiers not specified here MAY be used, provided they use a separate namespace and advertise support similarly to custom groups.</p>

      <p>The following table lists the possible modifiers.</p>
      <table>
        <tr>
          <th>Modifier</th>
          <th>Description</th>
        </tr>
        <tr>
          <td><link url="#active">{urn:xmpp:mentions:0}active</link></td>
          <td>Only notify if user is active</td>
        </tr>
        <tr>
          <td><link url="#noping">{urn:xmpp:mentions:0}noping</link></td>
          <td>Do not notify the mentioned user</td>
        </tr>
      </table>

      <section3 topic="Active" anchor="active">
        <p>The active modifier tells receiving entities that only users active when the message is sent should be mentioned. This works similarly to <tt>@here</tt> in many legacy messengers, except that it can be applied to any type of mention here. Implementations SHOULD notify the user if they are currently active, and SHOULD NOT notify them otherwise. It is up to implementations to decide what constitutes "active". Examples include an online status or recent activity in the client.</p>

        <example caption="Mention all active users of a room"><![CDATA[
<message to='news@chat.commons.example' type='groupchat'>
  <body>Hello, everybody!</body>
  <mention xmlns='urn:xmpp:mentions:0' mentions='urn:xmpp:mentions:0channel'>
    <active />
  </mention>
</message>]]></example>
      </section3>

      <section3 topic="No Ping" anchor="noping">
        <p>The <tt>noping</tt> modifier tells receiving entities that the sender does not wish to notify the mentioned user. This could be useful to explicitly reference a specific user or group without disturbing the user(s) in question, such as for distinguishing two users with the same name or directing someone to another user or group.</p>

        <example caption="Mention a user without notifying them"><![CDATA[
<message to='news@chat.commons.example' type='groupchat'>
  <body>Sorry, I was referring to Alice there.</body>
  <mention xmlns='urn:xmpp:mentions:0'
    begin='26'
    end='31'
    occupantid='alice@occupantid'>
    <noping />
  </mention>
</message>]]></example>
      </section3>
    </section2>


    <section2 topic="Multi-User Chats Permissions" anchor="permissions">
      <p>Administrators of <span class="ref"><link url="https://xmpp.org/extensions/xep-0045.html">Multi-User Chat (XEP-0045)</link></span> <note>XEP-0045: Multi-User Chat &lt;<link url="https://xmpp.org/extensions/xep-0045.html">https://xmpp.org/extensions/xep-0045.html</link>&gt;.</note> rooms may wish to limit how mentions are used. This section provides a mechanism for administrators to set permissions in a MUC, which receiving entities SHOULD refer to when deciding whether to notify the user.</p>
      <p>Rooms which provide permissions MUST advertise support with <tt>urn:xmpp:mentions:0</tt>. Mentions MAY be sent in rooms which do not have permissions set, and/or do not advertise support for them; it is up to receiving entities to determine how to handle mentions in rooms without configured permissions.</p>

      <p>The following examples demonstrate how a user can get and set the permissions configuration form.</p>
      <example caption="Client requests permissions from room"><![CDATA[
<iq from='user@chat.commons.example/client'
  to='room@chat.commons.example'
  id='permissions1'
  type='get'>
  <query xmlns='urn:xmpp:mentions:0' />
</iq>]]></example>

      <p>In the following response, the <tt>mentions#count</tt> and <tt>mentions#individual</tt> fields MUST be present at minimum. All other fields are OPTIONAL, but they MUST be present if and only if the corresponding feature is advertised in service discovery. The following form's fields SHOULD also be advertised in the room's <tt>muc#roominfo</tt> extension form.</p>
      <p>Receiving entities SHOULD ignore all mentions if the message contains more mentions than the threshold specified by <tt>mentions#count</tt>. Receiving entities SHOULD ignore a given mention if the sender does not have at least the minimum role required by the room.</p>
      <example caption="MUC returns configured permissions"><![CDATA[
<iq from='room@chat.commons.example'
  to='user@chat.commons.example/client'
  id='permissions1'
  type='result'>
  <query xmlns='urn:xmpp:mentions:0'>
    <x xmlns='jabber:x:data' type='form'>
      <title>Permissions for Explicit Mentions</title>
      <instructions>
        Complete this form to inform entities about who can mention whom.
        The count is the maximum number of mentions allowed per message.
        For each mention type supported, the users allowed to use the type
        may be set to all participants, moderators only, or nobody.
      </instructions>
      <field type='hidden' var='FORM_TYPE'>
        <value>urn:xmpp:mentions:0</value>
      </field>
      <field var='mentions#count'
        label='How many mentions are allowed in a message?'
        type='text-single'>
        <required />
        <value>5</value>
      </field>
      <field var='mentions#individual'
        label='Who can mention individual users?'
        type='list-single'>
        <required />
        <value>participants</value>
        <option label='Participants'>
          <value>participants</value>
        </option>
        <option label='Moderators Only'>
          <value>moderators</value>
        </option>
        <option label='Nobody'>
          <value>none</value>
        </option>
      </field>
      <!-- If room supports urn:xmpp:mentions:0#channel: -->
      <field var='mentions#channel'
        label='Who can mention rooms?'
        type='list-single'>
        <required />
        <value>participants</value>
        <option label='Participants'>
          <value>participants</value>
        </option>
        <option label='Moderators Only'>
          <value>moderators</value>
        </option>
        <option label='Nobody'>
          <value>none</value>
        </option>
      </field>
      <!-- If room supports urn:xmpp:mentions:0#space: -->
      <field var='mentions#space'
        label='Who can mention spaces?'
        type='list-single'>
        <required />
        <value>participants</value>
        <option label='Participants'>
          <value>participants</value>
        </option>
        <option label='Moderators Only'>
          <value>moderators</value>
        </option>
        <option label='Nobody'>
          <value>none</value>
        </option>
      </field>
      <!-- If room supports urn:xmpp:mentions:0#server: -->
      <field var='mentions#server'
        label='Who can mention servers?'
        type='list-single'>
        <required />
        <value>participants</value>
        <option label='Participants'>
          <value>participants</value>
        </option>
        <option label='Moderators Only'>
          <value>moderators</value>
        </option>
        <option label='Nobody'>
          <value>none</value>
        </option>
      </field>
      <!-- If room supports urn:xmpp:mentions:0#associations: -->
      <field var='mentions#associations'
        label='Who can mention roles/affiliations?'
        type='list-single'>
        <required />
        <value>participants</value>
        <option label='Participants'>
          <value>participants</value>
        </option>
        <option label='Moderators Only'>
          <value>moderators</value>
        </option>
        <option label='Nobody'>
          <value>none</value>
        </option>
      </field>
      <!-- If room supports urn:xmpp:mentions:0#hats: -->
      <field var='mentions#hats'
        label='Who can mention hats?'
        type='list-single'>
        <required />
        <value>participants</value>
        <option label='Participants'>
          <value>participants</value>
        </option>
        <option label='Moderators Only'>
          <value>moderators</value>
        </option>
        <option label='Nobody'>
          <value>none</value>
        </option>
      </field>
    </x>
  </query>
</iq>]]></example>

      <p>If the user is an owner of the room, they may fill out the form and submit it to change the configuration.</p>
      <example caption="Owner submits permissions form"><![CDATA[
<iq from='user@chat.commons.example/client'
  to='room@chat.commons.example'
  id='permissions2'
  type='set'>
  <query xmlns='urn:xmpp:mentions:0'>
    <x xmlns='jabber:x:data' type='submit'>
      <field var='FORM_TYPE'>
        <value>urn:xmpp:mentions:0</value>
      </field>
      <field var='mentions#count'>
        <value>1</value>
      </field>
      <field var='mentions#individual'>
        <value>participants</value>
      </field>
      <!-- If room supports urn:xmpp:mentions:0#channel: -->
      <field var='mentions#channel'>
        <value>moderators</value>
      </field>
      <!-- If room supports urn:xmpp:mentions:0#space: -->
      <field var='mentions#space'>
        <value>moderators</value>
      </field>
      <!-- If room supports urn:xmpp:mentions:0#server: -->
      <field var='mentions#server'>
        <value>moderators</value>
      </field>
      <!-- If room supports urn:xmpp:mentions:0#associations: -->
      <field var='mentions#associations'>
        <value>participants</value>
      </field>
      <!-- If room supports urn:xmpp:mentions:0#hats: -->
      <field var='mentions#hats'>
        <value>participants</value>
      </field>
    </x>
  </query>
</iq>]]></example>

      <p>Upon success, the room MUST inform the user.</p>
      <example caption="Room informs owner of success"><![CDATA[
<iq to='room@chat.commons.example'
  from='user@chat.commons.example/client'
  id='permissions2'
  type='result' />]]></example>

      <p>If the user is not an owner, a <tt>&lt;forbidden /&gt;</tt> error MUST be returned.</p>
      <example caption="Room denies access to non-owner"><![CDATA[
<iq to='room@chat.commons.example'
  from='user@chat.commons.example/client'
  id='permissions2'
  type='error'>
  <query xmlns='urn:xmpp:mentions:0' />
  <error type='auth'>
    <forbidden xmlns='urn:ietf:params:xml:ns:xmpp-stanzas' />
  </error>
</iq>]]></example>

      <p>Upon successful change of configuration, the service SHOULD broadcast the changes to all users. The message SHOULD include only those fields which have been modified.</p>
      <example caption="Room notifies user of change"><![CDATA[
<message to='user@chat.commons.example/client'
  from='room@chat.commons.example
  id='permissions4'
  type='groupchat'>
  <x xmlns='jabber:x:data' type='result'>
    <title>Updated configuration for Explicit Mention Permissions</title>
    <field type='hidden' var='FORM_TYPE'>
      <value>urn:xmpp:mentions:0</value>
    </field>
    <!-- Supposing only count and individual were changed... -->
    <field var='mentions#count' type='text-single'>
      <value>1</value>
    </field>
    <field var='mentions#individual' type='list-single'>
      <value>participants</value>
    </field>
  </x>
</message>]]></example>
    </section2>
  </section1>

  <section1 topic="Implementation Notes" anchor="impl">
    <p>This specification allows sending clients to convey a user's intent. Implementations SHOULD also allow sending participants to talk about someone without having to mention them.</p>
    <p>No specific server support is required for mentions to be sent between entities, though implementing permissions in MUCs is RECOMMENDED. It is up to receiving entities whether or not a given mention refers to them, and whether the mention should notify the user. User interfaces SHOULD have an option to suppress notifications for the various types of mentions independently of MUC permission settings.</p>
    <p><span class="ref"><link url="https://xmpp.org/extensions/xep-0421.html">Anonymous unique occupant identifiers for MUCs (XEP-0421)</link></span> <note>XEP-0421: Anonymous unique occupant identifiers for MUCs &lt;<link url="https://xmpp.org/extensions/xep-0421.html">https://xmpp.org/extensions/xep-0421.html</link>&gt;.</note> is being used to mention in <span class="ref"><link url="https://xmpp.org/extensions/xep-0045.html">Multi-User Chat (XEP-0045)</link></span> <note>XEP-0045: Multi-User Chat &lt;<link url="https://xmpp.org/extensions/xep-0045.html">https://xmpp.org/extensions/xep-0045.html</link>&gt;.</note> instead of a participant JID or a real JID. This allows us to have a common solution across MUC, and also to use a stable identifier, that is guaranteed to be unique per occupant (bare JID) and prevent usurpation.</p>
    <p>As <span class="ref"><link url="https://xmpp.org/extensions/xep-0421.html">Anonymous unique occupant identifiers for MUCs (XEP-0421)</link></span> <note>XEP-0421: Anonymous unique occupant identifiers for MUCs &lt;<link url="https://xmpp.org/extensions/xep-0421.html">https://xmpp.org/extensions/xep-0421.html</link>&gt;.</note> in MUC can point to multiple nicknames, it may be confusing for clients which would want to display something based on the nickname (colors, etc.). It also may be an issue for a service sending push notifications that need to know which devices to send to.</p>
  </section1>

  <section1 topic="Accessibility Considerations" anchor="access">
    <p>This specification allows users to explicitly choose whether to mention a user or group, removing the need to use old regex-based name matches, which are prone to false positives. It also allows users to refer to someone else without disturbing them and without relying on tricks to prevent regex matches.</p>
  </section1>

  <section1 topic="Internationalization Considerations" anchor="i18n">
    <p>If an implementation sends a mention element of type <tt>urn:xmpp:mentions:0</tt> or its subtypes which contains a valid <tt>hreflang</tt> attribute that refers to content with an <tt>xml:lang</tt> attribute, it SHOULD take care to send a mention for every languages it sends.</p>
  </section1>

  <section1 topic="Security Considerations" anchor="security">
    <p>Setting proper permissions in MUCs can help mitigate the possibility for malicious entities to abuse the ability to mention groups of people. Servers MAY filter mentions which violate the configured permissions, and MAY do further filtering according to their own rules. No attempt is made to mitigate abuse of regex-based implicit mentions; implementations SHOULD allow implicit mentions to be turned off.</p>
    <p>This specification allows sending mentions without including them in the message body, effectively hiding them from the user. User interfaces SHOULD allow users to view a list of all mentions attached to a message.</p>
    <p>Use of explicit mentions with OMEMO can leak metadata about who the message is directed towards, if only the body of the message is encrypted.</p>
    <p>Using <span class="ref"><link url="https://xmpp.org/extensions/xep-0421.html">Anonymous unique occupant identifiers for MUCs (XEP-0421)</link></span> <note>XEP-0421: Anonymous unique occupant identifiers for MUCs &lt;<link url="https://xmpp.org/extensions/xep-0421.html">https://xmpp.org/extensions/xep-0421.html</link>&gt;.</note> instead of a regular participant JID in MUC prevents moderators possibly leaking JIDs they have access to that other occupants don't. Using occupant IDs even in non-anonymous rooms allows them to become semi-anonymous without leaking JIDs.</p>
  </section1>

  <section1 topic="IANA Considerations" anchor="iana">
    <p>None.</p>
  </section1>

  <section1 topic="XMPP Registrar Considerations" anchor="registrar">
    <p>TODO</p>
    <section2 topic="Field Standardization" anchor="registrar-formtype">
      <p>TODO</p>
    </section2>
  </section1>

  <section1 topic="Design Considerations" anchor="design">
    <p>Most clients currently use regex-based solutions to determine whether a user should be notified of a message. This is prone to false positives, especially for users with common words as names. It also provides no mechanism for a user to refer to someone else without notifying them.</p>
    <p>An early revision of <span class="ref"><link url="https://xmpp.org/extensions/xep-0372.html">References (XEP-0372)</link></span> <note>XEP-0372: References &lt;<link url="https://xmpp.org/extensions/xep-0372.html">https://xmpp.org/extensions/xep-0372.html</link>&gt;.</note> provides a basic means to explicitly mention a single user via JID, but no means of mentioning groups of users, nor means to extend mentions further.</p>
    <p>This specification is designed to depend on a proposed revision to <span class="ref"><link url="https://xmpp.org/extensions/xep-0372.html">References (XEP-0372)</link></span> <note>XEP-0372: References &lt;<link url="https://xmpp.org/extensions/xep-0372.html">https://xmpp.org/extensions/xep-0372.html</link>&gt;.</note>, which makes references more generic and removes mentions, among other changes. If and when the revision is accepted, this specification may be updated to depend on <span class="ref"><link url="https://xmpp.org/extensions/xep-0372.html">References (XEP-0372)</link></span> <note>XEP-0372: References &lt;<link url="https://xmpp.org/extensions/xep-0372.html">https://xmpp.org/extensions/xep-0372.html</link>&gt;.</note>.</p>
  </section1>

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

  <section1 topic="Acknowledgements" anchor="acknowledgements">
    <p>Special thanks to pep for providing the initial document which this one is based off of, and for allowing me to continue work on it.</p>
  </section1>
</xep>
