From f215dca816745ef54f5436d6cea9350d6dcd3982 Mon Sep 17 00:00:00 2001 From: "Emma [it/its]@Rory&" Date: Fri, 5 Jan 2024 12:22:42 +0100 Subject: Cleanup --- LibMatrix/StateEvent.cs | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) (limited to 'LibMatrix/StateEvent.cs') 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(), -- cgit 1.4.1