From 0d0511e35d9965fc0ea5190ae3347c3d77c3334c Mon Sep 17 00:00:00 2001 From: TheArcaneBrony Date: Mon, 14 Aug 2023 04:09:13 +0200 Subject: Split LibMatrix into separate repo --- LibMatrix/Filters/LocalRoomQueryFilter.cs | 28 +++++++++++++ LibMatrix/Filters/SyncFilter.cs | 66 +++++++++++++++++++++++++++++++ 2 files changed, 94 insertions(+) create mode 100644 LibMatrix/Filters/LocalRoomQueryFilter.cs create mode 100644 LibMatrix/Filters/SyncFilter.cs (limited to 'LibMatrix/Filters') diff --git a/LibMatrix/Filters/LocalRoomQueryFilter.cs b/LibMatrix/Filters/LocalRoomQueryFilter.cs new file mode 100644 index 0000000..668d408 --- /dev/null +++ b/LibMatrix/Filters/LocalRoomQueryFilter.cs @@ -0,0 +1,28 @@ +namespace LibMatrix.Filters; + +public class LocalRoomQueryFilter { + public string RoomIdContains { get; set; } = ""; + public string NameContains { get; set; } = ""; + public string CanonicalAliasContains { get; set; } = ""; + public string VersionContains { get; set; } = ""; + public string CreatorContains { get; set; } = ""; + public string EncryptionContains { get; set; } = ""; + public string JoinRulesContains { get; set; } = ""; + public string GuestAccessContains { get; set; } = ""; + public string HistoryVisibilityContains { get; set; } = ""; + + public bool Federatable { get; set; } = true; + public bool Public { get; set; } = true; + + public int JoinedMembersGreaterThan { get; set; } = 0; + public int JoinedMembersLessThan { get; set; } = int.MaxValue; + + public int JoinedLocalMembersGreaterThan { get; set; } = 0; + public int JoinedLocalMembersLessThan { get; set; } = int.MaxValue; + public int StateEventsGreaterThan { get; set; } = 0; + public int StateEventsLessThan { get; set; } = int.MaxValue; + + + public bool CheckFederation { get; set; } + public bool CheckPublic { get; set; } +} diff --git a/LibMatrix/Filters/SyncFilter.cs b/LibMatrix/Filters/SyncFilter.cs new file mode 100644 index 0000000..c907f6b --- /dev/null +++ b/LibMatrix/Filters/SyncFilter.cs @@ -0,0 +1,66 @@ +using System.Text.Json.Serialization; + +namespace LibMatrix.Filters; + +public class SyncFilter { + [JsonPropertyName("account_data")] + public EventFilter? AccountData { get; set; } + + [JsonPropertyName("presence")] + public EventFilter? Presence { get; set; } + + [JsonPropertyName("room")] + public RoomFilter? Room { get; set; } + + public class RoomFilter { + [JsonPropertyName("account_data")] + public StateFilter? AccountData { get; set; } + + [JsonPropertyName("ephemeral")] + public StateFilter? Ephemeral { get; set; } + + [JsonPropertyName("state")] + public StateFilter? State { get; set; } + + [JsonPropertyName("timeline")] + public StateFilter? Timeline { get; set; } + + + public class StateFilter : EventFilter { + [JsonPropertyName("contains_url")] + public bool? ContainsUrl { get; set; } + + [JsonPropertyName("include_redundant_members")] + public bool? IncludeRedundantMembers { get; set; } + + [JsonPropertyName("lazy_load_members")] + public bool? LazyLoadMembers { get; set; } + + [JsonPropertyName("rooms")] + public List? Rooms { get; set; } + + [JsonPropertyName("not_rooms")] + public List? NotRooms { get; set; } + + [JsonPropertyName("unread_thread_notifications")] + public bool? UnreadThreadNotifications { get; set; } + } + } + + public class EventFilter { + [JsonPropertyName("limit")] + public int? Limit { get; set; } + + [JsonPropertyName("types")] + public List? Types { get; set; } + + [JsonPropertyName("not_types")] + public List? NotTypes { get; set; } + + [JsonPropertyName("senders")] + public List? Senders { get; set; } + + [JsonPropertyName("not_senders")] + public List? NotSenders { get; set; } + } +} -- cgit 1.4.1