mirror of
https://github.com/matrix-org/mjolnir.git
synced 2024-09-28 20:26:02 +00:00
switch to room.event emit
This commit is contained in:
parent
ba2602f3c7
commit
0cade8dc03
@ -131,7 +131,6 @@ describe("Test: standard consequences", function() {
|
||||
});
|
||||
await this.mjolnir.enableProtection("95B1Cr");
|
||||
|
||||
await goodUser.sendMessage(protectedRoomId, {msgtype: "m.text", body: "SUwvFT"});
|
||||
let reply = new Promise(async (resolve, reject) => {
|
||||
this.mjolnir.client.on('room.message', async (roomId, event) => {
|
||||
if (event?.content?.body === "SUwvFT") {
|
||||
@ -139,7 +138,7 @@ describe("Test: standard consequences", function() {
|
||||
}
|
||||
});
|
||||
|
||||
badUser.on('room.leave', (roomId, event) => {
|
||||
this.mjolnir.client.on('room.event', (roomId, event) => {
|
||||
if (
|
||||
roomId === protectedRoomId
|
||||
&& event?.type === "m.room.member"
|
||||
@ -153,6 +152,7 @@ describe("Test: standard consequences", function() {
|
||||
}
|
||||
});
|
||||
});
|
||||
await goodUser.sendMessage(protectedRoomId, {msgtype: "m.text", body: "SUwvFT"});
|
||||
|
||||
await reply
|
||||
});
|
||||
|
Loading…
Reference in New Issue
Block a user