mirror of
https://github.com/Swiftgram/Telegram-iOS.git
synced 2025-12-23 06:35:51 +00:00
Stories
This commit is contained in:
@@ -33,5 +33,28 @@ public extension TelegramEngine.EngineData.Item {
|
||||
return EngineContactList(peers: view.peers.map(EnginePeer.init), presences: view.peerPresences.mapValues(EnginePeer.Presence.init))
|
||||
}
|
||||
}
|
||||
|
||||
public struct Top: TelegramEngineDataItem, PostboxViewDataItem {
|
||||
public typealias Result = Array<EnginePeer.Id>
|
||||
|
||||
public init() {
|
||||
}
|
||||
|
||||
var key: PostboxViewKey {
|
||||
return .cachedItem(cachedRecentPeersEntryId())
|
||||
}
|
||||
|
||||
func extract(view: PostboxView) -> [EnginePeer.Id] {
|
||||
if let value = (view as? CachedItemView)?.value?.get(CachedRecentPeers.self) {
|
||||
if value.enabled {
|
||||
return value.ids
|
||||
} else {
|
||||
return []
|
||||
}
|
||||
} else {
|
||||
return []
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user