mirror of
https://github.com/Swiftgram/Telegram-iOS.git
synced 2025-08-02 00:17:02 +00:00
Support copyLocalItem in secure id resource fetch
This commit is contained in:
parent
a1c59b9037
commit
1977e5da27
@ -95,9 +95,16 @@ func fetchSecureIdLocalImageResource(postbox: Postbox, resource: SecureIdLocalIm
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
TempBox.shared.dispose(file)
|
TempBox.shared.dispose(file)
|
||||||
case .copyLocalItem:
|
case let .copyLocalItem(item):
|
||||||
assertionFailure()
|
let tempFile = TempBox.shared.tempFile(fileName: "file")
|
||||||
break
|
if item.copyTo(url: URL(fileURLWithPath: tempFile.path)) {
|
||||||
|
if let data = try? Data(contentsOf: URL(fileURLWithPath: tempFile.path)) {
|
||||||
|
let _ = buffer.with { buffer in
|
||||||
|
buffer.data = data
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
TempBox.shared.dispose(tempFile)
|
||||||
case let .replaceHeader(data, range):
|
case let .replaceHeader(data, range):
|
||||||
let _ = buffer.with { buffer in
|
let _ = buffer.with { buffer in
|
||||||
if buffer.data.count < range.count {
|
if buffer.data.count < range.count {
|
||||||
|
Loading…
x
Reference in New Issue
Block a user