From 0e3853a095e4404a2a3b29fcf5e1a66d2a4798d5 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Timoth=C3=A9e=20Jaussoin?= Date: Mon, 3 Apr 2023 16:20:29 +0200 Subject: [PATCH] XEP-0372: urn:xmpp:reference:1 - Redefine types - Bump the namespace. - Make uri parameter non mandatory - Remove the mentions chapter (defined in another XEP). - Add reference to XEP-0426 - Add the XML schema - Add restrictions around the begin and end attributes - Complete the discovery section - Add the optional hreflang attribute --- xep-0372.xml | 120 +++++++++++++++++++++++++++++++++------------------ 1 file changed, 79 insertions(+), 41 deletions(-) diff --git a/xep-0372.xml b/xep-0372.xml index 5e632eaea..7baaa603a 100644 --- a/xep-0372.xml +++ b/xep-0372.xml @@ -25,6 +25,21 @@ Refs &ksmithisode; + + 0.6.0 + 2023-04-03 + tj + +
    +
  • Redefine types
  • +
  • Make uri parameter non mandatory
  • +
  • Remove the mentions chapter (defined in another XEP)
  • +
  • Add reference to &xep0426;
  • +
  • Add hreflang attribute
  • +
  • Bump the namespace
  • +
+
+
0.5.0 2020-12-09 @@ -77,71 +92,58 @@ -

If a client implements references, it MUST specify the 'urn:xmpp:reference:0' feature in its service discovery information features as specified in &xep0030; and the Entity Capabilities profile specified in &xep0115;.

- - - -]]> +

If an entity implements references, it MUST specify the 'urn:xmpp:reference:1' feature in its service discovery information features as specified in &xep0030; and the Entity Capabilities profile specified in &xep0115;.

+ +

If the entity is also implementing specific references profiles, it MUST expose the specific feature defined in the related type.

- ... - + + ... -]]> -

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.

-

The 'begin' and 'end' attributes are indexes denoting the beginning and end of the referenced substring in the message body. The Dijkstra convention of rangesDijkstra convention of ranges <https://www.cs.utexas.edu/users/EWD/transcriptions/EWD08xx/EWD831.html> is used, which means that 'begin' is inclusive and 'end' is exclusive. In other words, the 'begin' attribute is the index of the first unicode code point in the referenced substring, with 0 being the index of the first code point in the body, and the 'end' attribute is one higher than the index of the last code point in the substring. - This convention has three main advantages. It matches subsequence indexing in various programming languages, 'end' minus 'begin' equals the length of the substring, and when two substrings are adjacent, the 'end' attribute of the first one matches the 'begin' attribute of the second one. - 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'.

- - But, soft! what light through yonder window breaks? It is the east, and Juliet is the sun. - - -]]> +

References are provided in a 'reference' element of a message, with a namespace of 'urn:xmpp:reference:1'. The element MUST contain a 'type' attribute denoting the type of the reference. Other profile specific attributes MAY be specified. It also MAY contain 'begin', 'end', 'hreflang' and 'anchor' elements.

+ + +

The character counting is done as specified in &xep0426;. Implementations SHOULD NOT send multiple references with overlapping ranges.

+
+ + +

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). Its value is an URI pointing to the reffering 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.

+
+ + +

An implementation MAY use the 'hreflang' attribute to target a message with the corresponding 'xml:lang' attribute, when 'begin' and 'end' attributes are specified.

+
-

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.

+

Data references are a generic reference without additional information. The reference element MUST contain a 'uri' attribute that points to an 'item' that is able to be fetched. This is useful for, for example, fetching an item from Pubsub as defined in Publish-Subscribe (XEP-0060) - Pubsub URIs.

Form received - + ]]>
-

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.

+

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.

+ uri='xmpp:fdp.shakespeare.lit?;node=fdp/submitted/stan.net/accidentreport;item=ndina872be'/> ]]>
@@ -184,6 +186,42 @@

Needs a namespace.

-

When advanced.

+ +

The following schema defines the base reference element.

+ + + + + + + This schema defines the reference element specified in XEP-0372: Reference + + + + + + + + + + + + + + + + + + + + +]]> +