<remark>Accepted by vote of Council on 2021-01-06.</remark>
</revision>
<revision>
<version>0.0.1</version>
<date>2020-12-17</date>
<initials>jcb</initials>
<remark><p>First draft.</p></remark>
</revision>
</header>
<section1topic='Introduction'anchor='intro'>
<p>The &xep0045; specification does not provide for a mechanism whereby an user might be informed of being mentioned in a Multi-User Chat (MUC) without being present as an occupant of that MUC.</p>
<p>This XEP aims to provide a standardized way in which this might be achieved.</p>
<p>Concerning "being mentioned" in a MUC, we will rely on &xep0372; as the means whereby someone is explicitly mentioned in a MUC message.</p>
<p>A user's client must be able to receive forwarded groupchat messages from a MUC in which that user is mentioned, while not having an active session in that MUC (i.e. without joining it).</p>
<p>For this to be possible, the MUC needs to know the user's JID and MUC nickname even when that user is not currently present in the MUC. &xep0045; section 7.10 ("Registering with a Room") describes a mechanism whereby a user can register a nickname with a MUC and it is recommended that this is the mechanism used to keep track of users across sessions.</p>
<p>Whether or not mesages are forwarded will be determined by a configuration setting on the MUC.</p>
<p>The MUC owner(s) will therefore determine whether notifications are sent out, and if activated, users may opt in or out (or have that done for them by a privileged user) by having their nicknames registered or not with the MUC.</p>
<section2topic='A MUC is configured to send out mention notifications'>
<p>When an owner creates or configures a MUC, the service offers the option to send out mention notifications to non-present, but still affiliated users:</p>
<section2topic='Notifying a non-present user of being mentioned in a MUC'>
<p>When an affiliated user in a given MUC is referenced in a 'groupchat' message via &xep0372;, and the MUC is configured to forward mentions, then the MUC will forward the message stanza to the user.</p>
<examplecaption='MUC forwards the message to the users client'><![CDATA[
<body>secondwitch: Thrice the brinded cat hath mew'd.</body>
<referencexmlns='urn:xmpp:reference:0'
type='mention'
begin='0'
uri='xmpp:hag66@shakespeare.lit'
end='11'/>
<stanza-idxmlns='urn:xmpp:sid:0'
id='5f3dbc5e-e1d3-4077-a492-693f3769c7ad'
by='coven@chat.shakespeare.lit'/>
</message>
</forwarded>
</mentions>
</message>
]]></example>
<p>Notice that in the example above, the entire original 'groupchat' message (including elements added server-side, like the &xep0359; stanza-id) is encapsulated inside a &xep0279; element.</p>
<p>Similarly to &xep0280;, the security model assumed by this document is that all of the resources for a single user are in the same trust boundary.</p>
<p>Forwarded groupchat messages leak information of who is currently present in a MUC without requiring the user to join the MUC first to find out.</p>
<ul>
<li>Any forwarded copies received by a client MUST be from a valid MUC JID which matches the MUC JID of the encapsulated, forwarded mesages;</li>
<li>any copies that do not meet this requirement MUST be ignored.</li>