-
Notifications
You must be signed in to change notification settings - Fork 151
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
Initial support for ban syncing + minor improvements and bugfixes #1807
base: develop
Are you sure you want to change the base?
Initial support for ban syncing + minor improvements and bugfixes #1807
Conversation
!cmd
!cmd
2e62550
to
70be3f3
Compare
!cmd
!cmd
This is now ready for review. |
70be3f3
to
834bfa1
Compare
!cmd
ping? |
Usually, IRC users just upload files somewhere and send a bare link, perhaps with a bit of explanation. The bridge originally did something like this for files: * f_[mtrx] uploaded an image: (20KiB) < https://matrix.org/_matrix/media/v3/download/something/some-other-thing/image.png > and something like this for code blocks: * f_[mtrx] sent a code block: https://matrix.org/_matrix/media/v3/download/something/some-other-thing That is quite unusual on IRC. This commit changes it to: <f_[mtrx]> https://matrix.org/_matrix/media/v3/download/something/some-other-thing/image.png (20KiB) <f_[mtrx]> https://matrix.org/_matrix/media/v3/download/something/some-other-thing Which is more natural. Signed-off-by: Ferass El Hafidi <[email protected]>
Signed-off-by: Ferass El Hafidi <[email protected]>
It previously was: <f_> hi everyone, what's up? I'm about to migrate some stuff today ~ a while after ~ <f_[mtrx]> <f_> "hi everyone,..." <- hi, doing great! Now it is: <f_> hi everyone, what's up? I'm about to migrate some stuff today ~ a while after ~ <f_[mtrx]> f_: "hi everyone,..." <- hi, doing great! Some IRC clients may not create a ping when the nickname is surrounded with `<` and `>`. Signed-off-by: Ferass El Hafidi <[email protected]>
when using `!cmd` IRC commands can be lowercase. Signed-off-by: Ferass El Hafidi <[email protected]>
Signed-off-by: Ferass El Hafidi <[email protected]>
834bfa1
to
f6999da
Compare
gentle ping - could anyone review this please? |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Sorry for the long wait.
I generally agree with everything, there's just a few nitpicks. Nice work!
Can we get test to selfReplyTemplate as well? Should be easy enough to cargo-cult the other ones. This would give us an excuse to cover the 4th case (the one that's currently a compilation error).
f6999da
to
2ff279a
Compare
starts with an invalid character Looks more natural to IRC users. IRC users usually add an underscore at the beginning or a "`". With that, "M24Hacker[m]" becomes "`24Hacker[m]" Signed-off-by: Ferass El Hafidi <[email protected]>
The bridge used to *not* bridge Matrix bans to IRC. As such, when someone banned an IRC user from Matrix, it would only prevent Matrix users from seeing messages coming from said user, but would not ban that user from IRC at all. This resulted in Matrix channel moderators being confused when other IRC users are reporting spam that simply isn't bridged at all as a result. This commit adds support for bridging Matrix bans to IRC. Currently, it just bans on IRC based on the IRC user's nickname, but this could change in the future, and most importantly is better than not bridging the ban at all. Signed-off-by: Ferass El Hafidi <[email protected]>
Fixes matrix-org#1521 Signed-off-by: Ferass El Hafidi <[email protected]>
2ff279a
to
9916598
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM but we're failing all sorts of tests
1ee448c
to
6d92beb
Compare
Plenty of test regressions here. Tricky to track down, since we're changing so many things at once. Test "should allow arbitrary IRC commands to be issued" fails presumably due to command casing changes in 7956631 fb0a326 changes some Matrix->IRC messages from I know it's late in the process, but I think it'd make sense to split this PR into a few smaller ones, so that the big features (like the ban syncing) don't block the minor things (like case-insensitive command handling). Not only it'll make it obvious what broke which test, it'll make the changelog much neater – we currently expect these to be a single item pointing to a single PR, and mega-PRs like this one would make it a lot trickier to process. |
2fb2bcd
to
faf7715
Compare
When someone sent a message: <f_[mtrx]> Hello? And then replied to their own message: <f_[mtrx]> > <@Funderscore:nova.astraltech.org> Hello? Hi? What would be sent on IRC would either be this: <f_[mtrx]> Hello? <f_[mtrx]> f_[mtrx]: Hi? Or: <f_[mtrx]> Hello? -- a while later -- <f_[mtrx]> f_[mtrx]: "Hello?" <- Hi? Both of which are confusing because usually nobody pings themself on IRC. This commit treats replies to self differently, and introduces a new `selfReplyTemplate` config option, so that the reply gets bridged as: <f_[mtrx]> <f_[mtrx]> Hello? <f_[mtrx]> Hi? Which is a bit more natural. Signed-off-by: Ferass El Hafidi <[email protected]>
Usually, IRC users just upload files somewhere and send a bare link, perhaps with a bit of explanation. The bridge originally did something like this for files: * f_[mtrx] uploaded an image: (20KiB) < https://matrix.org/_matrix/media/v3/download/something/some-other-thing/image.png > and something like this for code blocks: * f_[mtrx] sent a code block: https://matrix.org/_matrix/media/v3/download/something/some-other-thing That is quite unusual on IRC. This commit changes it to: <f_[mtrx]> https://matrix.org/_matrix/media/v3/download/something/some-other-thing/image.png (20KiB) <f_[mtrx]> https://matrix.org/_matrix/media/v3/download/something/some-other-thing Which is more natural. Signed-off-by: Ferass El Hafidi <[email protected]>
Signed-off-by: Ferass El Hafidi <[email protected]>
Signed-off-by: Ferass El Hafidi <[email protected]>
Signed-off-by: Ferass El Hafidi <[email protected]>
Signed-off-by: Ferass El Hafidi <[email protected]>
One linting error away and the changelog, and we should be good to go |
faf7715
to
ce800dc
Compare
Few improvements to the bridge:
Change format for bridging file uploads and codeblocks to something more natural to IRC users
For file uploads:
For code blocks:
Change default format for replies, again, to something that's a bit more natural
New format:
Handle replying to self
New format (long):
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 #1521
In
!cmd
, don't require commands be uppercaseIRC commands are, for the most part, case-insensitive. For example, with
NICK
:Or
PING
: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!