From 3a38f44d1f683c2e15ffb7aee614ad7bb53bfa1a Mon Sep 17 00:00:00 2001 From: ryanzhao Date: Fri, 22 Oct 2021 11:59:57 +1100 Subject: [PATCH 1/2] fix deleting message in open groups --- Session/Conversations/ConversationVC+Interaction.swift | 9 +++++++-- .../MediaPageViewController.swift | 2 +- 2 files changed, 8 insertions(+), 3 deletions(-) diff --git a/Session/Conversations/ConversationVC+Interaction.swift b/Session/Conversations/ConversationVC+Interaction.swift index ff908f43f..90807940f 100644 --- a/Session/Conversations/ConversationVC+Interaction.swift +++ b/Session/Conversations/ConversationVC+Interaction.swift @@ -567,8 +567,13 @@ extension ConversationVC : InputViewDelegate, MessageCellDelegate, ContextMenuAc return } - if viewItem.interaction.interactionType() == .outgoingMessage, - let message = viewItem.interaction as? TSMessage, message.serverHash != nil { + guard let message = viewItem.interaction as? TSMessage else { return self.deleteLocally(viewItem) } + + // Handle open group messages the old way + if message.isOpenGroupMessage { return self.deleteForEveryone(viewItem) } + + // Handle 1-1 and closed group messages with unsend request + if viewItem.interaction.interactionType() == .outgoingMessage, message.serverHash != nil { let alertVC = UIAlertController.init(title: nil, message: nil, preferredStyle: .actionSheet) let deleteLocallyAction = UIAlertAction.init(title: NSLocalizedString("delete_message_for_me", comment: ""), style: .destructive) { _ in self.deleteLocally(viewItem) diff --git a/Session/Media Viewing & Editing/MediaPageViewController.swift b/Session/Media Viewing & Editing/MediaPageViewController.swift index 6036e8044..9301d4f57 100644 --- a/Session/Media Viewing & Editing/MediaPageViewController.swift +++ b/Session/Media Viewing & Editing/MediaPageViewController.swift @@ -406,7 +406,7 @@ class MediaPageViewController: UIPageViewController, UIPageViewControllerDataSou } let actionSheet = UIAlertController(title: nil, message: nil, preferredStyle: .actionSheet) - let deleteAction = UIAlertAction(title: NSLocalizedString("TXT_DELETE_TITLE", comment: ""), + let deleteAction = UIAlertAction(title: NSLocalizedString("delete_message_for_me", comment: ""), style: .destructive) { _ in let deletedItem = currentViewController.galleryItem mediaGalleryDataSource.delete(items: [deletedItem], initiatedBy: self) From e529e68cb22abcdb7422c9b79ae44a1950744d21 Mon Sep 17 00:00:00 2001 From: ryanzhao Date: Fri, 22 Oct 2021 14:38:33 +1100 Subject: [PATCH 2/2] update build number --- Session.xcodeproj/project.pbxproj | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/Session.xcodeproj/project.pbxproj b/Session.xcodeproj/project.pbxproj index af76e017c..7612a87aa 100644 --- a/Session.xcodeproj/project.pbxproj +++ b/Session.xcodeproj/project.pbxproj @@ -5049,7 +5049,7 @@ "CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer"; CODE_SIGN_STYLE = Automatic; COPY_PHASE_STRIP = NO; - CURRENT_PROJECT_VERSION = 304; + CURRENT_PROJECT_VERSION = 305; DEBUG_INFORMATION_FORMAT = dwarf; DEVELOPMENT_TEAM = SUQ8J2PCT7; FRAMEWORK_SEARCH_PATHS = "$(inherited)"; @@ -5122,7 +5122,7 @@ "CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer"; CODE_SIGN_STYLE = Automatic; COPY_PHASE_STRIP = NO; - CURRENT_PROJECT_VERSION = 304; + CURRENT_PROJECT_VERSION = 305; DEBUG_INFORMATION_FORMAT = "dwarf-with-dsym"; DEVELOPMENT_TEAM = SUQ8J2PCT7; ENABLE_NS_ASSERTIONS = NO; @@ -5188,7 +5188,7 @@ "CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer"; CODE_SIGN_STYLE = Automatic; COPY_PHASE_STRIP = NO; - CURRENT_PROJECT_VERSION = 304; + CURRENT_PROJECT_VERSION = 305; DEBUG_INFORMATION_FORMAT = dwarf; DEVELOPMENT_TEAM = SUQ8J2PCT7; FRAMEWORK_SEARCH_PATHS = "$(inherited)"; @@ -5262,7 +5262,7 @@ "CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer"; CODE_SIGN_STYLE = Automatic; COPY_PHASE_STRIP = NO; - CURRENT_PROJECT_VERSION = 304; + CURRENT_PROJECT_VERSION = 305; DEBUG_INFORMATION_FORMAT = "dwarf-with-dsym"; DEVELOPMENT_TEAM = SUQ8J2PCT7; ENABLE_NS_ASSERTIONS = NO; @@ -6198,7 +6198,7 @@ CODE_SIGN_ENTITLEMENTS = Session/Meta/Signal.entitlements; CODE_SIGN_IDENTITY = "iPhone Developer"; "CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer"; - CURRENT_PROJECT_VERSION = 304; + CURRENT_PROJECT_VERSION = 305; DEVELOPMENT_TEAM = SUQ8J2PCT7; FRAMEWORK_SEARCH_PATHS = ( "$(inherited)", @@ -6269,7 +6269,7 @@ CODE_SIGN_ENTITLEMENTS = Session/Meta/Signal.entitlements; CODE_SIGN_IDENTITY = "iPhone Developer"; "CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer"; - CURRENT_PROJECT_VERSION = 304; + CURRENT_PROJECT_VERSION = 305; DEVELOPMENT_TEAM = SUQ8J2PCT7; FRAMEWORK_SEARCH_PATHS = ( "$(inherited)",