1
0
mirror of https://github.com/moparisthebest/xeps synced 2024-11-24 02:02:16 -05:00

XEP-xxxx (MDS) use stanza-id element instead of attr

This commit is contained in:
Daniel Gultsch 2024-02-27 14:38:33 +01:00
parent be9cae8ce7
commit 6b2c521af9

View File

@ -66,20 +66,23 @@
<section1 topic='Use Cases' anchor='usecases'>
<section2 topic="Server-side persistence" anchor='pep-node'>
<p>Clients use items in a private PEP (&xep0163;) node called 'urn:xmpp:mds:displayed:0' to synchronize and persist the displayed state (See &xep0223;). The item ID corresponds to the JID of the respective chat. For normal, 1:1 chats this SHOULD be the bare JID of the contact, for group chats this SHOULD be the bare JID of the room and for private messages in group chats the full JID of the participant.</p>
<p>The item contains a single &lt;displayed/> element qualified by the 'xrn:xmpp:mds:displayed:0' namespace. The &lt;displayed/> element MUST contain an attribute called 'stanza-id' that corresponds to the stanza-id (&xep0359;) of the most recent, displayed message, in that particular chat.</p>
<p>The item contains a single &lt;displayed/> element qualified by the 'xrn:xmpp:mds:displayed:0' namespace. The &lt;displayed/> element MUST contain exactly one &xep0359; &lt;stanza-id/> element that corresponds to the stanza-id of the most recent, displayed message, in that particular chat.</p>
</section2>
<section2 topic="Flagging chat as displayed" anchor='publish'>
<p>Only messages <strong>received</strong> by the user (meaning sent by third parties such as a contact, a participant in a group chat, etc) SHOULD be flagged as 'displayed'. However since 'displayed' means <em>all messages up to this point</em> and the stanza-id of a message <strong>sent</strong> by the user indicates a valid point in the chat history, sent messages MAY be flagged as well.</p>
<p>Flagging a chat as <em>displayed up to this point</em> happens by publishing a PEP item with an id corresponding to the JID of the chat and a &lt;displayed/> payload element into the 'urn:xmpp:mds:displayed:0' node.</p>
<p>For group chats the stanza-id attribute of the &lt;displayed/> element refers to the stanza-id injected by the room. For all other chats the stanza-id attribute refers to the stanza-id injected by the users server (the server hosting the user account).</p>
<p>For group chats the &lt;stanza-id/> child of the &lt;displayed/> element refers to the stanza-id injected by the room. For all other chats the stanza-id child refers to the stanza-id injected by the users server (the server hosting the user account).</p>
<p>The client MUST include appropriate publish-options in the publication, including, but not limited to, setting the access model to whitelist and the max-items to max.</p>
<example caption='Client marks a chat as display'><![CDATA[
<iq from='juliet@capulet.lit/balcony' type='set' id='flag-as-displayed-1'>
<pubsub xmlns='http://jabber.org/protocol/pubsub'>
<publish node='urn:xmpp:mds:displayed:0'>
<item id='romeo@montegue.lit'>
<displayed xmlns='urn:xmpp:mds:displayed:0'
stanza-id='0f710f2b-52ed-4d52-b928-784dad74a52b'/>
<displayed xmlns='urn:xmpp:mds:displayed:0'>
<stanza-id xmlns='urn:xmpp:sid:0'
by='juliet@capulet.lit'
id='0f710f2b-52ed-4d52-b928-784dad74a52b'/>
</display>
</item>
</publish>
<publish-options>
@ -127,12 +130,18 @@
<pubsub xmlns='http://jabber.org/protocol/pubsub'>
<items node='urn:xmpp:mds:displayed:0'>
<item id='romeo@montegue.lit'>
<displayed xmlns='urn:xmpp:mds:displayed:0'
stanza-id='0f710f2b-52ed-4d52-b928-784dad74a52b'/>
<displayed xmlns='urn:xmpp:mds:displayed:0'>
<stanza-id xmlns='urn:xmpp:sid:0'
id='0f710f2b-52ed-4d52-b928-784dad74a52b'
by='juliet@capulet.lit'/>
</displayed>
</item>
<item id='example@conference.shakespeare.lit'>
<displayed xmlns='urn:xmpp:mds:displayed:0'
stanza-id='ca21deaf-812c-48f1-8f16-339a674f2864'/>
<stanza-id xmlns='urn:xmpp:sid:0'
id='ca21deaf-812c-48f1-8f16-339a674f2864'
by='example@conference.shakespeare.lit'/>
</displayed>
</item>
</items>
</pubsub>
@ -172,7 +181,9 @@
<example caption="Juliet lets both Romeo and her other devices know she has displayed the message"><![CDATA[
<message to='romeo@montegue.lit' from='juliet@capulet.let/balcony'>
<displayed xmlns='urn:xmpp:chat-markers:0' id='the-msg-1'/>
<displayed xmlns='urn:xmpp:mds:displayed:0' stanza-id='0423e3a9-d516-493d-bb06-bee0e51ab9fb'/>
<displayed xmlns='urn:xmpp:mds:displayed:0'>
<stanza-id xmlns='urn:xmpp:sid:0' by='juliet@capulet.lit' id='0423e3a9-d516-493d-bb06-bee0e51ab9fb'/>
</displayed>
</message>
]]></example>
<example caption="Server sends out PEP notifications to Juliets connected devices"><![CDATA[
@ -180,7 +191,9 @@
<event xmlns='http://jabber.org/protocol/pubsub#event'>
<items node='urn:xmpp:mds:displayed:0'>
<item id='romeo@montegue.lit'>
<displayed xmlns='urn:xmpp:mds:displayed:0' stanza-id='0423e3a9-d516-493d-bb06-bee0e51ab9fb'/>
<displayed xmlns='urn:xmpp:mds:displayed:0'>
<stanza-id xmlns='urn:xmpp:sid:0' by='juliet@capulet.lit' id='0423e3a9-d516-493d-bb06-bee0e51ab9fb'/>
</displayed>
</item>
</items>
</event>