Clean up getMessages() signature

This commit is contained in:
Niels Andriesse 2019-05-27 10:27:49 +10:00
parent 8f25f96301
commit ca713f6476
1 changed files with 3 additions and 1 deletions

View File

@ -22,6 +22,8 @@ import PromiseKit
}
}
public typealias MessagePromise = Promise<[SSKProtoEnvelope]> // To keep the return type of getMessages() readable
// MARK: Lifecycle
override private init() { }
@ -34,7 +36,7 @@ import PromiseKit
}
// MARK: Public API
public static func getMessages() -> Promise<Set<Promise<[SSKProtoEnvelope]>>> {
public static func getMessages() -> Promise<Set<MessagePromise>> {
let hexEncodedPublicKey = OWSIdentityManager.shared().identityKeyPair()!.hexEncodedPublicKey
return getTargetSnodes(for: hexEncodedPublicKey).mapValues { targetSnode in
let lastHash = getLastMessageHashValue(for: targetSnode) ?? ""