Skip to content
This repository has been archived by the owner on Sep 16, 2024. It is now read-only.

Commit

Permalink
Update index.ts
Browse files Browse the repository at this point in the history
  • Loading branch information
bertybuttface committed Oct 27, 2023
1 parent 7992942 commit 1dca8d6
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -76,7 +76,12 @@ async function main() {
client.on("room.failed_decryption", async (roomId, event, error) => {
// handle `m.room.encrypted` event that could not be decrypted
LogService.error("index", `Failed decryption event!\n${{ roomId, event, error }}`);
await client.sendText(roomId, `I couldn't decrypt the message :( Please add me to an unencrypted room.`);
await client.sendText(roomId, `Room key error. I will leave the room, please reinvite me!`);
try {
await client.leaveRoom(roomId);
} catch (e) {
LogService.error("index", `Failed to leave room ${roomId} after failed decryption!`);
}
});

client.on("room.join", async (roomId: string, _event: any) => {
Expand Down

0 comments on commit 1dca8d6

Please sign in to comment.