Group call optimizations

This commit is contained in:
Isaac
2024-06-14 23:03:36 +04:00
parent 93a4e355f7
commit 2f177e9a48
17 changed files with 250 additions and 118 deletions

View File

@@ -2452,6 +2452,24 @@ public final class VoiceChatControllerImpl: ViewController, VoiceChatController
}
})
}
var lastTimestamp = 0.0
self.call.onMutedSpeechActivityDetected = { [weak self] value in
Queue.mainQueue().async {
guard let self, value else {
return
}
let timestamp = CFAbsoluteTimeGetCurrent()
if lastTimestamp + 1000.0 < timestamp {
lastTimestamp = timestamp
//TODO:localize
self.presentUndoOverlay(content: .info(title: nil, text: "Your microphone is muted.", timeout: nil, customUndoText: nil), action: { _ in
return false
})
}
}
}
}
deinit {