On Tue, 10 Mar 2026 18:47:05 +0100
Philipp Hörist <philipp(a)hoerist.com> wrote:
Hi,
Im a bit confused about begin/end
The XEP says
If a mention element of type urn:xmpp:mentions:0
or its subtypes
contains both begin and end attributes, the receiving entity MAY
use this as a hint that the specified range of the content is being
addressed to the specified occupant.
I dont think this is necessary, as its usual that the content that
follows the mention is addressed to the mentioned user.
What was missing was that we can special format the nickname or the
@admin @all etc in the GUI when we receive a message, without
hardcoding some regex or scanning for nicknames.
The 'begin' and 'end' attributes specify the range of the
specially-formatted text. It is meant to be used to, for example,
pillify text like "@room" or "@romeo". Note that there can be
multiple
mentions, and the content addressed to them isn't always what follows:
"@romeo, have you seen @juliet?" has two mentions, with ranges
specified for "@romeo" and "@juliet".
Just to be extra sure, the spec doesn't mention any special-cased "@"
character. This is just an artifact used in clients UI and should not be
observed on the wire, right?
I'm confused by the examples here.
Parameters begin and end here should not be concerned with any special
character not part of what is used to refer to the mentioned
occupant(s).
Some clients may display "@channel" as a keyword or sth but we agree
that's not what is being transmitted. It would look more like a mention
tag addressed to the channel.