[Standards] XEP-0372: References

Jonas Wielicki jonas at wielicki.name
Mon Mar 12 14:20:10 UTC 2018


Hi list,

Some feedback on XEP-0372 references from me after reading it thoroughly for 
the first time [1].

First, it uses ranges of "characters" into <body/>, but doesn’t specificy 
which language. Since there can be multiple <body/> elements with different 
effective xml:lang values, this is ambiguous. I think this needs resolving in 
one way or the other. FWIW, I’d argue that using codepoints is much saner, 
because those are readily available and consistent across all receiving 
entities of the same message. (Even though this potentially introduces some 
interesting edge-cases when somebody creates a references starting in the 
middle of, e.g., an emoji sequence.)


Second, I think that the way the type of the reference is specified isn’t 
actually great. There is no way to "subclass" this protocol in a sane manner 
due to the lack of (standardised) namespacing of the @type attribute. Also, 
while it may make sense to have some very generic attributes like @uri on the 
reference, other type-specific things don’t belong there, IMO (it makes 
validation much harder).

I would suggest to follow an approach which allows a bit more extensibility by 
having the type of the reference determined by a child element, like so:

    <reference xmlns="…" start="…" end="…">
        <mention jid="…"/>
        <!-- or maybe something instead of @jid in case of MUC/MIX -->
    </reference>

This also prevents us from having to cram a thousand different meanings into a 
URI, creating ambiguity on the way. A pubsub node publication could be much 
cleaner referenced by:

    <reference xmlns="…" start="…" end="…">
        <pubsub-item jid="…" node="…" id="…"/>
    </reference>

Likewise for messages:

    <reference xmlns="…" start="…" end="…">
        <message from="…" id="…"/>
    </reference>

If we want to keep generic URI references:

    <reference xmlns="…" start="…" end="…">
        <generic uri="…"/>
    </reference>


Now I’m not sure how to integrate the <anchor/> idea into that. The idea is 
neat, but the lack of standardization for URIs for different objects (such as 
pubsub items, MUC messages, MIX messages, one-on-one messages etc.) in XMPP 
makes it seem that using an URI is not a great idea at this point. In general, 
it would be neat to have such URIs properly specified.

kind regards,
Jonas

   [1]: I’m doing this while evaluating how to implement Emoji Reactions. cf.
        https://github.com/jabbercat/jabbercat/issues/80. But the commentary
        is not focused on this use-case at all.
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 833 bytes
Desc: This is a digitally signed message part.
URL: <http://mail.jabber.org/pipermail/standards/attachments/20180312/01ff6abf/attachment.sig>


More information about the Standards mailing list