From bafcb8001d0737565a2db24a6ec34d486b795a10 Mon Sep 17 00:00:00 2001 From: Christian Pauly Date: Tue, 2 Jul 2019 10:15:20 +0200 Subject: [PATCH] Fix sync filters --- lib/src/Connection.dart | 11 +++++------ 1 file changed, 5 insertions(+), 6 deletions(-) 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}"; }