From 4e2cef634699f8afcdca1584164eb57e4f5bdfeb Mon Sep 17 00:00:00 2001 From: ThomasSession Date: Mon, 9 Sep 2024 11:32:01 +1000 Subject: [PATCH] Fixing 'Leave group dialog' from inside the group settings --- .../conversation/v2/menus/ConversationMenuHelper.kt | 6 +++--- .../org/thoughtcrime/securesms/home/HomeActivity.kt | 5 +++-- libsession/src/main/res/values/strings.xml | 13 ++++++++----- 3 files changed, 14 insertions(+), 10 deletions(-) diff --git a/app/src/main/java/org/thoughtcrime/securesms/conversation/v2/menus/ConversationMenuHelper.kt b/app/src/main/java/org/thoughtcrime/securesms/conversation/v2/menus/ConversationMenuHelper.kt index fd62793422..d6b6b25f90 100644 --- a/app/src/main/java/org/thoughtcrime/securesms/conversation/v2/menus/ConversationMenuHelper.kt +++ b/app/src/main/java/org/thoughtcrime/securesms/conversation/v2/menus/ConversationMenuHelper.kt @@ -286,7 +286,7 @@ object ConversationMenuHelper { val accountID = TextSecurePreferences.getLocalNumber(context) val isCurrentUserAdmin = admins.any { it.toString() == accountID } val message = if (isCurrentUserAdmin) { - Phrase.from(context, R.string.groupLeaveDescriptionAdmin) + Phrase.from(context, R.string.groupDeleteDescription) .put(GROUP_NAME_KEY, group.title) .format() } else { @@ -305,7 +305,7 @@ object ConversationMenuHelper { context.showSessionDialog { title(R.string.groupLeave) text(message) - button(R.string.yes) { + dangerButton(R.string.leave) { try { val groupPublicKey = doubleDecodeGroupID(thread.address.toString()).toHexString() val isClosedGroup = DatabaseComponent.get(context).lokiAPIDatabase().isClosedGroup(groupPublicKey) @@ -316,7 +316,7 @@ object ConversationMenuHelper { onLeaveFailed() } } - button(R.string.no) + button(R.string.cancel) } } diff --git a/app/src/main/java/org/thoughtcrime/securesms/home/HomeActivity.kt b/app/src/main/java/org/thoughtcrime/securesms/home/HomeActivity.kt index 69442b512e..dbcc39e7b6 100644 --- a/app/src/main/java/org/thoughtcrime/securesms/home/HomeActivity.kt +++ b/app/src/main/java/org/thoughtcrime/securesms/home/HomeActivity.kt @@ -595,8 +595,6 @@ class HomeActivity : PassphraseRequiredActionBarActivity(), message = Phrase.from(this.applicationContext, R.string.groupDeleteDescription) .put(GROUP_NAME_KEY, group.title) .format() - positiveButtonId = R.string.leave - negativeButtonId = R.string.cancel } else { // Otherwise this is either a community, or it's a group you're not an admin of title = if (recipient.isCommunityRecipient) getString(R.string.communityLeave) else getString(R.string.groupLeave) @@ -604,6 +602,9 @@ class HomeActivity : PassphraseRequiredActionBarActivity(), .put(GROUP_NAME_KEY, group.title) .format() } + + positiveButtonId = R.string.leave + negativeButtonId = R.string.cancel } else { // If this is a 1-on-1 conversation if (recipient.name != null) { diff --git a/libsession/src/main/res/values/strings.xml b/libsession/src/main/res/values/strings.xml index fbb869372c..dd2ca01029 100644 --- a/libsession/src/main/res/values/strings.xml +++ b/libsession/src/main/res/values/strings.xml @@ -163,7 +163,6 @@ Camera unavailable. Grant Camera Access {app_name} needs camera access to take photos and videos, but it has been permanently denied. Please continue to app settings, select \"Permissions\", and enable \"Camera\". - {app_name} needs camera access to take photos and videos, but it has been permanently denied. Tap Settings -> Permissions and turn \"Camera\" on. {app_name} needs camera access to take photos and videos, or scan QR codes. {app_name} needs camera access to scan QR codes Cancel @@ -313,6 +312,7 @@ Delete Type This setting applies to everyone in this conversation. This setting applies to messages you send in this conversation. + This setting applies to everyone in this conversation.\nOnly group admins can change this setting. Disappear After {disappearing_messages_type} - {time} Disappear After Read Messages delete after they have been read. @@ -414,7 +414,7 @@ You and {count} others were invited to join the group. You and {other_name} were invited to join the group. Leave Group - Are you sure you want to leave {group_name}? + Are you sure you want to leave {group_name}? Are you sure you want to leave {group_name}?\n\nThis will remove all members and delete all group content. Failed to leave {group_name} Groups have been upgraded, create a new group to upgrade. Old group functionality will be degraded from {date}. @@ -563,7 +563,7 @@ You have accepted the message request from {name}. Sending a message to this user will automatically accept their message request and reveal your Account ID. Your message request has been accepted. - Are you sure you want to clear all message and group invites? + Are you sure you want to clear all message requests and group invites? Community Message Requests Allow message requests from Community conversations. Are you sure you want to delete this message request? @@ -677,20 +677,23 @@ Set Password Your password has been set. Please keep it safe. Paste + {app_name} needs music and audio access in order to send files, music and audio, but it has been permanently denied. Tap Settings -> Permissions, and turn \"Music and audio\" on. {app_name} needs to use Apple Music to play media attachments. Auto Update Automatically check for updates on startup. + {app_name} needs camera access to take photos and videos, but it has been permanently denied. Tap Settings -> Permissions, and turn \"Camera\" on. The screen lock feature on {app_name} uses Face ID. Keep in System Tray {app_name} continues running in the background when you close the window {app_name} needs photo library access to continue. You can enable access in the iOS settings. Microphone - {app_name} needs microphone access to send audio messages, but it has been permanently denied. Tap settings -> Permissions, and turn \"Microphone\" on. + {app_name} needs microphone access to make calls and send audio messages, but it has been permanently denied. Tap settings -> Permissions, and turn \"Microphone\" on. You can enable microphone access in {app_name}\'s privacy settings {app_name} needs microphone access to make calls and record audio messages. Allow access to microphone. + {app_name} needs music and audio access in order to send files, music and audio. Permission required - {app_name} needs storage access so you can send and save attachments. Tap Settings -> Permissions, and turn \"Files and media\" on. + {app_name} needs photo library access so you can send photos and videos, but it has been permanently denied. Tap Settings -> Permissions, and turn \"Photos and videos\" on. {app_name} needs storage access so you can send and save attachments. Tap Settings -> Permissions, and turn \"Storage\" on. {app_name} needs storage access to save attachments and media. {app_name} needs storage access to save photos and videos, but it has been permanently denied. Please continue to app settings, select \"Permissions\", and enable \"Storage\".