Skip to content

Commit

Permalink
Fetch messages from server using Topic.missingRange.
Browse files Browse the repository at this point in the history
(cherry picked from commit a8266bc)
  • Loading branch information
aforge committed Feb 28, 2023
1 parent f375fff commit f0edd4c
Showing 1 changed file with 1 addition and 3 deletions.
4 changes: 1 addition & 3 deletions TinodeSDK/ComTopic.swift
Original file line number Diff line number Diff line change
Expand Up @@ -128,9 +128,7 @@ public class ComTopic: Topic<TheCard, PrivateType, TheCard, PrivateType> {
// Not enough messages in cache to fullfill the request, call the server.

// Use query builder to get cached message ranges.
// 'since' is inclusive (>=), 'before' is exclusive (<).
let (since, before) = forward ? (lastLoadedSeq + 1, nil) : (nil, lastLoadedSeq)
let query = metaGetBuilder().withData(since: since, before: before, limit: remainingCount)
let query = metaGetBuilder().withEarlierData(limit: limit)
getMeta(query: query.build())
.thenApply({ _ in
// Read message page from DB.
Expand Down

0 comments on commit f0edd4c

Please # to comment.