1
0
mirror of https://github.com/moparisthebest/xeps synced 2025-02-16 07:10:15 -05:00

XEP-0444: Add restrictions to reactions

This commit is contained in:
Nicolas Cedilnik 2022-11-19 16:01:03 +01:00 committed by nicoco
parent 2d4b8b5728
commit 63715d1254

View File

@ -37,6 +37,12 @@
<email>xsf@larma.de</email>
<jid>jabber@larma.de</jid>
</author>
<revision>
<version>0.2.0</version>
<date>2022-12-30</date>
<initials>NC</initials>
<remark>Add emoji rejection mechanism.</remark>
</revision>
<revision>
<version>0.1.0</version>
<date>2020-10-13</date>
@ -140,6 +146,74 @@
<store xmlns="urn:xmpp:hints"/>
</message>]]></example>
</section2>
<section2 topic="Rejecting a reaction" anchor="restricting-reactions">
<p>
In some cases, only a limited number and/or subset
of emojis are allowed to react to a message.
This is particularly useful in the context of gateways to other chat
networks that are not as permissive about which and how many emojis
can be used for message reactions.
MUC components may also allow room admins to restrict the subset and/or number
of emojis per message.
</p>
<example caption="Romeo sends a message"><![CDATA[
<message from="romeo@legacy-love-network.capulet.net"
to='juliet@capulet.net'
id='restricted-reactions-1'
type='chat'>
<body>I shall only accept heart emojis as reactions</body>
</message>]]></example>
<example caption="Juliet reacts with both a 💘 and a 💜"><![CDATA[
<message from="juliet@capulet.net"
to='romeo@legacy-love-network.capulet.net'
id='will-be-rejected1'
type='chat'>
<reactions id='restricted-reactions-1' xmlns='urn:xmpp:reactions:0'>
<reaction>💘</reaction>
<reaction>💜</reaction>
</reactions>
<store xmlns="urn:xmpp:hints"/>
</message>]]></example>
<p>
In this case, the recipient (or any intermediary node) MUST reject the reaction-containing message.
</p>
<example caption="Romeo rejects the reactions"><![CDATA[
<message from="romeo@legacy-love-network.capulet.net"
to="juliet@capulet.net"
type="error"
id="will-be-rejected1">
<error xmlns="jabber:client" type="modify">
<not-acceptable xmlns="urn:ietf:params:xml:ns:xmpp-stanzas" />
<text xmlns="urn:ietf:params:xml:ns:xmpp-stanzas">
Only 💘, ❤️ and 💜 are allowed as reactions on this legacy IM network,
and you can only use a single emoji at once.
</text>
</error>
</message>]]></example>
<p>
When receiving this kind of error message, the reaction-sending entity MUST consider that its emoji reactions
to this message are now void.
</p>
<p>
Optionally, an error message can contain a reactions element, listing the subset of emojis that were valid in
the original reactions message.
</p>
<example caption="Romeo removes a subset of reactions"><![CDATA[
<message from="romeo@legacy-love-network.capulet.net"
to="juliet@capulet.net"
type="error"
id="will-be-rejected1">
<error xmlns="jabber:client" type="modify">
<not-acceptable xmlns="urn:ietf:params:xml:ns:xmpp-stanzas" />
<reactions id='restricted-reactions-1' xmlns='urn:xmpp:reactions:0'>
<reaction>💘</reaction>
</reactions>
</error>
</message>]]></example>
<p>
In this case, the reaction-sending entity MUST modify the emojis accordingly.
</p>
</section2>
</section1>
<section1 topic='Business Rules' anchor='rules'>
<p>Messages MUST NOT contain more then one &lt;reactions&gt; element</p>