2015-10-16 16:09:02 -04:00
|
|
|
<?xml version='1.0' encoding='UTF-8'?>
|
|
|
|
<!DOCTYPE xep SYSTEM 'xep.dtd' [
|
|
|
|
<!ENTITY % ents SYSTEM 'xep.ent'>
|
|
|
|
%ents;
|
|
|
|
]>
|
|
|
|
<?xml-stylesheet type='text/xsl' href='xep.xsl'?>
|
|
|
|
<xep>
|
|
|
|
<header>
|
|
|
|
<title>Message Attaching</title>
|
|
|
|
<abstract>
|
|
|
|
This specification defines a method for indicating that a message contains
|
|
|
|
content which describes an earlier message in the conversation and should
|
|
|
|
be grouped with the earlier message.
|
|
|
|
</abstract>
|
|
|
|
&LEGALNOTICE;
|
2015-12-15 15:28:27 -05:00
|
|
|
<number>0367</number>
|
2020-01-02 11:58:53 -05:00
|
|
|
<status>Deferred</status>
|
2015-10-16 16:09:02 -04:00
|
|
|
<type>Standards Track</type>
|
|
|
|
<sig>Standards</sig>
|
|
|
|
<approver>Council</approver>
|
|
|
|
<dependencies>
|
|
|
|
<spec>XMPP Core</spec>
|
2019-01-13 05:40:43 -05:00
|
|
|
<spec>XEP-0359</spec>
|
2015-10-16 16:09:02 -04:00
|
|
|
</dependencies>
|
|
|
|
<supersedes/>
|
|
|
|
<supersededby/>
|
|
|
|
<shortname>message-attaching</shortname>
|
|
|
|
&sam;
|
|
|
|
<author>
|
|
|
|
<firstname>Craig</firstname>
|
|
|
|
<surname>Petchell</surname>
|
|
|
|
<email>cpetchell@atlassian.com</email>
|
|
|
|
</author>
|
2018-08-18 13:08:11 -04:00
|
|
|
&mwild;
|
|
|
|
<revision>
|
|
|
|
<version>0.3</version>
|
|
|
|
<date>2018-08-18</date>
|
|
|
|
<initials>mw</initials>
|
|
|
|
<remark>Update to use unique stanza ids.</remark>
|
|
|
|
</revision>
|
2017-09-11 11:49:11 -04:00
|
|
|
<revision>
|
|
|
|
<version>0.2</version>
|
|
|
|
<date>2017-09-11</date>
|
|
|
|
<initials>XEP Editor (jwi)</initials>
|
|
|
|
<remark>Defer due to lack of activity.</remark>
|
|
|
|
</revision>
|
2015-12-15 15:28:27 -05:00
|
|
|
<revision>
|
|
|
|
<version>0.1</version>
|
|
|
|
<date>2015-12-15</date>
|
|
|
|
<initials>XEP Editor (asw)</initials>
|
|
|
|
<remark><p>Initial published version approved by the XMPP Council.</p></remark>
|
|
|
|
</revision>
|
2015-10-16 16:09:02 -04:00
|
|
|
<revision>
|
|
|
|
<version>0.0.1</version>
|
|
|
|
<date>2015-10-16</date>
|
|
|
|
<initials>ssw</initials>
|
|
|
|
<remark><p>First draft.</p></remark>
|
|
|
|
</revision>
|
|
|
|
</header>
|
|
|
|
<section1 topic='Introduction' anchor='intro'>
|
|
|
|
<p>
|
|
|
|
Many messaging applications send special messages which include more
|
|
|
|
information about a previous message. For example, when sending a link the
|
|
|
|
service may display the description or an image off the page, or users may
|
|
|
|
respond to a message with a "sticker" or an "emotion" which they wish to
|
|
|
|
display alongside the message, even though the conversation has moved on.
|
|
|
|
</p>
|
|
|
|
<p>
|
|
|
|
This specification defines a way by which one can indicate that a message
|
|
|
|
is logically (and visibly) "attached" to an earlier message in the
|
|
|
|
conversation.
|
|
|
|
</p>
|
|
|
|
</section1>
|
|
|
|
<section1 topic='Discovering support' anchor='disco'>
|
|
|
|
<p>
|
|
|
|
If a client implements message attaching, it MUST specify the
|
2018-08-18 13:08:11 -04:00
|
|
|
'urn:xmpp:message-attaching:1' feature in its service discovery information
|
2015-10-16 16:09:02 -04:00
|
|
|
features as specified in &xep0030; and the Entity Capabilities profile
|
|
|
|
specified in &xep0115;.
|
|
|
|
</p>
|
|
|
|
<example caption='Client requests information about a chat partner's client'><![CDATA[
|
|
|
|
<iq type='get'
|
|
|
|
from='alonso@naples.lit/ship'
|
|
|
|
id='miuARo9V'>
|
|
|
|
<query xmlns='http://jabber.org/protocol/disco#info'/>
|
|
|
|
</iq>]]></example>
|
|
|
|
<example caption='Partner's client advertises support for attaching'><![CDATA[
|
|
|
|
<iq type='result'
|
|
|
|
to='alonso@naples.lit/ship'
|
|
|
|
from='naples.lit'
|
|
|
|
id='miuARo9V'>
|
|
|
|
<query xmlns='http://jabber.org/protocol/disco#info'>
|
|
|
|
…
|
2018-08-18 13:08:11 -04:00
|
|
|
<feature var='urn:xmpp:message-attaching:1'/>
|
2015-10-16 16:09:02 -04:00
|
|
|
…
|
|
|
|
</query>
|
|
|
|
</iq>]]></example>
|
|
|
|
</section1>
|
|
|
|
<section1 topic='Usage' anchor='usage'>
|
|
|
|
<p>
|
|
|
|
Messages that are attached to other messages MUST contain an
|
2018-08-18 13:08:11 -04:00
|
|
|
<attach-to/> element qualified by the 'urn:xmpp:message-attaching:1'
|
2015-10-16 16:09:02 -04:00
|
|
|
namespace and with an 'id' attribute set to the ID of the message that we
|
2018-08-18 13:08:11 -04:00
|
|
|
want to attach to (important note: the correct ID to use depends on the context,
|
|
|
|
see the business rules below). Messages MAY be attached to any
|
|
|
|
other message, including those sent by other clients, but clients MAY choose
|
|
|
|
to ignore the attach-to directive and display the message normally.
|
2015-10-16 16:09:02 -04:00
|
|
|
</p>
|
|
|
|
<example caption='User attaches a message'><![CDATA[
|
2019-04-03 08:29:08 -04:00
|
|
|
<message to='antonio@milan.lit/ship' from='prospero@milan.lit/island' id='RgEGnjqy'>
|
2015-10-16 16:09:02 -04:00
|
|
|
<body>storm.png</body>
|
2018-08-18 13:08:11 -04:00
|
|
|
<attach-to id='SD24VCzSYQ' xmlns='urn:xmpp:message-attaching:1'/>
|
2015-10-16 16:09:02 -04:00
|
|
|
</message>]]></example>
|
|
|
|
<p>
|
|
|
|
Note that indicating that a message should be "attached" to an earlier
|
|
|
|
message in the conversation is merely a suggestion to the client to display
|
|
|
|
the message next to or below the old message.
|
|
|
|
</p>
|
|
|
|
</section1>
|
|
|
|
<section1 topic='Business Rules' anchor='rules'>
|
2018-08-18 13:08:11 -04:00
|
|
|
<section2 topic='Using the correct ID' anchor='business-id'>
|
|
|
|
<p>
|
|
|
|
For messages of type 'groupchat', the stanza's 'id' attribute MUST NOT be
|
|
|
|
used for attachments. Instead, in group chat situations, the ID assigned to
|
|
|
|
the stanza by the group chat itself must be used. This is discovered in a
|
|
|
|
<stanza-id> element with a 'by' attribute that matches the bare JID of
|
|
|
|
the group chat, as defined in &xep0359;.
|
|
|
|
</p>
|
2019-01-13 05:40:08 -05:00
|
|
|
<p>
|
|
|
|
This implies that group chat messages without a &xep0359; stanza-id cannot
|
|
|
|
be attached-to.
|
|
|
|
</p>
|
2018-08-18 13:08:11 -04:00
|
|
|
<p>
|
|
|
|
For other message types the attacher should use the 'id' from a XEP-0359
|
|
|
|
<origin-id> if present, or the value of the 'id' attribute on the
|
|
|
|
<message> otherwise.
|
|
|
|
</p>
|
|
|
|
</section2>
|
|
|
|
<section2 topic='Display of attached messages' anchor='business-display'>
|
|
|
|
<p>
|
|
|
|
A receiving client MAY choose to show the attached message next to or below
|
|
|
|
the indicated message in whatever display is used for messages or can
|
|
|
|
choose to display the attachment in another way (including as a normal
|
|
|
|
message, completely ignoring the attach-to element).
|
|
|
|
</p>
|
|
|
|
<p>
|
|
|
|
A receiving client SHOULD indicate that the message is an attachment, and
|
|
|
|
not a part of the original message to prevent confusion.
|
|
|
|
</p>
|
|
|
|
</section2>
|
|
|
|
<section2 topic='General' anchor='business-general'>
|
|
|
|
<p>
|
|
|
|
<attach-to/> elements MUST NOT be put on any stanza type other than
|
|
|
|
messages.
|
|
|
|
</p>
|
|
|
|
<p>
|
|
|
|
A server may choose to strip some <attach-to/> messages based on
|
|
|
|
local policy (eg. a server might have a policy that only it can create
|
|
|
|
message attachments).
|
|
|
|
</p>
|
|
|
|
<p>Clients MUST send ids on messages if they support attachments.</p>
|
|
|
|
<p>
|
|
|
|
Messages MUST NOT contain more than one <attach-to/> element.
|
|
|
|
</p>
|
|
|
|
<p>
|
|
|
|
Clients and servers MUST NOT include an <attach-to/> element on
|
|
|
|
messages with a non-messaging payload unless they are including it on an
|
|
|
|
error which may be attached to the message that caused the error to be
|
|
|
|
generated.
|
|
|
|
</p>
|
|
|
|
</section2>
|
2015-10-16 16:09:02 -04:00
|
|
|
</section1>
|
|
|
|
<section1 topic='Security Considerations' anchor='security'>
|
2017-01-01 17:34:35 -05:00
|
|
|
<p>
|
2018-08-18 13:08:11 -04:00
|
|
|
Clients that implement message attachments MUST display the attachments
|
2019-01-13 05:39:08 -05:00
|
|
|
in such a way that they could not be confused with the original message
|
|
|
|
and cause someone viewing the conversation to assume they were sent by
|
|
|
|
the sender of the message being attached to.
|
2018-08-18 13:08:11 -04:00
|
|
|
</p>
|
|
|
|
<p>
|
|
|
|
When matching a received attachment to the original message, clients must
|
|
|
|
ensure they match using the correct ID, as described in the business rules
|
|
|
|
section, e.g. within a group chat only the XEP-0359 stanza-id should be
|
|
|
|
matched against. If this is not available, the message SHOULD be displayed
|
|
|
|
as a normal unattached message.
|
2017-01-01 17:34:35 -05:00
|
|
|
</p>
|
2015-10-16 16:09:02 -04:00
|
|
|
</section1>
|
|
|
|
<section1 topic='IANA Considerations' anchor='iana'>
|
|
|
|
<p>This document requires no interaction with &IANA;.</p>
|
|
|
|
</section1>
|
|
|
|
<section1 topic='XMPP Registrar Considerations' anchor='registrar'>
|
|
|
|
<p>This specification defines the following XML namespaces:</p>
|
|
|
|
<ul>
|
2018-08-18 13:08:11 -04:00
|
|
|
<li>urn:xmpp:message-attaching:1</li>
|
2015-10-16 16:09:02 -04:00
|
|
|
</ul>
|
|
|
|
<p>
|
|
|
|
The ®ISTRAR; shall include the foregoing namespaces in its disco
|
|
|
|
features registry as defined in &xep0030;.
|
2017-01-01 17:34:35 -05:00
|
|
|
</p>
|
|
|
|
<code caption='Registry Submission'><![CDATA[
|
2015-10-16 16:09:02 -04:00
|
|
|
<var>
|
2018-08-18 13:08:11 -04:00
|
|
|
<name>urn:xmpp:message-attaching:1</name>
|
2015-10-16 16:09:02 -04:00
|
|
|
<desc>Indicates support for attaching one message to another.</desc>
|
|
|
|
<doc>XEP-xxxx</doc>
|
|
|
|
</var>
|
2017-01-01 17:34:35 -05:00
|
|
|
]]></code>
|
2015-10-16 16:09:02 -04:00
|
|
|
</section1>
|
|
|
|
<section1 topic='XML Schema' anchor='schema'>
|
|
|
|
<code><![CDATA[
|
|
|
|
<?xml version='1.0' encoding='UTF-8'?>
|
|
|
|
|
|
|
|
<xs:schema
|
|
|
|
xmlns:xs='http://www.w3.org/2001/XMLSchema'
|
2018-08-18 13:08:11 -04:00
|
|
|
targetNamespace='urn:xmpp:message-attaching:1'
|
|
|
|
xmlns='urn:xmpp:message-attaching:1'
|
2015-10-16 16:09:02 -04:00
|
|
|
elementFormDefault='qualified'>
|
|
|
|
|
|
|
|
<xs:element name='attach-to'>
|
|
|
|
<xs:complexType>
|
|
|
|
<xs:simpleContent>
|
|
|
|
<xs:extension base='xs:string'>
|
|
|
|
<xs:attribute name='id' type='xs:string' use='required'/>
|
|
|
|
</xs:extension>
|
|
|
|
</xs:simpleContent>
|
|
|
|
</xs:complexType>
|
|
|
|
</xs:element>
|
|
|
|
|
|
|
|
</xs:schema>
|
2017-02-14 17:08:49 -05:00
|
|
|
]]></code>
|
2015-10-16 16:09:02 -04:00
|
|
|
</section1>
|
|
|
|
</xep>
|