diff options
Diffstat (limited to 'MatrixRoomUtils.Core/StateEventTypes/GuestAccessData.cs')
-rw-r--r-- | MatrixRoomUtils.Core/StateEventTypes/GuestAccessData.cs | 16 |
1 files changed, 16 insertions, 0 deletions
diff --git a/MatrixRoomUtils.Core/StateEventTypes/GuestAccessData.cs b/MatrixRoomUtils.Core/StateEventTypes/GuestAccessData.cs new file mode 100644 index 0000000..1727ce9 --- /dev/null +++ b/MatrixRoomUtils.Core/StateEventTypes/GuestAccessData.cs @@ -0,0 +1,16 @@ +using System.Text.Json.Serialization; +using MatrixRoomUtils.Core.Extensions; +using MatrixRoomUtils.Core.Interfaces; + +namespace MatrixRoomUtils.Core.StateEventTypes; + +[MatrixEvent(EventName = "m.room.guest_access")] +public class GuestAccessData : IStateEventType { + [JsonPropertyName("guest_access")] + public string GuestAccess { get; set; } + + public bool IsGuestAccessEnabled { + get => GuestAccess == "can_join"; + set => GuestAccess = value ? "can_join" : "forbidden"; + } +} \ No newline at end of file |