From 79391515ed64f4c39490e39ae694ee9f25a2aee6 Mon Sep 17 00:00:00 2001 From: Tulir Asokan Date: Sat, 31 Aug 2024 02:41:28 +0300 Subject: [PATCH] event: add unstable prefixes for policy events --- event/content.go | 7 +++++++ event/state.go | 3 ++- event/type.go | 7 +++++++ 3 files changed, 16 insertions(+), 1 deletion(-) diff --git a/event/content.go b/event/content.go index e0026e9e..d08acad1 100644 --- a/event/content.go +++ b/event/content.go @@ -40,6 +40,13 @@ var TypeMap = map[Type]reflect.Type{ StateSpaceChild: reflect.TypeOf(SpaceChildEventContent{}), StateInsertionMarker: reflect.TypeOf(InsertionMarkerContent{}), + StateLegacyPolicyRoom: reflect.TypeOf(ModPolicyContent{}), + StateLegacyPolicyServer: reflect.TypeOf(ModPolicyContent{}), + StateLegacyPolicyUser: reflect.TypeOf(ModPolicyContent{}), + StateUnstablePolicyRoom: reflect.TypeOf(ModPolicyContent{}), + StateUnstablePolicyServer: reflect.TypeOf(ModPolicyContent{}), + StateUnstablePolicyUser: reflect.TypeOf(ModPolicyContent{}), + StateElementFunctionalMembers: reflect.TypeOf(ElementFunctionalMembersContent{}), EventMessage: reflect.TypeOf(MessageEventContent{}), diff --git a/event/state.go b/event/state.go index eb539069..0844936a 100644 --- a/event/state.go +++ b/event/state.go @@ -185,7 +185,8 @@ type SpaceParentEventContent struct { type PolicyRecommendation string const ( - PolicyRecommendationBan PolicyRecommendation = "m.ban" + PolicyRecommendationBan PolicyRecommendation = "m.ban" + PolicyRecommendationUnstableBan PolicyRecommendation = "org.matrix.mjolnir.ban" ) // ModPolicyContent represents the content of a m.room.rule.user, m.room.rule.room, and m.room.rule.server state event. diff --git a/event/type.go b/event/type.go index 162e2ce7..3f447343 100644 --- a/event/type.go +++ b/event/type.go @@ -192,6 +192,13 @@ var ( StateSpaceChild = Type{"m.space.child", StateEventType} StateSpaceParent = Type{"m.space.parent", StateEventType} + StateLegacyPolicyRoom = Type{"m.room.rule.room", StateEventType} + StateLegacyPolicyServer = Type{"m.room.rule.server", StateEventType} + StateLegacyPolicyUser = Type{"m.room.rule.user", StateEventType} + StateUnstablePolicyRoom = Type{"org.matrix.mjolnir.rule.room", StateEventType} + StateUnstablePolicyServer = Type{"org.matrix.mjolnir.rule.server", StateEventType} + StateUnstablePolicyUser = Type{"org.matrix.mjolnir.rule.user", StateEventType} + // Deprecated: MSC2716 has been abandoned StateInsertionMarker = Type{"org.matrix.msc2716.marker", StateEventType}