element-hq / element-meta

Shared/meta documentation and project artefacts for Element clients
65 stars 11 forks source link

Handle irc:// and ircs:// protocol #2401

Open tgr opened 2 years ago

tgr commented 2 years ago

Your use case

It would be nice if Element Web could register itself as a protocol handler for IRC protocols (irc:// / ircs://). Many people use Element as an IRC client, and this would make opening IRC links less cumbersome for them. Since there is no way to tell whether the user prefers another client for IRC, this could take the form of a register/unregister button somewhere in the settings panel.

This is complicated by the fact that a given Matrix homeserver is only bridged with some IRC networks, you can only register one domain as a handler for a given protocol (so all IRC links will be sent to one homeserver to handle), and it isn't trivial to match an IRC link (an IRC server domain/port) to an IRC network. But that seems surmountable, and the matrix.org homeserver is bridged with most major network, so it would work well enough in practice.

Have you considered any alternatives?

A shell script could be registered with the OS as the handler and could launch the link in a browser. This wouldn't require any changes in Element, and is just a few lines of code. It is well beyond the average user's ability to do, though.

Additional context

No response

t3chguy commented 2 years ago

Element has no concept of bridges, and specifically hardcoding bridges for a bunch of networks into an app with no concept of bridges (given its a generic Matrix client, not a matrix.org-specific client) is not great. Not all servers are federating and thus may not even be able to make use of the matrix.org set of bridges.

tgr commented 2 years ago

I imagine the client would consult its homeserver in some way, e.g. the homeserver would provide a map of URI prefix (scheme + authority) to Matrix room name prefix, the client could use it to provide protocol registration options to the user, and in case of the protocol being invoked it would use the prefix mapping to open the appropriate Matrix room.

t3chguy commented 2 years ago

Then this would need spec support.

RokeJulianLockhart commented 2 months ago

https://github.com/element-hq/element-meta/issues/2401

@tgr and @t3chguy, I think that modifying the specification to cater for this is a really good idea, because as https://github.com/orgs/beeper/repositories?type=source&q=bridge demonstrates, bridges are solely becoming more popular, and shall need to consume intents designed for their 1st-party counterparts at some point to implement certain functionality.