1
0
mirror of https://github.com/matrix-org/matrix-js-sdk.git synced 2025-12-10 07:22:27 +03:00

Make SonarCloud happier (#2850)

* Make SonarCloud happier

* Revert one change due to lack of strict mode upstream

* Fix typo
This commit is contained in:
Michael Telatynski
2022-11-07 12:16:48 +00:00
committed by GitHub
parent 52932f59ab
commit 6c543382e6
23 changed files with 102 additions and 152 deletions

View File

@@ -119,12 +119,10 @@ class OlmEncryption extends EncryptionAlgorithm {
const promises: Promise<void>[] = [];
for (let i = 0; i < users.length; ++i) {
const userId = users[i];
for (const userId of users) {
const devices = this.crypto.getStoredDevicesForUser(userId) || [];
for (let j = 0; j < devices.length; ++j) {
const deviceInfo = devices[j];
for (const deviceInfo of devices) {
const key = deviceInfo.getIdentityKey();
if (key == this.olmDevice.deviceCurve25519Key) {
// don't bother sending to ourself
@@ -304,8 +302,7 @@ class OlmDecryption extends DecryptionAlgorithm {
// try each session in turn.
const decryptionErrors: Record<string, string> = {};
for (let i = 0; i < sessionIds.length; i++) {
const sessionId = sessionIds[i];
for (const sessionId of sessionIds) {
try {
const payload = await this.olmDevice.decryptMessage(
theirDeviceIdentityKey, sessionId, message.type, message.body,