mirror of
https://github.com/Swiftgram/Telegram-iOS.git
synced 2025-07-17 16:51:10 +00:00
Merge branch 't' into mac-7.5-release
This commit is contained in:
commit
d06288e4c8
@ -33,7 +33,7 @@ private final class MessageMediaPreuploadManagerContext {
|
|||||||
assert(self.queue.isCurrent())
|
assert(self.queue.isCurrent())
|
||||||
}
|
}
|
||||||
|
|
||||||
func add(network: Network, postbox: Postbox, id: Int64, encrypt: Bool, tag: MediaResourceFetchTag?, source: Signal<MediaResourceData, NoError>) {
|
func add(network: Network, postbox: Postbox, id: Int64, encrypt: Bool, tag: MediaResourceFetchTag?, source: Signal<MediaResourceData, NoError>, onComplete:(()->Void)? = nil) {
|
||||||
let context = MessageMediaPreuploadManagerUploadContext()
|
let context = MessageMediaPreuploadManagerUploadContext()
|
||||||
self.uploadContexts[id] = context
|
self.uploadContexts[id] = context
|
||||||
let queue = self.queue
|
let queue = self.queue
|
||||||
@ -47,6 +47,7 @@ private final class MessageMediaPreuploadManagerContext {
|
|||||||
default:
|
default:
|
||||||
print("result")
|
print("result")
|
||||||
context.result = next
|
context.result = next
|
||||||
|
onComplete?()
|
||||||
}
|
}
|
||||||
for subscriber in context.subscribers.copyItems() {
|
for subscriber in context.subscribers.copyItems() {
|
||||||
subscriber(next)
|
subscriber(next)
|
||||||
@ -112,9 +113,9 @@ public final class MessageMediaPreuploadManager {
|
|||||||
})
|
})
|
||||||
}
|
}
|
||||||
|
|
||||||
public func add(network: Network, postbox: Postbox, id: Int64, encrypt: Bool, tag: MediaResourceFetchTag?, source: Signal<MediaResourceData, NoError>) {
|
public func add(network: Network, postbox: Postbox, id: Int64, encrypt: Bool, tag: MediaResourceFetchTag?, source: Signal<MediaResourceData, NoError>, onComplete:(()->Void)? = nil) {
|
||||||
self.impl.with { context in
|
self.impl.with { context in
|
||||||
context.add(network: network, postbox: postbox, id: id, encrypt: encrypt, tag: tag, source: source)
|
context.add(network: network, postbox: postbox, id: id, encrypt: encrypt, tag: tag, source: source, onComplete: onComplete)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user