Improve log messages and comment

This commit is contained in:
Benoit Marty 2025-09-11 16:37:12 +02:00
parent 2db74ce9e5
commit f1c0ac0b9b

View file

@ -273,7 +273,7 @@ class DefaultActiveCallManager(
val callType = activeCall.callType as CallType.RoomCall val callType = activeCall.callType as CallType.RoomCall
val ringingInfo = activeCall.callState as CallState.Ringing val ringingInfo = activeCall.callState as CallState.Ringing
val client = matrixClientProvider.getOrRestore(callType.sessionId).getOrNull() ?: run { val client = matrixClientProvider.getOrRestore(callType.sessionId).getOrNull() ?: run {
Timber.tag(tag).d("Couldn't find room for incoming call: $activeCall") Timber.tag(tag).d("Couldn't find session for incoming call: $activeCall")
return@flatMapLatest flowOf() return@flatMapLatest flowOf()
} }
val room = client.getRoom(callType.roomId) ?: run { val room = client.getRoom(callType.roomId) ?: run {
@ -281,7 +281,7 @@ class DefaultActiveCallManager(
return@flatMapLatest flowOf() return@flatMapLatest flowOf()
} }
Timber.tag(tag).d("Found room for rining call: ${room.roomId}") Timber.tag(tag).d("Found room for ringing call: ${room.roomId}")
// If we have declined from another phone we want to stop ringing. // If we have declined from another phone we want to stop ringing.
room.subscribeToCallDecline(ringingInfo.notificationData.eventId) room.subscribeToCallDecline(ringingInfo.notificationData.eventId)
@ -293,11 +293,11 @@ class DefaultActiveCallManager(
} }
} }
.onEach { decliner -> .onEach { decliner ->
Timber.tag(tag).d("Call: $activeCall was declined by from another session") Timber.tag(tag).d("Call: $activeCall was declined by user from another session")
// decline // Remove the active call and cancel the notification
activeCall.value = null activeCall.value = null
if (activeWakeLock?.isHeld == true) { if (activeWakeLock?.isHeld == true) {
Timber.tag(tag).d("Releasing partial wakelock after timeout") Timber.tag(tag).d("Releasing partial wakelock after call declined from another session")
activeWakeLock.release() activeWakeLock.release()
} }
cancelIncomingCallNotification() cancelIncomingCallNotification()