Keep guard pattern

This commit is contained in:
David Langley 2021-12-03 11:28:49 +00:00
parent bf8b485e2c
commit 0cf50e88e9

View file

@ -203,18 +203,19 @@ internal class MxCallImpl(
override fun selectAnswer() {
Timber.tag(loggerTag.value).v("select answer $callId")
if (isOutgoing) {
// This is an outgoing call, select the remote client that answered.
// state is still DIALING.
CallSelectAnswerContent(
callId = callId,
partyId = ourPartyId,
selectedPartyId = opponentPartyId?.getOrNull(),
version = MxCall.VOIP_PROTO_VERSION.toString()
)
.let { createEventAndLocalEcho(type = EventType.CALL_SELECT_ANSWER, roomId = roomId, content = it.toContent()) }
.also { eventSenderProcessor.postEvent(it) }
if (!isOutgoing) {
return
}
// This is an outgoing call, select the remote client that answered.
// state is still DIALING.
CallSelectAnswerContent(
callId = callId,
partyId = ourPartyId,
selectedPartyId = opponentPartyId?.getOrNull(),
version = MxCall.VOIP_PROTO_VERSION.toString()
)
.let { createEventAndLocalEcho(type = EventType.CALL_SELECT_ANSWER, roomId = roomId, content = it.toContent()) }
.also { eventSenderProcessor.postEvent(it) }
}
override suspend fun transfer(targetUserId: String,