diff --git a/lib/src/Connection.dart b/lib/src/Connection.dart index e0ece74a..9b5fd3b7 100644 --- a/lib/src/Connection.dart +++ b/lib/src/Connection.dart @@ -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 _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}"; }