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

Update spoilers protoxep based on feedback from ML

Fixes #282
This commit is contained in:
theSouL 2016-11-05 06:18:28 +01:00 committed by Sam Whited
parent 33d082b6c5
commit f098d8ecf0

View File

@ -37,7 +37,7 @@
<jid>vaulor@blastersklan.com</jid> <jid>vaulor@blastersklan.com</jid>
</author> </author>
<revision> <revision>
<version>0.0.1</version> <version>0.0.2</version>
<date>2016-10-31</date> <date>2016-10-31</date>
<initials>sfp, xfp</initials> <initials>sfp, xfp</initials>
<remark><p>First draft.</p></remark> <remark><p>First draft.</p></remark>
@ -69,63 +69,71 @@
specified in &xep0115;. specified in &xep0115;.
</p> </p>
<example caption='Client requests information about a chat partner&apos;s client'><![CDATA[ <example caption='Client requests information about a chat partner&apos;s client'><![CDATA[
<iq type='get' <iq from='romeo@montague.net/orchard'
from='romeo@montague.net/orchard' id='disco1'
id='disco1'> to='juliet@capulet.lit/balcony'
<query xmlns='http://jabber.org/protocol/disco#info'/> type='get'>
<query xmlns='http://jabber.org/protocol/disco#info'/>
</iq>]]></example> </iq>]]></example>
<example caption='Partner&apos;s client advertises support for spoiler messages'><![CDATA[ <example caption='Partner&apos;s client advertises support for spoiler messages'><![CDATA[
<iq type='result' <iq to='romeo@montague.net/orchard'
to='romeo@montague.net/orchard' id='disco1'
from='montague.net' from='juliet@capulet.lit/balcony'
id='disco1'> type='result'>
<query xmlns='http://jabber.org/protocol/disco#info'> <query xmlns='http://jabber.org/protocol/disco#info'>
<feature var='urn:xmpp:spoiler:0'/> <feature var='urn:xmpp:spoiler:0'/>
</query> </query>
</iq>]]></example> </iq>]]></example>
</section1> </section1>
<section1 topic='Use Cases' anchor='usecases'> <section1 topic='Use Cases' anchor='usecases'>
<p> <p>
Messages user wants to be sent as spoilers, MUST contain an Messages user wants to be sent as spoilers, MUST contain a &lt;spoiler&gt; element qualified by the
&lt;spoiler&gt; element qualified by the 'urn:xmpp:spoiler:0' namespace 'urn:xmpp:spoiler:0' namespace and optionally, &lt;spoiler&gt; elements may contain character data as
and optionally, &lt;spoiler&gt; elements may possess a 'hint' attribute a hint that warns about the topic of the spoiler message. They may also possess the 'xml:lang'
that warns about the topic of the spoiler message. attribute.
</p> </p>
<example caption='User sends a spoiler message without the hint attribute'><![CDATA[ <example caption='User sends a spoiler message without the hint'><![CDATA[
<message to='romeo@montague.net/orchard' from='juliet@capulet.net/balcony' id='spoiler1'> <message to='romeo@montague.net/orchard' from='juliet@capulet.net/balcony' id='spoiler1'>
<body>This is a very long message so I'm going to hide inside a spoiler [...] </body> <body>This is a very long message so I'm going to hide inside a spoiler [...] </body>
<spoiler xmlns='urn:xmpp:spoiler:0'/> <spoiler xmlns='urn:xmpp:spoiler:0'/>
</message> </message>
]]></example> ]]></example>
<example caption='User sends a spoiler message with the hint attribute'><![CDATA[ <example caption='User sends a spoiler message with the hint'><![CDATA[
<message to='romeo@montague.net/orchard' from='juliet@capulet.net/balcony' id='spoiler2'> <message to='romeo@montague.net/orchard' from='juliet@capulet.net/balcony' id='spoiler2'>
<body>And at the end of the story, both of them die! It is so tragic!</body> <body>And at the end of the story, both of them die! It is so tragic!</body>
<spoiler hint='Love story end' xmlns='urn:xmpp:spoiler:0'/> <spoiler xmlns='urn:xmpp:spoiler:0'>Love story end</spoiler>
</message> </message>
]]></example> ]]></example>
</section1> <example caption='User sends a spoiler message with the hint in two languages'><![CDATA[
<message to='romeo@montague.net/orchard' from='juliet@capulet.net/balcony' id='spoiler3'>
<body>holidays.png</body>
<spoiler xml:lang='en' xmlns='urn:xmpp:spoiler:0'>Trip to the beach</spoiler>
<spoiler xml:lang='ca' xmlns='urn:xmpp:spoiler:0'>Viatge a la platja</spoiler>
</message>
]]></example>
<example caption='User sends a spoiler message with the hint and body in two languages'><![CDATA[
<message to='romeo@montague.net/orchard' from='juliet@capulet.net/balcony' id='spoiler4'>
<body xml:lang='en'>And at the end of the story, both of them die! It is so tragic!</body>
<body xml:lang='ca'>I al final de la història, els dos moren! És tan tràgic!</body>
<spoiler xml:lang='en' xmlns='urn:xmpp:spoiler:0'>Love story end</spoiler>
<spoiler xml:lang='ca' xmlns='urn:xmpp:spoiler:0'>Fi de la història d'amor</spoiler>
</message>
]]></example>
</section1>
<section1 topic='Business Rules' anchor='rules'> <section1 topic='Business Rules' anchor='rules'>
<p> <p>
It MUST be clear a message is in fact a spoiler and its content MUST only <ol>
be displayed upon user's request. <li>It MUST be clear that a message is in fact a spoiler and its content MUST only be displayed upon
</p> user's request.</li>
<p> <li>Clients MAY provide a way to display spoilers always uncovered, without the need of interaction
Clients MAY provide a way to display spoilers always uncovered, without by the user (e.g. in the client's settings).</li>
the need of interaction by the user (e.g. in the client's settings). <li>Clients SHOULD display spoiler's hint, if any, before showing message's content.</li>
</p> <li>Clients MAY display spoiler's hint even after showing message's content (e.g. as a header or
<p> title of the message).</li>
Clients SHOULD display spoiler's hint, if any, before showing message's <li>Users SHOULD uncover or hide a spoiler message at will, anytime.</li>
content. </ol>
</p>
<p>
Clients MAY display spoiler's hint even after showing message's content
(e.g. as a header or title of the message).
</p>
<p>
Users SHOULD be able to uncover or hide a spoiler message at will,
anytime.
</p> </p>
</section1> </section1>
<section1 topic='Security Considerations' anchor='security'> <section1 topic='Security Considerations' anchor='security'>
@ -152,7 +160,7 @@
<code caption='Registration'><![CDATA[ <code caption='Registration'><![CDATA[
<var> <var>
<name>urn:xmpp:spoiler:0</name> <name>urn:xmpp:spoiler:0</name>
<desc>Indicates that a message should be hidden by default.</desc> <desc>Indicates that a message's content should not be displayed by default.</desc>
<doc>xxxx</doc> <doc>xxxx</doc>
</var> </var>
]]></code> ]]></code>
@ -163,16 +171,16 @@
<?xml version='1.0' encoding='UTF-8'?> <?xml version='1.0' encoding='UTF-8'?>
<xs:schema <xs:schema
xmlns:xs='http://www.w3.org/2001/XMLSchema' xmlns:xs='http://www.w3.org/2001/XMLSchema'
targetNamespace='urn:xmpp:spoiler:0' targetNamespace='urn:xmpp:spoiler:0'
xmlns='urn:xmpp:spoiler:0' xmlns='urn:xmpp:spoiler:0'
elementFormDefault='qualified'> elementFormDefault='qualified'>
<xs:element name='spoiler'> <xs:element name='spoiler'>
<xs:complexType> <xs:complexType>
<xs:simpleContent> <xs:simpleContent>
<xs:extension base='xs:string'> <xs:extension base='xs:string'>
<xs:attribute name='hint' type='xs:string'/> <xs:attribute ref='xml:lang' use='optional'/>
</xs:extension> </xs:extension>
</xs:simpleContent> </xs:simpleContent>
</xs:complexType> </xs:complexType>