Skip to content
This repository has been archived by the owner on Sep 11, 2024. It is now read-only.

Use the non-deprecated importRoomKeys method on CryptoApi #12232

Merged
merged 2 commits into from
Feb 9, 2024

Conversation

andybalaam
Copy link
Contributor

@andybalaam andybalaam commented Feb 6, 2024

Part of element-hq/element-web#26681


This change is marked as an internal change (Task), so will not be included in the changelog.

Copy link
Member

@BillCarsonFr BillCarsonFr left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM just one comment

@@ -108,7 +108,7 @@ export default class ImportE2eKeysDialog extends React.Component<IProps, IState>
return MegolmExportEncryption.decryptMegolmKeyFile(arrayBuffer, passphrase);
})
.then((keys) => {
return this.props.matrixClient.importRoomKeys(JSON.parse(keys));
return this.props.matrixClient.getCrypto()?.importRoomKeys(JSON.parse(keys));
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

At this point there should be a cryptoAPI, maybe we can just do getCrypto()! or maybe we could have a sort of getSafeCrypto() new API that would throw a End-to-end encryption disabled like the deprecatedimportRoomKeys was doing

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Good call - fixed in f1fbff9

@andybalaam andybalaam force-pushed the andybalaam/use-nondeprecated-importroomkeys branch from 276acad to f1fbff9 Compare February 9, 2024 12:53
@andybalaam andybalaam added this pull request to the merge queue Feb 9, 2024
Merged via the queue into develop with commit d192807 Feb 9, 2024
22 checks passed
@andybalaam andybalaam deleted the andybalaam/use-nondeprecated-importroomkeys branch February 9, 2024 13:34
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
T-Task Refactoring, enabling or disabling functionality, other engineering tasks
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants