Skip to content

Commit

Permalink
Detect UISI errors from pantalaimon in the management room
Browse files Browse the repository at this point in the history
  • Loading branch information
turt2live committed Nov 14, 2019
1 parent 778f9c3 commit 07c9c04
Showing 1 changed file with 12 additions and 0 deletions.
12 changes: 12 additions & 0 deletions src/Mjolnir.ts
Original file line number Diff line number Diff line change
Expand Up @@ -311,6 +311,18 @@ export class Mjolnir {
}

private async handleEvent(roomId: string, event: any) {
// Check for UISI errors
if (roomId === config.managementRoom) {
if (event['type'] === 'm.room.message' && event['content'] && event['content']['body']) {
if (event['content']['body'] === "** Unable to decrypt: The sender's device has not sent us the keys for this message. **") {
// UISI
await this.client.unstableApis.addReactionToEvent(roomId, event['event_id'], '⚠');
await this.client.unstableApis.addReactionToEvent(roomId, event['event_id'], 'UISI');
await this.client.unstableApis.addReactionToEvent(roomId, event['event_id'], '🚨');
}
}
}

if (Object.keys(this.protectedRooms).includes(roomId)) {
if (event['sender'] === await this.client.getUserId()) return; // Ignore ourselves
if (event['type'] === 'm.room.power_levels' && event['state_key'] === '') {
Expand Down

0 comments on commit 07c9c04

Please sign in to comment.