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