mirror of
https://github.com/signalapp/Signal-Android.git
synced 2026-04-22 09:49:30 +01:00
Implement auto-lower-hand.
This commit is contained in:
committed by
Cody Henthorne
parent
32b710a3ca
commit
b6f98521c8
@@ -5,15 +5,19 @@
|
||||
|
||||
package org.thoughtcrime.securesms.events
|
||||
|
||||
import java.util.concurrent.TimeUnit
|
||||
import kotlin.time.Duration
|
||||
import kotlin.time.Duration.Companion.milliseconds
|
||||
import kotlin.time.Duration.Companion.seconds
|
||||
|
||||
data class GroupCallRaiseHandEvent(val sender: CallParticipant, val timestamp: Long) {
|
||||
data class GroupCallRaiseHandEvent(val sender: CallParticipant, private val timestampMillis: Long) {
|
||||
|
||||
fun getCollapseTimestamp(): Long {
|
||||
return timestamp + TimeUnit.SECONDS.toMillis(LIFESPAN_SECONDS)
|
||||
val timestamp = timestampMillis.milliseconds
|
||||
|
||||
fun getCollapseTimestamp(): Duration {
|
||||
return timestamp + LIFESPAN
|
||||
}
|
||||
|
||||
companion object {
|
||||
const val LIFESPAN_SECONDS = 4L
|
||||
private val LIFESPAN = 4L.seconds
|
||||
}
|
||||
}
|
||||
|
||||
@@ -0,0 +1,24 @@
|
||||
/*
|
||||
* Copyright 2025 Signal Messenger, LLC
|
||||
* SPDX-License-Identifier: AGPL-3.0-only
|
||||
*/
|
||||
|
||||
package org.thoughtcrime.securesms.events
|
||||
|
||||
import org.signal.ringrtc.GroupCall.SpeechEvent
|
||||
import kotlin.time.Duration
|
||||
import kotlin.time.Duration.Companion.milliseconds
|
||||
import kotlin.time.Duration.Companion.seconds
|
||||
|
||||
data class GroupCallSpeechEvent @JvmOverloads constructor(
|
||||
val speechEvent: SpeechEvent,
|
||||
private val timestampMs: Long = System.currentTimeMillis()
|
||||
) {
|
||||
fun getCollapseTimestamp(): Duration {
|
||||
return timestampMs.milliseconds + LIFESPAN
|
||||
}
|
||||
|
||||
companion object {
|
||||
private val LIFESPAN = 4L.seconds
|
||||
}
|
||||
}
|
||||
@@ -106,6 +106,7 @@ class WebRtcViewModel(state: WebRtcServiceState) {
|
||||
val isCallLink: Boolean = state.callInfoState.callRecipient.isCallLink
|
||||
val callLinkDisconnectReason: CallLinkDisconnectReason? = state.callInfoState.callLinkDisconnectReason
|
||||
val groupCallEndReason: GroupCallEndReason? = state.callInfoState.groupCallEndReason
|
||||
val groupCallSpeechEvent: GroupCallSpeechEvent? = state.callInfoState.groupCallSpeechEvent
|
||||
|
||||
@get:JvmName("hasAtLeastOneRemote")
|
||||
val hasAtLeastOneRemote = if (state.callInfoState.callRecipient.isIndividual) {
|
||||
|
||||
Reference in New Issue
Block a user