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

namespace LibMatrix.EventTypes.Spec.State;

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

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