mirror of
https://github.com/vector-im/hydrogen-web.git
synced 2025-02-02 07:31:38 +01:00
Pass device-id through options
This commit is contained in:
parent
321775b800
commit
1c09f20778
@ -151,6 +151,7 @@ export class CrossSigning {
|
||||
otherUserId: userId,
|
||||
clock: this.platform.clock,
|
||||
deviceMessageHandler: this.deviceMessageHandler,
|
||||
ourUserDeviceId: this.deviceId,
|
||||
log
|
||||
}, startingMessage);
|
||||
|
||||
|
@ -59,7 +59,6 @@ export class SASVerification {
|
||||
const olmSas = new olm.SAS();
|
||||
this.olmSas = olmSas;
|
||||
this.channel = channel;
|
||||
this.channel.setOurDeviceId(options.ourUserDeviceId);
|
||||
this.setupCancelAfterTimeout(clock);
|
||||
const stageOptions = {...options, olmSas, eventEmitter: this.eventEmitter};
|
||||
if (channel.getReceivedMessage(VerificationEventTypes.Start)) {
|
||||
@ -163,6 +162,7 @@ export function tests() {
|
||||
theirDeviceId,
|
||||
theirUserId,
|
||||
ourUserId,
|
||||
ourDeviceId,
|
||||
receivedMessages,
|
||||
deviceTracker,
|
||||
txnId,
|
||||
|
@ -44,7 +44,6 @@ export interface IChannel {
|
||||
getSentMessage(event: VerificationEventTypes): any;
|
||||
getReceivedMessage(event: VerificationEventTypes): any;
|
||||
setStartMessage(content: any): void;
|
||||
setOurDeviceId(id: string): void;
|
||||
cancelVerification(cancellationType: CancelReason): Promise<void>;
|
||||
acceptMessage: any;
|
||||
startMessage: any;
|
||||
@ -60,6 +59,7 @@ type Options = {
|
||||
clock: Clock;
|
||||
deviceMessageHandler: DeviceMessageHandler;
|
||||
log: ILogItem;
|
||||
ourUserDeviceId: string;
|
||||
}
|
||||
|
||||
export class ToDeviceChannel extends Disposables implements IChannel {
|
||||
@ -88,6 +88,7 @@ export class ToDeviceChannel extends Disposables implements IChannel {
|
||||
this.hsApi = options.hsApi;
|
||||
this.deviceTracker = options.deviceTracker;
|
||||
this.otherUserId = options.otherUserId;
|
||||
this.ourDeviceId = options.ourUserDeviceId;
|
||||
this.clock = options.clock;
|
||||
this.log = options.log;
|
||||
this.deviceMessageHandler = options.deviceMessageHandler;
|
||||
@ -279,10 +280,6 @@ export class ToDeviceChannel extends Disposables implements IChannel {
|
||||
return promise;
|
||||
}
|
||||
|
||||
setOurDeviceId(id: string) {
|
||||
this.ourDeviceId = id;
|
||||
}
|
||||
|
||||
setStartMessage(event) {
|
||||
this.startMessage = event;
|
||||
this._initiatedByUs = event.content.from_device === this.ourDeviceId;
|
||||
|
@ -16,12 +16,12 @@ export class MockChannel implements ITestChannel {
|
||||
public startMessage: any;
|
||||
public isCancelled: boolean = false;
|
||||
private olmSas: any;
|
||||
public ourUserDeviceId: string;
|
||||
|
||||
constructor(
|
||||
public otherUserDeviceId: string,
|
||||
public otherUserId: string,
|
||||
public ourUserId: string,
|
||||
public ourUserDeviceId: string,
|
||||
private fixtures: Map<string, any>,
|
||||
private deviceTracker: any,
|
||||
public id: string,
|
||||
@ -111,10 +111,6 @@ export class MockChannel implements ITestChannel {
|
||||
this.recalculateCommitment();
|
||||
}
|
||||
|
||||
setOurDeviceId(id: string) {
|
||||
this.ourUserDeviceId = id;
|
||||
}
|
||||
|
||||
async cancelVerification(_: CancelReason): Promise<void> {
|
||||
console.log("MockChannel.cancelVerification()");
|
||||
this.isCancelled = true;
|
||||
|
Loading…
x
Reference in New Issue
Block a user