Fix incorrect handling of hangup message.

This commit is contained in:
Cody Henthorne
2023-09-23 22:40:46 -04:00
parent 5d612f020c
commit 65cdc143da

View File

@@ -137,8 +137,8 @@ object CallMessageProcessor {
) {
log(envelope.timestamp!!, "handleCallHangupMessage")
val (hangupId, hangupDeviceId) = if (hangup?.id != null && hangup.deviceId != null) {
hangup.id!! to hangup.deviceId!!
val (hangupId: Long, hangupDeviceId: Int?) = if (hangup?.id != null) {
hangup.id!! to hangup.deviceId
} else {
warn(envelope.timestamp!!, "Invalid hangup, null message or missing id/deviceId")
return
@@ -148,7 +148,7 @@ object CallMessageProcessor {
ApplicationDependencies.getSignalCallManager()
.receivedCallHangup(
CallMetadata(remotePeer, metadata.sourceDeviceId),
HangupMetadata(HangupMessage.Type.fromProto(hangup.type), hangupDeviceId)
HangupMetadata(HangupMessage.Type.fromProto(hangup.type), hangupDeviceId ?: 0)
)
}