about summary refs log tree commit diff
path: root/LibMatrix/EventTypes/Spec/State/GuestAccessEventData.cs
diff options
context:
space:
mode:
Diffstat (limited to 'LibMatrix/EventTypes/Spec/State/GuestAccessEventData.cs')
-rw-r--r--LibMatrix/EventTypes/Spec/State/GuestAccessEventData.cs16
1 files changed, 16 insertions, 0 deletions
diff --git a/LibMatrix/EventTypes/Spec/State/GuestAccessEventData.cs b/LibMatrix/EventTypes/Spec/State/GuestAccessEventData.cs
new file mode 100644
index 0000000..af1b2ce
--- /dev/null
+++ b/LibMatrix/EventTypes/Spec/State/GuestAccessEventData.cs
@@ -0,0 +1,16 @@
+using System.Text.Json.Serialization;
+using LibMatrix.Helpers;
+using LibMatrix.Interfaces;
+
+namespace LibMatrix.EventTypes.Spec.State;
+
+[MatrixEvent(EventName = "m.room.guest_access")]
+public class GuestAccessEventContent : EventContent {
+    [JsonPropertyName("guest_access")]
+    public string GuestAccess { get; set; }
+
+    public bool IsGuestAccessEnabled {
+        get => GuestAccess == "can_join";
+        set => GuestAccess = value ? "can_join" : "forbidden";
+    }
+}