124 lines
5.1 KiB

<?xml version='1.0' encoding='UTF-8'?>
<!DOCTYPE xep SYSTEM 'xep.dtd' [
<!ENTITY % ents SYSTEM 'xep.ent'>
<!ENTITY ns "urn:xmpp:fallback:0">
<?xml-stylesheet type='text/xsl' href='xep.xsl'?>
<title>Fallback Indication</title>
<abstract>This specification proposes a mechanism by which message bodies can be marked as being purely for fallback
purposes, and therefore to be ignored by intermediaries and anything that understands the remainder of the message.</abstract>
<type>Standards Track</type>
<spec>XMPP Core</spec>
<remark>Minor editorial fixes</remark>
<initials>XEP Editor (jsc)</initials>
<remark>Accepted by vote of Council on 2020-01-02.</remark>
<li>Initial Revision</li>
<section1 topic='Introduction' anchor='intro'>
<p>A common and convenient practise for new extensions is to supply a fallback body. This provides immediate backwards
compatibility for naive clients, since - not understanding the new protocol - they will gracefully degrade to displaying
the body as an instant message.</p>
<p>By way of example, a recent Reactions proposal suggested including the emoji as a <tt>&lt;body/></tt> element, so
that existing clients would simply display it as a normal message.</p>
<p>The downside of this approach is that servers and other intermediaries treat the presence of a <tt>&lt;body/></tt>
as being an indicator that a message is indeed an instant message. They will then treat it this way for archival
purposes, etc, which might not be appropriate.</p>
<p>This specification tackles the problem by providing an element to be used as a hint that the supplied
<tt>&lt;body/></tt> and <tt>&lt;subject/></tt> elements are only for fallback purposes, and the message SHOULD be
treated as if they were not present for most purposes.</p>
<section1 topic='Overview' anchor="overview">
<section2 topic="Discovering Support" anchor="feature">
<p>Support for this protocol MAY be advertised by the Service Discovery protocol defined in &xep0030; using a feature
of <tt>&ns;</tt>. Note that lack of support will result in the desired fallback behaviour.</p>
<section2 topic="Fallback Indicator">
<p>The fallback indicator is an element <tt>&lt;fallback/></tt> qualified by the <tt>&ns;</tt> namespace. It has no
attributes, content, or child elements.</p>
<message from="alice@example.org" to="bob@example.net" type="chat">
<fallback xmlns="]]>&ns;<![CDATA["/>
<encrypted xmlns="urn:example:crypto">Abobql jvyy rire qrpelcg bhe fhcre-frperg zrffntr!</encrypted>
<body>This message is encrypted.</body>
<p>Receiving the above message, a naive client will naturally display only the <tt>&lt;body/></tt> element text, but
a client or server which supports this specification will know this is merely a fallback placeholder, and to ignore
(and not display) the content therein.</p>
<section2 topic="Alternatives">
<li>&xep0334; was considered, and would probably be ideal - servers often examine these elements and alter
behaviour accordingly, but the specification was rejected by Council.</li>
<li>Placing fallback elements within the <tt>&lt;fallback/></tt> element would shift the onus from server to
client, but this is likely to be less useful.</li>
<section1 topic="Schema">
<?xml version="1.0" encoding="UTF-8"?>
<xs:schema attributeFormDefault="unqualified" elementFormDefault="qualified" targetNamespace="]]>&ns;<![CDATA[" xmlns:xs="http://www.w3.org/2001/XMLSchema">
<xs:element name="fallback">
<section1 topic='Security Considerations' anchor='security'>
<p>This specification allows messages with a body (and real message content therein) to be treated by a server as
if that body text does not exist. Servers MAY, particularly in a secure setting, wish to archive copies of the message
even if they ordinarily would not archive a message with no body.</p>
<section1 topic='IANA Considerations' anchor='iana'>
<p>This XEP requires no interaction with &IANA;. </p>
<section1 topic='XMPP Registrar Considerations' anchor='registrar'>
<section1 topic='Acknowledgements' anchor='ack'>
<p>The author wishes to share any credit with many members of the community.</p>