Fix various warnings

This commit is contained in:
Niels Andriesse 2021-01-28 15:40:45 +11:00
parent 647bdb0d10
commit 54e902c848
7 changed files with 15 additions and 34 deletions

View File

@ -14,7 +14,6 @@ target 'Session' do
pod 'Reachability', :inhibit_warnings => true pod 'Reachability', :inhibit_warnings => true
pod 'Sodium', '~> 0.8.0', :inhibit_warnings => true pod 'Sodium', '~> 0.8.0', :inhibit_warnings => true
pod 'SSZipArchive', :inhibit_warnings => true pod 'SSZipArchive', :inhibit_warnings => true
pod 'Starscream', git: 'https://github.com/signalapp/Starscream.git', branch: 'signal-release', :inhibit_warnings => true
pod 'YapDatabase/SQLCipher', :git => 'https://github.com/loki-project/session-ios-yap-database.git', branch: 'signal-release', :inhibit_warnings => true pod 'YapDatabase/SQLCipher', :git => 'https://github.com/loki-project/session-ios-yap-database.git', branch: 'signal-release', :inhibit_warnings => true
pod 'YYImage', git: 'https://github.com/signalapp/YYImage', :inhibit_warnings => true pod 'YYImage', git: 'https://github.com/signalapp/YYImage', :inhibit_warnings => true
pod 'ZXingObjC', :inhibit_warnings => true pod 'ZXingObjC', :inhibit_warnings => true
@ -50,7 +49,6 @@ target 'SignalUtilitiesKit' do
pod 'Reachability', :inhibit_warnings => true pod 'Reachability', :inhibit_warnings => true
pod 'SAMKeychain', :inhibit_warnings => true pod 'SAMKeychain', :inhibit_warnings => true
pod 'SignalCoreKit', git: 'https://github.com/signalapp/SignalCoreKit.git', :inhibit_warnings => true pod 'SignalCoreKit', git: 'https://github.com/signalapp/SignalCoreKit.git', :inhibit_warnings => true
pod 'Starscream', git: 'https://github.com/signalapp/Starscream.git', branch: 'signal-release', :inhibit_warnings => true
pod 'SwiftProtobuf', '~> 1.5.0', :inhibit_warnings => true pod 'SwiftProtobuf', '~> 1.5.0', :inhibit_warnings => true
pod 'YapDatabase/SQLCipher', :git => 'https://github.com/loki-project/session-ios-yap-database.git', branch: 'signal-release', :inhibit_warnings => true pod 'YapDatabase/SQLCipher', :git => 'https://github.com/loki-project/session-ios-yap-database.git', branch: 'signal-release', :inhibit_warnings => true
pod 'YYImage', git: 'https://github.com/signalapp/YYImage', :inhibit_warnings => true pod 'YYImage', git: 'https://github.com/signalapp/YYImage', :inhibit_warnings => true

View File

