mirror of
https://github.com/Swiftgram/Telegram-iOS.git
synced 2025-12-22 14:20:20 +00:00
[WIP] Stickers editor
This commit is contained in:
@@ -2110,7 +2110,15 @@ public final class SharedAccountContextImpl: SharedAccountContext {
|
||||
|
||||
let limit: Int32 = 10
|
||||
var reachedLimitImpl: ((Int32) -> Void)?
|
||||
let controller = context.sharedContext.makeContactMultiselectionController(ContactMultiselectionControllerParams(context: context, mode: .premiumGifting, options: [], isPeerEnabled: { peer in
|
||||
|
||||
let mode: ContactMultiselectionControllerMode
|
||||
if case let .chatList(peerIds) = source {
|
||||
mode = .premiumGifting(topSectionTitle: "🎂 BIRTHDAY TODAY", topSectionPeers: peerIds)
|
||||
} else {
|
||||
mode = .premiumGifting(topSectionTitle: nil, topSectionPeers: [])
|
||||
}
|
||||
|
||||
let controller = context.sharedContext.makeContactMultiselectionController(ContactMultiselectionControllerParams(context: context, mode: mode, options: [], isPeerEnabled: { peer in
|
||||
if case let .user(user) = peer, user.botInfo == nil && !peer.isService && !user.flags.contains(.isSupport) {
|
||||
return true
|
||||
} else {
|
||||
@@ -2309,7 +2317,7 @@ public final class SharedAccountContextImpl: SharedAccountContext {
|
||||
return StickerPackScreen(context: context, updatedPresentationData: updatedPresentationData, mainStickerPack: mainStickerPack, stickerPacks: stickerPacks, loadedStickerPacks: loadedStickerPacks, isEditing: isEditing, parentNavigationController: parentNavigationController, sendSticker: sendSticker)
|
||||
}
|
||||
|
||||
public func makeStickerEditorScreen(context: AccountContext, source: Any, transitionArguments: (UIView, CGRect, UIImage?)?, completion: @escaping (TelegramMediaFile) -> Void) -> ViewController {
|
||||
public func makeStickerEditorScreen(context: AccountContext, source: Any, transitionArguments: (UIView, CGRect, UIImage?)?, completion: @escaping (TelegramMediaFile, @escaping () -> Void) -> Void) -> ViewController {
|
||||
let subject: MediaEditorScreen.Subject
|
||||
let mode: MediaEditorScreen.Mode.StickerEditorMode
|
||||
if let file = source as? TelegramMediaFile {
|
||||
@@ -2342,9 +2350,10 @@ public final class SharedAccountContextImpl: SharedAccountContext {
|
||||
}
|
||||
return nil
|
||||
}, completion: { result, commit in
|
||||
commit({})
|
||||
if case let .sticker(file) = result.media {
|
||||
completion(file)
|
||||
completion(file, {
|
||||
commit({})
|
||||
})
|
||||
}
|
||||
} as (MediaEditorScreen.Result, @escaping (@escaping () -> Void) -> Void) -> Void
|
||||
)
|
||||
|
||||
Reference in New Issue
Block a user