mirror of
https://github.com/Swiftgram/Telegram-iOS.git
synced 2025-12-24 07:05:35 +00:00
Animated emoji
This commit is contained in:
@@ -18,11 +18,11 @@ public final class AnimatedStickerNodeLocalFileSource: AnimatedStickerNodeSource
|
||||
self.name = name
|
||||
}
|
||||
|
||||
public func directDataPath() -> Signal<String, NoError> {
|
||||
public func directDataPath(attemptSynchronously: Bool) -> Signal<String?, NoError> {
|
||||
if let path = self.path {
|
||||
return .single(path)
|
||||
} else {
|
||||
return .never()
|
||||
return .single(nil)
|
||||
}
|
||||
}
|
||||
|
||||
@@ -30,6 +30,10 @@ public final class AnimatedStickerNodeLocalFileSource: AnimatedStickerNodeSource
|
||||
return .never()
|
||||
}
|
||||
|
||||
func maybeCachedDataPath(width: Int, height: Int) -> (String, Bool)? {
|
||||
return nil
|
||||
}
|
||||
|
||||
public var path: String? {
|
||||
if let path = getAppBundle().path(forResource: self.name, ofType: "tgs") {
|
||||
return path
|
||||
@@ -64,13 +68,14 @@ public final class AnimatedStickerResourceSource: AnimatedStickerNodeSource {
|
||||
}
|
||||
}
|
||||
|
||||
public func directDataPath() -> Signal<String, NoError> {
|
||||
return self.account.postbox.mediaBox.resourceData(self.resource)
|
||||
|> filter { data in
|
||||
return data.complete
|
||||
}
|
||||
|> map { data -> String in
|
||||
return data.path
|
||||
public func directDataPath(attemptSynchronously: Bool) -> Signal<String?, NoError> {
|
||||
return self.account.postbox.mediaBox.resourceData(self.resource, attemptSynchronously: attemptSynchronously)
|
||||
|> map { data -> String? in
|
||||
if data.complete {
|
||||
return data.path
|
||||
} else {
|
||||
return nil
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user