From 8a605858fd83a4a139766460febba923dd72cb94 Mon Sep 17 00:00:00 2001 From: Niels Andriesse Date: Fri, 3 May 2019 10:10:11 +1000 Subject: [PATCH] Clean & suppress warnings for dependencies --- LokiKit/LokiMessagingAPI.swift | 4 ++-- LokiKit/Mnemonic/Mnemonic.swift | 8 ++++---- Podfile | 1 + Podfile.lock | 2 +- .../xcshareddata/xcschemes/Signal-Internal.xcscheme | 8 ++++---- .../xcshareddata/xcschemes/Signal.xcscheme | 10 +++++----- .../xcschemes/SignalShareExtension.xcscheme | 6 +++--- .../Registration/OnboardingKeyPairViewController.swift | 2 +- Signal/translations/en.lproj/Localizable.strings | 3 +-- SignalMessaging/profiles/OWSProfileManager.m | 2 +- 10 files changed, 23 insertions(+), 23 deletions(-) diff --git a/LokiKit/LokiMessagingAPI.swift b/LokiKit/LokiMessagingAPI.swift index a0731f33c..f3704b4c4 100644 --- a/LokiKit/LokiMessagingAPI.swift +++ b/LokiKit/LokiMessagingAPI.swift @@ -2,7 +2,7 @@ import PromiseKit public struct LokiMessagingAPI { - private static var snodeURL: String { return textSecureServerURL } + private static var baseURL: String { return textSecureServerURL } private static var port: String { return "8080" } private static var apiVersion: String { return "v1" } @@ -19,7 +19,7 @@ public struct LokiMessagingAPI { // MARK: API private static func invoke(_ method: Method, parameters: [String:String] = [:]) -> Promise { - let url = URL(string: "\(snodeURL):\(port)/\(apiVersion)/storage_rpc")! + let url = URL(string: "\(baseURL):\(port)/\(apiVersion)/storage_rpc")! let request = TSRequest(url: url, method: "POST", parameters: [ "method" : method.rawValue, "params" : parameters ]) return TSNetworkManager.shared().makePromise(request: request) } diff --git a/LokiKit/Mnemonic/Mnemonic.swift b/LokiKit/Mnemonic/Mnemonic.swift index e636f7395..f1ade5cf8 100644 --- a/LokiKit/Mnemonic/Mnemonic.swift +++ b/LokiKit/Mnemonic/Mnemonic.swift @@ -43,10 +43,10 @@ enum Mnemonic { } } - enum DecodingError : Error { + enum DecodingError : LocalizedError { case generic, inputTooShort, missingLastWord, invalidWord, verificationFailed - var description: String { + var errorDescription: String { switch self { case .generic: return NSLocalizedString("Something went wrong. Please check your mnemonic and try again.", comment: "") case .inputTooShort: return NSLocalizedString("Looks like you didn't enter enough words. Please check your mnemonic and try again.", comment: "") @@ -63,7 +63,7 @@ enum Mnemonic { let prefixLength = language.prefixLength var result: [String] = [] let n = wordSet.count - let characterCount = string.indices.count + let characterCount = string.indices.count // Safe for this particular case for chunkStartIndexAsInt in stride(from: 0, to: characterCount, by: 8) { let chunkStartIndex = string.index(string.startIndex, offsetBy: chunkStartIndexAsInt) let chunkEndIndex = string.index(chunkStartIndex, offsetBy: 8) @@ -95,7 +95,7 @@ enum Mnemonic { let n = truncatedWordSet.count // Check preconditions guard words.count >= 12 else { throw DecodingError.inputTooShort } - guard words.count % 3 != 0 else { throw DecodingError.missingLastWord } + guard !words.count.isMultiple(of: 3) else { throw DecodingError.missingLastWord } // Get checksum word let checksumWord = words.popLast()! // Decode diff --git a/Podfile b/Podfile index 42d28eb88..63bd128d3 100644 --- a/Podfile +++ b/Podfile @@ -2,6 +2,7 @@ platform :ios, '9.0' source 'https://github.com/CocoaPods/Specs.git' use_frameworks! +inhibit_all_warnings! def shared_pods diff --git a/Podfile.lock b/Podfile.lock index 8439c483d..4e800af1f 100644 --- a/Podfile.lock +++ b/Podfile.lock @@ -305,6 +305,6 @@ SPEC CHECKSUMS: YapDatabase: b418a4baa6906e8028748938f9159807fd039af4 YYImage: 1e1b62a9997399593e4b9c4ecfbbabbf1d3f3b54 -PODFILE CHECKSUM: 71de0ab6116c92a1a144e5889d07cc57a0d61f77 +PODFILE CHECKSUM: 7ccaed3947d300293e21ab9e118dae7de7592743 COCOAPODS: 1.5.3 diff --git a/Signal.xcodeproj/xcshareddata/xcschemes/Signal-Internal.xcscheme b/Signal.xcodeproj/xcshareddata/xcschemes/Signal-Internal.xcscheme index 572fd60ab..c5583e4d9 100644 --- a/Signal.xcodeproj/xcshareddata/xcschemes/Signal-Internal.xcscheme +++ b/Signal.xcodeproj/xcshareddata/xcschemes/Signal-Internal.xcscheme @@ -15,7 +15,7 @@ @@ -33,7 +33,7 @@ @@ -56,7 +56,7 @@ @@ -87,7 +87,7 @@ diff --git a/Signal.xcodeproj/xcshareddata/xcschemes/Signal.xcscheme b/Signal.xcodeproj/xcshareddata/xcschemes/Signal.xcscheme index a274fca29..3117b9039 100644 --- a/Signal.xcodeproj/xcshareddata/xcschemes/Signal.xcscheme +++ b/Signal.xcodeproj/xcshareddata/xcschemes/Signal.xcscheme @@ -15,7 +15,7 @@ @@ -28,7 +28,7 @@ buildForAnalyzing = "YES"> @@ -117,7 +117,7 @@ @@ -152,7 +152,7 @@ @@ -193,7 +193,7 @@ diff --git a/Signal.xcodeproj/xcshareddata/xcschemes/SignalShareExtension.xcscheme b/Signal.xcodeproj/xcshareddata/xcschemes/SignalShareExtension.xcscheme index cc64d8a0e..77ad0a66b 100644 --- a/Signal.xcodeproj/xcshareddata/xcschemes/SignalShareExtension.xcscheme +++ b/Signal.xcodeproj/xcshareddata/xcschemes/SignalShareExtension.xcscheme @@ -30,7 +30,7 @@ @@ -72,7 +72,7 @@ @@ -92,7 +92,7 @@ diff --git a/Signal/src/ViewControllers/Registration/OnboardingKeyPairViewController.swift b/Signal/src/ViewControllers/Registration/OnboardingKeyPairViewController.swift index c20b93e15..dc6111d4a 100644 --- a/Signal/src/ViewControllers/Registration/OnboardingKeyPairViewController.swift +++ b/Signal/src/ViewControllers/Registration/OnboardingKeyPairViewController.swift @@ -205,7 +205,7 @@ final class OnboardingKeyPairViewController : OnboardingBaseViewController { hexEncodedPublicKey = keyPair.hexEncodedPublicKey } catch let error { let error = error as? Mnemonic.DecodingError ?? Mnemonic.DecodingError.generic - errorLabel.text = error.description + errorLabel.text = error.errorDescription errorLabel.isHidden = false return } diff --git a/Signal/translations/en.lproj/Localizable.strings b/Signal/translations/en.lproj/Localizable.strings index bb9fe3a1d..70c1e79b7 100644 --- a/Signal/translations/en.lproj/Localizable.strings +++ b/Signal/translations/en.lproj/Localizable.strings @@ -2543,8 +2543,7 @@ /* Info message embedding a {{time amount}}, see the *_TIME_AMOUNT strings for context. */ "YOU_UPDATED_DISAPPEARING_MESSAGES_CONFIGURATION" = "You set disappearing message time to %@."; -// -- Loki -- - +// Loki: "Loki Messenger can let you know when you get a message (and who it is from)" = "Loki Messenger can let you know when you get a message (and who it is from)"; "Create Your Loki Messenger Account" = "Create Your Loki Messenger Account"; "Enter a name to be shown to your contacts" = "Enter a name to be shown to your contacts"; diff --git a/SignalMessaging/profiles/OWSProfileManager.m b/SignalMessaging/profiles/OWSProfileManager.m index 3a7561be6..22129168d 100644 --- a/SignalMessaging/profiles/OWSProfileManager.m +++ b/SignalMessaging/profiles/OWSProfileManager.m @@ -294,7 +294,7 @@ typedef void (^ProfileManagerFailureBlock)(NSError *error); OWSUserProfile *userProfile = self.localUserProfile; OWSAssertDebug(userProfile); - /* Loki: We don't support avatar uploads yet */ + // Loki: We don't support avatar uploads yet OWSLogVerbose(@"Updating local profile on service with no avatar."); tryToUpdateService(nil, nil);