Add external sticker set import

This commit is contained in:
Ilya Laktyushin
2021-04-16 14:22:38 +03:00
parent e2584bc99c
commit d9f3dba292
22 changed files with 1786 additions and 22 deletions

View File

@@ -23,6 +23,7 @@ import ShareController
import ChatInterfaceState
import TelegramCallsUI
import UndoUI
import ImportStickerPackUI
private func defaultNavigationForPeerId(_ peerId: PeerId?, navigation: ChatControllerInteractionNavigateToPeer) -> ChatControllerInteractionNavigateToPeer {
if case .default = navigation {
@@ -480,5 +481,16 @@ func openResolvedUrlImpl(_ resolvedUrl: ResolvedUrl, context: AccountContext, ur
}), on: .root, blockInteraction: false, completion: {})
}))
}
case .importStickers:
dismissInput()
if let navigationController = navigationController, let data = UIPasteboard.general.data(forPasteboardType: "org.telegram.third-party.stickerpack"), let stickerPack = ImportStickerPack(data: data) {
for controller in navigationController.overlayControllers {
if controller is ImportStickerPackController {
controller.dismiss()
}
}
let controller = ImportStickerPackController(context: context, stickerPack: stickerPack, parentNavigationController: navigationController)
present(controller, nil)
}
}
}