Skip to content

Commit 8fc29ae

Browse files
committed
feat(legacy crypto!): remove ICreateClientOpts.deviceToImport.
`ICreateClientOpts.deviceToImport` was used in the legacy cryto. The rust crypto doesn't support to import devices in this way.
1 parent 89ac700 commit 8fc29ae

File tree

1 file changed

+1
-32
lines changed

1 file changed

+1
-32
lines changed

src/client.ts

+1-32
Original file line numberDiff line numberDiff line change
@@ -223,11 +223,6 @@ export const UNSTABLE_MSC3852_LAST_SEEN_UA = new UnstableValue(
223223
"org.matrix.msc3852.last_seen_user_agent",
224224
);
225225

226-
interface IExportedDevice {
227-
userId: string;
228-
deviceId: string;
229-
}
230-
231226
export interface IKeysUploadResponse {
232227
one_time_key_counts: {
233228
// eslint-disable-line camelcase
@@ -335,15 +330,6 @@ export interface ICreateClientOpts {
335330
*/
336331
queryParams?: Record<string, string>;
337332

338-
/**
339-
* Device data exported with
340-
* "exportDevice" method that must be imported to recreate this device.
341-
* Should only be useful for devices with end-to-end crypto enabled.
342-
* If provided, deviceId and userId should **NOT** be provided at the top
343-
* level (they are present in the exported data).
344-
*/
345-
deviceToImport?: IExportedDevice;
346-
347333
/**
348334
* Encryption key used for encrypting sensitive data (such as e2ee keys) in {@link ICreateClientOpts#cryptoStore}.
349335
*
@@ -1288,24 +1274,7 @@ export class MatrixClient extends TypedEventEmitter<EmittedEvents, ClientEventHa
12881274
logger: this.logger,
12891275
});
12901276

1291-
if (opts.deviceToImport) {
1292-
if (this.deviceId) {
1293-
this.logger.warn(
1294-
"not importing device because device ID is provided to " +
1295-
"constructor independently of exported data",
1296-
);
1297-
} else if (this.credentials.userId) {
1298-
this.logger.warn(
1299-
"not importing device because user ID is provided to " +
1300-
"constructor independently of exported data",
1301-
);
1302-
} else if (!opts.deviceToImport.deviceId) {
1303-
this.logger.warn("not importing device because no device ID in exported data");
1304-
} else {
1305-
this.deviceId = opts.deviceToImport.deviceId;
1306-
this.credentials.userId = opts.deviceToImport.userId;
1307-
}
1308-
} else if (opts.pickleKey) {
1277+
if (opts.pickleKey) {
13091278
this.legacyPickleKey = opts.pickleKey;
13101279
}
13111280

0 commit comments

Comments
 (0)