Browse Source

Add ProtoXEP: Compatibility fallback

Marvin W 1 year ago
No known key found for this signature in database
GPG Key ID: 72E9235DB996F2A
  1. 134


@ -0,0 +1,134 @@ @@ -0,0 +1,134 @@
<?xml version='1.0' encoding='UTF-8'?>
<!DOCTYPE xep SYSTEM 'xep.dtd' [
<!ENTITY % ents SYSTEM 'xep.ent'>
<?xml-stylesheet type='text/xsl' href='xep.xsl'?>
<title>Compatibility Fallbacks</title>
This document defines a way to indicate that a specific part of the body only serves as fallback and which
specification the fallback is for.
<type>Standards Track</type>
<p>First draft.</p>
<section1 topic='Introduction' anchor='intro'>
New specifications can use the message body to convey intended meaning to users of non-supporting clients. This
XEP provides a way to indicate which part of the body serves as fallback and which specification it provides a
fallback for.
This specification serves a different purpose than the similarly named &xep0428;. Fallback indication tells
servers that the body is only a fallback and that clients implementing all the specifications used by the message
will not make use of the message body. This specification tells clients that parts of the body are only included
to aid clients not supporting a certain specification.
<section1 topic='Use Cases' anchor='usecases'>
To mark a specific text section in the body as a fallback, a &lt;fallback&gt; element in the urn:xmpp:compat:0
namespace is placed in the message stanza. The &lt;fallback&gt; element has a 'for' attribute with an identifier
of the specification the fallback is for. The &lt;fallback&gt; element contains one &lt;body&gt; element for each
continuous character sequence in the body that is part of the fallback text. Each body element contains a 'start'
and 'end' attribute which point to the start and end of a fallback character sequence as defined in &xep0426;,
For example, Juliet might be part of a group that shares news. Breaking news are indicated by a specific element
and supporting clients can highlight them accordingly. To also inform users of non-supporting clients about the
importance of a piece of news, the information is prefixed by "BREAKING NEWS: " in the body. A supporting client
sees the &lt;fallback&gt; element and removes the respective character sequence before highlighting the message to
the user.
<message to='' id='message-id2' type='chat'>
<body>BREAKING NEWS: Romeo is dead.</body>
<breaking xmlns='urn:example:breaking-news:0' />
<fallback xmlns='urn:xmpp:compat:0' for='urn:example:breaking-news:0'>
<body start='0' end='15' />
Another example are message replies, where a &lt;reply&gt; element specifies the referenced message. A simple
fallback is to include a &xep0393; quote of the referenced message in the body text. To provide a better fallback,
the sender can also include markup information for the quote.
<message to='' id='message-id2' type='groupchat'>
> Anna wrote:
> Hi, how are you?
<reply to='' id='message-id1' xmlns='urn:xmpp:reply:0' />
<markup xmlns="urn:example:markup:0">
<quote start='0' end='33' />
<fallback xmlns='urn:xmpp:compat:0' for='urn:example:markup:0'>
<body start='0' end='1' />
<body start='14' end='15' />
<fallback xmlns='urn:xmpp:compat:0' for='urn:xmpp:reply:0'>
<body start='0' end='33' />
<section1 topic='Business Rules' anchor='rules'>
<p>The exact behavior for a compatibility fallback should be defined in the respective specification. Not displaying
the fallback in supporting clients would be an example for a behavior.
<section1 topic="Security Considerations" anchor="security">
An attacker might include a compatibility fallback with a meaning that is different from what would be displayed
by a supporting client. While this could also be achieved using other parts of the XMPP specifications (e.g.
xml:lang), some environments might want to prevent it. Specifications could standardize some parts of the
compatibility text such that the equivalence can be verified by supporting clients.
<section1 topic='IANA Considerations' anchor='iana'>
<p>This document requires no interaction with &IANA;.</p>
<section1 topic='XMPP Registrar Considerations' anchor='registrar'>
<p>This document requires no interaction with &REGISTRAR;.</p>