diff options
author | Emma [it/its]@Rory& <root@rory.gay> | 2024-05-30 21:39:12 +0200 |
---|---|---|
committer | Emma [it/its]@Rory& <root@rory.gay> | 2024-05-30 21:39:12 +0200 |
commit | 4bdea63982dae9c17b7a5fbda38d505655b8d4b3 (patch) | |
tree | 8ca9c6bad5f9526c5b36d707f08406fc3bbe2848 /LibMatrix/Events/BaseEvent.cs | |
parent | Log warning if registering a duplicate type (diff) | |
download | LibMatrix-4bdea63982dae9c17b7a5fbda38d505655b8d4b3.tar.xz |
Diffstat (limited to 'LibMatrix/Events/BaseEvent.cs')
-rw-r--r-- | LibMatrix/Events/BaseEvent.cs | 52 |
1 files changed, 52 insertions, 0 deletions
diff --git a/LibMatrix/Events/BaseEvent.cs b/LibMatrix/Events/BaseEvent.cs new file mode 100644 index 0000000..2e27368 --- /dev/null +++ b/LibMatrix/Events/BaseEvent.cs @@ -0,0 +1,52 @@ +using System.Text.Json.Nodes; +using System.Text.Json.Serialization; + +namespace LibMatrix.Events; + +public class StateEvent { + [JsonPropertyName("state_key")] + public string? StateKey { get; set; } + + [JsonPropertyName("type")] + public string Type { get; set; } + + [JsonPropertyName("replaces_state")] + public string? ReplacesState { get; set; } +} + +public class StateEventResponse : StateEvent { + [JsonPropertyName("origin_server_ts")] + public long? OriginServerTs { get; set; } + + [JsonPropertyName("room_id")] + public string? RoomId { get; set; } + + [JsonPropertyName("sender")] + public string? Sender { get; set; } + + [JsonPropertyName("unsigned")] + public UnsignedData? Unsigned { get; set; } + + [JsonPropertyName("event_id")] + public string? EventId { get; set; } + + public class UnsignedData { + [JsonPropertyName("age")] + public ulong? Age { get; set; } + + [JsonPropertyName("redacted_because")] + public object? RedactedBecause { get; set; } + + [JsonPropertyName("transaction_id")] + public string? TransactionId { get; set; } + + [JsonPropertyName("replaces_state")] + public string? ReplacesState { get; set; } + + [JsonPropertyName("prev_sender")] + public string? PrevSender { get; set; } + + [JsonPropertyName("prev_content")] + public JsonObject? PrevContent { get; set; } + } +} \ No newline at end of file |