diff --git a/Session/Conversations/Settings/ThreadSettingsViewModel.swift b/Session/Conversations/Settings/ThreadSettingsViewModel.swift index b8f8067dc..c4ec3ac98 100644 --- a/Session/Conversations/Settings/ThreadSettingsViewModel.swift +++ b/Session/Conversations/Settings/ThreadSettingsViewModel.swift @@ -516,7 +516,7 @@ class ThreadSettingsViewModel: SessionTableViewModel, NavigationItemSource, Navi confirmationInfo: ConfirmationModal.Info( title: "groupLeave".localized(), body: .attributedText( - "groupDeleteDescription" + (currentUserIsClosedGroupAdmin ? "groupDeleteDescription" : "groupLeaveDescription") .put(key: "group_name", value: threadViewModel.displayName) .localizedFormatted(baseFont: .boldSystemFont(ofSize: Values.smallFontSize)) ), diff --git a/Session/Utilities/UIContextualAction+Utilities.swift b/Session/Utilities/UIContextualAction+Utilities.swift index 4c86fabbe..1a947ec31 100644 --- a/Session/Utilities/UIContextualAction+Utilities.swift +++ b/Session/Utilities/UIContextualAction+Utilities.swift @@ -416,8 +416,8 @@ public extension UIContextualAction { }() let confirmationModalExplanation: NSAttributedString = { - switch threadViewModel.threadVariant { - case .legacyGroup, .group: + switch (threadViewModel.threadVariant, threadViewModel.currentUserIsClosedGroupAdmin) { + case (.legacyGroup, true), (.group, true): return "groupDeleteDescription" .put(key: "group_name", value: threadViewModel.displayName) .localizedFormatted(baseFont: .boldSystemFont(ofSize: Values.smallFontSize)) @@ -516,18 +516,19 @@ public extension UIContextualAction { ) } + guard threadViewModel.currentUserIsClosedGroupAdmin == false else { + return "groupDeleteDescription" + .put(key: "group_name", value: threadViewModel.displayName) + .localizedFormatted(baseFont: .boldSystemFont(ofSize: Values.smallFontSize)) + } + switch threadViewModel.threadVariant { case .contact: return "conversationsDeleteDescription" .put(key: "name", value: threadViewModel.displayName) .localizedFormatted(baseFont: .boldSystemFont(ofSize: Values.smallFontSize)) - case .legacyGroup, .group: - return "groupDeleteDescription" - .put(key: "group_name", value: threadViewModel.displayName) - .localizedFormatted(baseFont: .boldSystemFont(ofSize: Values.smallFontSize)) - - case .community: + default: return "groupLeaveDescription" .put(key: "group_name", value: threadViewModel.displayName) .localizedFormatted(baseFont: .boldSystemFont(ofSize: Values.smallFontSize))