Commit Graph

791 Commits

Author SHA1 Message Date
gnuxie 41db3392df Stop throwing in Draupnir['makeDraupnirBot'] 2024-04-06 20:03:36 +01:00
gnuxie 8044a78fa6 Fix reportPollerTest (it works!) 2024-04-06 20:03:36 +01:00
gnuxie 2198c34b55 Chore: please typescript in abuseReportTest. 2024-04-06 20:03:36 +01:00
gnuxie 28d220142e Chore: Delete random crap that was accidentally comitted sometime 2024-04-06 20:03:36 +01:00
gnuxie 380f4b1a77 Update for ClientsInRoomsMap rework (MPS). 2024-04-06 20:03:36 +01:00
gnuxie c1215ab045 Create a test/tsconfig.json.
We then run this as part of the build step, then run tsc with the
original project file to get the side effect of emitting the source
files. Since the `test/tsconfig.json` has `noEmit: true`.
2024-04-06 20:03:36 +01:00
gnuxie 0dc7c84afd Fix BanPropagationProtectionTest (it works!)
However, it does hang because something is sat on the event loop,
i can't find out what yet.
2024-04-06 20:03:36 +01:00
gnuxie 70d0cec695 Typo in RoomUpdateError
We really need a way to type the embedded expressions within JSX to
stop this happening, aswell as accidentally passing `undefined`.
2024-04-06 20:03:36 +01:00
gnuxie 2fe1ad1f37 Fix renderSetMembershipBans - it wasn't finished. 2024-04-06 20:03:36 +01:00
gnuxie e16e6b9fbf Give roomJoiner to MjolnirWatchedListsConfig (MPS). 2024-04-06 20:03:36 +01:00
gnuxie dba3aefca3 Fix acceptInviteFromSpaceTest. (it works!) 2024-04-06 20:03:36 +01:00
gnuxie e17ebe1ff0 Fix abuseReportTest (it works!). 2024-04-06 20:03:36 +01:00
gnuxie 0d87c687fe Restrict ReportManager's reaction listsener to management room. 2024-04-06 20:03:36 +01:00
gnuxie 91358af874 Fix bug where report manager was only being shown 'm.room.message' 2024-04-06 20:03:36 +01:00
gnuxie 5a991897dc Fix Draupnir's joinOnInviteListener. 2024-04-06 20:03:36 +01:00
gnuxie d718967a7c Fix hello test (it works).
Ok so this is pretty shit, i hate the integration test suite now.

The reason why we return the test functions with `as any` in the
hello test is because we had to remove `Record<string, any>` from
mocha's test context interface, otherwise the interface would
have been completely useless. Maybe there is a ts setting though
to not infer any from `this` at all? and just ignore those properties.

The tsconfig.json situation is a bit weird, i don't understand why
it's in this situation. However, it seems like we can try to
https://github.com/jaredpalmer/tsdx/issues/84#issuecomment-489690504
use this workaround so that ts language features work in the test
directory.

I think we should focus on doing as little effort as possible getting
these tests into working condition. If something is too complicated,
it will need removing. If we need to make additional tests,
this entire integration tests directory should be moved
to a legacy-integration directory and we can start afresh.

