mirror of
https://github.com/matrix-org/mjolnir.git
synced 2024-10-01 01:36:06 -04:00
Detect UISI errors from pantalaimon in the management room
This commit is contained in:
parent
778f9c3459
commit
07c9c04169
@ -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'] === '') {
|
||||
|
Loading…
Reference in New Issue
Block a user