Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

XEP-0490: Add the XML Schema and fix some examples #1400

Open
wants to merge 3 commits into
base: master
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
58 changes: 48 additions & 10 deletions xep-0490.xml
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,17 @@
<email>[email protected]</email>
<jid>[email protected]</jid>
</author>
<revision>
<version>1.0.1</version>
<date>2024-11-20</date>
<initials>egp</initials>
<remark>
<ul>
<li>Fix some examples, and their indentation.</li>
<li>Add the XML Schema.</li>
</ul>
</remark>
</revision>
<revision>
<version>1.0.0</version>
<date>2024-11-06</date>
Expand Down Expand Up @@ -113,7 +124,7 @@
<stanza-id xmlns='urn:xmpp:sid:0'
by='[email protected]'
id='0f710f2b-52ed-4d52-b928-784dad74a52b'/>
</display>
</displayed>
</item>
</publish>
<publish-options>
Expand Down Expand Up @@ -168,7 +179,7 @@
</displayed>
</item>
<item id='[email protected]'>
<displayed xmlns='urn:xmpp:mds:displayed:0'
<displayed xmlns='urn:xmpp:mds:displayed:0'>
<stanza-id xmlns='urn:xmpp:sid:0'
id='ca21deaf-812c-48f1-8f16-339a674f2864'
by='[email protected]'/>
Expand Down Expand Up @@ -211,15 +222,15 @@
]]></example>
<example caption="Juliet lets both Romeo and her other devices know she has displayed the message"><![CDATA[
<message to='[email protected]'>
<displayed xmlns='urn:xmpp:chat-markers:0' id='the-msg-1'/>
<displayed xmlns='urn:xmpp:mds:displayed:0'>
<stanza-id xmlns='urn:xmpp:sid:0' by='[email protected]' id='0423e3a9-d516-493d-bb06-bee0e51ab9fb'/>
</displayed>
<displayed xmlns='urn:xmpp:chat-markers:0' id='the-msg-1'/>
<displayed xmlns='urn:xmpp:mds:displayed:0'>
<stanza-id xmlns='urn:xmpp:sid:0' by='[email protected]' id='0423e3a9-d516-493d-bb06-bee0e51ab9fb'/>
</displayed>
</message>
]]></example>
<example caption="Juliet’s server strips the displayed element used for server assist and forwards the stanza to Romeo"><![CDATA[
<message to='[email protected]' from='[email protected]/balcony'>
<displayed xmlns='urn:xmpp:chat-markers:0' id='the-msg-1'/>
<displayed xmlns='urn:xmpp:chat-markers:0' id='the-msg-1'/>
</message>
]]></example>
<example caption="Server sends out PEP notifications to Juliets connected devices"><![CDATA[
Expand All @@ -239,8 +250,8 @@
</section2>
</section1>
<section1 topic='Business Rules' anchor='rules'>
<section2 topic='Client' anchor='rules-client'>
<ul>
<section2 topic='Client' anchor='rules-client'>
<ul>
<li>The displayed state only moves forward. Receiving a displayed state with a stanza-id that references a message older than the current local representation is considered redundant and MUST be ignored.</li>
<li>Displayed states with a stanza-id not found in the respective chat MUST be ignored.</li>
<li>Receiving an outgoing message (for example via &xep0280; or &xep0313;) SHOULD NOT mark the chat as displayed. Outgoing messages are neutral towards the overall displayed state of a given chat. For example if the <em>displayed up to</em> state references the most recent incoming message and this message is only followed by outgoing messages the overall state of that chat SHOULD be considered <em>displayed</em>.</li>
Expand Down Expand Up @@ -289,6 +300,33 @@
</ul>
</section1>
<section1 topic='XML Schema' anchor='schema'>
<p>REQUIRED for protocol specifications.</p>
<code><![CDATA[<?xml version='1.0' encoding='UTF-8'?>

<xs:schema
xmlns:xs='http://www.w3.org/2001/XMLSchema'
xmlns:sid='urn:xmpp:sid:0'
xmlns='urn:xmpp:mds:displayed:0'
targetNamespace='urn:xmpp:mds:displayed:0'
elementFormDefault='qualified'>

<xs:annotation>
<xs:documentation>
The protocol documented by this schema is defined in
XEP-0490: https://xmpp.org/extensions/xep-0490.html
</xs:documentation>
</xs:annotation>

<xs:import namespace='urn:xmpp:sid:0'
schemaLocation='xep-0359.xsd'/>

<xs:element name='displayed'>
<xs:complexType>
<xs:sequence>
<xs:element ref='sid:stanza-id'/>
</xs:sequence>
</xs:complexType>
</xs:element>

</xs:schema>]]></code>
</section1>
</xep>