@ -53,7 +53,6 @@ PODS:
- SQLCipher/standard (4.4.0): - SQLCipher/standard (4.4.0):
- SQLCipher/common - SQLCipher/common
- SSZipArchive (2.2.3) - SSZipArchive (2.2.3)
- Starscream (3.0.6)
- SwiftProtobuf (1.5.0) - SwiftProtobuf (1.5.0)
- YapDatabase/SQLCipher (3.1.1): - YapDatabase/SQLCipher (3.1.1):
- YapDatabase/SQLCipher/Core (= 3.1.1) - YapDatabase/SQLCipher/Core (= 3.1.1)
@ -142,7 +141,6 @@ DEPENDENCIES:
- SignalCoreKit (from `https://github.com/signalapp/SignalCoreKit.git`) - SignalCoreKit (from `https://github.com/signalapp/SignalCoreKit.git`)
- Sodium (~> 0.8.0) - Sodium (~> 0.8.0)
- SSZipArchive - SSZipArchive
- Starscream (from `https://github.com/signalapp/Starscream.git`, branch `signal-release`)
- SwiftProtobuf (~> 1.5.0) - SwiftProtobuf (~> 1.5.0)
- YapDatabase/SQLCipher (from `https://github.com/loki-project/session-ios-yap-database.git`, branch `signal-release`) - YapDatabase/SQLCipher (from `https://github.com/loki-project/session-ios-yap-database.git`, branch `signal-release`)
- YYImage (from `https://github.com/signalapp/YYImage`) - YYImage (from `https://github.com/signalapp/YYImage`)
@ -176,9 +174,6 @@ EXTERNAL SOURCES:
:git: https://github.com/signalapp/Mantle :git: https://github.com/signalapp/Mantle
SignalCoreKit: SignalCoreKit:
:git: https://github.com/signalapp/SignalCoreKit.git :git: https://github.com/signalapp/SignalCoreKit.git
Starscream:
:branch: signal-release
:git: https://github.com/signalapp/Starscream.git
YapDatabase: YapDatabase:
:branch: signal-release :branch: signal-release
:git: https://github.com/loki-project/session-ios-yap-database.git :git: https://github.com/loki-project/session-ios-yap-database.git
@ -195,9 +190,6 @@ CHECKOUT OPTIONS:
SignalCoreKit: SignalCoreKit:
:commit: 21c092e94b307690957b50f2305e5e65d28fa89e :commit: 21c092e94b307690957b50f2305e5e65d28fa89e
:git: https://github.com/signalapp/SignalCoreKit.git :git: https://github.com/signalapp/SignalCoreKit.git
Starscream:
:commit: b09ea163c3cb305152c65b299cb024610f52e735
:git: https://github.com/signalapp/Starscream.git
YapDatabase: YapDatabase:
:commit: 5806f6b6e0b34124ee09283a9eca9ce7e6eaf14e :commit: 5806f6b6e0b34124ee09283a9eca9ce7e6eaf14e
:git: https://github.com/loki-project/session-ios-yap-database.git :git: https://github.com/loki-project/session-ios-yap-database.git
@ -224,12 +216,11 @@ SPEC CHECKSUMS:
Sodium: 63c0ca312a932e6da481689537d4b35568841bdc Sodium: 63c0ca312a932e6da481689537d4b35568841bdc
SQLCipher: e434ed542b24f38ea7b36468a13f9765e1b5c072 SQLCipher: e434ed542b24f38ea7b36468a13f9765e1b5c072
SSZipArchive: 62d4947b08730e4cda640473b0066d209ff033c9 SSZipArchive: 62d4947b08730e4cda640473b0066d209ff033c9
Starscream: 8aaf1a7feb805c816d0e7d3190ef23856f6665b9
SwiftProtobuf: 241400280f912735c1e1b9fe675fdd2c6c4d42e2 SwiftProtobuf: 241400280f912735c1e1b9fe675fdd2c6c4d42e2
YapDatabase: b418a4baa6906e8028748938f9159807fd039af4 YapDatabase: b418a4baa6906e8028748938f9159807fd039af4
YYImage: 6db68da66f20d9f169ceb94dfb9947c3867b9665 YYImage: 6db68da66f20d9f169ceb94dfb9947c3867b9665
ZXingObjC: fdbb269f25dd2032da343e06f10224d62f537bdb ZXingObjC: fdbb269f25dd2032da343e06f10224d62f537bdb
PODFILE CHECKSUM: e639c728c4ea2a89f3e904f3a07d380c7459bdd9 PODFILE CHECKSUM: 70f7bae656b18fbce6806589f2df6a5a87bce09e
COCOAPODS: 1.10.0.rc.1 COCOAPODS: 1.10.0.rc.1

View File

