From 166ac447a80b16f5c0d2db7b836de281f990f418 Mon Sep 17 00:00:00 2001 From: Cadence Ember Date: Thu, 12 Oct 2023 15:49:57 +1300 Subject: [PATCH 1/2] Fix corrupted member_cache entries on invite --- db/migrations/0005-clear-member-cache.sql | 5 +++++ m2d/event-dispatcher.js | 4 ++-- 2 files changed, 7 insertions(+), 2 deletions(-) create mode 100644 db/migrations/0005-clear-member-cache.sql diff --git a/db/migrations/0005-clear-member-cache.sql b/db/migrations/0005-clear-member-cache.sql new file mode 100644 index 00000000..6899fe62 --- /dev/null +++ b/db/migrations/0005-clear-member-cache.sql @@ -0,0 +1,5 @@ +BEGIN TRANSACTION; + +DELETE FROM member_cache; + +COMMIT; diff --git a/m2d/event-dispatcher.js b/m2d/event-dispatcher.js index 48add814..f7e5e1b0 100644 --- a/m2d/event-dispatcher.js +++ b/m2d/event-dispatcher.js @@ -147,6 +147,6 @@ sync.addTemporaryListener(as, "type:m.room.member", guard("m.room.member", */ async event => { if (event.state_key[0] !== "@") return - if (utils.eventSenderIsFromDiscord(event.sender)) return - db.prepare("REPLACE INTO member_cache (room_id, mxid, displayname, avatar_url) VALUES (?, ?, ?, ?)").run(event.room_id, event.sender, event.content.displayname || null, event.content.avatar_url || null) + if (utils.eventSenderIsFromDiscord(event.state_key)) return + db.prepare("REPLACE INTO member_cache (room_id, mxid, displayname, avatar_url) VALUES (?, ?, ?, ?)").run(event.room_id, event.state_key, event.content.displayname || null, event.content.avatar_url || null) })) From fc44edf290423a4a50cb44a23a9c966fd56e85e3 Mon Sep 17 00:00:00 2001 From: Cadence Ember Date: Thu, 12 Oct 2023 15:53:43 +1300 Subject: [PATCH 2/2] v1.1.1 --- package-lock.json | 4 ++-- package.json | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/package-lock.json b/package-lock.json index 16ed46c2..d1ed09e3 100644 --- a/package-lock.json +++ b/package-lock.json @@ -1,12 +1,12 @@ { "name": "out-of-your-element", - "version": "1.1.0", + "version": "1.1.1", "lockfileVersion": 3, "requires": true, "packages": { "": { "name": "out-of-your-element", - "version": "1.1.0", + "version": "1.1.1", "license": "AGPL-3.0-or-later", "dependencies": { "@chriscdn/promise-semaphore": "^2.0.1", diff --git a/package.json b/package.json index 7c84ebc6..e8eec833 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "out-of-your-element", - "version": "1.1.0", + "version": "1.1.1", "description": "A bridge between Matrix and Discord", "main": "index.js", "repository": {