From 9f8d0c85c54b4715974994aea52562072d6f1751 Mon Sep 17 00:00:00 2001 From: "Emma [it/its]@Rory&" Date: Wed, 31 Jan 2024 12:09:28 +0100 Subject: Better sync filter support, named filters, error handling --- LibMatrix/Filters/SyncFilter.cs | 24 ++++++++++-------------- 1 file changed, 10 insertions(+), 14 deletions(-) (limited to 'LibMatrix/Filters') diff --git a/LibMatrix/Filters/SyncFilter.cs b/LibMatrix/Filters/SyncFilter.cs index b05f6b4..5ffef4d 100644 --- a/LibMatrix/Filters/SyncFilter.cs +++ b/LibMatrix/Filters/SyncFilter.cs @@ -24,6 +24,15 @@ public class SyncFilter { [JsonPropertyName("timeline")] public StateFilter? Timeline { get; set; } + + [JsonPropertyName("rooms")] + public List? Rooms { get; set; } + + [JsonPropertyName("not_rooms")] + public List? NotRooms { get; set; } + + [JsonPropertyName("include_leave")] + public bool? IncludeLeave { get; set; } public class StateFilter(bool? containsUrl = null, bool? includeRedundantMembers = null, bool? lazyLoadMembers = null, List? rooms = null, List? notRooms = null, bool? unreadThreadNotifications = null, @@ -66,17 +75,4 @@ public class SyncFilter { [JsonPropertyName("not_senders")] public List? NotSenders { get; set; } = notSenders; } -} - -public static class ExampleFilters { - public static readonly SyncFilter Limit1Filter = new() { - Presence = new(limit: 1), - Room = new() { - AccountData = new(limit: 1), - Ephemeral = new(limit: 1), - State = new(limit: 1), - Timeline = new(limit: 1), - }, - AccountData = new(limit: 1) - }; -} +} \ No newline at end of file -- cgit 1.4.1