Commit Graph

546 Commits

Author SHA1 Message Date
gnuxie 4283905b34 I don't like this solution
`details` and `summary` being put into html in markdown is unacceptable
regardless of whether popular implementations support it.
Plain text client will not lol.

What's being asked for is detail/summary on category of commands.
That can only really happen once Synapse admin commands are all grouped
together into one table.
2023-03-07 19:59:08 +00:00
Gnuxie e2c689c668 Add who banned the user to the ban propagation protection. (#37) 2023-03-07 15:08:21 +00: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
JokerGermany 00645463c7 Don't recommend uppercase shortcodes, when mjolnir doesn't like them. (#31) 2023-02-21 21:04:28 +00:00
Catalan Lover e3c33743fc Change all instances of Mjolnir/mjolnir with Draupnir/draupnir. (#35)
Also changes Mjölnir instances to Draupnir.
2023-02-21 21:03:12 +00:00
Val Lorentz a83e077fd3 Fix link to Mjolnir 2023-02-20 22:50:13 +00:00
gnuxie 0620bb1db7 Tag information missing when creating version.txt in CI. 2023-02-20 20:10:54 +00:00
gnuxie 64e721d690 v1.80.1 v1.80.1 2023-02-20 20:05:37 +00:00
gnuxie ec83d5625f We added an any presentation type with no subtype semantics...
This broke presentation renderers since `any` doesn't have a renderer
and it would match every presentation type. So anything that needed
rendering would try to be rendered as `any` which sucks.
Not sure what the semantics would be yet but we don't have to worry
for now.
2023-02-20 19:47:26 +00:00
gnuxie 12e124e1a6 Add noImplicitThis to .tsconfig. 2023-02-20 19:47:26 +00:00
gnuxie 8dddf5a390 Ban wasn't using implicit this for finding a matrix client. 2023-02-20 19:47:26 +00:00
Aminda Suomalainen e57834fe1d add .gitattributes & .editorconfig (#25)
The `.gitattributes` configuration requires everything that is detected as text to have `lf` line endings even when checked out.

The [`.editorconfig` configures capable text editors](https://editorconfig.org/#pre-installed) to

* use `lf` line endings
* remove trailing whitespace (with the exception of markdown files where it's valid way to end a paragraph?)
* insert a newline at end of file
* use the utf-8 charset
* use 4 spaces for indenting (instead of tabs)

while within this repository.

Signed-off-by: Aminda Suomalainen
Signed-off-by: Aminda Suomalainen <suomalainen+git@mikaela.info>
2023-02-14 12:19:36 +00:00
gnuxie 5e2a175645 v1.80.0 v1.80.0 2023-02-11 20:57:39 +00:00
gnuxie 88f711b8f4 Update yarn:version to account for pre-releases. 2023-02-11 20:57:35 +00:00
gnuxie 8cad6a6b81 Update project status in README.md. 2023-02-11 20:47:33 +00:00
gnuxie 7178b01dbb Do not touch version.txt if generating the version fails. 2023-02-11 20:16:30 +00:00
gnuxie acc7b59a33 Github actions should generate version.txt. 2023-02-11 15:59:50 +00:00
gnuxie fea67c3821 Use package.json version if version.txt is missing. 2023-02-11 15:59:50 +00:00
gnuxie b7139b398c Move version.txt to project top level. 2023-02-11 14:20:46 +00:00
gnuxie 72b7e1161c Migrate status protection to interface-manager.
This is required because it was piggy backing `status` previously.
Protections should be able to have their own command tables https://github.com/Gnuxie/Draupnir/issues/21.
2023-02-11 14:20:46 +00:00
gnuxie cd9230dcda Add 'any' presentation type for the status protection command. 2023-02-11 14:20:46 +00:00
gnuxie 079f0dfcab Make rules and rules matching use interface-manager. 2023-02-11 14:20:46 +00:00
gnuxie 728ed1c0e5 Fix DeadDocumentMatrix calculating pages incorrectly. 2023-02-11 14:20:46 +00:00
gnuxie 8ec4988385 Support threaded replies in DeadDocumentMatrix. 2023-02-11 14:20:46 +00:00
gnuxie 6b9e7a8dec Basic Command Help for new commands. 2023-02-11 14:20:46 +00:00
gnuxie 8157bae07a Migrate status command to use interface-manager. 2023-02-11 14:20:46 +00:00
gnuxie 31a5ee08c7 Allow null to be used in CommandResult.
We didn't have anything to represent no value before and this
was needed to support the legacy `status protection` command.
2023-02-11 14:20:46 +00:00
gnuxie c851ab1011 Stop matching newline at end of version file. 2023-02-11 14:20:46 +00:00
gnuxie d92c8582cd make DeadDocumentMarkdown keep count of li in unordered lists. 2023-02-11 14:20:46 +00:00
gnuxie 9ab0b5149b Fix DeadDocument FringeWalker calling commit on pre nodes. 2023-02-11 14:20:46 +00:00
gnuxie ddba23f323 Interning a sub-command would overwrite the parent command. 2023-02-11 14:20:46 +00:00
gnuxie c2f185cf92 Add root nodes to commands that were missing them. 2023-02-11 14:20:46 +00:00
gnuxie fa5c47cc1a Introduce Root tag to go with Fragment. 2023-02-11 14:20:46 +00:00
gnuxie b59247df61 Allow fragments to be used in DeadDocument.
They work like React.Fragment except we don't have components yet
so it has to be a special node.
2023-02-11 14:20:46 +00:00
gnuxie cbddf71ebe Include version information in !draupnir status. 2023-02-11 14:20:46 +00:00
gnuxie 58ebc39c03 v1.80.0-beta.0 v1.80.0-beta.0 2023-02-08 15:25:13 +00:00
gnuxie ce44e6259a update CONTRIBUTING. 2023-02-08 15:11:24 +00:00
gnuxie 4f1781e31b Rename the bot from Mjolnir to Draupnir in the documentation
Following through with this everywhere will take a lot of time.
2023-02-08 15:04:42 +00:00
jesopo 71e0958505 fix 2 issues in !config get 2023-02-08 13:11:07 +00:00
gnuxie 1257b26306 Rename Parmater Parameter
Yeah don't ask.
2023-02-08 13:10:49 +00:00
Gnuxie c936332442 Ban/Unban rework + Prompts for missing arguments (#12)
* basic ban conversion, but i have better ideas

* Still very WIP on CLIM prompt-for-accept semantics.

* Introduce promotable streams.

This allows parameters to specify details to prompt for missing
arguments
and allow for interactive commands.

* Changes that were made before PolicyListManager that no longer make sense

We don't want the default list anymore since we're just going to prompt
with the lists that they can choose from.

* Fix semantics of TagDynamicEnvironment.

Bind and write were wrong and bind was binding to the node name
instead of the variable name.

* The JSX factory can render presentation types to DocumentNodes, unsure if this is the right
move yet but it works

* Attributes for anchor nodes now render properly

* Ban command prompts are working!!!!

* Stub AppserviceBotEmitter.

There isn't much we can do right now until there is time to work on
https://github.com/Gnuxie/Draupnir/issues/13.

* Combine ban/unban syntax.

* Remove old UnbanBanCommands.

WARNING: There is a major difference in that the ban command no longer supports
globs, I don't think?

* Activate new unban command.

* The presentation type boolean will have to be just a string for now.

I don't think it makes sense to read them into actual booleans.

* configurable defaults for ban reason.
2023-02-08 12:50:23 +00:00
Gnuxie 0d4864ed26 Merge pull request #5 from Gnuxie/gnuxie/policy-list-manager
Incorperate Mjolnir's new Policy List Manager

- https://github.com/matrix-org/mjolnir/pull/462
- https://github.com/matrix-org/mjolnir/pull/463
2023-01-31 20:23:08 +00:00
gnuxie 9797e32b5e Make MatrixRoomReference.joinClient return a new MatrixRoomReference. 2023-01-31 20:16:28 +00:00
gnuxie e293cecd7b Extract PolicyListManager from PolicyList to its own file. 2023-01-31 20:16:28 +00:00
gnuxie 7de7a1f506 Fail early when PolicyManager cannot resolve alias.
as per https://github.com/matrix-org/mjolnir/issues/404.
2023-01-31 20:13:52 +00:00
David Teller 9b08b51dac PolicyListManager: Let's not forget to remove the room also from the set of rooms we failed to resolve (#463) 2023-01-31 20:12:06 +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 ad1e7cfac8 Merge pull request #9 from Gnuxie/gnuxie/errors
Improve errors caused by HTTP requests and stop alarm fatigue.
2023-01-31 20:07:17 +00:00
gnuxie 5164e48149 Rename MakeRoomAdminCommand to HijackRoomCommand 2023-01-31 20:00:14 +00:00
gnuxie 72f554ef2e Improve HTTP Error handling.
So as a history lesson.
The Matrix Bot SDK uses the npm library "requests".
When there was a http error, matrix-bot-sdk
would literally throw the response object.
This would be a horrible 1000+line long thing to accidentally
be logged to the console via node's inspect.
Though it was inevitable since you can't be sure every catch
was handling the error correctly. Irregardless, the solution
developed at Element was to create an error object
that had concise details.
This was great, however, within the matrix-bot-sdk there is
[this](https://github.com/Half-Shot/matrix-bot-sdk/blob/f58d7ea6e24d1db8b9b8009dea4cd97cbff54d0c/src/http.ts#L66)
awful line of code which logs every http error as error using the
matrix-bot-sdk logger.
This wastes so much log space and causes alarm fatigue,
rather than muting the module, the action instead taken
was to redact stack traces from http errors.
This was not a good idea.
Eventually matrix-bot-sdk was updated to have a MatrixError type
when a request was performed via the client-server api that had an
error.
matrix-appservice-bridge depends upon this and so Mjolnir now needs
to be updated to throw MatrixError's.
We have gone a step further in this commit and also muted
the matrix-bot-sdk http module, to stop the alarm fatigue problem
https://github.com/turt2live/matrix-bot-sdk/pull/158
2023-01-31 19:57:56 +00:00