@ -340,7 +340,7 @@
C32C59C7256DB41F003C73A2 /* TSThread.m in Sources */ = {isa = PBXBuildFile; fileRef = C33FDBB8255A581600E217F9 /* TSThread.m */; }; C32C59C7256DB41F003C73A2 /* TSThread.m in Sources */ = {isa = PBXBuildFile; fileRef = C33FDBB8255A581600E217F9 /* TSThread.m */; };
C32C5A02256DB658003C73A2 /* MessageSender+Convenience.swift in Sources */ = {isa = PBXBuildFile; fileRef = B8D8F1EF256621180092EF10 /* MessageSender+Convenience.swift */; }; C32C5A02256DB658003C73A2 /* MessageSender+Convenience.swift in Sources */ = {isa = PBXBuildFile; fileRef = B8D8F1EF256621180092EF10 /* MessageSender+Convenience.swift */; };
C32C5A13256DB7A5003C73A2 /* PushNotificationAPI.swift in Sources */ = {isa = PBXBuildFile; fileRef = C33FDBDE255A581900E217F9 /* PushNotificationAPI.swift */; }; C32C5A13256DB7A5003C73A2 /* PushNotificationAPI.swift in Sources */ = {isa = PBXBuildFile; fileRef = C33FDBDE255A581900E217F9 /* PushNotificationAPI.swift */; };
C32C5A24256DB7DB003C73A2 /* LKUserDefaults.swift in Sources */ = {isa = PBXBuildFile; fileRef = C33FDB6B255A580F00E217F9 /* LKUserDefaults.swift */; }; C32C5A24256DB7DB003C73A2 /* SNUserDefaults.swift in Sources */ = {isa = PBXBuildFile; fileRef = C33FDB6B255A580F00E217F9 /* SNUserDefaults.swift */; };
C32C5A2D256DB849003C73A2 /* LKGroupUtilities.m in Sources */ = {isa = PBXBuildFile; fileRef = C33FDBE1255A581A00E217F9 /* LKGroupUtilities.m */; }; C32C5A2D256DB849003C73A2 /* LKGroupUtilities.m in Sources */ = {isa = PBXBuildFile; fileRef = C33FDBE1255A581A00E217F9 /* LKGroupUtilities.m */; };
C32C5A36256DB856003C73A2 /* LKGroupUtilities.h in Headers */ = {isa = PBXBuildFile; fileRef = C33FDBCA255A581700E217F9 /* LKGroupUtilities.h */; settings = {ATTRIBUTES = (Public, ); }; }; C32C5A36256DB856003C73A2 /* LKGroupUtilities.h in Headers */ = {isa = PBXBuildFile; fileRef = C33FDBCA255A581700E217F9 /* LKGroupUtilities.h */; settings = {ATTRIBUTES = (Public, ); }; };
C32C5A47256DB8F0003C73A2 /* ECKeyPair+Hexadecimal.swift in Sources */ = {isa = PBXBuildFile; fileRef = C33FDA73255A57FA00E217F9 /* ECKeyPair+Hexadecimal.swift */; }; C32C5A47256DB8F0003C73A2 /* ECKeyPair+Hexadecimal.swift in Sources */ = {isa = PBXBuildFile; fileRef = C33FDA73255A57FA00E217F9 /* ECKeyPair+Hexadecimal.swift */; };
@ -1496,7 +1496,7 @@
C33FDB67255A580F00E217F9 /* OWSMediaGalleryFinder.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = OWSMediaGalleryFinder.h; sourceTree = "<group>"; }; C33FDB67255A580F00E217F9 /* OWSMediaGalleryFinder.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = OWSMediaGalleryFinder.h; sourceTree = "<group>"; };
C33FDB68255A580F00E217F9 /* ContentProxy.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = ContentProxy.swift; sourceTree = "<group>"; }; C33FDB68255A580F00E217F9 /* ContentProxy.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = ContentProxy.swift; sourceTree = "<group>"; };
C33FDB69255A580F00E217F9 /* FeatureFlags.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = FeatureFlags.swift; sourceTree = "<group>"; }; C33FDB69255A580F00E217F9 /* FeatureFlags.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = FeatureFlags.swift; sourceTree = "<group>"; };
C33FDB6B255A580F00E217F9 /* LKUserDefaults.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = LKUserDefaults.swift; sourceTree = "<group>"; }; C33FDB6B255A580F00E217F9 /* SNUserDefaults.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = SNUserDefaults.swift; sourceTree = "<group>"; };
C33FDB6C255A580F00E217F9 /* NSNotificationCenter+OWS.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = "NSNotificationCenter+OWS.m"; sourceTree = "<group>"; }; C33FDB6C255A580F00E217F9 /* NSNotificationCenter+OWS.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = "NSNotificationCenter+OWS.m"; sourceTree = "<group>"; };
C33FDB6F255A580F00E217F9 /* OWSOutgoingReceiptManager.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = OWSOutgoingReceiptManager.m; sourceTree = "<group>"; }; C33FDB6F255A580F00E217F9 /* OWSOutgoingReceiptManager.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = OWSOutgoingReceiptManager.m; sourceTree = "<group>"; };
C33FDB71255A581000E217F9 /* OWSMediaGalleryFinder.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = OWSMediaGalleryFinder.m; sourceTree = "<group>"; }; C33FDB71255A581000E217F9 /* OWSMediaGalleryFinder.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = OWSMediaGalleryFinder.m; sourceTree = "<group>"; };
@ -2301,7 +2301,6 @@
B8AE75A325A6C6A6001A84D2 /* Data+Trimming.swift */, B8AE75A325A6C6A6001A84D2 /* Data+Trimming.swift */,
C3C2A5D52553860A00C340D1 /* Dictionary+Description.swift */, C3C2A5D52553860A00C340D1 /* Dictionary+Description.swift */,
B8BC00BF257D90E30032E807 /* General.swift */, B8BC00BF257D90E30032E807 /* General.swift */,
C33FDB6B255A580F00E217F9 /* LKUserDefaults.swift */,
C3C2A5CE2553860700C340D1 /* Logging.swift */, C3C2A5CE2553860700C340D1 /* Logging.swift */,
C33FDAFD255A580600E217F9 /* LRUCache.swift */, C33FDAFD255A580600E217F9 /* LRUCache.swift */,
C33FDB5C255A580E00E217F9 /* NSArray+Functional.h */, C33FDB5C255A580E00E217F9 /* NSArray+Functional.h */,
@ -2318,6 +2317,7 @@
C33FDB51255A580D00E217F9 /* NSUserDefaults+OWS.h */, C33FDB51255A580D00E217F9 /* NSUserDefaults+OWS.h */,
C33FDB77255A581000E217F9 /* NSUserDefaults+OWS.m */, C33FDB77255A581000E217F9 /* NSUserDefaults+OWS.m */,
C33FDB14255A580800E217F9 /* OWSMath.h */, C33FDB14255A580800E217F9 /* OWSMath.h */,
C33FDB6B255A580F00E217F9 /* SNUserDefaults.swift */,
C33FDB3F255A580C00E217F9 /* String+SSK.swift */, C33FDB3F255A580C00E217F9 /* String+SSK.swift */,
C3C2AC2D2553CBEB00C340D1 /* String+Trimming.swift */, C3C2AC2D2553CBEB00C340D1 /* String+Trimming.swift */,
C38EF237255B6D65007E1867 /* UIDevice+featureSupport.swift */, C38EF237255B6D65007E1867 /* UIDevice+featureSupport.swift */,
@ -4427,7 +4427,6 @@
"${BUILT_PRODUCTS_DIR}/SQLCipher/SQLCipher.framework", "${BUILT_PRODUCTS_DIR}/SQLCipher/SQLCipher.framework",
"${BUILT_PRODUCTS_DIR}/SSZipArchive/SSZipArchive.framework", "${BUILT_PRODUCTS_DIR}/SSZipArchive/SSZipArchive.framework",
"${BUILT_PRODUCTS_DIR}/Sodium/Sodium.framework", "${BUILT_PRODUCTS_DIR}/Sodium/Sodium.framework",
"${BUILT_PRODUCTS_DIR}/Starscream/Starscream.framework",
"${BUILT_PRODUCTS_DIR}/YYImage/YYImage.framework", "${BUILT_PRODUCTS_DIR}/YYImage/YYImage.framework",
"${BUILT_PRODUCTS_DIR}/YapDatabase/YapDatabase.framework", "${BUILT_PRODUCTS_DIR}/YapDatabase/YapDatabase.framework",
"${BUILT_PRODUCTS_DIR}/ZXingObjC/ZXingObjC.framework", "${BUILT_PRODUCTS_DIR}/ZXingObjC/ZXingObjC.framework",
@ -4453,7 +4452,6 @@
"${TARGET_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}/SQLCipher.framework", "${TARGET_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}/SQLCipher.framework",
"${TARGET_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}/SSZipArchive.framework", "${TARGET_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}/SSZipArchive.framework",
"${TARGET_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}/Sodium.framework", "${TARGET_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}/Sodium.framework",
"${TARGET_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}/Starscream.framework",
"${TARGET_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}/YYImage.framework", "${TARGET_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}/YYImage.framework",
"${TARGET_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}/YapDatabase.framework", "${TARGET_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}/YapDatabase.framework",
"${TARGET_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}/ZXingObjC.framework", "${TARGET_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}/ZXingObjC.framework",
@ -4831,7 +4829,7 @@
C3A71F892558BA9F0043A11F /* Mnemonic.swift in Sources */, C3A71F892558BA9F0043A11F /* Mnemonic.swift in Sources */,
C33FDEF8255A656D00E217F9 /* Promise+Delaying.swift in Sources */, C33FDEF8255A656D00E217F9 /* Promise+Delaying.swift in Sources */,
B8BC00C0257D90E30032E807 /* General.swift in Sources */, B8BC00C0257D90E30032E807 /* General.swift in Sources */,
C32C5A24256DB7DB003C73A2 /* LKUserDefaults.swift in Sources */, C32C5A24256DB7DB003C73A2 /* SNUserDefaults.swift in Sources */,
C3D9E41F25676C870040E4F3 /* OWSPrimaryStorageProtocol.swift in Sources */, C3D9E41F25676C870040E4F3 /* OWSPrimaryStorageProtocol.swift in Sources */,
C3BBE0A72554D4DE0050F1E3 /* Promise+Retrying.swift in Sources */, C3BBE0A72554D4DE0050F1E3 /* Promise+Retrying.swift in Sources */,
B8856D7B256F14F4001CE70E /* UIView+OWS.m in Sources */, B8856D7B256F14F4001CE70E /* UIView+OWS.m in Sources */,

