Skip to content

Add network icon ISUPPORT token #563

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

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

Image for: Conversation
Copy link
Contributor


## The `draft/NETWORKICON` ISUPPORT token

If a server publishes a `draft/NETWORKICON` ISUPPORT token, the value MUST be a URL to an image. The URL SHOULD use the "https" scheme.
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

should there be a way for the client to say what mime types it accepts for the image to be in?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

MIME types are one thing, image size in pixels is another one… For the latter negotiation wouldn't work, the client might want to show the icon in different places, with a different size for each one.

The Web solves this by listing all possible icons, with all formats and sizes. I've decided against this approach for this spec because:

  • It adds a whole bunch of extra complexity.
  • It's a lot of characters. URLs might be quite long.

If we really wanted to solve this, maybe advertising the URL of a JSON manifest would be better (like Web app manifests). But I don't think we actually need this complexity.

Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Something like .ico that can pack multiple sizes could work in this regard.

Copy link
Contributor Author

emersion May 15, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

.ico is a very old format, I don't think we should build on it. It's missing a lot of features one would expect from modern image formats. I don't even think my GUI framework supports it.

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

one option, to move the complexity elsewhere, would be to only support svg icons.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

My expectation is that server authors will use one of the widely supported image formats (e.g. PNG or SVG).

If format negotiation is really deemed necessary by a network, HTTP supports this feature natively already via Accept.

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think this spec should define the format and dimensions, just to keep things simple for clients. There's nothing stopping us from defining something more complex in the future if the flexibility is needed.

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I don't think this spec should leave the format entirely open-ended. If the spec allows any format, then are clients also expected to support each and every single format that could be rasterized to an image? SVG, PDF, PS, Xfig?
If we go for only HTTP icon location (which I'm not a big fan of, but anyway), then the Accept header should probably be mentioned explicitly so that clients and servers are advised to use it. And the server be required to provide at least one of (for instance) ICO, BMP, PNG. So that lightweight clients could support only these 3 formats and be assured to get the network icon, if any.

Also, FWIW, ICO format does support PNG as individual images and support alpha channel for both BMP and PNG individual images.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

+1 for using the Accept header. The server can respond with 406 if its not available in that form.

Copy link
Contributor

I think we should go with ICON, and here's why.

I absolutely agree that the icon would and in 80-90% of cases should use the same icon all over their network, however I feel like this would disallow theming of certain servers icons.

For example, if I have fire.*, water.* and ice.*, I might want to theme each icon with a background of either fire, water or ice, but with a clear print of the network name on top of the logo.

I do think it would be weird if people used completely different icons for each of their servers and I don't imagine anyone would do that anyway, but I still think this should be allowed, and, although it's technically not forbidden by this here spec proposal to use different icons on each server, the name suggests it would be and could be confusing to client developers.

I think outright forbidding different icons for different servers, either by suggestive language or by spec, limits things unnecessarily and I vote to change the token name to ICON (without a draft/ prefix since the IRC specification forbids any characters that are not specifically A-Z)

Copy link
Contributor

without a draft/ prefix since the IRC specification forbids any characters that are not specifically A-Z

I asked about this recently in #ircdocs and the predominant advice I got was that this restriction should be removed from the Modern spec.

Copy link
Member

jwheare commented May 16, 2025

Regardless of any future decision to allow draft/ in isupport, that decision has not happened yet nor even been formally proposed. So let’s continue to submit specs according to the status quo rather than desired but undecided futures.

Copy link
Member

jwheare commented May 16, 2025

I also think we go with ICON and not preempt a need to specify whether it has to be the same network wide or can differ per server. That can be up to network operators (this includes server operators, they are necessarily collaborators)

Copy link
Contributor

In one of the other proposals I seem to remember there was a {size} template variable which the client could use to scale the icon. Is this useful to client developers?

Copy link
Contributor

delthas commented May 16, 2025

In one of the other proposals I seem to remember there was a {size} template variable which the client could use to scale the icon. Is this useful to client developers?

No, images are small anyway and it is trivial to resize them client side.

Copy link
Member

jwheare commented May 16, 2025

The avatar metadata key from the registry defines an optional {size} template variable.

Clients can resize, but depending on the range of sizes, different resizing algorithms will produce variable results. A template variable would allow servers to provide e.g. a custom 16x16 icon whose pixels have been artisanally crafted.

So it can be useful, but unsure if that's desired here.

Copy link

unsolicited +1 for the {size} template variable, if not for reduced data usage then for optical sizing adjustments in particularly complex logos. i need to adjust my network's coat of arms for use at 32x32

Copy link
Contributor Author

Renamed to ICON.

Copy link
Contributor Author

Opened ircdocs/modern-irc#250 to discuss prefixes for ISUPPORT tokens.

Copy link
Contributor

I still see draft/ICON in d2daee5 (also I would personally recommend against force-pushing to spec PRs).

Copy link
Contributor Author

Yes, I have intentionally left the draft/ prefix for now.

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