Commit Graph

11 Commits

Author SHA1 Message Date
gnuxie c438eca08c Fix commandUtils
Alright, they're not using the safe emitter, but neither are the
consumers.
2024-04-06 20:03:37 +01:00
Gnuxie 5414c46c36 Ban Propagation protection (that is enabled by default) (#36)
* Experimental Protection to propagate room level bans to policies.

- Needs an automated option
- I really want this to be enabled by default
- It needs to be easily configurable and very visible because it's a really useful feature.
- Need to check that they are not already banned on a policy list.
- Allow possibility to rely last message like a report behind spoiler text.

* Use MatrixDataManager for enabled protections.

This will allow us to create "enabled by default" protections
via a schema migration.

* Enable BanPropagationProtection by default

* BanPropagation: only prompt when user is not already banned.

* Test for BanPropagationProtection.

* clearTimeout for prompt reactions if we got a reaction.

* Allow renderMatrixAndSend to not need a reply.

* document getFirstEventMatching
2023-02-22 16:43:24 +00:00
David Teller 9e9b48700d This should hopefully fix some startup woes (#462)
Splitting PolicyListManager from Mjolnir, making it more resilient to startup errors
2023-01-31 20:12:04 +00:00
Gnuxie 704bb660c2 Refactor how we listen for matrix events. (#446)
* Refactor Matrix event listener in Mjolnir and ManagedMjolnir.

closes https://github.com/matrix-org/mjolnir/issues/411.

Issue #411 says that we have to be careful about room.join,
but this was before we figured how to make matrix-appservice-bridge
echo events sent by its own intents.

* Remove MatrixClientListener since it isn't actually needed.

* Protect which config values can be used for ManagedMjolnirs.

* Introduce MatrixSendClient

so listeners aren't accidentally added to a MatrixClient instead
of MatrixEmitter.

* doc

* Move provisioned mjolnir config to src/config.

This just aids maintance so whenever someone goes to change the config
of the bot they will see this and update it.

* doc for matrix intent listener.
2022-12-06 17:17:40 +00:00
David Teller e05616b327 New command !mjolnir since <date or duration> <kick | ban | show> <limit> [reason] [...rooms] (#238)
A new command `since` to affect all users who have joined a protected room since a given date.
2022-03-21 10:39:15 +01:00
David Teller 26ae55cd24 A command to show when users in a given room have joined (#225) 2022-03-07 11:34:25 +01:00
Gnuxie e52b59df6e Fix bad teardowns that hang in tests. (#202)
* Fix bad teardowns and hanging test.
2022-01-28 11:03:20 +00:00
gnuxie 4537cf0d8a Add test for ruleserver policy consumption.
Ensures that the consumer of the ruleserver rules is enforcing them.
2022-01-21 12:13:04 +00:00
gnuxie 7ee3ce1dd2 rename onReactionTo to getFirstReaction 2022-01-21 12:13:04 +00:00
gnuxie c52084c58a Stop managing client from utils and require the caller to (tests)
Specifically `onReactionTo` was starting and stopping the client
argument it was given, which could be problematic if the caller
didn't expect that or didn't want it to.
2021-10-20 11:44:25 +01:00
gnuxie 6c1a502f34 Integration tests for redaction commands.
This is important now that both timeline pagination and
how the callbacks are now awaited during pagination
have been changed.
2021-10-20 11:00:44 +01:00