Fix sync filters

This commit is contained in:
Christian Pauly 2019-07-02 10:15:20 +02:00
parent e96929de00
commit bafcb8001d

View file

@ -44,10 +44,9 @@ class Connection {
}));
}
String get _syncFilters => Uri.encodeFull(
"{\"room\":{\"state\":{\"lazy_load_members\":${client.lazyLoadMembers ? "1" : "0"}}}");
String get _firstSyncFilters => Uri.encodeFull(
"{\"room\":{\"include_leave\":1,\"state\":{\"lazy_load_members\":${client.lazyLoadMembers ? "1" : "0"}}}");
String get _syncFilters => '{"room":{"state":{"lazy_load_members":true}}}';
String get _firstSyncFilters =>
'{"room":{"include_leave":true,"state":{"lazy_load_members":true}}}';
/// Handles the connection to the Matrix Homeserver. You can change this to a
/// MockClient for testing.
@ -251,10 +250,10 @@ class Connection {
Future<void> _sync() async {
if (client.isLogged() == false) return;
String action = "/client/r0/sync?filters=$_firstSyncFilters";
String action = "/client/r0/sync?filter=$_firstSyncFilters";
if (client.prevBatch != null) {
action = "/client/r0/sync?filters=$_syncFilters";
action = "/client/r0/sync?filter=$_syncFilters";
action += "&timeout=30000";
action += "&since=${client.prevBatch}";
}