You've already forked matrix-js-sdk
mirror of
https://github.com/matrix-org/matrix-js-sdk.git
synced 2025-11-26 17:03:12 +03:00
Remember next_batch tokens in the accumulator. Glue it in to SyncApi
This commit is contained in:
@@ -59,6 +59,8 @@ function debuglog() {
|
||||
* @param {MatrixClient} client The matrix client instance to use.
|
||||
* @param {Object} opts Config options
|
||||
* @param {module:crypto=} opts.crypto Crypto manager
|
||||
* @param {SyncAccumulator=} opts.syncAccumulator An accumulator which will be
|
||||
* kept up-to-date.
|
||||
*/
|
||||
function SyncApi(client, opts) {
|
||||
this.client = client;
|
||||
@@ -529,6 +531,10 @@ SyncApi.prototype._sync = function(syncOptions) {
|
||||
console.error("Caught /sync error", e.stack || e);
|
||||
}
|
||||
|
||||
if(self.opts.syncAccumulator) {
|
||||
self.opts.syncAccumulator.accumulateRooms(data);
|
||||
}
|
||||
|
||||
// emit synced events
|
||||
const syncEventData = {
|
||||
oldSyncToken: syncToken,
|
||||
|
||||
Reference in New Issue
Block a user