matrix-org / matrix-appservice-irc

Node.js IRC bridge for Matrix
Apache License 2.0
460 stars 149 forks source link

Bridge improvements and bug fixing #1807

Open funderscore1 opened 2 weeks ago

funderscore1 commented 2 weeks ago

Few improvements to the bridge:

Change format for bridging file uploads and codeblocks to something more natural to IRC users For file uploads:

<f_[mtrx]> https://matrix.org/_matrix/media/v3/download/something/some-other-thing/image.png (20KiB)

For code blocks:

<f_[mtrx]> https://matrix.org/_matrix/media/v3/download/something/some-other-thing

Change default format for replies, again, to something that's a bit more natural New format:

<f_[mtrx]> f_: "hi everyone!..." <- hi!

Handle replying to self New format (long):

<f_[mtrx]> <f_[mtrx]> what is this
<f_[mtrx]> ^

Use "`" instead of an "M" when the nick starts with an invalid character This is more in-line with what a usual IRC user would do, and less noticeable.

Fix bug when replying to a long message See https://github.com/matrix-org/matrix-appservice-irc/issues/1521

In !cmd, don't require commands be uppercase IRC commands are, for the most part, case-insensitive. For example, with NICK:

NICK funderscore1
:funderscore123!~0@4G4AABC5T.tor-irc.dnsbl.oftc.net NICK :funderscore1
nick funderscore12
:funderscore1!~0@4G4AABC5T.tor-irc.dnsbl.oftc.net NICK :funderscore12
Nick funderscore1
:funderscore12!~0@4G4AABC5T.tor-irc.dnsbl.oftc.net NICK :funderscore1
NIcK funderscore12
:funderscore1!~0@4G4AABC5T.tor-irc.dnsbl.oftc.net NICK :funderscore12

Or PING:

Ping :D
:helix.oftc.net PONG helix.oftc.net :D
PING :D
:helix.oftc.net PONG helix.oftc.net :D
pIng :D
:helix.oftc.net PONG helix.oftc.net :D
ping :D
:helix.oftc.net PONG helix.oftc.net :D

Fix a formatting issue in !help

Doesn't need much explanation.

Initial support for bridging Matrix bans to IRC

This is the big one. The bridge used to treat matrix bans as kicks, thus only kick the IRC user that has been banned on Matrix.

This resulted in IRC users still annoying other IRC users while the Matrix side didn't notice anything at all.

Now, matrix bans are bridged as /mode +b ${nick}!*@* and /kick ${nick}. Unbanning is still unimplemented, so moderators will need to manually send a raw command to the admin room: !cmd mode #channel -b ${nick}!*@*.


Feedback welcome!

funderscore1 commented 2 weeks ago

This is now ready for review.