View File

@ -254,7 +254,7 @@ public final class OpenGroupAPI : DotNetAPI {
let request = TSRequest(url: url, method: "POST", parameters: [:]) let request = TSRequest(url: url, method: "POST", parameters: [:])
request.allHTTPHeaderFields = [ "Content-Type" : "application/json", "Authorization" : "Bearer \(token)" ] request.allHTTPHeaderFields = [ "Content-Type" : "application/json", "Authorization" : "Bearer \(token)" ]
let promise = OnionRequestAPI.sendOnionRequest(request, to: server, using: serverPublicKey, isJSONRequired: false) let promise = OnionRequestAPI.sendOnionRequest(request, to: server, using: serverPublicKey, isJSONRequired: false)
promise.done(on: DispatchQueue.global(qos: .default)) { _ -> Void in let _ = promise.done(on: DispatchQueue.global(qos: .default)) { _ -> Void in
SNLog("Banned user with ID: \(publicKey) from server: \(server).") SNLog("Banned user with ID: \(publicKey) from server: \(server).")
} }
promise.catch(on: DispatchQueue.main) { error in promise.catch(on: DispatchQueue.main) { error in

View File

@ -288,7 +288,7 @@ public class SignalAttachment: NSObject {
cachedVideoPreview = image cachedVideoPreview = image
return image return image
} catch let error { } catch {
return nil return nil
} }
} }

