about summary refs log tree commit diff
path: root/LibMatrix/StateEvent.cs
diff options
context:
space:
mode:
authorEmma [it/its]@Rory& <root@rory.gay>2024-01-05 12:22:42 +0100
committerEmma [it/its]@Rory& <root@rory.gay>2024-01-05 12:22:42 +0100
commitf215dca816745ef54f5436d6cea9350d6dcd3982 (patch)
tree2749bcd4d1297943478b6080d5688ef642ca1d40 /LibMatrix/StateEvent.cs
parentToObject and ToJson for MatrixException (diff)
downloadLibMatrix-f215dca816745ef54f5436d6cea9350d6dcd3982.tar.xz
Cleanup
Diffstat (limited to 'LibMatrix/StateEvent.cs')
-rw-r--r--LibMatrix/StateEvent.cs5
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(),