about summary refs log tree commit diff
path: root/LibMatrix/StateEventTypes/Spec/GuestAccessEventData.cs
blob: 0709b865a4de8ecea1427a24d7400c2632b849ff (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
using System.Text.Json.Serialization;
using LibMatrix.Helpers;
using LibMatrix.Interfaces;

namespace LibMatrix.StateEventTypes.Spec;

[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";
    }
}