matrix-org / matrix-appservice-irc

Node.js IRC bridge for Matrix
Apache License 2.0
465 stars 150 forks source link

"IRC-ify" highlights between multiple Matrix users on the IRC side. #1389

Open vaguerant opened 3 years ago

vaguerant commented 3 years ago

Is your feature request related to a problem? Please describe. In a channel with at least two Matrix users and one bridged IRC user, highlights between the two Matrix users may not reflect the nicks as they exist on the IRC side. Hypothetical example chat below.

Matrix side. Names in brackets are Matrix highlights.

Jimmy Fake Names: Hey (Dom de Plume), what's up?
Dom de Plume: Not much, (Jimmy Fake Names).
irconsiderate: Who are you even talking to?

IRC side. Note that the Matrix users' nicks are different on the IRC side to how they appear on the Matrix side.

<justsomenick> Hey Dom de Plume, what's up?
<differential> Not much, Jimmy Fake Names.
<irconsiderate> Who are you even talking to?

On the IRC side, it becomes necessary to learn to connect all Matrix users' display names to their IRC counterparts in order to follow the conversation.

Describe the solution you'd like I think highlights of Matrix users should be substituted in-place by the plaintext IRC nick equivalents when sent on the IRC side. The above conversation again, using this approach:

IRC side. Note that the highlights now make sense.

<justsomenick> Hey differential, what's up?
<differential> Not much, justsomenick.
<irconsiderate> I am in full understanding of who you are talking to.

Matrix side. Nothing has changed here except that conversation is not being impeded by (rightfully) confused IRC users.

Jimmy Fake Names: Hey (Dom de Plume), what's up?
Dom de Plume: Not much, (Jimmy Fake Names).
irconsiderate: I am in full understanding of who you are talking to.

This way, the bridge becomes transparent to IRC users: they do not need to commit any extra mental work to connecting the IRC nicks they can see to the Matrix display names they sometimes see in highlights.

Describe alternatives you've considered Well, there's the current solution which just behaves as if this isn't a problem. Personally, I'm called Vague Rant on Matrix and vaguerant on IRC, so it's not terribly confusing to IRC users when I am addressed by my Matrix name. Maybe it's reasonable to simply assume this will be the case most of the time and leave things as is, and just tell IRC users to deal with it when it isn't.

Additional context Heisenbridge has a similar issue, hifi/heisenbridge#102. The proposed solution there is to substitute intra-Matrix highlights with the mxids of users in messages from the relay bot on the IRC side. I don't believe this is practical for this project as it hits exactly the same issue as I am reporting: there is no guarantee that the mxid will match the puppeted nick on the IRC side.

hifi commented 3 years ago

Here substituting M->I and M->M mentions with IRC nicks on IRC would be the correct behavior in my opinion. I->M should also be converted back to a proper Matrix mention pill for the matching user.

vaguerant commented 3 years ago

Just had an interesting situation occur in a bridged room as a direct result of this issue. I am in an IRC channel where there is a user on the IRC side named vague. To recap, my IRC nick is vaguerant and my Matrix display name is Vague Rant.

After another Matrix user in the channel highlighted me several times, the user vague became frustrated, because the plaintext highlights for Vague Rant (a nick which does not and cannot exist on the IRC side) also trigger highlights for vague.

I didn't predict this possibility at all when first filing. Taking it even further, there is a major risk of even worse nick clashes here--a Matrix user could set their display name to be identical to the IRC nick of a different user, making any conversation originating on the Matrix side a confusing jumbled mess for all IRC users.

Mikaela commented 3 years ago

Related: https://github.com/matrix-org/matrix-appservice-irc/issues/1277

I am also possibly causing this as my Matrix display name and IRC nickname aren't related.

Mikaela commented 3 years ago

Another example discussion:

2021-199 12:30:41 EEST <AmyMalik> Michaela, any relation?
2021-199 12:31:47 EEST <Michaela> <AmyMalik "Aminda Fantomino de Rozo, any re"> to Mikaela? <redacted>
2021-199 12:32:16 EEST <AmyMalik> why does it translate Michaela to Aminda Fantomino de Rozo?