about summary refs log tree commit diff
path: root/LibMatrix.EventTypes/Spec/State
diff options
context:
space:
mode:
Diffstat (limited to 'LibMatrix.EventTypes/Spec/State')
-rw-r--r--LibMatrix.EventTypes/Spec/State/RoomInfo/RoomEncryptionEventContent.cs1
-rw-r--r--LibMatrix.EventTypes/Spec/State/RoomInfo/RoomGuestAccessEventContent.cs3
-rw-r--r--LibMatrix.EventTypes/Spec/State/RoomInfo/RoomHistoryVisibilityEventContent.cs3
-rw-r--r--LibMatrix.EventTypes/Spec/State/RoomInfo/RoomJoinRulesEventContent.cs9
-rw-r--r--LibMatrix.EventTypes/Spec/State/RoomInfo/RoomTopicEventContent.cs1
5 files changed, 12 insertions, 5 deletions
diff --git a/LibMatrix.EventTypes/Spec/State/RoomInfo/RoomEncryptionEventContent.cs b/LibMatrix.EventTypes/Spec/State/RoomInfo/RoomEncryptionEventContent.cs
index 992b57c..5ddd7f3 100644
--- a/LibMatrix.EventTypes/Spec/State/RoomInfo/RoomEncryptionEventContent.cs
+++ b/LibMatrix.EventTypes/Spec/State/RoomInfo/RoomEncryptionEventContent.cs
@@ -4,6 +4,7 @@ namespace LibMatrix.EventTypes.Spec.State;
 
 [MatrixEvent(EventName = "m.room.encryption")]
 public class RoomEncryptionEventContent : EventContent {
+    public const string EventId = "m.room.encryption";
     [JsonPropertyName("algorithm")]
     public string? Algorithm { get; set; }
     [JsonPropertyName("rotation_period_ms")]
diff --git a/LibMatrix.EventTypes/Spec/State/RoomInfo/RoomGuestAccessEventContent.cs b/LibMatrix.EventTypes/Spec/State/RoomInfo/RoomGuestAccessEventContent.cs
index 4f62eb1..5e6e4d2 100644
--- a/LibMatrix.EventTypes/Spec/State/RoomInfo/RoomGuestAccessEventContent.cs
+++ b/LibMatrix.EventTypes/Spec/State/RoomInfo/RoomGuestAccessEventContent.cs
@@ -4,8 +4,9 @@ namespace LibMatrix.EventTypes.Spec.State;
 
 [MatrixEvent(EventName = "m.room.guest_access")]
 public class RoomGuestAccessEventContent : EventContent {
+    public const string EventId = "m.room.guest_access";
     [JsonPropertyName("guest_access")]
-    public required string GuestAccess { get; set; }
+    public string GuestAccess { get; set; }
 
     [JsonIgnore]
     public bool IsGuestAccessEnabled {
diff --git a/LibMatrix.EventTypes/Spec/State/RoomInfo/RoomHistoryVisibilityEventContent.cs b/LibMatrix.EventTypes/Spec/State/RoomInfo/RoomHistoryVisibilityEventContent.cs
index 48ba538..c523e5e 100644
--- a/LibMatrix.EventTypes/Spec/State/RoomInfo/RoomHistoryVisibilityEventContent.cs
+++ b/LibMatrix.EventTypes/Spec/State/RoomInfo/RoomHistoryVisibilityEventContent.cs
@@ -4,6 +4,7 @@ namespace LibMatrix.EventTypes.Spec.State;
 
 [MatrixEvent(EventName = "m.room.history_visibility")]
 public class RoomHistoryVisibilityEventContent : EventContent {
+    public const string EventId = "m.room.history_visibility";
     [JsonPropertyName("history_visibility")]
-    public required string HistoryVisibility { get; set; }
+    public string HistoryVisibility { get; set; }
 }
diff --git a/LibMatrix.EventTypes/Spec/State/RoomInfo/RoomJoinRulesEventContent.cs b/LibMatrix.EventTypes/Spec/State/RoomInfo/RoomJoinRulesEventContent.cs
index 0663288..981d927 100644
--- a/LibMatrix.EventTypes/Spec/State/RoomInfo/RoomJoinRulesEventContent.cs
+++ b/LibMatrix.EventTypes/Spec/State/RoomInfo/RoomJoinRulesEventContent.cs
@@ -4,9 +4,11 @@ namespace LibMatrix.EventTypes.Spec.State;
 
 [MatrixEvent(EventName = "m.room.join_rules")]
 public class RoomJoinRulesEventContent : EventContent {
+    public const string EventId = "m.room.join_rules";
     /// <summary>
     /// one of ["public", "invite", "knock", "restricted", "knock_restricted"]
     /// "private" is reserved without implementation!
+    /// unknown values are treated as "private"
     /// </summary>
     [JsonPropertyName("join_rule")]
     public string JoinRuleValue { get; set; }
@@ -19,7 +21,7 @@ public class RoomJoinRulesEventContent : EventContent {
             "knock" => JoinRules.Knock,
             "restricted" => JoinRules.Restricted,
             "knock_restricted" => JoinRules.KnockRestricted,
-            _ => throw new ArgumentOutOfRangeException()
+            _ => JoinRules.Private
         };
         set => JoinRuleValue = value switch {
             JoinRules.Public => "public",
@@ -27,7 +29,7 @@ public class RoomJoinRulesEventContent : EventContent {
             JoinRules.Knock => "knock",
             JoinRules.Restricted => "restricted",
             JoinRules.KnockRestricted => "knock_restricted",
-            _ => throw new ArgumentOutOfRangeException(nameof(value), value, null)
+            _ => "private"
         };
     }
 
@@ -47,6 +49,7 @@ public class RoomJoinRulesEventContent : EventContent {
         Invite,
         Knock,
         Restricted,
-        KnockRestricted
+        KnockRestricted,
+        Private // reserved without implementation!
     }
 }
diff --git a/LibMatrix.EventTypes/Spec/State/RoomInfo/RoomTopicEventContent.cs b/LibMatrix.EventTypes/Spec/State/RoomInfo/RoomTopicEventContent.cs
index 37536d2..8abb2c8 100644
--- a/LibMatrix.EventTypes/Spec/State/RoomInfo/RoomTopicEventContent.cs
+++ b/LibMatrix.EventTypes/Spec/State/RoomInfo/RoomTopicEventContent.cs
@@ -5,6 +5,7 @@ namespace LibMatrix.EventTypes.Spec.State;
 [MatrixEvent(EventName = "m.room.topic")]
 [MatrixEvent(EventName = "org.matrix.msc3765.topic", Legacy = true)]
 public class RoomTopicEventContent : EventContent {
+    public const string EventId = "m.room.topic";
     [JsonPropertyName("topic")]
     public string? Topic { get; set; }
 }