about summary refs log tree commit diff
path: root/LibMatrix.EventTypes/Spec/State/RoomInfo/RoomGuestAccessEventContent.cs
blob: 4f62eb1f383539524d0e40163ca1e9880f45dab6 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
using System.Text.Json.Serialization;

namespace LibMatrix.EventTypes.Spec.State;

[MatrixEvent(EventName = "m.room.guest_access")]
public class RoomGuestAccessEventContent : EventContent {
    [JsonPropertyName("guest_access")]
    public required string GuestAccess { get; set; }

    [JsonIgnore]
    public bool IsGuestAccessEnabled {
        get => GuestAccess == "can_join";
        set => GuestAccess = value ? "can_join" : "forbidden";
    }
}