Conversation
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 <vitali64pmemail@protonmail.com>
Signed-off-by: Ferass El Hafidi <vitali64pmemail@protonmail.com>
|
Looks good to me, and I've heard it's been successfully running on pixie.town for a while. |
Half-Shot
left a comment
There was a problem hiding this comment.
This is fine, but this isn't ban syncing. This needs to handle the case of unbanning too, or at the very least some technical documentation to explain why we don't do that.
And actually I'd love some documentation on our docs site on what users can expect from kicks / bans.
| }); | ||
|
|
||
|
|
||
| describe("Banning", () => { |
There was a problem hiding this comment.
file says kicking
test says banning
new test file time?
There was a problem hiding this comment.
How about renaming kicking.spec.js to kicking-banning.spec.js? I think they go well in one file.
| if (ircRooms[i].server.domain !== server.domain) { | ||
| return; | ||
| } | ||
| senderClient.ban(bannedNick, ircRooms[i].channel); |
There was a problem hiding this comment.
Do we need to await either of these?
There was a problem hiding this comment.
Because you're doing two operations here, and I'm not sure if one should proceed if the other fails? At the very least, run them both concurrently but await the result so we can throw an error. Node typically crashes the process these days if a unawaited promise throws.
There was a problem hiding this comment.
I think if +b fails (not sure why it would) and /kick works that's better than if it fails and /kick isn't ran because of that.
| this.log.debug("Banning %s from channel %s", nick, channel); | ||
|
|
||
| // best effort ban | ||
| await c.send("MODE", channel, "+b", nick + "!*@*"); |
There was a problem hiding this comment.
I'm always a bit skeptical about these. I presume we're sure this is reasonably implementation independent.
We don't want to offer a ban command config option or anything like that?
There was a problem hiding this comment.
Why would this be implementation dependent?
There was a problem hiding this comment.
I'd love to know how we could offer ban config when banning from Matrix.
| await this.matrixHandler.onLeave(request, memberEvent, target); | ||
| } | ||
| } | ||
| else if (event.content.membership === "ban") { |
There was a problem hiding this comment.
Not implemented because I didn't wrap my head on how unbanning works on Matrix and how to check that.
|
I think this could nicely be supplemented with an Afaik removing a ban on the matrix side consists of the user's |
@f0x52 I'll look into that, thanks |
Split off from #1807, credit to @funderscore1