Limit history fetches to 100 messages

This commit is contained in:
Ali 2019-12-08 22:13:19 +04:00
parent 5faa143d6f
commit 6171761401

View File

@ -121,7 +121,9 @@ func withResolvedAssociatedMessages(postbox: Postbox, source: FetchMessageHistor
|> switchToLatest
}
func fetchMessageHistoryHole(accountPeerId: PeerId, source: FetchMessageHistoryHoleSource, postbox: Postbox, peerId: PeerId, namespace: MessageId.Namespace, direction: MessageHistoryViewRelativeHoleDirection, space: MessageHistoryHoleSpace, count: Int) -> Signal<Never, NoError> {
func fetchMessageHistoryHole(accountPeerId: PeerId, source: FetchMessageHistoryHoleSource, postbox: Postbox, peerId: PeerId, namespace: MessageId.Namespace, direction: MessageHistoryViewRelativeHoleDirection, space: MessageHistoryHoleSpace, count rawCount: Int) -> Signal<Never, NoError> {
let count = min(100, rawCount)
return postbox.stateView()
|> mapToSignal { view -> Signal<AuthorizedAccountState, NoError> in
if let state = view.state as? AuthorizedAccountState {