1
0
mirror of https://github.com/moparisthebest/xeps synced 2024-11-21 16:55:07 -05:00

Take standards@ feedback into account

This commit is contained in:
nicoco 2023-01-14 08:53:19 +01:00
parent 63715d1254
commit 5fe1b6fb16

View File

@ -75,6 +75,7 @@
</p> </p>
</section1> </section1>
<section1 topic='Discovering support' anchor='disco'> <section1 topic='Discovering support' anchor='disco'>
<section2 topic="Basic support" anchor="disco-base">
<p> <p>
If a client implements message reactions, it MUST specify the If a client implements message reactions, it MUST specify the
'urn:xmpp:reactions:0' feature in its service discovery information features 'urn:xmpp:reactions:0' feature in its service discovery information features
@ -98,6 +99,47 @@
... ...
</query> </query>
</iq>]]></example> </iq>]]></example>
</section2>
<section2 topic="Restricted reactions" anchor="disco-restricted">
<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>
<p>
To allow clients to adapt their UIs, entities that have such restrictions in place
SHOULD advertise it with &xep0128; in a &xep0004; using the
'urn:xmpp:reactions:0:restrictions' namespace as FORM_TYPE.
</p>
<example caption='Entities advertises support for restricted reactions'><![CDATA[
<iq type='result'
to='juliet@capulet.lit/balcony'
from='romeo@montague.lit/orchard'
id='info1'>
<query xmlns='http://jabber.org/protocol/disco#info'>
...
<feature var='urn:xmpp:reactions:0'/>
<x xmlns='jabber:x:data' type='result'>
<field var='FORM_TYPE' type='hidden'>
<value>urn:xmpp:reactions:0:restrictions</value>
</field>
<field var='max_reactions_per_user'>
<value>1</value>
</field>
<field var='allowlist'>
<value>💘</value>
<value>❤️</value>
<value>💜</value>
</field>
</x>
...
</query>
</iq>]]></example>
</section2>
</section1> </section1>
<section1 topic='Use Cases' anchor='usecases'> <section1 topic='Use Cases' anchor='usecases'>
<section2 topic="Sending reactions to a message" anchor="sending-reactions"> <section2 topic="Sending reactions to a message" anchor="sending-reactions">
@ -146,15 +188,11 @@
<store xmlns="urn:xmpp:hints"/> <store xmlns="urn:xmpp:hints"/>
</message>]]></example> </message>]]></example>
</section2> </section2>
<section2 topic="Rejecting a reaction" anchor="restricting-reactions"> <section2 topic="Rejecting a reaction" anchor="rejecting">
<p> <p>
In some cases, only a limited number and/or subset Entities implementing reaction restrictions MUST reply to invalid reactions payloads
of emojis are allowed to react to a message. with a message type="error" containing a 'not-acceptable' error.
This is particularly useful in the context of gateways to other chat The error payload SHOULD contain a human-readable text message explaining the reaction rules.
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> </p>
<example caption="Romeo sends a message"><![CDATA[ <example caption="Romeo sends a message"><![CDATA[
<message from="romeo@legacy-love-network.capulet.net" <message from="romeo@legacy-love-network.capulet.net"
@ -174,9 +212,6 @@
</reactions> </reactions>
<store xmlns="urn:xmpp:hints"/> <store xmlns="urn:xmpp:hints"/>
</message>]]></example> </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[ <example caption="Romeo rejects the reactions"><![CDATA[
<message from="romeo@legacy-love-network.capulet.net" <message from="romeo@legacy-love-network.capulet.net"
to="juliet@capulet.net" to="juliet@capulet.net"
@ -191,27 +226,8 @@
</error> </error>
</message>]]></example> </message>]]></example>
<p> <p>
When receiving this kind of error message, the reaction-sending entity MUST consider that its emoji reactions When receiving this error message, the reaction-sending entity MUST revert the "message reactions"
to this message are now void. to its previous state in its user interface.
</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> </p>
</section2> </section2>
</section1> </section1>