Remove references to some deprecated js-sdk identifiers (#12729)

* IKeyBackupInfo -> KeyBackupInfo

* ICryptoCallbacks -> CryptoCallbacks

* IRoomEncryption -> RoomEncryptionEventContent

* MEGOLM_ALGORITHM -> a single local constant

* UserTrustLevel -> UserVerificationStatus
This commit is contained in:
Richard van der Hoff 2024-07-04 16:50:07 +01:00 committed by GitHub
parent de12d69e6b
commit 489bc32674
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
18 changed files with 61 additions and 43 deletions

19
src/utils/crypto/index.ts Normal file
View file

@ -0,0 +1,19 @@
/*
Copyright 2024 The Matrix.org Foundation C.I.C.
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
*/
/** The `algorithm` property used in `m.room.encrypted` state events for encrypted rooms.
*/
export const MEGOLM_ENCRYPTION_ALGORITHM = "m.megolm.v1.aes-sha2";

View file

@ -14,12 +14,12 @@ See the License for the specific language governing permissions and
limitations under the License.
*/
import { MEGOLM_ALGORITHM } from "matrix-js-sdk/src/crypto/olmlib";
import { EventType, KNOWN_SAFE_ROOM_VERSION, MatrixClient, MatrixEvent } from "matrix-js-sdk/src/matrix";
import { KnownMembership } from "matrix-js-sdk/src/types";
import { LocalRoom, LOCAL_ROOM_ID_PREFIX } from "../../../src/models/LocalRoom";
import { LOCAL_ROOM_ID_PREFIX, LocalRoom } from "../../../src/models/LocalRoom";
import { determineCreateRoomEncryptionOption, Member } from "../../../src/utils/direct-messages";
import { MEGOLM_ENCRYPTION_ALGORITHM } from "../crypto";
/**
* Create a DM local room. This room will not be send to the server and only exists inside the client.
@ -59,7 +59,7 @@ export async function createDmLocalRoom(client: MatrixClient, targets: Member[])
event_id: `~${localRoom.roomId}:${client.makeTxnId()}`,
type: EventType.RoomEncryption,
content: {
algorithm: MEGOLM_ALGORITHM,
algorithm: MEGOLM_ENCRYPTION_ALGORITHM,
},
sender: userId,
state_key: "",