mirror of
https://github.com/matrix-org/mjolnir.git
synced 2024-10-01 01:36:06 -04:00
Make sure we stop clients after they have started, not before.
Yeah it's a long story.
This commit is contained in:
parent
17a1d02af8
commit
f481ec84d3
@ -33,7 +33,7 @@ import { getFirstReaction } from "./commandUtils";
|
|||||||
await badUser.sendMessage(targetRoom, {msgtype: 'm.text', body: "Very Bad Stuff"});
|
await badUser.sendMessage(targetRoom, {msgtype: 'm.text', body: "Very Bad Stuff"});
|
||||||
|
|
||||||
try {
|
try {
|
||||||
moderator.start();
|
await moderator.start();
|
||||||
await getFirstReaction(moderator, this.mjolnir.managementRoomId, '✅', async () => {
|
await getFirstReaction(moderator, this.mjolnir.managementRoomId, '✅', async () => {
|
||||||
return await moderator.sendMessage(this.mjolnir.managementRoomId, { msgtype: 'm.text', body: `!mjolnir redact ${badUserId} ${targetRoom}` });
|
return await moderator.sendMessage(this.mjolnir.managementRoomId, { msgtype: 'm.text', body: `!mjolnir redact ${badUserId} ${targetRoom}` });
|
||||||
});
|
});
|
||||||
@ -80,7 +80,7 @@ import { getFirstReaction } from "./commandUtils";
|
|||||||
}
|
}
|
||||||
|
|
||||||
try {
|
try {
|
||||||
moderator.start();
|
await moderator.start();
|
||||||
await getFirstReaction(moderator, this.mjolnir.managementRoomId, '✅', async () => {
|
await getFirstReaction(moderator, this.mjolnir.managementRoomId, '✅', async () => {
|
||||||
return await moderator.sendMessage(this.mjolnir.managementRoomId, { msgtype: 'm.text', body: `!mjolnir redact ${badUserId}` });
|
return await moderator.sendMessage(this.mjolnir.managementRoomId, { msgtype: 'm.text', body: `!mjolnir redact ${badUserId}` });
|
||||||
});
|
});
|
||||||
@ -116,7 +116,7 @@ import { getFirstReaction } from "./commandUtils";
|
|||||||
let eventToRedact = await badUser.sendMessage(targetRoom, {msgtype: 'm.text', body: "Very Bad Stuff"});
|
let eventToRedact = await badUser.sendMessage(targetRoom, {msgtype: 'm.text', body: "Very Bad Stuff"});
|
||||||
|
|
||||||
try {
|
try {
|
||||||
moderator.start();
|
await moderator.start();
|
||||||
await getFirstReaction(moderator, this.mjolnir.managementRoomId, '✅', async () => {
|
await getFirstReaction(moderator, this.mjolnir.managementRoomId, '✅', async () => {
|
||||||
return await moderator.sendMessage(this.mjolnir.managementRoomId, {msgtype: 'm.text', body: `!mjolnir redact https://matrix.to/#/${encodeURIComponent(targetRoom)}/${encodeURIComponent(eventToRedact)}`});
|
return await moderator.sendMessage(this.mjolnir.managementRoomId, {msgtype: 'm.text', body: `!mjolnir redact https://matrix.to/#/${encodeURIComponent(targetRoom)}/${encodeURIComponent(eventToRedact)}`});
|
||||||
});
|
});
|
||||||
|
@ -50,7 +50,7 @@ describe("Test: Mjolnir can still sync and respond to commands while throttled",
|
|||||||
await Promise.all([...Array(50).keys()].map((i) => badUser.sendMessage(targetRoom, {msgtype: 'm.text.', body: `Bad Message #${i}`})));
|
await Promise.all([...Array(50).keys()].map((i) => badUser.sendMessage(targetRoom, {msgtype: 'm.text.', body: `Bad Message #${i}`})));
|
||||||
|
|
||||||
try {
|
try {
|
||||||
moderator.start();
|
await moderator.start();
|
||||||
await getFirstReaction(moderator, this.mjolnir.managementRoomId, '✅', async () => {
|
await getFirstReaction(moderator, this.mjolnir.managementRoomId, '✅', async () => {
|
||||||
return await moderator.sendMessage(this.mjolnir.managementRoomId, { msgtype: 'm.text', body: `!mjolnir redact ${badUserId} ${targetRoom}` });
|
return await moderator.sendMessage(this.mjolnir.managementRoomId, { msgtype: 'm.text', body: `!mjolnir redact ${badUserId} ${targetRoom}` });
|
||||||
});
|
});
|
||||||
|
Loading…
Reference in New Issue
Block a user