You've already forked matrix-js-sdk
mirror of
https://github.com/matrix-org/matrix-js-sdk.git
synced 2025-11-28 05:03:59 +03:00
Apply suggestions from SonarQube (#2340)
This commit is contained in:
committed by
GitHub
parent
b86630f0e3
commit
8be30acb11
@@ -70,7 +70,7 @@ class OlmEncryption extends EncryptionAlgorithm {
|
||||
return Promise.resolve();
|
||||
}
|
||||
|
||||
this.prepPromise = this.crypto.downloadKeys(roomMembers).then((res) => {
|
||||
this.prepPromise = this.crypto.downloadKeys(roomMembers).then(() => {
|
||||
return this.crypto.ensureOlmSessionsForUsers(roomMembers);
|
||||
}).then(() => {
|
||||
this.sessionPrepared = true;
|
||||
@@ -144,7 +144,7 @@ class OlmEncryption extends EncryptionAlgorithm {
|
||||
}
|
||||
}
|
||||
|
||||
return await Promise.all(promises).then(() => encryptedContent);
|
||||
return Promise.all(promises).then(() => encryptedContent);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -261,7 +261,7 @@ class OlmDecryption extends DecryptionAlgorithm {
|
||||
*
|
||||
* @return {string} payload, if decrypted successfully.
|
||||
*/
|
||||
private async decryptMessage(theirDeviceIdentityKey: string, message: IMessage): Promise<string> {
|
||||
private decryptMessage(theirDeviceIdentityKey: string, message: IMessage): Promise<string> {
|
||||
// This is a wrapper that serialises decryptions of prekey messages, because
|
||||
// otherwise we race between deciding we have no active sessions for the message
|
||||
// and creating a new one, which we can only do once because it removes the OTK.
|
||||
@@ -274,7 +274,7 @@ class OlmDecryption extends DecryptionAlgorithm {
|
||||
});
|
||||
// we want the error, but don't propagate it to the next decryption
|
||||
this.olmDevice.olmPrekeyPromise = myPromise.catch(() => {});
|
||||
return await myPromise;
|
||||
return myPromise;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user