use session_id from member event to set dest_session_id

so our invite event isn't ignored by EC
This commit is contained in:
Bruno Windels 2022-04-11 12:36:02 +02:00
parent 8a06663023
commit 156f5b78bf
2 changed files with 3 additions and 8 deletions

View file

@ -23,7 +23,8 @@ export enum EventType {
export const SDPStreamMetadataKey = "org.matrix.msc3077.sdp_stream_metadata"; export const SDPStreamMetadataKey = "org.matrix.msc3077.sdp_stream_metadata";
export interface CallDeviceMembership { export interface CallDeviceMembership {
device_id: string device_id: string,
session_id: string
} }
export interface CallMembership { export interface CallMembership {

View file

@ -42,7 +42,6 @@ export type Options = Omit<PeerCallOptions, "emitUpdate" | "sendSignallingMessag
export class Member { export class Member {
private peerCall?: PeerCall; private peerCall?: PeerCall;
private localMedia?: LocalMedia; private localMedia?: LocalMedia;
private destSessionId?: string;
constructor( constructor(
public readonly member: RoomMember, public readonly member: RoomMember,
@ -116,7 +115,7 @@ export class Member {
groupMessage.content.device_id = this.options.ownDeviceId; groupMessage.content.device_id = this.options.ownDeviceId;
groupMessage.content.party_id = this.options.ownDeviceId; groupMessage.content.party_id = this.options.ownDeviceId;
groupMessage.content.sender_session_id = this.options.sessionId; groupMessage.content.sender_session_id = this.options.sessionId;
groupMessage.content.dest_session_id = this.destSessionId!; groupMessage.content.dest_session_id = this.callDeviceMembership.session_id;
// const encryptedMessages = await this.options.encryptDeviceMessage(this.member.userId, groupMessage, log); // const encryptedMessages = await this.options.encryptDeviceMessage(this.member.userId, groupMessage, log);
// const payload = formatToDeviceMessagesPayload(encryptedMessages); // const payload = formatToDeviceMessagesPayload(encryptedMessages);
const payload = { const payload = {
@ -145,11 +144,6 @@ export class Member {
if (this.peerCall) { if (this.peerCall) {
const prevState = this.peerCall.state; const prevState = this.peerCall.state;
this.peerCall.handleIncomingSignallingMessage(message, deviceId); this.peerCall.handleIncomingSignallingMessage(message, deviceId);
//if (prevState !== this.peerCall.state) {
if (!this.destSessionId) {
this.destSessionId = message.content.sender_session_id;
}
//}
} else { } else {
// TODO: need to buffer events until invite comes? // TODO: need to buffer events until invite comes?
} }