1
0
mirror of https://github.com/matrix-org/matrix-js-sdk.git synced 2025-11-28 05:03:59 +03:00

Unexpected ignored self key request when it's not shared history (#2724)

* ignore forwarded key process also if the user is not the same
This commit is contained in:
mcalinghee
2022-10-04 14:31:21 +02:00
committed by GitHub
parent 0ccf7c50f2
commit f84a33910c

View File

@@ -1444,9 +1444,10 @@ class MegolmDecryption extends DecryptionAlgorithm {
memberEvent?.getPrevContent()?.membership === "invite");
const fromUs = event.getSender() === this.baseApis.getUserId();
if (!weRequested) {
// If someone sends us an unsolicited key and it's not
// shared history, ignore it
if (!weRequested && !fromUs) {
// If someone sends us an unsolicited key and they're
// not one of our other devices and it's not shared
// history, ignore it
if (!extraSessionData.sharedHistory) {
logger.log("forwarded key not shared history - ignoring");
return;
@@ -1455,7 +1456,7 @@ class MegolmDecryption extends DecryptionAlgorithm {
// If someone sends us an unsolicited key for a room
// we're already in, and they're not one of our other
// devices or the one who invited us, ignore it
if (room && !fromInviter && !fromUs) {
if (room && !fromInviter) {
logger.log("forwarded key not from inviter or from us - ignoring");
return;
}