View File

@ -295,18 +295,12 @@ public class OWSLinkPreview: MTLModel {
@objc @objc
public class func isValidLinkUrl(_ urlString: String) -> Bool { public class func isValidLinkUrl(_ urlString: String) -> Bool {
guard let url = URL(string: urlString) else { return URL(string: urlString) != nil
return false
}
return true
} }
@objc @objc
public class func isValidMediaUrl(_ urlString: String) -> Bool { public class func isValidMediaUrl(_ urlString: String) -> Bool {
guard let url = URL(string: urlString) else { return URL(string: urlString) != nil
return false
}
return true
} }
// MARK: - Serial Queue // MARK: - Serial Queue

View File

@ -1,6 +1,6 @@
import Foundation import Foundation
public enum LKUserDefaults { public enum SNUserDefaults {
public enum Bool : Swift.String { public enum Bool : Swift.String {
case hasLaunchedOnce case hasLaunchedOnce
@ -32,27 +32,27 @@ public enum LKUserDefaults {
public extension UserDefaults { public extension UserDefaults {
subscript(bool: LKUserDefaults.Bool) -> Bool { subscript(bool: SNUserDefaults.Bool) -> Bool {
get { return self.bool(forKey: bool.rawValue) } get { return self.bool(forKey: bool.rawValue) }
set { set(newValue, forKey: bool.rawValue) } set { set(newValue, forKey: bool.rawValue) }
} }
subscript(date: LKUserDefaults.Date) -> Date? { subscript(date: SNUserDefaults.Date) -> Date? {
get { return self.object(forKey: date.rawValue) as? Date } get { return self.object(forKey: date.rawValue) as? Date }
set { set(newValue, forKey: date.rawValue) } set { set(newValue, forKey: date.rawValue) }
} }
subscript(double: LKUserDefaults.Double) -> Double { subscript(double: SNUserDefaults.Double) -> Double {
get { return self.double(forKey: double.rawValue) } get { return self.double(forKey: double.rawValue) }
set { set(newValue, forKey: double.rawValue) } set { set(newValue, forKey: double.rawValue) }
} }
subscript(int: LKUserDefaults.Int) -> Int { subscript(int: SNUserDefaults.Int) -> Int {
get { return self.integer(forKey: int.rawValue) } get { return self.integer(forKey: int.rawValue) }
set { set(newValue, forKey: int.rawValue) } set { set(newValue, forKey: int.rawValue) }
} }
subscript(string: LKUserDefaults.String) -> String? { subscript(string: SNUserDefaults.String) -> String? {
get { return self.string(forKey: string.rawValue) } get { return self.string(forKey: string.rawValue) }
set { set(newValue, forKey: string.rawValue) } set { set(newValue, forKey: string.rawValue) }
} }