1
0
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:
Kegan Dougal
2017-02-09 11:05:16 +00:00
parent 1e3fcdc109
commit ef57b88343
2 changed files with 23 additions and 13 deletions

View File

@@ -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,