WIP: Support using Element Call for voice calls in DMs
This commit is contained in:
@@ -18,10 +18,12 @@ sealed interface RoomCallState {
|
||||
|
||||
data class StandBy(
|
||||
val canStartCall: Boolean,
|
||||
// TODO: add is DM to know if should show the voice call option?
|
||||
) : RoomCallState
|
||||
|
||||
data class OnGoing(
|
||||
val canJoinCall: Boolean,
|
||||
val isVoiceIntent: Boolean,
|
||||
val isUserInTheCall: Boolean,
|
||||
val isUserLocallyInTheCall: Boolean,
|
||||
) : RoomCallState
|
||||
|
||||
@@ -17,6 +17,7 @@ open class RoomCallStateProvider : PreviewParameterProvider<RoomCallState> {
|
||||
anOngoingCallState(),
|
||||
anOngoingCallState(canJoinCall = false),
|
||||
anOngoingCallState(canJoinCall = true, isUserInTheCall = true),
|
||||
anOngoingCallState(canJoinCall = true, isVoiceIntent = true),
|
||||
RoomCallState.Unavailable,
|
||||
)
|
||||
}
|
||||
@@ -25,10 +26,12 @@ fun anOngoingCallState(
|
||||
canJoinCall: Boolean = true,
|
||||
isUserInTheCall: Boolean = false,
|
||||
isUserLocallyInTheCall: Boolean = isUserInTheCall,
|
||||
isVoiceIntent: Boolean = false,
|
||||
) = RoomCallState.OnGoing(
|
||||
canJoinCall = canJoinCall,
|
||||
isUserInTheCall = isUserInTheCall,
|
||||
isUserLocallyInTheCall = isUserLocallyInTheCall,
|
||||
isVoiceIntent = isVoiceIntent
|
||||
)
|
||||
|
||||
fun aStandByCallState(
|
||||
|
||||
@@ -56,6 +56,7 @@ class RoomCallStatePresenter(
|
||||
canJoinCall = canJoinCall,
|
||||
isUserInTheCall = isUserInTheCall,
|
||||
isUserLocallyInTheCall = isUserLocallyInTheCall,
|
||||
isVoiceIntent = false // TODO
|
||||
)
|
||||
else -> RoomCallState.StandBy(canStartCall = canJoinCall)
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user