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-05-30 21:39:12 +0200
committerEmma [it/its]@Rory& <root@rory.gay>2024-05-30 21:39:12 +0200
commit4bdea63982dae9c17b7a5fbda38d505655b8d4b3 (patch)
tree8ca9c6bad5f9526c5b36d707f08406fc3bbe2848 /LibMatrix/StateEvent.cs
parentLog warning if registering a duplicate type (diff)
downloadLibMatrix-4bdea63982dae9c17b7a5fbda38d505655b8d4b3.tar.xz
Diffstat (limited to 'LibMatrix/StateEvent.cs')
-rw-r--r--LibMatrix/StateEvent.cs6
1 files changed, 6 insertions, 0 deletions
diff --git a/LibMatrix/StateEvent.cs b/LibMatrix/StateEvent.cs
index 81ee3fe..3bd0672 100644
--- a/LibMatrix/StateEvent.cs
+++ b/LibMatrix/StateEvent.cs
@@ -1,6 +1,7 @@
 using System.Collections.Frozen;
 using System.Diagnostics.CodeAnalysis;
 using System.Reflection;
+using System.Runtime.CompilerServices;
 using System.Text.Json;
 using System.Text.Json.Nodes;
 using System.Text.Json.Serialization;
@@ -54,6 +55,8 @@ public class StateEvent {
     [JsonIgnore]
     [SuppressMessage("ReSharper", "PropertyCanBeMadeInitOnly.Global")]
     public EventContent? TypedContent {
+        [RequiresDynamicCode("TypedContent requires reflection to deserialize the content of the event.")]
+        [RequiresUnreferencedCode("TypedContent requires reflection to deserialize the content of the event.")]
         get {
             // if (Type == "m.receipt") {
             // return null;
@@ -72,6 +75,9 @@ public class StateEvent {
 
             return null;
         }
+        
+        [RequiresDynamicCode("TypedContent requires reflection to deserialize the content of the event.")]
+        [RequiresUnreferencedCode("TypedContent requires reflection to deserialize the content of the event.")]
         set {
             if (value is null)
                 RawContent?.Clear();