diff options
author | Emma [it/its]@Rory& <root@rory.gay> | 2024-01-05 12:22:42 +0100 |
---|---|---|
committer | Emma [it/its]@Rory& <root@rory.gay> | 2024-01-05 12:22:42 +0100 |
commit | f215dca816745ef54f5436d6cea9350d6dcd3982 (patch) | |
tree | 2749bcd4d1297943478b6080d5688ef642ca1d40 /LibMatrix/StateEvent.cs | |
parent | ToObject and ToJson for MatrixException (diff) | |
download | LibMatrix-f215dca816745ef54f5436d6cea9350d6dcd3982.tar.xz |
Cleanup
Diffstat (limited to '')
-rw-r--r-- | LibMatrix/StateEvent.cs | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/LibMatrix/StateEvent.cs b/LibMatrix/StateEvent.cs index ad7605a..4a0adbd 100644 --- a/LibMatrix/StateEvent.cs +++ b/LibMatrix/StateEvent.cs @@ -26,8 +26,11 @@ public class StateEvent { }).ToFrozenDictionary(); public static Type GetStateEventType(string type) => KnownStateEventTypesByName.GetValueOrDefault(type) ?? typeof(UnknownEventContent); + + [JsonIgnore] + public Type MappedType => GetStateEventType(Type); - private static readonly JsonSerializerOptions TypedContentSerializerOptions = new JsonSerializerOptions() { + private static readonly JsonSerializerOptions TypedContentSerializerOptions = new() { Converters = { new JsonFloatStringConverter(), new JsonDoubleStringConverter(), |