Skip to content

Commit 553758e

Browse files
authored
Bump rust sdk wasm version to 7.0.0 (#4316)
1 parent 509e64c commit 553758e

File tree

3 files changed

+17
-38
lines changed

3 files changed

+17
-38
lines changed

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -53,7 +53,7 @@
5353
],
5454
"dependencies": {
5555
"@babel/runtime": "^7.12.5",
56-
"@matrix-org/matrix-sdk-crypto-wasm": "^6.0.0",
56+
"@matrix-org/matrix-sdk-crypto-wasm": "^7.0.0",
5757
"another-json": "^0.2.0",
5858
"bs58": "^6.0.0",
5959
"content-type": "^1.0.4",

src/rust-crypto/RoomEncryptor.ts

Lines changed: 9 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -14,16 +14,17 @@ See the License for the specific language governing permissions and
1414
limitations under the License.
1515
*/
1616

17+
import * as RustSdkCryptoJs from "@matrix-org/matrix-sdk-crypto-wasm";
1718
import {
19+
CollectStrategy,
1820
EncryptionAlgorithm,
1921
EncryptionSettings,
22+
HistoryVisibility as RustHistoryVisibility,
2023
OlmMachine,
2124
RoomId,
22-
UserId,
23-
HistoryVisibility as RustHistoryVisibility,
2425
ToDeviceRequest,
26+
UserId,
2527
} from "@matrix-org/matrix-sdk-crypto-wasm";
26-
import * as RustSdkCryptoJs from "@matrix-org/matrix-sdk-crypto-wasm";
2728

2829
import { EventType } from "../@types/event";
2930
import { IContent, MatrixEvent } from "../models/event";
@@ -252,8 +253,11 @@ export class RoomEncryptor {
252253

253254
// When this.room.getBlacklistUnverifiedDevices() === null, the global settings should be used
254255
// See Room#getBlacklistUnverifiedDevices
255-
rustEncryptionSettings.onlyAllowTrustedDevices =
256-
this.room.getBlacklistUnverifiedDevices() ?? globalBlacklistUnverifiedDevices;
256+
if (this.room.getBlacklistUnverifiedDevices() ?? globalBlacklistUnverifiedDevices) {
257+
rustEncryptionSettings.sharingStrategy = CollectStrategy.DeviceBasedStrategyOnlyTrustedDevices;
258+
} else {
259+
rustEncryptionSettings.sharingStrategy = CollectStrategy.DeviceBasedStrategyAllDevices;
260+
}
257261

258262
await logDuration(this.prefixedLogger, "shareRoomKey", async () => {
259263
const shareMessages: ToDeviceRequest[] = await this.olmMachine.shareRoomKey(

yarn.lock

Lines changed: 7 additions & 32 deletions
Original file line numberDiff line numberDiff line change
@@ -1473,10 +1473,10 @@
14731473
"@jridgewell/resolve-uri" "^3.1.0"
14741474
"@jridgewell/sourcemap-codec" "^1.4.14"
14751475

1476-
"@matrix-org/matrix-sdk-crypto-wasm@^6.0.0":
1477-
version "6.2.1"
1478-
resolved "https://registry.yarnpkg.com/@matrix-org/matrix-sdk-crypto-wasm/-/matrix-sdk-crypto-wasm-6.2.1.tgz#94cd1263656e2b4f3b1dc6f728856efab8920aca"
1479-
integrity sha512-5mav0EKog0w9NWRRxFzZ+ZcT5Il/KlLh1bsQXgxfhzfJq1RgWLLu+OsvHSZau5NSbPxfOd4ZTWc2ZLAf+V/8mg==
1476+
"@matrix-org/matrix-sdk-crypto-wasm@^7.0.0":
1477+
version "7.0.0"
1478+
resolved "https://registry.yarnpkg.com/@matrix-org/matrix-sdk-crypto-wasm/-/matrix-sdk-crypto-wasm-7.0.0.tgz#8d6abdb9ded8656cc9e2a7909913a34bf3fc9b3a"
1479+
integrity sha512-MOencXiW/gI5MuTtCNsuojjwT5DXCrjMqv9xOslJC9h2tPdLFFFMGr58dY5Lis4DRd9MRWcgrGowUIHOqieWTA==
14801480

14811481
"@matrix-org/olm@3.2.15":
14821482
version "3.2.15"
@@ -5758,16 +5758,7 @@ string-length@^4.0.1:
57585758
char-regex "^1.0.2"
57595759
strip-ansi "^6.0.0"
57605760

5761-
"string-width-cjs@npm:string-width@^4.2.0":
5762-
version "4.2.3"
5763-
resolved "https://registry.yarnpkg.com/string-width/-/string-width-4.2.3.tgz#269c7117d27b05ad2e536830a8ec895ef9c6d010"
5764-
integrity sha512-wKyQRQpjJ0sIp62ErSZdGsjMJWsap5oRNihHhu6G7JVO/9jIB6UyevL+tXuOqrng8j/cxKTWyWUwvSTriiZz/g==
5765-
dependencies:
5766-
emoji-regex "^8.0.0"
5767-
is-fullwidth-code-point "^3.0.0"
5768-
strip-ansi "^6.0.1"
5769-
5770-
string-width@^4.1.0, string-width@^4.2.0, string-width@^4.2.3:
5761+
"string-width-cjs@npm:string-width@^4.2.0", string-width@^4.1.0, string-width@^4.2.0, string-width@^4.2.3:
57715762
version "4.2.3"
57725763
resolved "https://registry.yarnpkg.com/string-width/-/string-width-4.2.3.tgz#269c7117d27b05ad2e536830a8ec895ef9c6d010"
57735764
integrity sha512-wKyQRQpjJ0sIp62ErSZdGsjMJWsap5oRNihHhu6G7JVO/9jIB6UyevL+tXuOqrng8j/cxKTWyWUwvSTriiZz/g==
@@ -5822,14 +5813,7 @@ string.prototype.trimstart@^1.0.8:
58225813
define-properties "^1.2.1"
58235814
es-object-atoms "^1.0.0"
58245815

5825-
"strip-ansi-cjs@npm:strip-ansi@^6.0.1":
5826-
version "6.0.1"
5827-
resolved "https://registry.yarnpkg.com/strip-ansi/-/strip-ansi-6.0.1.tgz#9e26c63d30f53443e9489495b2105d37b67a85d9"
5828-
integrity sha512-Y38VPSHcqkFrCpFnQ9vuSXmquuv5oXOKpGeT6aGrr3o3Gc9AlVa6JBfUSOCnbxGGZF+/0ooI7KrPuUSztUdU5A==
5829-
dependencies:
5830-
ansi-regex "^5.0.1"
5831-
5832-
strip-ansi@^6.0.0, strip-ansi@^6.0.1:
5816+
"strip-ansi-cjs@npm:strip-ansi@^6.0.1", strip-ansi@^6.0.0, strip-ansi@^6.0.1:
58335817
version "6.0.1"
58345818
resolved "https://registry.yarnpkg.com/strip-ansi/-/strip-ansi-6.0.1.tgz#9e26c63d30f53443e9489495b2105d37b67a85d9"
58355819
integrity sha512-Y38VPSHcqkFrCpFnQ9vuSXmquuv5oXOKpGeT6aGrr3o3Gc9AlVa6JBfUSOCnbxGGZF+/0ooI7KrPuUSztUdU5A==
@@ -6370,16 +6354,7 @@ word-wrap@^1.2.5:
63706354
resolved "https://registry.yarnpkg.com/word-wrap/-/word-wrap-1.2.5.tgz#d2c45c6dd4fbce621a66f136cbe328afd0410b34"
63716355
integrity sha512-BN22B5eaMMI9UMtjrGd5g5eCYPpCPDUy0FJXbYsaT5zYxjFOckS53SQDE3pWkVoWpHXVb3BrYcEN4Twa55B5cA==
63726356

6373-
"wrap-ansi-cjs@npm:wrap-ansi@^7.0.0":
6374-
version "7.0.0"
6375-
resolved "https://registry.yarnpkg.com/wrap-ansi/-/wrap-ansi-7.0.0.tgz#67e145cff510a6a6984bdf1152911d69d2eb9e43"
6376-
integrity sha512-YVGIj2kamLSTxw6NsZjoBxfSwsn0ycdesmc4p+Q21c5zPuZ1pl+NfxVdxPtdHvmNVOQ6XSYG4AUtyt/Fi7D16Q==
6377-
dependencies:
6378-
ansi-styles "^4.0.0"
6379-
string-width "^4.1.0"
6380-
strip-ansi "^6.0.0"
6381-
6382-
wrap-ansi@^7.0.0:
6357+
"wrap-ansi-cjs@npm:wrap-ansi@^7.0.0", wrap-ansi@^7.0.0:
63836358
version "7.0.0"
63846359
resolved "https://registry.yarnpkg.com/wrap-ansi/-/wrap-ansi-7.0.0.tgz#67e145cff510a6a6984bdf1152911d69d2eb9e43"
63856360
integrity sha512-YVGIj2kamLSTxw6NsZjoBxfSwsn0ycdesmc4p+Q21c5zPuZ1pl+NfxVdxPtdHvmNVOQ6XSYG4AUtyt/Fi7D16Q==

0 commit comments

Comments
 (0)