From a371b7c50140bf93b0665093902008d2de9cf3bb Mon Sep 17 00:00:00 2001 From: vulet Date: Sun, 25 Apr 2021 16:04:01 +0800 Subject: [PATCH] fix(e2ee): self-react after decryption promise --- main.js | 1 + 1 file changed, 1 insertion(+) diff --git a/main.js b/main.js index 15c0d1e..f4d6e39 100644 --- a/main.js +++ b/main.js @@ -18,6 +18,7 @@ matrixClient.on('RoomMember.membership', (event, member) => { }); matrixClient.on('event', async (event) => { + if (event.isEncrypted()) await event._decryptionPromise; if (event.getSender() === matrixClient.credentials.userId) return matrix.utils.selfReact(event); if (!event.getContent()['m.relates_to']) return; if (event.event.unsigned.age > 10000) return;