Convert InternalValues to kotlin.

This commit is contained in:
Greyson Parrelli
2024-11-18 12:18:29 -05:00
parent 5f67bd9725
commit ae37001949
25 changed files with 270 additions and 289 deletions

View File

@@ -115,7 +115,7 @@ class InternalSettingsViewModel(private val repository: InternalSettingsReposito
}
fun setUseConversationItemV2Media(enabled: Boolean) {
SignalStore.internal.setUseConversationItemV2Media(enabled)
SignalStore.internal.useConversationItemV2Media = enabled
refresh()
}
@@ -145,25 +145,25 @@ class InternalSettingsViewModel(private val repository: InternalSettingsReposito
}
private fun getState() = InternalSettingsState(
seeMoreUserDetails = SignalStore.internal.recipientDetails(),
shakeToReport = SignalStore.internal.shakeToReport(),
gv2forceInvites = SignalStore.internal.gv2ForceInvites(),
gv2ignoreP2PChanges = SignalStore.internal.gv2IgnoreP2PChanges(),
allowCensorshipSetting = SignalStore.internal.allowChangingCensorshipSetting(),
seeMoreUserDetails = SignalStore.internal.recipientDetails,
shakeToReport = SignalStore.internal.shakeToReport,
gv2forceInvites = SignalStore.internal.gv2ForceInvites,
gv2ignoreP2PChanges = SignalStore.internal.gv2IgnoreP2PChanges,
allowCensorshipSetting = SignalStore.internal.allowChangingCensorshipSetting,
forceWebsocketMode = SignalStore.internal.isWebsocketModeForced,
callingServer = SignalStore.internal.groupCallingServer(),
callingAudioProcessingMethod = SignalStore.internal.callingAudioProcessingMethod(),
callingDataMode = SignalStore.internal.callingDataMode(),
callingDisableTelecom = SignalStore.internal.callingDisableTelecom(),
callingEnableOboeAdm = SignalStore.internal.callingEnableOboeAdm(),
useBuiltInEmojiSet = SignalStore.internal.forceBuiltInEmoji(),
callingServer = SignalStore.internal.groupCallingServer,
callingAudioProcessingMethod = SignalStore.internal.callingAudioProcessingMethod,
callingDataMode = SignalStore.internal.callingDataMode,
callingDisableTelecom = SignalStore.internal.callingDisableTelecom,
callingEnableOboeAdm = SignalStore.internal.callingEnableOboeAdm,
useBuiltInEmojiSet = SignalStore.internal.forceBuiltInEmoji,
emojiVersion = null,
removeSenderKeyMinimium = SignalStore.internal.removeSenderKeyMinimum(),
delayResends = SignalStore.internal.delayResends(),
disableStorageService = SignalStore.internal.storageServiceDisabled(),
removeSenderKeyMinimium = SignalStore.internal.removeSenderKeyMinimum,
delayResends = SignalStore.internal.delayResends,
disableStorageService = SignalStore.internal.storageServiceDisabled,
canClearOnboardingState = SignalStore.story.hasDownloadedOnboardingStory && Stories.isFeatureEnabled(),
pnpInitialized = SignalStore.misc.hasPniInitializedDevices,
useConversationItemV2ForMedia = SignalStore.internal.useConversationItemV2Media(),
useConversationItemV2ForMedia = SignalStore.internal.useConversationItemV2Media,
hasPendingOneTimeDonation = SignalStore.inAppPayments.getPendingOneTimeDonation() != null,
hevcEncoding = SignalStore.internal.hevcEncoding,
newCallingUi = SignalStore.internal.newCallingUi

View File

@@ -96,7 +96,7 @@ class AdvancedPrivacySettingsViewModel(
val websocketConnected: Boolean = AppDependencies.signalWebSocket.webSocketState.firstOrError().blockingGet() == WebSocketConnectionState.CONNECTED
return when {
SignalStore.internal.allowChangingCensorshipSetting() -> {
SignalStore.internal.allowChangingCensorshipSetting -> {
CensorshipCircumventionState.AVAILABLE
}
isCountryCodeCensoredByDefault && enabledState == SettingsValues.CensorshipCircumventionEnabled.DISABLED -> {

View File

@@ -84,7 +84,7 @@ class ConversationSettingsRepository(
}
}
fun isInternalRecipientDetailsEnabled(): Boolean = SignalStore.internal.recipientDetails()
fun isInternalRecipientDetailsEnabled(): Boolean = SignalStore.internal.recipientDetails
fun hasGroups(consumer: (Boolean) -> Unit) {
SignalExecutors.BOUNDED.execute { consumer(SignalDatabase.groups.getActiveGroupCount() > 0) }