Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add named-modes specification #484

Open
wants to merge 9 commits into
base: master
Choose a base branch
from
Open

Conversation

progval
Copy link
Contributor

@progval progval commented Dec 13, 2021

This is a spec that has been in the making for a while, and it's finally ready for review.

It is inspired by InspIRCd's namedmode module, though they are unfortunately not compatible.

In terms of implementation, I wrote a proof-of-concept as a third-party InspIRCd 4 module that I hope to productionize when this draft is accepted.

Finally, as this is a pretty complicated spec, please avoid sending copyediting comments right away, this is probably going to be a very long thread with many changes.

rendered view

@progval
Copy link
Contributor Author

progval commented Dec 13, 2021

A possible change: currently, the RPL_LISTPROPLIST syntax is like this:

RPL_LISTPROPLIST <nick> <channel> <modename> <mask> [<setter> <settime>]

to mirror the existing behavior, and to make it easier to handle optional parameters.

However, if we change it to this:

RPL_LISTPROPLIST <nick> <channel> <modename> [<setter> <settime>] <mask>

It would allow spaces in the mask, as it is always the trailing parameter

I don't want to do allow spaces in this spec (to make it easy to convert to MODE), but we may want to change this order so that we can easily allow spaces later in a new spec.

What do you think?

Co-authored-by: James Wheare <[email protected]>
extensions/named-modes.md Outdated Show resolved Hide resolved
extensions/named-modes.md Outdated Show resolved Hide resolved
Co-authored-by: James Wheare <[email protected]>
@slingamn
Copy link
Contributor

Any thoughts on requiring that servers MUST translate MODE to PROP for clients that have enabled the capability? This opens up the possibility of future greenfield clients that don't know about MODE at all.

@progval
Copy link
Contributor Author

progval commented Dec 13, 2021

@slingamn maybe a separate cap to allow gradual upgrades?

@progval
Copy link
Contributor Author

progval commented Dec 14, 2021

On second thought, nevermind. We don't need one more moving part.

@slingamn
Copy link
Contributor

Here's an edgy take: I think we should preemptively make this specification syntactically tolerant of spaces in mode parameters. (They can still be semantically disallowed, especially for named modes that are the equivalent of an RFC1459 mode.)

"Non-final parameters" are an ever-flowing wellspring of correctness issues. The backwards compatibility issues don't seem too bad: since the MODE parameters to +k and +b can already be sent by clients as IRC final parameters, server implementations already need to validate them to ensure that they don't contain spaces.

@emersion might have been joking but at one point he suggested using the tag value escaping syntax for this. What if we required all mode parameters --- in RPL_PROPLIST, RPL_LISTPROPLIST, and PROP --- to be tag-value-escaped?

@grawity
Copy link
Contributor

grawity commented Dec 16, 2021

@emersion might have been joking but at one point he suggested using the tag value escaping syntax for this. What if we required all mode parameters --- in RPL_PROPLIST, RPL_LISTPROPLIST, and PROP --- to be tag-value-escaped?

Sounds like an interesting idea. I would actually like the entire wire protocol to move towards something like that, leaving the :trailing wart in history.

@progval
Copy link
Contributor Author

progval commented Dec 20, 2021

What about a single PROP change per line, so we can always use the space character instead? It can simplify implementations on both ends and doesn't have much of an overhead

@slingamn
Copy link
Contributor

slingamn commented Feb 4, 2022

I don't have strong feelings about this but it seems suboptimal.

I feel like everyone who would implement this has ready access to a tag-value (un)escaping implementation, no?

@progval
Copy link
Contributor Author

progval commented Feb 5, 2022

It mostly just "feels wrong" to me. But why not. It may not be usable as-is everywhere though; as current implementations can assume serialized values don't contain ;, but that's a minor change to make.

Though I also like "single PROP change per line" because it simplifies implementations on both ends.

No strong opinion either way.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants