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/StateEvent.cs | |
parent | Log warning if registering a duplicate type (diff) | |
download | LibMatrix-dev/home-changes.tar.xz |
Changes dev/home-changes
Diffstat (limited to '')
-rw-r--r-- | LibMatrix/StateEvent.cs | 6 |
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(); |