1
0
mirror of https://github.com/matrix-org/matrix-js-sdk.git synced 2025-11-23 17:02:25 +03:00

Support m.call.select_answer

Only send one if the answer has a party_id set

Also change some event types to the enum and rename receivedAnswer
to be more consistent
This commit is contained in:
David Baker
2020-10-21 11:52:58 +01:00
parent 9f713781cd
commit 8712703f7c
3 changed files with 57 additions and 15 deletions

View File

@@ -213,7 +213,7 @@ export class CallEventHandler {
call.onAnsweredElsewhere(content);
}
} else {
call.receivedAnswer(content);
call.onAnswerReceived(event);
}
} else if (event.getType() === EventType.CallCandidates) {
if (event.getSender() === this.client.credentials.userId) {
@@ -251,6 +251,13 @@ export class CallEventHandler {
this.calls.delete(content.call_id);
}
}
} else if (event.getType() === EventType.CallSelectAnswer) {
if (event.getContent().party_id === call.ourPartyId) {
// Ignore remote echo
return;
}
call.onSelectAnswerReceived(event);
}
}
}