Skip to content

Commit

Permalink
feat: use SFT for OneOnOne calls if the flag is true (WPB-7153) (#3225)
Browse files Browse the repository at this point in the history
Co-authored-by: Yamil Medina <[email protected]>
Co-authored-by: Alexandre Ferris <[email protected]>
  • Loading branch information
3 people authored Jul 29, 2024
1 parent 1da258d commit 7389744
Show file tree
Hide file tree
Showing 6 changed files with 14 additions and 14 deletions.
4 changes: 2 additions & 2 deletions app/src/main/kotlin/com/wire/android/ui/calling/CallState.kt
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ import com.wire.android.model.ImageAsset.UserAvatarAsset
import com.wire.android.ui.calling.model.UICallParticipant
import com.wire.android.ui.home.conversationslist.model.Membership
import com.wire.kalium.logic.data.call.CallStatus
import com.wire.kalium.logic.data.call.ConversationType
import com.wire.kalium.logic.data.call.ConversationTypeForCall
import com.wire.kalium.logic.data.conversation.Conversation
import com.wire.kalium.logic.data.id.ConversationId

Expand All @@ -38,7 +38,7 @@ data class CallState(
val isOnFrontCamera: Boolean = true,
val isSpeakerOn: Boolean = false,
val isCbrEnabled: Boolean = false,
val conversationType: ConversationType = ConversationType.OneOnOne,
val conversationTypeForCall: ConversationTypeForCall = ConversationTypeForCall.OneOnOne,
val membership: Membership = Membership.None,
val protocolInfo: Conversation.ProtocolInfo? = null,
val mlsVerificationStatus: Conversation.VerificationStatus = Conversation.VerificationStatus.NOT_VERIFIED,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ import com.wire.android.util.dispatchers.DispatcherProvider
import com.wire.android.util.ui.WireSessionImageLoader
import com.wire.kalium.logic.data.call.Call
import com.wire.kalium.logic.data.call.CallStatus
import com.wire.kalium.logic.data.call.ConversationType
import com.wire.kalium.logic.data.call.ConversationTypeForCall
import com.wire.kalium.logic.data.call.VideoState
import com.wire.kalium.logic.data.conversation.Conversation
import com.wire.kalium.logic.data.conversation.ConversationDetails
Expand Down Expand Up @@ -128,7 +128,7 @@ class SharedCallingViewModel @AssistedInject constructor(
is ConversationDetails.Group -> {
callState.copy(
conversationName = getConversationName(details.conversation.name),
conversationType = ConversationType.Conference,
conversationTypeForCall = ConversationTypeForCall.Conference,
protocolInfo = details.conversation.protocol,
mlsVerificationStatus = details.conversation.mlsVerificationStatus,
proteusVerificationStatus = details.conversation.proteusVerificationStatus
Expand All @@ -141,7 +141,7 @@ class SharedCallingViewModel @AssistedInject constructor(
avatarAssetId = details.otherUser.completePicture?.let { assetId ->
ImageAsset.UserAvatarAsset(wireSessionImageLoader, assetId)
},
conversationType = ConversationType.OneOnOne,
conversationTypeForCall = ConversationTypeForCall.OneOnOne,
membership = userTypeMapper.toMembership(details.otherUser.userType),
protocolInfo = details.conversation.protocol,
mlsVerificationStatus = details.conversation.mlsVerificationStatus,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@ import com.wire.android.ui.home.conversationslist.model.Membership
import com.wire.android.ui.home.conversationslist.model.hasLabel
import com.wire.android.ui.theme.wireTypography
import com.wire.android.util.EMPTY
import com.wire.kalium.logic.data.call.ConversationType
import com.wire.kalium.logic.data.call.ConversationTypeForCall
import com.wire.kalium.logic.data.conversation.Conversation
import com.wire.kalium.logic.data.id.ConversationId
import java.util.Locale
Expand All @@ -61,7 +61,7 @@ fun CallerDetails(
isCameraOn: Boolean,
isCbrEnabled: Boolean,
avatarAssetId: ImageAsset.UserAvatarAsset?,
conversationType: ConversationType,
conversationTypeForCall: ConversationTypeForCall,
membership: Membership,
callingLabel: String,
protocolInfo: Conversation.ProtocolInfo?,
Expand Down Expand Up @@ -130,7 +130,7 @@ fun CallerDetails(
modifier = Modifier.padding(top = dimensions().spacing8x)
)

if (!isCameraOn && conversationType == ConversationType.OneOnOne) {
if (!isCameraOn && conversationTypeForCall == ConversationTypeForCall.OneOnOne) {
UserProfileAvatar(
avatarData = UserAvatarData(avatarAssetId),
size = dimensions().outgoingCallUserAvatarSize,
Expand All @@ -149,7 +149,7 @@ fun PreviewCallerDetails() {
isCameraOn = false,
isCbrEnabled = false,
avatarAssetId = null,
conversationType = ConversationType.OneOnOne,
conversationTypeForCall = ConversationTypeForCall.OneOnOne,
membership = Membership.Guest,
callingLabel = String.EMPTY,
protocolInfo = null,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,7 @@ import com.wire.android.ui.common.visbility.rememberVisibilityState
import com.wire.android.ui.home.conversations.PermissionPermanentlyDeniedDialogState
import com.wire.android.ui.theme.wireTypography
import com.wire.android.util.permission.rememberRecordAudioPermissionFlow
import com.wire.kalium.logic.data.call.ConversationType
import com.wire.kalium.logic.data.call.ConversationTypeForCall
import com.wire.kalium.logic.data.id.ConversationId

@Suppress("ParameterWrapping")
Expand Down Expand Up @@ -247,7 +247,7 @@ private fun IncomingCallContent(
onVideoPreviewCreated = onVideoPreviewCreated,
onSelfClearVideoPreview = onSelfClearVideoPreview
)
val isCallingString = if (callState.conversationType == ConversationType.Conference) {
val isCallingString = if (callState.conversationTypeForCall == ConversationTypeForCall.Conference) {
stringResource(R.string.calling_label_incoming_call_someone_calling, callState.callerName ?: "")
} else stringResource(R.string.calling_label_incoming_call)

Expand All @@ -257,7 +257,7 @@ private fun IncomingCallContent(
isCameraOn = callState.isCameraOn,
isCbrEnabled = callState.isCbrEnabled,
avatarAssetId = callState.avatarAssetId,
conversationType = callState.conversationType,
conversationTypeForCall = callState.conversationTypeForCall,
membership = callState.membership,
callingLabel = isCallingString,
protocolInfo = callState.protocolInfo,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -175,7 +175,7 @@ private fun OutgoingCallContent(
isCameraOn = callState.isCameraOn,
isCbrEnabled = callState.isCbrEnabled,
avatarAssetId = callState.avatarAssetId,
conversationType = callState.conversationType,
conversationTypeForCall = callState.conversationTypeForCall,
membership = callState.membership,
callingLabel = stringResource(id = R.string.calling_label_ringing_call),
protocolInfo = callState.protocolInfo,
Expand Down
2 changes: 1 addition & 1 deletion kalium
Submodule kalium updated 29 files
+1 βˆ’1 data/src/commonMain/kotlin/com/wire/kalium/logic/data/call/ConversationTypeForCall.kt
+5 βˆ’0 logic/src/androidInstrumentedTest/kotlin/com/wire/kalium/logic/feature/call/CallManagerTest.kt
+3 βˆ’4 logic/src/androidInstrumentedTest/kotlin/com/wire/kalium/logic/feature/call/scenario/OnIncomingCallTest.kt
+2 βˆ’0 logic/src/appleMain/kotlin/com/wire/kalium/logic/feature/call/CallManagerImpl.kt
+2 βˆ’0 logic/src/appleMain/kotlin/com/wire/kalium/logic/feature/call/GlobalCallManager.kt
+8 βˆ’9 logic/src/commonJvmAndroid/kotlin/com/wire/kalium/logic/feature/call/CallManagerImpl.kt
+3 βˆ’0 logic/src/commonJvmAndroid/kotlin/com/wire/kalium/logic/feature/call/GlobalCallManager.kt
+2 βˆ’2 logic/src/commonJvmAndroid/kotlin/com/wire/kalium/logic/feature/call/scenario/OnIncomingCall.kt
+2 βˆ’2 logic/src/commonMain/kotlin/com/wire/kalium/logic/data/call/CallRepository.kt
+44 βˆ’28 logic/src/commonMain/kotlin/com/wire/kalium/logic/data/call/mapper/CallMapper.kt
+6 βˆ’0 logic/src/commonMain/kotlin/com/wire/kalium/logic/data/conversation/ConversationMapper.kt
+8 βˆ’0 logic/src/commonMain/kotlin/com/wire/kalium/logic/data/conversation/ConversationRepository.kt
+1 βˆ’1 logic/src/commonMain/kotlin/com/wire/kalium/logic/data/featureConfig/FeatureConfigMapper.kt
+24 βˆ’12 logic/src/commonMain/kotlin/com/wire/kalium/logic/feature/UserSessionScope.kt
+2 βˆ’0 logic/src/commonMain/kotlin/com/wire/kalium/logic/feature/call/CallManager.kt
+10 βˆ’7 logic/src/commonMain/kotlin/com/wire/kalium/logic/feature/call/CallsScope.kt
+2 βˆ’0 logic/src/commonMain/kotlin/com/wire/kalium/logic/feature/call/GlobalCallManager.kt
+71 βˆ’0 logic/src/commonMain/kotlin/com/wire/kalium/logic/feature/call/usecase/GetCallConversationTypeProvider.kt
+6 βˆ’0 logic/src/commonMain/kotlin/com/wire/kalium/logic/feature/call/usecase/StartCallUseCase.kt
+17 βˆ’7 logic/src/commonTest/kotlin/com/wire/kalium/logic/data/call/CallMapperTest.kt
+10 βˆ’10 logic/src/commonTest/kotlin/com/wire/kalium/logic/data/call/CallRepositoryTest.kt
+259 βˆ’0 logic/src/commonTest/kotlin/com/wire/kalium/logic/feature/call/usecase/GetCallConversationTypeProviderTest.kt
+21 βˆ’4 logic/src/commonTest/kotlin/com/wire/kalium/logic/feature/call/usecase/StartCallUseCaseTest.kt
+1 βˆ’1 ...del/src/commonMain/kotlin/com/wire/kalium/network/api/authenticated/featureConfigs/FeatureConfigResponse.kt
+3 βˆ’0 persistence/src/commonMain/db_user/com/wire/kalium/persistence/Conversations.sq
+2 βˆ’2 persistence/src/commonMain/db_user/com/wire/kalium/persistence/Notification.sq
+1 βˆ’0 persistence/src/commonMain/kotlin/com/wire/kalium/persistence/dao/conversation/ConversationDAO.kt
+5 βˆ’0 persistence/src/commonMain/kotlin/com/wire/kalium/persistence/dao/conversation/ConversationDAOImpl.kt
+24 βˆ’5 persistence/src/commonTest/kotlin/com/wire/kalium/persistence/dao/message/MessageNotificationsTest.kt

0 comments on commit 7389744

Please sign in to comment.