mirror of
https://github.com/Swiftgram/Telegram-iOS.git
synced 2025-06-16 05:55:20 +00:00
Fix API usage
This commit is contained in:
parent
15b20e5c13
commit
3c077c2820
@ -169,6 +169,12 @@ public final class CachedPremiumGiftCodeOptions: Codable {
|
||||
}
|
||||
|
||||
func _internal_premiumGiftCodeOptions(account: Account, peerId: EnginePeer.Id?, onlyCached: Bool = false) -> Signal<[PremiumGiftCodeOption], NoError> {
|
||||
if let peerId {
|
||||
if peerId.namespace == Namespaces.Peer.SecretChat {
|
||||
return .single([])
|
||||
}
|
||||
}
|
||||
|
||||
let cached = account.postbox.transaction { transaction -> Signal<[PremiumGiftCodeOption], NoError> in
|
||||
if let entry = transaction.retrieveItemCacheEntry(id: ItemCacheEntryId(collectionId: Namespaces.CachedItemCollection.cachedPremiumGiftCodeOptions, key: ValueBoxKey(length: 0)))?.get(CachedPremiumGiftCodeOptions.self) {
|
||||
return .single(entry.options)
|
||||
@ -222,6 +228,12 @@ func _internal_premiumGiftCodeOptions(account: Account, peerId: EnginePeer.Id?,
|
||||
|
||||
|
||||
func _internal_premiumGiftCodeOptions(account: Account, peerId: EnginePeer.Id?) -> Signal<[PremiumGiftCodeOption], NoError> {
|
||||
if let peerId {
|
||||
if peerId.namespace == Namespaces.Peer.SecretChat {
|
||||
return .single([])
|
||||
}
|
||||
}
|
||||
|
||||
var flags: Int32 = 0
|
||||
if let _ = peerId {
|
||||
flags |= 1 << 0
|
||||
|
Loading…
x
Reference in New Issue
Block a user