feat: rename stripLocationMetadata to stripMetadata in UI state and dialogs

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
This commit is contained in:
davotoula
2026-03-18 10:42:59 +01:00
parent c76459859d
commit 3b1b15911f
8 changed files with 15 additions and 15 deletions
@@ -66,7 +66,7 @@ open class NewMediaModel : ViewModel() {
var useH265Codec by mutableStateOf(false) var useH265Codec by mutableStateOf(false)
// Strip location and sensitive metadata from files before upload // Strip location and sensitive metadata from files before upload
var stripLocationMetadata by mutableStateOf(true) var stripMetadata by mutableStateOf(true)
open fun load( open fun load(
account: Account, account: Account,
@@ -76,7 +76,7 @@ open class NewMediaModel : ViewModel() {
this.account = account this.account = account
this.multiOrchestrator = MultiOrchestrator(uris) this.multiOrchestrator = MultiOrchestrator(uris)
this.selectedServer = defaultServer() this.selectedServer = defaultServer()
this.stripLocationMetadata = account.settings.stripLocationOnUpload this.stripMetadata = account.settings.stripLocationOnUpload
} }
fun isImage( fun isImage(
@@ -119,7 +119,7 @@ open class NewMediaModel : ViewModel() {
myAccount, myAccount,
context, context,
useH265Codec, useH265Codec,
stripLocationMetadata, stripMetadata,
) )
if (results.allGood) { if (results.allGood) {
@@ -112,7 +112,7 @@ fun NewMediaView(
postViewModel.selectedServer?.let { postViewModel.selectedServer?.let {
account.settings.changeDefaultFileServer(it) account.settings.changeDefaultFileServer(it)
} }
account.settings.changeStripLocationOnUpload(postViewModel.stripLocationMetadata) account.settings.changeStripLocationOnUpload(postViewModel.stripMetadata)
}, },
) )
}, },
@@ -278,7 +278,7 @@ fun ImageVideoPost(
Modifier Modifier
.fillMaxWidth() .fillMaxWidth()
.padding(top = 8.dp), .padding(top = 8.dp),
checked = postViewModel.stripLocationMetadata, checked = postViewModel.stripMetadata,
onCheckedChange = { postViewModel.stripLocationMetadata = it }, onCheckedChange = { postViewModel.stripMetadata = it },
) )
} }
@@ -70,7 +70,7 @@ fun RoomChatFileUploadDialog(
) )
accountViewModel.account.settings.changeDefaultFileServer(state.selectedServer) accountViewModel.account.settings.changeDefaultFileServer(state.selectedServer)
accountViewModel.account.settings.changeStripLocationOnUpload(state.stripLocationMetadata) accountViewModel.account.settings.changeStripLocationOnUpload(state.stripMetadata)
}, },
onCancel, onCancel,
accountViewModel, accountViewModel,
@@ -104,7 +104,7 @@ class ChatFileUploader(
viewState.selectedServer, viewState.selectedServer,
account, account,
context, context,
stripMetadata = viewState.stripLocationMetadata, stripMetadata = viewState.stripMetadata,
) )
if (results.allGood) { if (results.allGood) {
@@ -149,7 +149,7 @@ class ChatFileUploader(
viewState.selectedServer, viewState.selectedServer,
account, account,
context, context,
stripMetadata = viewState.stripLocationMetadata, stripMetadata = viewState.stripMetadata,
) )
if (results.allGood) { if (results.allGood) {
@@ -131,7 +131,7 @@ fun ChannelFileUploadDialog(
) )
accountViewModel.account.settings.changeDefaultFileServer(state.selectedServer) accountViewModel.account.settings.changeDefaultFileServer(state.selectedServer)
accountViewModel.account.settings.changeStripLocationOnUpload(state.stripLocationMetadata) accountViewModel.account.settings.changeStripLocationOnUpload(state.stripMetadata)
}, },
onCancel, onCancel,
accountViewModel, accountViewModel,
@@ -348,7 +348,7 @@ open class ChannelNewMessageViewModel :
uploadState.selectedServer, uploadState.selectedServer,
account, account,
context, context,
stripMetadata = uploadState.stripLocationMetadata, stripMetadata = uploadState.stripMetadata,
) )
if (results.allGood) { if (results.allGood) {
@@ -265,8 +265,8 @@ private fun ImageVideoPostChat(
title = R.string.strip_metadata_label, title = R.string.strip_metadata_label,
description = R.string.strip_metadata_description, description = R.string.strip_metadata_description,
modifier = Modifier.fillMaxWidth().padding(top = 8.dp), modifier = Modifier.fillMaxWidth().padding(top = 8.dp),
checked = fileUploadState.stripLocationMetadata, checked = fileUploadState.stripMetadata,
onCheckedChange = { fileUploadState.stripLocationMetadata = it }, onCheckedChange = { fileUploadState.stripMetadata = it },
) )
} }
@@ -36,7 +36,7 @@ import kotlinx.collections.immutable.ImmutableList
@Stable @Stable
class ChatFileUploadState( class ChatFileUploadState(
val defaultServer: ServerName, val defaultServer: ServerName,
defaultStripLocationMetadata: Boolean = true, defaultStripMetadata: Boolean = true,
) { ) {
val mediaUploadTracker = MediaUploadTracker() val mediaUploadTracker = MediaUploadTracker()
val isUploadingImage: Boolean get() = mediaUploadTracker.isUploadingImage val isUploadingImage: Boolean get() = mediaUploadTracker.isUploadingImage
@@ -56,7 +56,7 @@ class ChatFileUploadState(
// 0 = Low, 1 = Medium, 2 = High, 3=UNCOMPRESSED // 0 = Low, 1 = Medium, 2 = High, 3=UNCOMPRESSED
var mediaQualitySlider by mutableIntStateOf(1) var mediaQualitySlider by mutableIntStateOf(1)
var stripLocationMetadata by mutableStateOf(defaultStripLocationMetadata) var stripMetadata by mutableStateOf(defaultStripMetadata)
var encryptFiles by mutableStateOf(true) var encryptFiles by mutableStateOf(true)
fun load(uris: ImmutableList<SelectedMedia>) { fun load(uris: ImmutableList<SelectedMedia>) {