1
0
mirror of https://github.com/moparisthebest/xeps synced 2024-11-21 08:45:04 -05:00

XEP-0425: Update tombstone markup and fix examples

Mandate use of stanza-id instead of origin-id
This commit is contained in:
JC Brand 2019-11-11 11:02:50 +01:00
parent b6897e8fff
commit 4c4d95ad85

View File

@ -24,6 +24,12 @@
<supersededby/>
<shortname>message-moderation</shortname>
&jcbrand;
<revision>
<version>0.2.0</version>
<date>2019-11-11</date>
<initials>jcb</initials>
<remark>Replace the message contents with a tombstone (instead of replacing the message itself)</remark>
</revision>
<revision>
<version>0.1.0</version>
<date>2019-11-01</date>
@ -65,8 +71,8 @@
<section1 topic='Use Case' anchor='usecase'>
<p>Consider a situation where a user sends a message that may be deemed inappropriate by a groupchat moderator. The groupchat service will append a &xep0359; stanza ID to the message before relaying it to all participants..</p>
<example caption="The user's client sends a message and the groupchat service adds a stanza id."><![CDATA[
<message type="groupchat" to='room@muc.example.com' id='inappropriate-1'>
<body>This message contains information not appropriate for this room.</body>
<message type="groupchat" from="room@muc.example.com/oldhag" to='room@muc.example.com/macbeth' id='inappropriate-1'>
<body>DM me for free magic potions!</body>
<stanza-id xmlns='urn:xmpp:sid:0' id='stanza-id-1' by='room@muc.example.com'/>
</message>]]></example>
@ -85,12 +91,12 @@
<section2 topic='Success case' anchor='usecase-success'>
<p>If the moderator is allowed to moderate the message, the groupchat service will send a message stanza to all participants (including the moderator), indicating that the message has been retracted and by whom.</p>
<p>This message will use &xep0422; to indicate that it applies to the moderated message, by referring to its XEP-0359 origin ID.</p>
<p>This message will use &xep0422; to indicate that it applies to the moderated message, by referring to its XEP-0359 Stanza ID.</p>
<example caption='The groupchat service sends a moderation message to all participants'><![CDATA[
<message type="groupchat" id='retraction-id-1' from='room@muc.example.com' to="juliet@capulet.example/balcony">
<message type="groupchat" id='retraction-id-1' from='room@muc.example.com' to="room@muc.example.com/macbeth">
<apply-to id="stanza-id-1" xmlns="urn:xmpp:fasten:0">
<moderated by='juliet@capulet.example' xmlns='urn:xmpp:message-moderate:0'>
<moderated by='room@muc.example.com/macbeth' xmlns='urn:xmpp:message-moderate:0'>
<retract xmlns='urn:xmpp:message-retract:0' />
<reason>This message contains inappropriate content for this forum</reason>
</moderated>
@ -106,7 +112,7 @@
<section2 topic='Error case' anchor='usecase-error'>
<p>In case the message could for some reason not be retracted, the grouchat service responds with an IQ stanza of type error.</p>
<example caption='The groupchat service responds with an error stanza'><![CDATA[
<iq type='error' to='juliet@montague.example/home' id='retract-request-1'>
<iq type='error' to='room@muc.example.com/macbeth' id='retract-request-1'>
<error type='modify'>
<forbidden xmlns='urn:ietf:params:xml:ns:xmpp-stanzas'/>
<text xmlns='urn:ietf:params:xml:ns:xmpp-stanzas'>
@ -118,21 +124,23 @@
</section1>
<section1 topic='Tombstones' anchor='tombstones'>
<p>An archiving service MAY replace the contents of a message that was retracted due to moderation with a 'tombstone' similar to the one described in &xep0424;.</p>
<p>The archiving service replaces the message with a &lt;moderated/&gt; element which contains a &lt;retracted/&gt; element. The &lt;moderated/&gt; element MUST include a 'by' attribute specifying the JID of the moderating entity. The &lt;retracted/&gt; element SHOULD contain a 'from' attribute which points to the JID of the author of the retracted message.</p>
<p>If the message was sent in a semi-anonymous MUC, the occupant id from &xep0421; needs to be included for the moderator and the message author in the &lt;moderated/&gt; and &lt;retracted/&gt; elements respectively. </p>
<p>A &xep0313; service MAY replace the contents of a message, that was retracted due to moderation, with a 'tombstone' similar to the one described in &xep0424;.</p>
<p>The archiving service replaces the message contents (i.e. the &lt;body/&gt; and any related elements which might leak information about the original message) with a &lt;moderated/&gt; element which in turn contains a &lt;retracted/&gt; element. The &lt;moderated/&gt; element MUST have a 'by' attribute specifying the JID of the moderating entity.</p>
<p>If the message was sent in a semi-anonymous MUC, the occupant id from &xep0421; SHOULD be included for the moderator and the message author in the &lt;moderated/&gt; and &lt;retracted/&gt; elements respectively. </p>
<example caption='Retracted groupchat message tombstone in a MAM result'><![CDATA[
<message id='aeb213' to='room@muc.example.com/macbeth'>
<result xmlns='urn:xmpp:mam:2' queryid='f28' id='28482-98726-73624'>
<result xmlns='urn:xmpp:mam:2' queryid='f28' id='stanza-id-1'>
<forwarded xmlns='urn:xmpp:forward:0'>
<delay xmlns='urn:xmpp:delay' stamp='2019-09-20T23:18:41Z'/>
<moderated by="witch@shakespeare.example">
<occupant-id xmlns="urn:xmpp:occupant-id:0" id="dd72603deec90a38ba552f7c68cbcc61bca202cd" />
<retracted from='macbeth@shakespeare.example' stamp='2019-09-20T23:19:12Z' xmlns='urn:xmpp:message-retract:0'>
<occupant-id xmlns="urn:xmpp:occupant-id:0" id="ab91cd8deec71a4888559f0c68cbcc61bca2123e" />
</retracted>
<reason>This message contains inappropriate content for this forum</reason>
<message type="groupchat" from="room@muc.example.com/oldhag" to="room@muc.example.com/macbeth" id="message-id-1">
<occupant-id xmlns="urn:xmpp:occupant-id:0" id="ef73b09de9c90a38ba552f7c68cbeef1dca24429" />
<moderated by="witch@shakespeare.example">
<occupant-id xmlns="urn:xmpp:occupant-id:0" id="dd72603deec90a38ba552f7c68cbcc61bca202cd" />
<retracted stamp='2019-09-20T23:19:12Z' xmlns='urn:xmpp:message-retract:0'/>
<reason>This message contains inappropriate content for this forum</reason>
</moderated>
</message>
</forwarded>
</result>
</message>]]></example>