mirror of
https://github.com/TelegramMessenger/Telegram-iOS.git
synced 2026-06-20 18:24:43 +00:00
Squashed range bf01b4c..a66739c (70 commits) covering 69 waves of the Postbox -> TelegramEngine consumer migration plus a few BUILD-dep followups. Notable additions to TelegramCore in this range: - Engine typealiases: EngineRawPeerPresence, EngineRawValueBoxKey, EngineSimpleDictionary, EngineRawPeerView, EngineRawPostboxViewKey, EngineRawPreferencesView, EngineRawMessageHistoryView (+ entry/attrs/ read-state), EngineMessageIdNamespaces, EngineHistoryViewInputAnchor, EngineRawUnreadMessageCountsItem, EngineRawMessageHistorySavedMessages IndexView, EngineRawChatInterfaceStateView, EngineRawOrderedItemList View, EngineRawMessageHistoryThreadIndexView, EngineRawCombinedRead StateView, EngineRawMessageHistoryThreadInfoView, EngineRawBasicPeer View, EngineRawCachedPeerDataView, EngineMessageHistoryThreadData, EngineViewUpdateType, EngineInitialMessageHistoryData, EnginePeerGroupId, EngineChatLocationInput, EngineHistoryViewInputTag. - Engine data items: Peer.CachedData, ItemCollections.InstalledPackInfos, ItemCollections.InstalledPackIds. - Engine facade: TelegramEngine.ItemCollections.allItems(namespace:). - Free function: engineAreMediaArraysEqual forwarder. Net effect: 65+ consumer modules drop "import Postbox"; 131 files changed (+1386 / -1493). Build green at HEAD.
21 lines
661 B
Swift
21 lines
661 B
Swift
import Foundation
|
|
import SwiftSignalKit
|
|
import Postbox
|
|
|
|
public extension TelegramEngine {
|
|
final class ItemCollections {
|
|
private let account: Account
|
|
|
|
init(account: Account) {
|
|
self.account = account
|
|
}
|
|
|
|
public func allItems(namespace: ItemCollectionId.Namespace) -> Signal<[EngineRawItemCollectionItem], NoError> {
|
|
return self.account.postbox.itemCollectionsView(orderedItemListCollectionIds: [], namespaces: [namespace], aroundIndex: nil, count: 10000000)
|
|
|> map { view -> [EngineRawItemCollectionItem] in
|
|
return view.entries.map { $0.item }
|
|
}
|
|
}
|
|
}
|
|
}
|