mirror of
https://github.com/TelegramMessenger/Telegram-iOS.git
synced 2026-07-06 03:33:41 +02:00
- BotLinkedForum dataItem
This commit is contained in:
parent
8f70aa3957
commit
68c08c67b3
1 changed files with 25 additions and 0 deletions
|
|
@ -2590,6 +2590,31 @@ public extension TelegramEngine.EngineData.Item {
|
|||
}
|
||||
}
|
||||
|
||||
public struct BotLinkedForum: TelegramEngineDataItem, PostboxViewDataItem {
|
||||
public typealias Result = CachedUserData.LinkedBotChannelId?
|
||||
|
||||
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.linkedBotChannelId
|
||||
} else {
|
||||
return nil
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
public struct AutoTranslateEnabled: TelegramEngineDataItem, TelegramEngineMapKeyDataItem, PostboxViewDataItem {
|
||||
public typealias Result = Bool
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue