From 13ac8e351c99d37831082539a82b9d11d9371144 Mon Sep 17 00:00:00 2001 From: Christian Pauly Date: Fri, 14 Jun 2019 12:39:18 +0200 Subject: [PATCH] Load archived rooms on first sync --- lib/src/Connection.dart | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/lib/src/Connection.dart b/lib/src/Connection.dart index aba06f7..1134930 100644 --- a/lib/src/Connection.dart +++ b/lib/src/Connection.dart @@ -46,6 +46,8 @@ class Connection { String get _syncFilters => "{\"room\":{\"state\":{\"lazy_load_members\":${client.lazyLoadMembers ? "1" : "0"}}}"; + String get _firstSyncFilters => + "{\"room\":{\"include_leave\":true,\"state\":{\"lazy_load_members\":${client.lazyLoadMembers ? "1" : "0"}}}"; /// Handles the connection to the Matrix Homeserver. You can change this to a /// MockClient for testing. @@ -251,9 +253,10 @@ class Connection { dynamic args = {}; - String action = "/client/r0/sync?filters=${_syncFilters}"; + String action = "/client/r0/sync?filters=${_firstSyncFilters}"; if (client.prevBatch != null) { + action = "/client/r0/sync?filters=${_syncFilters}"; action += "&timeout=30000"; action += "&since=${client.prevBatch}"; }