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 metadata-2 spec #501

Merged
merged 60 commits into from
Sep 24, 2024
Merged

Add metadata-2 spec #501

merged 60 commits into from
Sep 24, 2024

Conversation

progval
Copy link
Contributor

@progval progval commented Jun 25, 2022

As far as I am aware, it addresses all known issues with the current deprecated metadata spec (listed in #339).

It is based on @DanielOaks' latest version, which is itself based on #339. Notable changes since dan's version are:

  • standard replies (thanks to @ValwareIRC)
  • it's now a batch type instead of old-style RPL_ENDOFxxxx
  • capability is renamed to metadata-2, since it is a breaking change compared to the deprecated spec
  • metadata keys are now vendored to avoid clashes

rendered

@progval
Copy link
Contributor Author

progval commented Jul 8, 2022

METADATA now explicitly allowed in connection-registration, so the cap does make sense now

@delthas
Copy link
Contributor

delthas commented Jul 30, 2024

When I'm joining a new channel (or receiving a join from a bouncer), I might want to wait until I've gathered all the information about a channel before displaying it. Right now I wait until RPL_ENDOFNAMES before considering the join complete and showing it.

The current spec gives 2 examples:

C: JOIN #smallchan
S: :modernclient!modernclient@example.com JOIN #smallchan
S: :irc.example.com 353 modernclient @ #smallchan :user1 user2 user3 user4 user5 ...
S: :irc.example.com 353 modernclient @ #smallchan :user51 user52 user53 user54 ...
S: :irc.example.com 353 modernclient @ #smallchan :user101 user102 user103 user104 ...
S: :irc.example.com 353 modernclient @ #smallchan :user151 user152 user153 user154 ...
S: :irc.example.com 366 modernclient #smallchan :End of /NAMES list.
S: :irc.example.com BATCH +UwZ67M metadata
S: @batch=UwZ67M :irc.example.com METADATA user2 bar * :second example value 
S: @batch=UwZ67M :irc.example.com METADATA user1 foo * :third example value
S: @batch=UwZ67M :irc.example.com METADATA user1 bar * :this is another example value
S: @batch=UwZ67M :irc.example.com METADATA user3 website * :www.example.com
...and some more metadata messages
S: :irc.example.com BATCH -UwZ67M
C: JOIN #bigchan
S: :modernclient!modernclient@example.com JOIN #bigchan
S: :irc.example.com 353 modernclient @ #bigchan :user1 user2 user3 user4 user5 ...
S: :irc.example.com 353 modernclient @ #bigchan :user51 user52 user53 user54 ...
S: :irc.example.com 353 modernclient @ #bigchan :user101 user102 user103 user104 ...
S: :irc.example.com 353 modernclient @ #bigchan :user151 user152 user153 user154 ...
S: :irc.example.com 366 modernclient #bigchan :End of /NAMES list.
S: :irc.example.com 774 modernclient #bigchan 4

Is it guaranteed that I will receive either a metadata batch or an RPL_METADATASYNCLATER on join? In which case, can I wait on either of those before considering the entire join complete? Maybe that should be made clearer in the spec?

(If it's a RPL_METADATASYNCLATER I'll probably give up waiting and show the channel immediately, then sync the contents later.)

delthas added a commit to delthas/soju that referenced this pull request Aug 27, 2024
First, this implements support for the metadata-2 specification,
work-in-progress by progval on ircv3-specifications [1].

The METADATA implementation is bouncer-only (namely, it does not
interact with any upstream METADATA).

The implementation is specific in that there are only 2 supported
keys: "pinned" and "muted". The user cannot set any other keys.
Those keys can only be "0" or "1", representing a boolean.

This enables downstreams to get/set two flags on each "message
target" (which can be either users or channels): pinned and muted.

- "pinned" is "1" when the channel should be pinned in the client,
  e.g. shown at the top of the channel list
- "muted" is "1" when the channel should be muted, e.g. have its
  notifications on non-highlights hidden

The actual specific client behavior for "pinned" and "muted" is not
defined here. This just enabels clients to get/set the flags.

[1]: ircv3/ircv3-specifications#501
@jwheare
Copy link
Member

jwheare commented Sep 21, 2024

Is this good to be merged as draft so we can encourage more implementation, and remove the confusing "deprecated" status metadata has on the website?

@progval
Copy link
Contributor Author

progval commented Sep 22, 2024

I think so, and it will make it easier to iterate with new PRs.

@jwheare jwheare merged commit 1e64318 into ircv3:master Sep 24, 2024
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.

9 participants