mirror of
https://github.com/Swiftgram/Telegram-iOS.git
synced 2025-12-22 22:25:57 +00:00
Merge branch 'master' of gitlab.com:peter-iakovlev/telegram-ios
This commit is contained in:
@@ -1697,14 +1697,16 @@ final class ChatMediaInputNode: ChatInputNode {
|
||||
|
||||
if let (itemNode, item) = itemNodeAndItem {
|
||||
let accountPeerId = strongSelf.context.account.peerId
|
||||
return strongSelf.context.account.postbox.transaction { transaction -> (Bool, Bool) in
|
||||
let isStarred = getIsStickerSaved(transaction: transaction, fileId: item.file.fileId)
|
||||
var hasPremium = false
|
||||
if let peer = transaction.getPeer(accountPeerId) as? TelegramUser, peer.isPremium {
|
||||
hasPremium = true
|
||||
return combineLatest(
|
||||
strongSelf.context.engine.stickers.isStickerSaved(id: item.file.fileId),
|
||||
strongSelf.context.engine.data.get(TelegramEngine.EngineData.Item.Peer.Peer(id: accountPeerId)) |> map { peer -> Bool in
|
||||
var hasPremium = false
|
||||
if case let .user(user) = peer, user.isPremium {
|
||||
hasPremium = true
|
||||
}
|
||||
return hasPremium
|
||||
}
|
||||
return (isStarred, hasPremium)
|
||||
}
|
||||
)
|
||||
|> deliverOnMainQueue
|
||||
|> map { isStarred, hasPremium -> (ASDisplayNode, PeekControllerContent)? in
|
||||
if let strongSelf = self {
|
||||
|
||||
Reference in New Issue
Block a user