mirror of
https://github.com/Swiftgram/Telegram-iOS.git
synced 2025-12-23 06:35:51 +00:00
Various Improvements
This commit is contained in:
@@ -79,7 +79,8 @@ public final class ImportStickerPackController: ViewController, StandalonePresen
|
||||
Queue.mainQueue().after(0.1) {
|
||||
self.controllerNode.updateStickerPack(self.stickerPack, verifiedStickers: Set(), declinedStickers: Set(), uploadedStickerResources: [:])
|
||||
|
||||
if self.stickerPack.isAnimated {
|
||||
if case .image = self.stickerPack.type {
|
||||
} else {
|
||||
let _ = (self.context.account.postbox.loadedPeerWithId(self.context.account.peerId)
|
||||
|> deliverOnMainQueue).start(next: { [weak self] peer in
|
||||
guard let strongSelf = self else {
|
||||
@@ -89,13 +90,13 @@ public final class ImportStickerPackController: ViewController, StandalonePresen
|
||||
var signals: [Signal<(UUID, StickerVerificationStatus, MediaResource?), NoError>] = []
|
||||
for sticker in strongSelf.stickerPack.stickers {
|
||||
if let resource = strongSelf.controllerNode.stickerResources[sticker.uuid] {
|
||||
signals.append(strongSelf.context.engine.stickers.uploadSticker(peer: peer, resource: resource, alt: sticker.emojis.first ?? "", dimensions: PixelDimensions(width: 512, height: 512), isAnimated: true)
|
||||
signals.append(strongSelf.context.engine.stickers.uploadSticker(peer: peer, resource: resource, alt: sticker.emojis.first ?? "", dimensions: PixelDimensions(width: 512, height: 512), mimeType: sticker.mimeType)
|
||||
|> map { result -> (UUID, StickerVerificationStatus, MediaResource?) in
|
||||
switch result {
|
||||
case .progress:
|
||||
return (sticker.uuid, .loading, nil)
|
||||
case let .complete(resource, mimeType):
|
||||
if mimeType == "application/x-tgsticker" {
|
||||
if ["application/x-tgsticker", "video/webm"].contains(mimeType) {
|
||||
return (sticker.uuid, .verified, resource)
|
||||
} else {
|
||||
return (sticker.uuid, .declined, nil)
|
||||
|
||||
Reference in New Issue
Block a user