From 19856c7ef579d5c2282237aff31b3bd455cfd7e3 Mon Sep 17 00:00:00 2001 From: Morgan Pretty Date: Fri, 14 Apr 2023 18:17:56 +1000 Subject: [PATCH 1/8] Disabled the disappearing messages setting when not a group member --- .../ThreadDisappearingMessagesViewModel.swift | 15 ++++++- .../Views/SessionCell+AccessoryView.swift | 30 ++++++++++---- .../SessionThreadViewModel.swift | 41 +++++++++++-------- .../Themes/Theme+ClassicDark.swift | 3 ++ .../Themes/Theme+ClassicLight.swift | 3 ++ .../Style Guide/Themes/Theme+Colors.swift | 4 +- .../Style Guide/Themes/Theme+OceanDark.swift | 3 ++ .../Style Guide/Themes/Theme+OceanLight.swift | 3 ++ SessionUIKit/Style Guide/Themes/Theme.swift | 3 ++ 9 files changed, 76 insertions(+), 29 deletions(-) diff --git a/Session/Conversations/Settings/ThreadDisappearingMessagesViewModel.swift b/Session/Conversations/Settings/ThreadDisappearingMessagesViewModel.swift index 886cc326a..a562ee556 100644 --- a/Session/Conversations/Settings/ThreadDisappearingMessagesViewModel.swift +++ b/Session/Conversations/Settings/ThreadDisappearingMessagesViewModel.swift @@ -98,7 +98,12 @@ class ThreadDisappearingMessagesViewModel: SessionTableViewModel [SectionModel] in + .trackingConstantRegion { [weak self, config, dependencies, threadId = self.threadId] db -> [SectionModel] in + let userPublicKey: String = getUserHexEncodedPublicKey(db, dependencies: dependencies) + let maybeThreadViewModel: SessionThreadViewModel? = try SessionThreadViewModel + .conversationSettingsQuery(threadId: threadId, userPublicKey: userPublicKey) + .fetchOne(db) + return [ SectionModel( model: .content, @@ -109,6 +114,10 @@ class ThreadDisappearingMessagesViewModel: SessionTableViewModel Date: Mon, 17 Apr 2023 08:42:03 +1000 Subject: [PATCH 2/8] Fixed an incorrect query resulting in always showing the 'sending' status --- .../Shared Models/SessionThreadViewModel.swift | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/SessionMessagingKit/Shared Models/SessionThreadViewModel.swift b/SessionMessagingKit/Shared Models/SessionThreadViewModel.swift index 01c249d6f..420b49a46 100644 --- a/SessionMessagingKit/Shared Models/SessionThreadViewModel.swift +++ b/SessionMessagingKit/Shared Models/SessionThreadViewModel.swift @@ -527,11 +527,11 @@ public extension SessionThreadViewModel { WHERE ( \(recipientState[.interactionId]) = \(interaction[.id]) AND -- Ignore 'skipped' states - \(SQL("\(recipientState[.state]) = \(RecipientState.State.sending)")) + \(SQL("\(recipientState[.state]) != \(RecipientState.State.skipped)")) ) LIMIT 1 - ), 0) AS \(ViewModel.interactionStateKey), - + ), \(SQL("\(RecipientState.State.sending)"))) AS \(ViewModel.interactionStateKey), + (\(readReceiptTableLiteral).\(readReceiptReadTimestampMsColumnLiteral) IS NOT NULL) AS \(ViewModel.interactionHasAtLeastOneReadReceiptKey), (\(linkPreview[.url]) IS NOT NULL) AS \(ViewModel.interactionIsOpenGroupInvitationKey), From 16bfbd4bad66a7a3c827e757eb9b0bdb504e1571 Mon Sep 17 00:00:00 2001 From: Morgan Pretty Date: Mon, 17 Apr 2023 08:44:09 +1000 Subject: [PATCH 3/8] Removed the iCloud entitlements --- Session/Meta/Signal.entitlements | 13 ------------- 1 file changed, 13 deletions(-) diff --git a/Session/Meta/Signal.entitlements b/Session/Meta/Signal.entitlements index 7be77767f..84526edd9 100644 --- a/Session/Meta/Signal.entitlements +++ b/Session/Meta/Signal.entitlements @@ -4,19 +4,6 @@ aps-environment production - com.apple.developer.icloud-container-identifiers - - iCloud.$(CFBundleIdentifier) - - com.apple.developer.icloud-services - - CloudDocuments - CloudKit - - com.apple.developer.ubiquity-container-identifiers - - iCloud.$(CFBundleIdentifier) - com.apple.security.application-groups group.com.loki-project.loki-messenger From 1d85fa35bd36a884c932f92619e6ed6aee11783e Mon Sep 17 00:00:00 2001 From: Morgan Pretty Date: Mon, 17 Apr 2023 15:48:12 +1000 Subject: [PATCH 4/8] Fixed a broken query preventing threads from appearing in the share extension --- .../Shared Models/SessionThreadViewModel.swift | 15 +++++++++++++-- 1 file changed, 13 insertions(+), 2 deletions(-) diff --git a/SessionMessagingKit/Shared Models/SessionThreadViewModel.swift b/SessionMessagingKit/Shared Models/SessionThreadViewModel.swift index 01c249d6f..b6ba6061a 100644 --- a/SessionMessagingKit/Shared Models/SessionThreadViewModel.swift +++ b/SessionMessagingKit/Shared Models/SessionThreadViewModel.swift @@ -1570,6 +1570,7 @@ public extension SessionThreadViewModel { let profile: TypedTableAlias = TypedTableAlias() let interaction: TypedTableAlias = TypedTableAlias() + let aggregateInteractionLiteral: SQL = SQL(stringLiteral: "aggregateInteraction") let profileIdColumnLiteral: SQL = SQL(stringLiteral: Profile.Columns.id.name) /// **Note:** The `numColumnsBeforeProfiles` value **MUST** match the number of fields before @@ -1603,11 +1604,21 @@ public extension SessionThreadViewModel { FROM \(SessionThread.self) LEFT JOIN \(Contact.self) ON \(contact[.id]) = \(thread[.id]) + LEFT JOIN ( - SELECT \(interaction[.threadId]), MAX(\(interaction[.timestampMs])) + SELECT + \(interaction[.id]) AS \(ViewModel.interactionIdKey), + \(interaction[.threadId]) AS \(ViewModel.threadIdKey), + MAX(\(interaction[.timestampMs])) FROM \(Interaction.self) + WHERE \(SQL("\(interaction[.variant]) != \(Interaction.Variant.standardIncomingDeleted)")) GROUP BY \(interaction[.threadId]) - ) AS \(Interaction.self) ON \(interaction[.threadId]) = \(thread[.id]) + ) AS \(aggregateInteractionLiteral) ON \(aggregateInteractionLiteral).\(ViewModel.threadIdKey) = \(thread[.id]) + LEFT JOIN \(Interaction.self) ON ( + \(interaction[.threadId]) = \(thread[.id]) AND + \(interaction[.id]) = \(aggregateInteractionLiteral).\(ViewModel.interactionIdKey) + ) + LEFT JOIN \(Profile.self) AS \(ViewModel.contactProfileKey) ON \(ViewModel.contactProfileKey).\(profileIdColumnLiteral) = \(thread[.id]) LEFT JOIN \(ClosedGroup.self) ON \(closedGroup[.threadId]) = \(thread[.id]) LEFT JOIN \(OpenGroup.self) ON \(openGroup[.threadId]) = \(thread[.id]) From 27e494dcb511eea78d3a988576034ea2aef3f70f Mon Sep 17 00:00:00 2001 From: Morgan Pretty Date: Tue, 18 Apr 2023 14:51:39 +1000 Subject: [PATCH 5/8] Increased build and version numbers --- Session.xcodeproj/project.pbxproj | 24 ++++++++++++------------ 1 file changed, 12 insertions(+), 12 deletions(-) diff --git a/Session.xcodeproj/project.pbxproj b/Session.xcodeproj/project.pbxproj index 5910fddad..363825f96 100644 --- a/Session.xcodeproj/project.pbxproj +++ b/Session.xcodeproj/project.pbxproj @@ -6076,7 +6076,7 @@ "CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer"; CODE_SIGN_STYLE = Automatic; COPY_PHASE_STRIP = NO; - CURRENT_PROJECT_VERSION = 401; + CURRENT_PROJECT_VERSION = 402; DEBUG_INFORMATION_FORMAT = dwarf; DEVELOPMENT_TEAM = SUQ8J2PCT7; FRAMEWORK_SEARCH_PATHS = "$(inherited)"; @@ -6101,7 +6101,7 @@ "@executable_path/Frameworks", "@executable_path/../../Frameworks", ); - MARKETING_VERSION = 2.2.12; + MARKETING_VERSION = 2.2.13; MTL_ENABLE_DEBUG_INFO = YES; PRODUCT_BUNDLE_IDENTIFIER = "com.loki-project.loki-messenger.ShareExtension"; PRODUCT_NAME = "$(TARGET_NAME)"; @@ -6149,7 +6149,7 @@ "CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer"; CODE_SIGN_STYLE = Automatic; COPY_PHASE_STRIP = NO; - CURRENT_PROJECT_VERSION = 401; + CURRENT_PROJECT_VERSION = 402; DEBUG_INFORMATION_FORMAT = "dwarf-with-dsym"; DEVELOPMENT_TEAM = SUQ8J2PCT7; ENABLE_NS_ASSERTIONS = NO; @@ -6179,7 +6179,7 @@ "@executable_path/Frameworks", "@executable_path/../../Frameworks", ); - MARKETING_VERSION = 2.2.12; + MARKETING_VERSION = 2.2.13; MTL_ENABLE_DEBUG_INFO = NO; PRODUCT_BUNDLE_IDENTIFIER = "com.loki-project.loki-messenger.ShareExtension"; PRODUCT_NAME = "$(TARGET_NAME)"; @@ -6215,7 +6215,7 @@ "CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer"; CODE_SIGN_STYLE = Automatic; COPY_PHASE_STRIP = NO; - CURRENT_PROJECT_VERSION = 401; + CURRENT_PROJECT_VERSION = 402; DEBUG_INFORMATION_FORMAT = dwarf; DEVELOPMENT_TEAM = SUQ8J2PCT7; FRAMEWORK_SEARCH_PATHS = "$(inherited)"; @@ -6238,7 +6238,7 @@ "@executable_path/Frameworks", "@executable_path/../../Frameworks", ); - MARKETING_VERSION = 2.2.12; + MARKETING_VERSION = 2.2.13; MTL_ENABLE_DEBUG_INFO = INCLUDE_SOURCE; MTL_FAST_MATH = YES; PRODUCT_BUNDLE_IDENTIFIER = "com.loki-project.loki-messenger.NotificationServiceExtension"; @@ -6289,7 +6289,7 @@ "CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer"; CODE_SIGN_STYLE = Automatic; COPY_PHASE_STRIP = NO; - CURRENT_PROJECT_VERSION = 401; + CURRENT_PROJECT_VERSION = 402; DEBUG_INFORMATION_FORMAT = "dwarf-with-dsym"; DEVELOPMENT_TEAM = SUQ8J2PCT7; ENABLE_NS_ASSERTIONS = NO; @@ -6317,7 +6317,7 @@ "@executable_path/Frameworks", "@executable_path/../../Frameworks", ); - MARKETING_VERSION = 2.2.12; + MARKETING_VERSION = 2.2.13; MTL_ENABLE_DEBUG_INFO = NO; MTL_FAST_MATH = YES; PRODUCT_BUNDLE_IDENTIFIER = "com.loki-project.loki-messenger.NotificationServiceExtension"; @@ -7217,7 +7217,7 @@ CODE_SIGN_ENTITLEMENTS = Session/Meta/Signal.entitlements; CODE_SIGN_IDENTITY = "iPhone Developer"; "CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer"; - CURRENT_PROJECT_VERSION = 401; + CURRENT_PROJECT_VERSION = 402; DEVELOPMENT_TEAM = SUQ8J2PCT7; FRAMEWORK_SEARCH_PATHS = ( "$(inherited)", @@ -7256,7 +7256,7 @@ "$(SRCROOT)", ); LLVM_LTO = NO; - MARKETING_VERSION = 2.2.12; + MARKETING_VERSION = 2.2.13; OTHER_LDFLAGS = "$(inherited)"; OTHER_SWIFT_FLAGS = "$(inherited) \"-D\" \"COCOAPODS\" \"-DDEBUG\""; PRODUCT_BUNDLE_IDENTIFIER = "com.loki-project.loki-messenger"; @@ -7289,7 +7289,7 @@ CODE_SIGN_ENTITLEMENTS = Session/Meta/Signal.entitlements; CODE_SIGN_IDENTITY = "iPhone Developer"; "CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer"; - CURRENT_PROJECT_VERSION = 401; + CURRENT_PROJECT_VERSION = 402; DEVELOPMENT_TEAM = SUQ8J2PCT7; FRAMEWORK_SEARCH_PATHS = ( "$(inherited)", @@ -7328,7 +7328,7 @@ "$(SRCROOT)", ); LLVM_LTO = NO; - MARKETING_VERSION = 2.2.12; + MARKETING_VERSION = 2.2.13; OTHER_LDFLAGS = "$(inherited)"; PRODUCT_BUNDLE_IDENTIFIER = "com.loki-project.loki-messenger"; PRODUCT_NAME = Session; From 08853e733301f7d6238b5bf770ce4ee2bab7e178 Mon Sep 17 00:00:00 2001 From: Morgan Pretty Date: Tue, 18 Apr 2023 16:03:12 +1000 Subject: [PATCH 6/8] Fixed an issue where mentions weren't working --- Session/Conversations/ConversationVC.swift | 1 + 1 file changed, 1 insertion(+) diff --git a/Session/Conversations/ConversationVC.swift b/Session/Conversations/ConversationVC.swift index 746213a43..10c6922b6 100644 --- a/Session/Conversations/ConversationVC.swift +++ b/Session/Conversations/ConversationVC.swift @@ -1266,6 +1266,7 @@ final class ConversationVC: BaseVC, ConversationSearchControllerDelegate, UITabl // after the app goes into background and goes back in foreground. DispatchQueue.main.async { self.snInputView.text = self.snInputView.text + completion?() } } From 6832b788d9ba0eebb9c6be0611b9da4a818558a9 Mon Sep 17 00:00:00 2001 From: Morgan Pretty Date: Tue, 18 Apr 2023 16:21:10 +1000 Subject: [PATCH 7/8] Increase 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 363825f96..0b26d6289 100644 --- a/Session.xcodeproj/project.pbxproj +++ b/Session.xcodeproj/project.pbxproj @@ -6076,7 +6076,7 @@ "CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer"; CODE_SIGN_STYLE = Automatic; COPY_PHASE_STRIP = NO; - CURRENT_PROJECT_VERSION = 402; + CURRENT_PROJECT_VERSION = 403; DEBUG_INFORMATION_FORMAT = dwarf; DEVELOPMENT_TEAM = SUQ8J2PCT7; FRAMEWORK_SEARCH_PATHS = "$(inherited)"; @@ -6149,7 +6149,7 @@ "CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer"; CODE_SIGN_STYLE = Automatic; COPY_PHASE_STRIP = NO; - CURRENT_PROJECT_VERSION = 402; + CURRENT_PROJECT_VERSION = 403; DEBUG_INFORMATION_FORMAT = "dwarf-with-dsym"; DEVELOPMENT_TEAM = SUQ8J2PCT7; ENABLE_NS_ASSERTIONS = NO; @@ -6215,7 +6215,7 @@ "CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer"; CODE_SIGN_STYLE = Automatic; COPY_PHASE_STRIP = NO; - CURRENT_PROJECT_VERSION = 402; + CURRENT_PROJECT_VERSION = 403; DEBUG_INFORMATION_FORMAT = dwarf; DEVELOPMENT_TEAM = SUQ8J2PCT7; FRAMEWORK_SEARCH_PATHS = "$(inherited)"; @@ -6289,7 +6289,7 @@ "CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer"; CODE_SIGN_STYLE = Automatic; COPY_PHASE_STRIP = NO; - CURRENT_PROJECT_VERSION = 402; + CURRENT_PROJECT_VERSION = 403; DEBUG_INFORMATION_FORMAT = "dwarf-with-dsym"; DEVELOPMENT_TEAM = SUQ8J2PCT7; ENABLE_NS_ASSERTIONS = NO; @@ -7217,7 +7217,7 @@ CODE_SIGN_ENTITLEMENTS = Session/Meta/Signal.entitlements; CODE_SIGN_IDENTITY = "iPhone Developer"; "CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer"; - CURRENT_PROJECT_VERSION = 402; + CURRENT_PROJECT_VERSION = 403; DEVELOPMENT_TEAM = SUQ8J2PCT7; FRAMEWORK_SEARCH_PATHS = ( "$(inherited)", @@ -7289,7 +7289,7 @@ CODE_SIGN_ENTITLEMENTS = Session/Meta/Signal.entitlements; CODE_SIGN_IDENTITY = "iPhone Developer"; "CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer"; - CURRENT_PROJECT_VERSION = 402; + CURRENT_PROJECT_VERSION = 403; DEVELOPMENT_TEAM = SUQ8J2PCT7; FRAMEWORK_SEARCH_PATHS = ( "$(inherited)", From 11b4c82bc3f0220ff3defec7adb4ff8e160c900c Mon Sep 17 00:00:00 2001 From: Morgan Pretty Date: Wed, 19 Apr 2023 10:41:07 +1000 Subject: [PATCH 8/8] Updated permission descriptions to appease Apple --- Session.xcodeproj/project.pbxproj | 12 ++++++------ Session/Meta/Session-Info.plist | 8 +++----- 2 files changed, 9 insertions(+), 11 deletions(-) diff --git a/Session.xcodeproj/project.pbxproj b/Session.xcodeproj/project.pbxproj index 0b26d6289..6ad57bb1e 100644 --- a/Session.xcodeproj/project.pbxproj +++ b/Session.xcodeproj/project.pbxproj @@ -6076,7 +6076,7 @@ "CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer"; CODE_SIGN_STYLE = Automatic; COPY_PHASE_STRIP = NO; - CURRENT_PROJECT_VERSION = 403; + CURRENT_PROJECT_VERSION = 404; DEBUG_INFORMATION_FORMAT = dwarf; DEVELOPMENT_TEAM = SUQ8J2PCT7; FRAMEWORK_SEARCH_PATHS = "$(inherited)"; @@ -6149,7 +6149,7 @@ "CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer"; CODE_SIGN_STYLE = Automatic; COPY_PHASE_STRIP = NO; - CURRENT_PROJECT_VERSION = 403; + CURRENT_PROJECT_VERSION = 404; DEBUG_INFORMATION_FORMAT = "dwarf-with-dsym"; DEVELOPMENT_TEAM = SUQ8J2PCT7; ENABLE_NS_ASSERTIONS = NO; @@ -6215,7 +6215,7 @@ "CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer"; CODE_SIGN_STYLE = Automatic; COPY_PHASE_STRIP = NO; - CURRENT_PROJECT_VERSION = 403; + CURRENT_PROJECT_VERSION = 404; DEBUG_INFORMATION_FORMAT = dwarf; DEVELOPMENT_TEAM = SUQ8J2PCT7; FRAMEWORK_SEARCH_PATHS = "$(inherited)"; @@ -6289,7 +6289,7 @@ "CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer"; CODE_SIGN_STYLE = Automatic; COPY_PHASE_STRIP = NO; - CURRENT_PROJECT_VERSION = 403; + CURRENT_PROJECT_VERSION = 404; DEBUG_INFORMATION_FORMAT = "dwarf-with-dsym"; DEVELOPMENT_TEAM = SUQ8J2PCT7; ENABLE_NS_ASSERTIONS = NO; @@ -7217,7 +7217,7 @@ CODE_SIGN_ENTITLEMENTS = Session/Meta/Signal.entitlements; CODE_SIGN_IDENTITY = "iPhone Developer"; "CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer"; - CURRENT_PROJECT_VERSION = 403; + CURRENT_PROJECT_VERSION = 404; DEVELOPMENT_TEAM = SUQ8J2PCT7; FRAMEWORK_SEARCH_PATHS = ( "$(inherited)", @@ -7289,7 +7289,7 @@ CODE_SIGN_ENTITLEMENTS = Session/Meta/Signal.entitlements; CODE_SIGN_IDENTITY = "iPhone Developer"; "CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer"; - CURRENT_PROJECT_VERSION = 403; + CURRENT_PROJECT_VERSION = 404; DEVELOPMENT_TEAM = SUQ8J2PCT7; FRAMEWORK_SEARCH_PATHS = ( "$(inherited)", diff --git a/Session/Meta/Session-Info.plist b/Session/Meta/Session-Info.plist index 704f7b3f3..be0439a2f 100644 --- a/Session/Meta/Session-Info.plist +++ b/Session/Meta/Session-Info.plist @@ -84,21 +84,19 @@ NSAppleMusicUsageDescription - Signal needs to use Apple Music to play media attachments. + Session needs to use Apple Music to play media attachments. NSCameraUsageDescription Session needs camera access to take pictures and scan QR codes. - NSContactsUsageDescription - Signal uses your contacts to find users you know. We do not store your contacts on the server. NSFaceIDUsageDescription Session's Screen Lock feature uses Face ID. NSHumanReadableCopyright com.loki-project.loki-messenger NSMicrophoneUsageDescription - Session needs access to your microphone to record media. + Session needs access to your microphone for calls and to send to audio messages. NSPhotoLibraryAddUsageDescription Session needs access to your library to save photos. NSPhotoLibraryUsageDescription - Session needs access to your library to send photos. + Session needs access to your library to update your avatar and send photos. PHPhotoLibraryPreventAutomaticLimitedAccessAlert UIAppFonts