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

Casemapping (RFC 3454) does not work for channel names #41

Open
mk-fg opened this issue Dec 12, 2022 · 2 comments
Open

Casemapping (RFC 3454) does not work for channel names #41

mk-fg opened this issue Dec 12, 2022 · 2 comments
Labels
bug Something isn't working

Comments

@mk-fg
Copy link
Contributor

mk-fg commented Dec 12, 2022

Hi,

Trying to use matrix2051 with ZNC-ERC bouncer-client combination, immediately bumped into error notice like following when sending message from client in a channel listed as !RrkYlRwPmZqHGhPFvf:foss.wtf:
[11:13:07] -server.- Error while sending message: {:room_not_found, "!rrkylrwpmzqhghpfvf:foss.wtf"}

I think the issue might be lack of casemapping for channel names, which client expects, but server does not seem to implement, since afaik on IRC !RrkYlRwPmZqHGhPFvf:foss.wtf and !rrkylrwpmzqhghpfvf:foss.wtf channel/user names should generally be equivalent.

matrix2051 advertises CASEMAPPING=rfc3454 in particular, which explicitly includes ASCII letters (listed at the start of B2/B3 appendixes there) and I think should be backwards-compatible in this case, even if client reads this as CASEMAPPING=ascii.

I'm not sure if there is an option to not support any case-mapping on IRC, as at least in ERC client, any unknown/missing CASEMAPPING values fallback to RFC 1459, which maps ascii letters + some non-letter characters, and there's no "none" option supported.

To report it more strictly:

  • What I did: tried sending message (any content) to a matrix channel !RrkYlRwPmZqHGhPFvf:foss.wtf, with ascii upper/lower-case letters in its name, from an ERC client (built into emacs text editor).

  • Expected result: message gets dispatched over Matrix protocol with no errors and can be seen in the channel there.

  • Actual result: [11:13:07] -server.- Error while sending message: {:room_not_found, "!rrkylrwpmzqhghpfvf:foss.wtf"} notice in response, message cannot be seen in Matrix channel.

  • Steps to reproduce:

    • Create any non-encrypted private channel, its name will almost certainly contain mixed-case letters in matrix2051 representation.

    • Use client that maps IRC names internally to some "canonical" representation using casemapping and resulting mapped names, or otherwise send PRIVMSG IRC command with channel name in all-upper/lower-case.

      For example, following command can be used in clients for testing: /msg <lowercase-chan-name> test

    • Note error notice in response instead of successful message send.

Wasn't able to find this reported under Issues from a quick look and search.
(if it is, maybe can include more keywords/info in the title)

Thanks.

@mk-fg
Copy link
Contributor Author

mk-fg commented Dec 12, 2022

Also, in rare case that anyone might stumble upon this issue specifically because of ERC keyword, with this ircd or others, simple workaround (disabling casemapping for channels entirely) can be:

(defun erc-add-default-channel-downcase-fix (old-func channel)
  (push channel erc-default-recipients))
(advice-add 'erc-add-default-channel :around #'erc-add-default-channel-downcase-fix)

Or with additional (if (not (string-search ":" channel)) (funcall old-func channel) ...) check if this should be limited to matrix2051 channels, which I think should always have : in their names, which is seldom used in these otherwise.

@progval progval added the bug Something isn't working label Dec 12, 2022
@progval
Copy link
Owner

progval commented Dec 12, 2022

another possible workaround is to set a canonical alias for the Matrix room and use that instead of the room id.

@mk-fg mk-fg mentioned this issue Dec 21, 2022
10 tasks
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants