Abstract: | This document defines a method for one XMPP stanza to provide references to another entity, such as mentioning users, HTTP resources, or other XMPP resources. |
Author: | Kevin Smith |
Copyright: | © 1999 – 2017 XMPP Standards Foundation. SEE LEGAL NOTICES. |
Status: | Experimental |
Type: | Standards Track |
Version: | 0.1 |
Last Updated: | 2016-03-22 |
WARNING: This Standards-Track document is Experimental. Publication as an XMPP Extension Protocol does not imply approval of this proposal by the XMPP Standards Foundation. Implementation of the protocol described herein is encouraged in exploratory implementations, but production systems are advised to carefully consider whether it is appropriate to deploy implementations of this protocol before it advances to a status of Draft.
1. Introduction
2. Discovery
3. Use Cases
3.1. Generics
3.2. Mentions
3.3. Data
3.4. Previous messages
4. Security Considerations
5. IANA Considerations
6. XMPP Registrar Considerations
7. XML Schema
Appendices
A: Document Information
B: Author Information
C: Legal Notices
D: Relation to XMPP
E: Discussion Venue
F: Requirements Conformance
G: Notes
H: Revision History
It's often desirable to encode a reference to another entity within a chat message and to mark up the reference. Examples of this include HTTP URLs, 'mentions' (referring to another user), references to previous messages and references to Form Discovery and Publishing (XEP-0346) [1] (FDP) forms. This document provides a mechanism for marking up a section of a message body with information about the target of the reference.
If a client implements references, it MUST specify the 'urn:xmpp:reference:0' feature in its service discovery information features as specified in Service Discovery (XEP-0030) [2] and the Entity Capabilities profile specified in Entity Capabilities (XEP-0115) [3].
<iq type='get' id='disco1' from='romeo@montegue.lit/30d3d8' to='juliet@capulet.lit/sabo239'> <query xmlns='http://jabber.org/protocol/disco#info'/> </iq>
<iq type='result' id='disco1' from='juliet@capulet.lit/sabo239' to='romeo@montegue.lit/30d3d8'> <query xmlns='http://jabber.org/protocol/disco#info'> ... <feature var='urn:xmpp:reference:0'/> ... </query> </iq>
TODO: Individual discovery of reference types - FDP, Mentions, ...
References are provided in a 'reference' element of a message, with a namespace of 'urn:xmpp:reference:0'. The element MUST contain a type attribute denoting the type of the reference and a uri attribute of the thing that is referenced. It MAY contain begin, end and anchor elements. A begin attribute is used to mark the index in the body of the referring message of the first character (TODO: define character appropriately) in the reference, with 0 being the index of the first character. An end attribute is similarly used for the index of the last character of the reference. Where the reference is not a substring of the message body in the referring stanza, begin and end are not used. An anchor attribute is used when the referring message is not the one containing the reference element, and points to the previous message containing the reference (the referring message).
Note that the URIs of the reference and anchor do not need to refer to the same mechanism as that in which the reference was received. E.g., a service could listen for mentions in a MIX channels of users outside that channel, and send them messages containing a reference to let them know that they've been mentioned.
Mentions are a reference to a user's bare JID, and have a type of 'mention'.
<message type='groupchat' id='sotehu-bthbtp32h3' to='balcony@channels.shakespeare.lit'> <body>But, soft! what light through yonder window breaks? It is the east, and Juliet is the sun.</body> <reference xmlns='urn:xmpp:reference:0' begin='72' end='78' type='mention' uri='xmpp:juliet@capulet.lit'/> </message>
Data references are a generic reference without additional information. The URI points to an 'item' that is able to be fetched. This is useful for, for example, fetching an item from pubsub, as in the example below. TODO: check URI syntax for refering to a pubsub item.
<message type='groupchat' id='sotehu-bthbtp32h4' from='balcony@channels.shakespeare.lit' to='romeo@montegue.lit/30d3d8'> <body>Form received</body> <reference xmlns='urn:xmpp:reference:0' type='data' uri='xmpp:fdp.shakespeare.lit?node=fdp/submitted/stan.isode.net/accidentreport&item=ndina872be'/> </message>
Sometimes it's desirable to annotate a reference in a previous message. An example of this might be where a MIX channel asynchronously adds information about references made in previous messages by users. In this case the message MUST NOT contain a body. Here the anchor attribute is used to provide a URI to the previous message. TODO: URI scheme for messages.
<message type='groupchat' id='sotehu-bthbtp32h5' from='balcony@channels.shakespeare.lit' to='romeo@montegue.lit/30d3d8'> <reference xmlns='urn:xmpp:reference:0' type='data' anchor='xmpp:balcony@channels.shakespeare.lit?node=messages&item=bnhob' begin='72' end='78' uri='xmpp:fdp.shakespeare.lit?node=fdp/submitted/stan.isode.net/accidentreport&item=ndina872be'/> </message>
TODO.
None.
Needs a namespace.
When advanced.
Series: XEP
Number: 0372
Publisher: XMPP Standards Foundation
Status:
Experimental
Type:
Standards Track
Version: 0.1
Last Updated: 2016-03-22
Approving Body: XMPP Council
Dependencies: XMPP Core, XMPP IM, XEP-0030, XEP-0115
Supersedes: None
Superseded By: None
Short Name: Refs
Source Control:
HTML
This document in other formats:
XML
PDF
Email:
kevin.smith@isode.com
JabberID:
kevin.smith@isode.com
The Extensible Messaging and Presence Protocol (XMPP) is defined in the XMPP Core (RFC 6120) and XMPP IM (RFC 6121) specifications contributed by the XMPP Standards Foundation to the Internet Standards Process, which is managed by the Internet Engineering Task Force in accordance with RFC 2026. Any protocol defined in this document has been developed outside the Internet Standards Process and is to be understood as an extension to XMPP rather than as an evolution, development, or modification of XMPP itself.
The primary venue for discussion of XMPP Extension Protocols is the <standards@xmpp.org> discussion list.
Discussion on other xmpp.org discussion lists might also be appropriate; see <http://xmpp.org/about/discuss.shtml> for a complete list.
Errata can be sent to <editor@xmpp.org>.
The following requirements keywords as used in this document are to be interpreted as described in RFC 2119: "MUST", "SHALL", "REQUIRED"; "MUST NOT", "SHALL NOT"; "SHOULD", "RECOMMENDED"; "SHOULD NOT", "NOT RECOMMENDED"; "MAY", "OPTIONAL".
1. XEP-0346: Form Discovery and Publishing <https://xmpp.org/extensions/xep-0346.html>.
2. XEP-0030: Service Discovery <https://xmpp.org/extensions/xep-0030.html>.
3. XEP-0115: Entity Capabilities <https://xmpp.org/extensions/xep-0115.html>.
Note: Older versions of this specification might be available at http://xmpp.org/extensions/attic/
Initial published version approved by the XMPP Council.
(XEP Editor (asw))First draft.
(kis)END