It's implied that capability names shouldn't start with a -, but not explicitly specified. Capability names "MUST" be treated as opaque identifiers. However, any possibility of a capability name that starts with - at all introduces ambiguity at the parsing step, and disallows simple solutions like if cap_name.startswith('-') and real_cap = cap_name.lstrip('-'). This patch proposes a formal prohibition on - as the first character of a capability name.
None of the CAP names listed in the IRCv3 registry have leading hyphens, nor have I ever seen a draft/ or vendor/ CAP name with one. The impact of this change on any live code should be nonexistent outside of (as a fellow developer put it) hypothetical "particularly antisocial" capability names in private use, not submitted to the registry.
Notes
Including myself, fellow developers working on upgrading our bot client's capability negotiation skills, and third parties we consulted along the way, at least half of the group (roughly 6-7 people) believed a leading hyphen is technically allowed by the current spec as written. I hope this revision removes all doubt that it was never intended to be permissible.
It's implied that capability names shouldn't start with a
-
, but not explicitly specified. Capability names "MUST" be treated as opaque identifiers. However, any possibility of a capability name that starts with-
at all introduces ambiguity at the parsing step, and disallows simple solutions likeif cap_name.startswith('-')
andreal_cap = cap_name.lstrip('-')
. This patch proposes a formal prohibition on-
as the first character of a capability name.None of the CAP names listed in the IRCv3 registry have leading hyphens, nor have I ever seen a
draft/
orvendor/
CAP name with one. The impact of this change on any live code should be nonexistent outside of (as a fellow developer put it) hypothetical "particularly antisocial" capability names in private use, not submitted to the registry.Notes
Including myself, fellow developers working on upgrading our bot client's capability negotiation skills, and third parties we consulted along the way, at least half of the group (roughly 6-7 people) believed a leading hyphen is technically allowed by the current spec as written. I hope this revision removes all doubt that it was never intended to be permissible.