Various improvements

This commit is contained in:
Ilya Laktyushin
2025-03-14 13:35:44 +04:00
parent ff34190f92
commit fed338985d
38 changed files with 914 additions and 534 deletions

View File

@@ -2411,5 +2411,30 @@ public extension TelegramEngine.EngineData.Item {
}
}
}
public struct DisallowedGifts: TelegramEngineDataItem, PostboxViewDataItem {
public typealias Result = TelegramDisallowedGifts?
public let id: EnginePeer.Id
public init(id: EnginePeer.Id) {
self.id = id
}
var key: PostboxViewKey {
return .cachedPeerData(peerId: self.id)
}
func extract(view: PostboxView) -> Result {
guard let view = view as? CachedPeerDataView else {
preconditionFailure()
}
if let cachedData = view.cachedPeerData as? CachedUserData {
return cachedData.disallowedGifts
} else {
return nil
}
}
}
}
}