mirror of
https://github.com/Swiftgram/Telegram-iOS.git
synced 2026-03-30 10:45:01 +00:00
35 lines
1007 B
Swift
35 lines
1007 B
Swift
import Foundation
|
|
import UIKit
|
|
import SwiftSignalKit
|
|
import Postbox
|
|
import TelegramCore
|
|
import AsyncDisplayKit
|
|
import Display
|
|
import AccountContext
|
|
import ChatControllerInteraction
|
|
import LegacyMediaPickerUI
|
|
|
|
extension ChatControllerImpl {
|
|
func openStickerEditing(file: TelegramMediaFile) {
|
|
var emoji: [String] = []
|
|
for attribute in file.attributes {
|
|
if case let .Sticker(displayText, _, _) = attribute {
|
|
emoji = [displayText]
|
|
}
|
|
}
|
|
|
|
let controller = self.context.sharedContext.makeStickerEditorScreen(
|
|
context: self.context,
|
|
source: (file, emoji),
|
|
mode: .generic,
|
|
transitionArguments: nil,
|
|
completion: { file, _, commit in
|
|
commit()
|
|
let _ = self.controllerInteraction?.sendSticker(.standalone(media: file), false, false, nil, false, nil, nil, nil, [])
|
|
},
|
|
cancelled: {}
|
|
)
|
|
self.push(controller)
|
|
}
|
|
}
|