From 30a0868789466012bab869af4300aef5a9cac108 Mon Sep 17 00:00:00 2001 From: Rory& Date: Thu, 30 May 2024 09:46:43 +0000 Subject: Rename legacy event types --- .../State/RoomInfo/RoomMemberLegacyEventContent.cs | 37 ++++++++++++++++++++++ 1 file changed, 37 insertions(+) create mode 100644 LibMatrix.LegacyEvents.EventTypes/Spec/State/RoomInfo/RoomMemberLegacyEventContent.cs (limited to 'LibMatrix.LegacyEvents.EventTypes/Spec/State/RoomInfo/RoomMemberLegacyEventContent.cs') diff --git a/LibMatrix.LegacyEvents.EventTypes/Spec/State/RoomInfo/RoomMemberLegacyEventContent.cs b/LibMatrix.LegacyEvents.EventTypes/Spec/State/RoomInfo/RoomMemberLegacyEventContent.cs new file mode 100644 index 0000000..d716425 --- /dev/null +++ b/LibMatrix.LegacyEvents.EventTypes/Spec/State/RoomInfo/RoomMemberLegacyEventContent.cs @@ -0,0 +1,37 @@ +using System.Text.Json.Serialization; + +namespace LibMatrix.LegacyEvents.EventTypes.Spec.State; + +[LegacyMatrixEvent(EventName = EventId)] +public class RoomMemberLegacyEventContent : LegacyEventContent { + public const string EventId = "m.room.member"; + + [JsonPropertyName("reason")] + public string? Reason { get; set; } + + [JsonPropertyName("membership")] + public required string Membership { get; set; } + + [JsonPropertyName("displayname")] + public string? DisplayName { get; set; } + + [JsonPropertyName("is_direct")] + public bool? IsDirect { get; set; } + + [JsonPropertyName("avatar_url")] + public string? AvatarUrl { get; set; } + + [JsonPropertyName("kind")] + public string? Kind { get; set; } + + [JsonPropertyName("join_authorised_via_users_server")] + public string? JoinAuthorisedViaUsersServer { get; set; } + + public static class MembershipTypes { + public const string Invite = "invite"; + public const string Join = "join"; + public const string Leave = "leave"; + public const string Ban = "ban"; + public const string Knock = "knock"; + } +} \ No newline at end of file -- cgit 1.4.1