mirror of
https://github.com/Swiftgram/Telegram-iOS.git
synced 2025-12-23 22:55:00 +00:00
no message
This commit is contained in:
@@ -187,7 +187,7 @@ private func makeInputSecureValue(context: SecureIdAccessContext, value: SecureI
|
||||
return Api.InputSecureValue.inputSecureValue(flags: flags, type: inputData.type, data: secureData, files: files, plainData: inputData.publicData, selfie: inputData.selfieReference.flatMap(apiInputSecretFile))
|
||||
}
|
||||
|
||||
public func saveSecureIdValue(network: Network, context: SecureIdAccessContext, value: SecureIdValue) -> Signal<SecureIdValueWithContext, SaveSecureIdValueError> {
|
||||
public func saveSecureIdValue(postbox: Postbox, network: Network, context: SecureIdAccessContext, value: SecureIdValue, uploadedFiles: [Data: Data]) -> Signal<SecureIdValueWithContext, SaveSecureIdValueError> {
|
||||
let delete = deleteSecureIdValues(network: network, keys: Set([value.key]))
|
||||
|> mapError { _ -> SaveSecureIdValueError in
|
||||
return .generic
|
||||
@@ -214,6 +214,17 @@ public func saveSecureIdValue(network: Network, context: SecureIdAccessContext,
|
||||
return .fail(.generic)
|
||||
}
|
||||
|
||||
for file in parsedValue.valueWithContext.value.fileReferences {
|
||||
switch file {
|
||||
case let .remote(file):
|
||||
if let data = uploadedFiles[file.fileHash] {
|
||||
postbox.mediaBox.storeResourceData(SecureFileMediaResource(file: file).id, data: data)
|
||||
}
|
||||
case .uploaded:
|
||||
break
|
||||
}
|
||||
}
|
||||
|
||||
return .single(parsedValue.valueWithContext)
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user