From 1085d12a4ca1d8ac9880a1d94b2dc71d7d5efc35 Mon Sep 17 00:00:00 2001 From: nielsandriesse Date: Mon, 15 Jun 2020 09:56:02 +1000 Subject: [PATCH 1/2] Don't repair session if there's an outstanding session request --- Signal/src/Loki/View Controllers/NewClosedGroupVC.swift | 3 ++- .../Session Management/SessionManagementProtocol.swift | 5 +++++ 2 files changed, 7 insertions(+), 1 deletion(-) diff --git a/Signal/src/Loki/View Controllers/NewClosedGroupVC.swift b/Signal/src/Loki/View Controllers/NewClosedGroupVC.swift index ad4f87698..66b42e50f 100644 --- a/Signal/src/Loki/View Controllers/NewClosedGroupVC.swift +++ b/Signal/src/Loki/View Controllers/NewClosedGroupVC.swift @@ -47,7 +47,8 @@ final class NewClosedGroupVC : BaseVC, UITableViewDataSource, UITableViewDelegat super.viewDidLoad() setUpGradientBackground() setUpNavBarStyle() - setNavBarTitle(NSLocalizedString("New Closed Group", comment: "")) + let customTitleFontSize = isSmallScreen ? Values.largeFontSize : Values.veryLargeFontSize + setNavBarTitle(NSLocalizedString("New Closed Group", comment: ""), customFontSize: customTitleFontSize) // Set up navigation bar buttons let closeButton = UIBarButtonItem(image: #imageLiteral(resourceName: "X"), style: .plain, target: self, action: #selector(close)) closeButton.tintColor = Colors.text diff --git a/SignalServiceKit/src/Loki/Protocol/Session Management/SessionManagementProtocol.swift b/SignalServiceKit/src/Loki/Protocol/Session Management/SessionManagementProtocol.swift index d34af79aa..61c808a6e 100644 --- a/SignalServiceKit/src/Loki/Protocol/Session Management/SessionManagementProtocol.swift +++ b/SignalServiceKit/src/Loki/Protocol/Session Management/SessionManagementProtocol.swift @@ -141,6 +141,11 @@ public final class SessionManagementProtocol : NSObject { @objc(repairSessionIfNeededForMessage:to:) public static func repairSessionIfNeeded(for message: TSOutgoingMessage, to hexEncodedPublicKey: String) { guard (message.thread as? TSGroupThread)?.groupModel.groupType == .closedGroup else { return } + var hasSentSessionRequest = false + storage.dbReadConnection.read { transaction in + hasSentSessionRequest = storage.getSessionRequestTimestamp(for: hexEncodedPublicKey, in: transaction) != nil + } + guard !hasSentSessionRequest else { return } DispatchQueue.main.async { storage.dbReadWriteConnection.readWrite { transaction in let thread = TSContactThread.getOrCreateThread(withContactId: hexEncodedPublicKey, transaction: transaction) From 93b3054c1758a7a0815b1c3bfc5fd5a4d4ceaead Mon Sep 17 00:00:00 2001 From: nielsandriesse Date: Mon, 15 Jun 2020 11:23:27 +1000 Subject: [PATCH 2/2] Update CryptoSwift --- Podfile | 4 ++-- Podfile.lock | 28 ++++++++++++++-------------- SessionServiceKit.podspec | 4 ++-- 3 files changed, 18 insertions(+), 18 deletions(-) diff --git a/Podfile b/Podfile index 9e3e348b3..84b698387 100644 --- a/Podfile +++ b/Podfile @@ -75,7 +75,7 @@ target 'Signal' do pod 'GCDWebServer', '~> 3.5.2', :inhibit_warnings => true # TODO: We can probably ditch this as we're not doing P2P anymore pod 'FeedKit', '~> 8.1', :inhibit_warnings => true - pod 'CryptoSwift', '~> 1.0', :inhibit_warnings => true + pod 'CryptoSwift', '~> 1.3', :inhibit_warnings => true pod 'NVActivityIndicatorView', '~> 4.7', :inhibit_warnings => true target 'SignalTests' do @@ -96,7 +96,7 @@ target 'LokiPushNotificationService' do # Loki third party pods ### - pod 'CryptoSwift', '~> 1.0', :inhibit_warnings => true + pod 'CryptoSwift', '~> 1.3', :inhibit_warnings => true end target 'SignalMessaging' do diff --git a/Podfile.lock b/Podfile.lock index 97a715538..4fe2378f9 100644 --- a/Podfile.lock +++ b/Podfile.lock @@ -72,17 +72,17 @@ PODS: - SessionHKDFKit/Tests (0.0.5): - CocoaLumberjack - SessionCoreKit - - SessionMetadataKit (1.0.1): + - SessionMetadataKit (1.0.2): - CocoaLumberjack - - CryptoSwift (~> 1.0) + - CryptoSwift (~> 1.3) - SessionAxolotlKit (~> 1.0.2) - SessionCoreKit (~> 1.0.0) - SessionCurve25519Kit (~> 2.1.2) - SessionHKDFKit (~> 0.0.5) - SwiftProtobuf (~> 1.5.0) - - SessionMetadataKit/Tests (1.0.1): + - SessionMetadataKit/Tests (1.0.2): - CocoaLumberjack - - CryptoSwift (~> 1.0) + - CryptoSwift (~> 1.3) - SessionAxolotlKit (~> 1.0.2) - SessionCoreKit (~> 1.0.0) - SessionCurve25519Kit (~> 2.1.2) @@ -91,7 +91,7 @@ PODS: - SessionServiceKit (1.0.0): - AFNetworking - CocoaLumberjack - - CryptoSwift (~> 1.0) + - CryptoSwift (~> 1.3) - GRKOpenSSLFramework - libPhoneNumber-iOS - Mantle @@ -101,14 +101,14 @@ PODS: - SessionAxolotlKit (~> 1.0.2) - SessionCoreKit (~> 1.0.0) - SessionCurve25519Kit (~> 2.1.2) - - SessionMetadataKit (~> 1.0.1) + - SessionMetadataKit (~> 1.0.2) - Starscream - SwiftProtobuf (~> 1.5.0) - YapDatabase/SQLCipher - SessionServiceKit/Tests (1.0.0): - AFNetworking - CocoaLumberjack - - CryptoSwift (~> 1.0) + - CryptoSwift (~> 1.3) - GRKOpenSSLFramework - libPhoneNumber-iOS - Mantle @@ -118,7 +118,7 @@ PODS: - SessionAxolotlKit (~> 1.0.2) - SessionCoreKit (~> 1.0.0) - SessionCurve25519Kit (~> 2.1.2) - - SessionMetadataKit (~> 1.0.1) + - SessionMetadataKit (~> 1.0.2) - Starscream - SwiftProtobuf (~> 1.5.0) - YapDatabase/SQLCipher @@ -198,7 +198,7 @@ PODS: DEPENDENCIES: - AFNetworking (~> 3.2.1) - - CryptoSwift (~> 1.0) + - CryptoSwift (~> 1.3) - FeedKit (~> 8.1) - GCDWebServer (~> 3.5.2) - GRKOpenSSLFramework (from `https://github.com/signalapp/GRKOpenSSLFramework`) @@ -289,7 +289,7 @@ CHECKOUT OPTIONS: :commit: 0dcf8cf8a7995ef8663146f7063e6c1d7f5a3274 :git: https://github.com/nielsandriesse/session-ios-hkdf-kit.git SessionMetadataKit: - :commit: 048dadf44f6ab4b7024b7ce0683179ee0a494cd8 + :commit: bc6a425ac96dd6482b4e10df1eee1349153b2eca :git: https://github.com/loki-project/session-ios-metadata-kit Starscream: :commit: b09ea163c3cb305152c65b299cb024610f52e735 @@ -316,15 +316,15 @@ SPEC CHECKSUMS: SessionCoreKit: 778a3f6e3da788b43497734166646025b6392e88 SessionCurve25519Kit: cedc6c713f8182e6ee02bf9bd1b337552e00ebbb SessionHKDFKit: b0f4e669411703ab925aba07491c5611564d1419 - SessionMetadataKit: 8de99830e5bb1f5b0a180f41197457f5b4a76ee4 - SessionServiceKit: b69bd197f730590b21dc5262bd5af73ce1f70ba0 + SessionMetadataKit: 29d6b1c0f8dbe630ccddd73362b9eb3b1abc8a6d + SessionServiceKit: c792d64fc86aaa0f7325beaa36e1a9211a887359 SQLCipher: e434ed542b24f38ea7b36468a13f9765e1b5c072 SSZipArchive: 62d4947b08730e4cda640473b0066d209ff033c9 - Starscream: ef3ece99d765eeccb67de105bfa143f929026cf5 + Starscream: 8aaf1a7feb805c816d0e7d3190ef23856f6665b9 SwiftProtobuf: 241400280f912735c1e1b9fe675fdd2c6c4d42e2 YapDatabase: b418a4baa6906e8028748938f9159807fd039af4 YYImage: 1e1b62a9997399593e4b9c4ecfbbabbf1d3f3b54 -PODFILE CHECKSUM: e9d54851d6e1df3274eaaf29ca701c3a0ab1070a +PODFILE CHECKSUM: 5963da3d09b1f6e9aee15d9e684901b350dce6ec COCOAPODS: 1.9.3 diff --git a/SessionServiceKit.podspec b/SessionServiceKit.podspec index 5c521809f..15e11f7d4 100644 --- a/SessionServiceKit.podspec +++ b/SessionServiceKit.podspec @@ -40,7 +40,7 @@ A Swift/Objective-C library for communicating with the Session messaging service s.dependency 'SessionCurve25519Kit', '~> 2.1.2' s.dependency 'CocoaLumberjack' - s.dependency 'CryptoSwift', '~> 1.0' + s.dependency 'CryptoSwift', '~> 1.3' s.dependency 'AFNetworking' s.dependency 'SessionAxolotlKit', '~> 1.0.2' s.dependency 'Mantle' @@ -52,7 +52,7 @@ A Swift/Objective-C library for communicating with the Session messaging service s.dependency 'Reachability' s.dependency 'SwiftProtobuf', '~> 1.5.0' s.dependency 'SessionCoreKit', '~> 1.0.0' - s.dependency 'SessionMetadataKit', '~> 1.0.1' + s.dependency 'SessionMetadataKit', '~> 1.0.2' s.dependency 'PromiseKit', '~> 6.0' s.test_spec 'Tests' do |test_spec|