mirror of
https://github.com/GLEGram/GLEGram-iOS.git
synced 2026-04-25 04:16:58 +02:00
4647310322
Based on Swiftgram 12.5 (Telegram iOS 12.5). All GLEGram features ported and organized in GLEGram/ folder. Features: Ghost Mode, Saved Deleted Messages, Content Protection Bypass, Font Replacement, Fake Profile, Chat Export, Plugin System, and more. See CHANGELOG_12.5.md for full details.
36 lines
1.1 KiB
Swift
36 lines
1.1 KiB
Swift
import Foundation
|
|
import UIKit
|
|
import SwiftSignalKit
|
|
import Postbox
|
|
import TelegramCore
|
|
import AsyncDisplayKit
|
|
import Display
|
|
import AccountContext
|
|
import ChatControllerInteraction
|
|
import ChatPresentationInterfaceState
|
|
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(canSend: canSendMessagesToChat(self.presentationInterfaceState)),
|
|
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)
|
|
}
|
|
}
|