mirror of
https://github.com/Swiftgram/Telegram-iOS.git
synced 2025-12-22 22:25:57 +00:00
Refactoring
This commit is contained in:
@@ -0,0 +1,73 @@
|
||||
import SwiftSignalKit
|
||||
import SyncCore
|
||||
import Postbox
|
||||
|
||||
public extension TelegramEngine {
|
||||
final class Stickers {
|
||||
private let account: Account
|
||||
|
||||
init(account: Account) {
|
||||
self.account = account
|
||||
}
|
||||
|
||||
public func archivedStickerPacks(namespace: ArchivedStickerPacksNamespace = .stickers) -> Signal<[ArchivedStickerPackItem], NoError> {
|
||||
return _internal_archivedStickerPacks(account: account, namespace: namespace)
|
||||
}
|
||||
|
||||
public func removeArchivedStickerPack(info: StickerPackCollectionInfo) -> Signal<Void, NoError> {
|
||||
return _internal_removeArchivedStickerPack(account: self.account, info: info)
|
||||
}
|
||||
|
||||
public func cachedStickerPack(reference: StickerPackReference, forceRemote: Bool) -> Signal<CachedStickerPackResult, NoError> {
|
||||
return _internal_cachedStickerPack(postbox: self.account.postbox, network: self.account.network, reference: reference, forceRemote: forceRemote)
|
||||
}
|
||||
|
||||
public func loadedStickerPack(reference: StickerPackReference, forceActualized: Bool) -> Signal<LoadedStickerPack, NoError> {
|
||||
return _internal_loadedStickerPack(postbox: self.account.postbox, network: self.account.network, reference: reference, forceActualized: forceActualized)
|
||||
}
|
||||
|
||||
public func randomGreetingSticker() -> Signal<FoundStickerItem?, NoError> {
|
||||
return _internal_randomGreetingSticker(account: self.account)
|
||||
}
|
||||
|
||||
public func searchStickers(query: String, scope: SearchStickersScope = [.installed, .remote]) -> Signal<[FoundStickerItem], NoError> {
|
||||
return _internal_searchStickers(account: self.account, query: query, scope: scope)
|
||||
}
|
||||
|
||||
public func searchStickerSetsRemotely(query: String) -> Signal<FoundStickerSets, NoError> {
|
||||
return _internal_searchStickerSetsRemotely(network: self.account.network, query: query)
|
||||
}
|
||||
|
||||
public func searchStickerSets(query: String) -> Signal<FoundStickerSets, NoError> {
|
||||
return _internal_searchStickerSets(postbox: self.account.postbox, query: query)
|
||||
}
|
||||
|
||||
public func searchGifs(query: String, nextOffset: String = "") -> Signal<ChatContextResultCollection?, NoError> {
|
||||
return _internal_searchGifs(account: self.account, query: query, nextOffset: nextOffset)
|
||||
}
|
||||
|
||||
public func addStickerPackInteractively(info: StickerPackCollectionInfo, items: [ItemCollectionItem], positionInList: Int? = nil) -> Signal<Void, NoError> {
|
||||
return _internal_addStickerPackInteractively(postbox: self.account.postbox, info: info, items: items, positionInList: positionInList)
|
||||
}
|
||||
|
||||
public func removeStickerPackInteractively(id: ItemCollectionId, option: RemoveStickerPackOption) -> Signal<(Int, [ItemCollectionItem])?, NoError> {
|
||||
return _internal_removeStickerPackInteractively(postbox: self.account.postbox, id: id, option: option)
|
||||
}
|
||||
|
||||
public func removeStickerPacksInteractively(ids: [ItemCollectionId], option: RemoveStickerPackOption) -> Signal<(Int, [ItemCollectionItem])?, NoError> {
|
||||
return _internal_removeStickerPacksInteractively(postbox: self.account.postbox, ids: ids, option: option)
|
||||
}
|
||||
|
||||
public func markFeaturedStickerPacksAsSeenInteractively(ids: [ItemCollectionId]) -> Signal<Void, NoError> {
|
||||
return _internal_markFeaturedStickerPacksAsSeenInteractively(postbox: self.account.postbox, ids: ids)
|
||||
}
|
||||
|
||||
public func searchEmojiKeywords(inputLanguageCode: String, query: String, completeMatch: Bool) -> Signal<[EmojiKeywordItem], NoError> {
|
||||
return _internal_searchEmojiKeywords(postbox: self.account.postbox, inputLanguageCode: inputLanguageCode, query: query, completeMatch: completeMatch)
|
||||
}
|
||||
|
||||
public func stickerPacksAttachedToMedia(media: AnyMediaReference) -> Signal<[StickerPackReference], NoError> {
|
||||
return _internal_stickerPacksAttachedToMedia(account: self.account, media: media)
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user