ios: fix accepting contact request incognito; android, desktop: fix showing incognito auto-accept toggle when short link data is not set (#6026)

* ios: fix accepting contact request incognito

* kotlin: fix incognito toggle
This commit is contained in:
spaced4ndy
2025-07-01 12:35:21 +00:00
committed by GitHub
parent 7726522e5a
commit 557e8ddbe4
5 changed files with 6 additions and 6 deletions

View File

@@ -69,7 +69,7 @@ struct ContextContactRequestActionsView: View {
private func acceptRequest(incognito: Bool = false) {
inProgress = true
Task {
await acceptContactRequest(incognito: false, contactRequestId: contactRequestId)
await acceptContactRequest(incognito: incognito, contactRequestId: contactRequestId)
await MainActor.run { inProgress = false }
}
}

View File

@@ -171,7 +171,7 @@ object ChatModel {
// return true if you handled the click
var centerPanelBackgroundClickHandler: (() -> Boolean)? = null
var addressShortLinkDataSet: Boolean = userAddress.value?.shortLinkDataSet ?: true
fun addressShortLinkDataSet(): Boolean = userAddress.value?.shortLinkDataSet ?: true
fun getUser(userId: Long): User? = if (currentUser.value?.userId == userId) {
currentUser.value

View File

@@ -63,7 +63,7 @@ fun ComposeContextContactRequestActionsView(
.fillMaxHeight()
.weight(1F)
.clickable {
if (chatModel.addressShortLinkDataSet) {
if (chatModel.addressShortLinkDataSet()) {
acceptContactRequest(rhId, incognito = false, contactRequestId, isCurrentUser = true, chatModel)
} else {
showAcceptRequestAlert(rhId, contactRequestId)

View File

@@ -523,7 +523,7 @@ fun ContactRequestMenuItems(rhId: Long?, contactRequestId: Long, chatModel: Chat
showMenu.value = false
}
)
if (!chatModel.addressShortLinkDataSet) {
if (!chatModel.addressShortLinkDataSet()) {
ItemAction(
stringResource(MR.strings.accept_contact_incognito_button),
painterResource(MR.images.ic_theater_comedy),
@@ -675,7 +675,7 @@ fun contactRequestAlertDialog(rhId: Long?, contactRequest: ChatInfo.ContactReque
}) {
Text(generalGetString(MR.strings.accept_contact_button), Modifier.fillMaxWidth(), textAlign = TextAlign.Center, color = MaterialTheme.colors.primary)
}
if (!chatModel.addressShortLinkDataSet) {
if (!chatModel.addressShortLinkDataSet()) {
SectionItemView({
AlertManager.shared.hideAlert()
acceptContactRequest(rhId, incognito = true, contactRequest.apiId, true, chatModel, onSucess)

View File

@@ -575,7 +575,7 @@ private class AddressSettingsState {
@Composable
private fun AutoAcceptSection(addressSettingsState: MutableState<AddressSettingsState>) {
SectionView(stringResource(MR.strings.auto_accept_contact).uppercase()) {
if (!chatModel.addressShortLinkDataSet && !addressSettingsState.value.businessAddress) {
if (!chatModel.addressShortLinkDataSet() && !addressSettingsState.value.businessAddress) {
AcceptIncognitoToggle(addressSettingsState)
}
// TODO v6.4.1 show this message editor even with auto-accept disabled