Skip to content

Commit 6ac3762

Browse files
committed
Add more methods to VerificationRequest
... to avoid the need for `channel`
1 parent 4c90703 commit 6ac3762

File tree

1 file changed

+16
-0
lines changed

1 file changed

+16
-0
lines changed

src/crypto/verification/request/VerificationRequest.ts

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -163,6 +163,22 @@ export class VerificationRequest<C extends IVerificationChannel = IVerificationC
163163
return true;
164164
}
165165

166+
/**
167+
* Unique ID for this verification request.
168+
*
169+
* An ID isn't assigned until the first message is sent, so this may be `undefined` in the early phases.
170+
*/
171+
public get transactionId(): string | undefined {
172+
return this.channel.transactionId;
173+
}
174+
175+
/**
176+
* For an in-room verification, the ID of the room.
177+
*/
178+
public get roomId(): string | undefined {
179+
return this.channel.roomId;
180+
}
181+
166182
public get invalid(): boolean {
167183
return this.phase === PHASE_UNSENT;
168184
}

0 commit comments

Comments
 (0)