We should also ideally not integration tests as much as possible
and try to reuse the unit helpers from MPS.
This is even going to be critical later on.
2024-04-06 20:03:36 +01:00
gnuxie cc97c8550e Naively fix appservice integration tests. 2024-04-06 20:03:36 +01:00
gnuxie 3eb3bae085 Instantiate web apis in an appropriate place. 2024-04-06 20:03:36 +01:00
gnuxie e05e55ef94 Fix bug where poller only showed reports from protected rooms.
Was introduced in https://github.com/matrix-org/mjolnir/pull/371
for whatever reason.
2024-04-06 20:03:36 +01:00
gnuxie bc673927e3 Typo in status command. 2024-04-06 20:03:35 +01:00
gnuxie 10905a0b29 Only inform protected rooms set of protected rooms. 2024-04-06 20:03:35 +01:00
gnuxie b5cc239325 Missing root node on consequence renderer. 2024-04-06 20:03:35 +01:00
gnuxie c190753e1d Enable MPS's Member/ServerBanSynchronisationProtections by default. 2024-04-06 20:03:35 +01:00
gnuxie 2f8215761c Load Draupnir protections in the DraupnirProtectedRoomsSet. 2024-04-06 20:03:35 +01:00
gnuxie 89ee808f6a Change leftover references to matrix-bot-sdk UserID.
These should now reference the MPS equivalent.
2024-04-06 20:03:35 +01:00
gnuxie 0c2d391ff4 Fix inverted boolean logic in CommandReader.
We couldn't read room references.
2024-04-06 20:03:35 +01:00
gnuxie b1dbfbba22 use MPS ClientPlatform to use preemptive joiner in Rooms commands. 2024-04-06 20:03:35 +01:00
gnuxie 426879fb68 Give commands access to MPS ClientPlatform. 2024-04-06 20:03:35 +01:00
gnuxie 4366a6df46 MPS ActionError['addContext'] got renamed to elaborate. 2024-04-06 20:03:35 +01:00
gnuxie 7aca44167f Fix: wrong event type was being given for watched policy lists data. 2024-04-06 20:03:35 +01:00
gnuxie b8606ce073 Make CreateBanListCommand consistent with Mjolnir again.
This was changed during MPS work, it won't work like this anyways,
since we need the alias name, not the fully qualified alias.
2024-04-06 20:03:35 +01:00
gnuxie bf6f27e079 Fix StatusCommand accidentally returning a promise. 2024-04-06 20:03:35 +01:00
gnuxie 73f2910b8e Stop stripping prefixes in CommandHandler, they're already stripped. 2024-04-06 20:03:35 +01:00
gnuxie ac4c447637 Start client in manual launch script.
Not doing this would just cause draupnir to exit.
2024-04-06 20:03:35 +01:00
gnuxie 9658f39769 Add <span> to DeadDocument. 2024-04-06 20:03:35 +01:00
gnuxie 34114353a8 Update for MPS ProtectionFailedToStartCB changing.
We added the protectionName to the callback.
2024-04-06 20:03:35 +01:00
gnuxie 5c61bc2626 Make errors more obvious at Draupnir MPS startup. 2024-04-06 20:03:35 +01:00
gnuxie 1d94599c68 Ensure sure we join the management room at startup. 2024-04-06 20:03:35 +01:00
gnuxie 7128e3f10c Update for changes to Mjolnir AccountData in MPS. 2024-04-06 20:03:35 +01:00
gnuxie fdc396c386 Fix missing designators in protections and power level commands. 2024-04-06 20:03:35 +01:00
gnuxie 8dadea7532 Fix inverted boolean expression for validating managementRoomID. 2024-04-06 20:03:35 +01:00
gnuxie c6f198303d Start fixes to dev environment 2024-04-06 20:03:35 +01:00
gnuxie 1a37134459 Ensure the enabled BanPropagationProtection by default (MPS).
We needed to add support that enabled this into MPS.
the `MatrixDataManager` has been removed because it is
redundant with the `SchemedDataManager` from MPS.
2024-04-06 20:03:35 +01:00
gnuxie a21f2682d3 Update for MPS's removal of StateTrackingMeta. 2024-04-06 20:03:35 +01:00
gnuxie 46ae7c24c6 Update DefaultTrackingMeta switching packages in MPS. 2024-04-06 20:03:35 +01:00
gnuxie ea4cdd0dda Web API's use MPS event and room IDs.
Still need to figure out the plumbing of starting this and the report poller
in integration tests and from index without being started from Draupnir's class.
2024-04-06 20:03:34 +01:00
gnuxie 3050fc6f22 Remove event emitter from ReportManager. 2024-04-06 20:03:34 +01:00
gnuxie 069dec2b9d Update for MPS 0.9.1. 2024-04-06 20:03:34 +01:00
gnuxie 1884e1b456 Hook the appservice bot into the reaction handler for prompts. 2024-04-06 20:03:34 +01:00
gnuxie fb8f76906b PromptForAccept refactor.
We had to change the old prompt for accept since it depended on the matrix emitter.
In order to remove the dependence on the event emitter, then we had to get
rid of the entire continuation which waits for the prompt and make it entirely
event driven instead.

Changes made while here were also emoji for numbres and no longer having timeout
for prompt arguments.
2024-04-06 20:03:34 +01:00