diff --git a/event/content.go b/event/content.go index e3ac419b..6bf05ed3 100644 --- a/event/content.go +++ b/event/content.go @@ -22,6 +22,7 @@ var TypeMap = map[Type]reflect.Type{ StateCanonicalAlias: reflect.TypeOf(CanonicalAliasEventContent{}), StateRoomName: reflect.TypeOf(RoomNameEventContent{}), StateRoomAvatar: reflect.TypeOf(RoomAvatarEventContent{}), + StateServerACL: reflect.TypeOf(ServerACLEventContent{}), StateTopic: reflect.TypeOf(TopicEventContent{}), StateTombstone: reflect.TypeOf(TombstoneEventContent{}), StateCreate: reflect.TypeOf(CreateEventContent{}), diff --git a/event/state.go b/event/state.go index ba189ab4..e72b9a38 100644 --- a/event/state.go +++ b/event/state.go @@ -29,6 +29,14 @@ type RoomAvatarEventContent struct { URL id.ContentURI `json:"url"` } +// ServerACLEventContent represents the content of a m.room.server_acl state event. +// https://spec.matrix.org/v1.1/client-server-api/#server-access-control-lists-acls-for-rooms +type ServerACLEventContent struct { + Allow []string `json:"allow,omitempty"` + AllowIPLiterals bool `json:"allow_ip_literals"` + Deny []string `json:"deny,omitempty"` +} + // TopicEventContent represents the content of a m.room.topic state event. // https://matrix.org/docs/spec/client_server/r0.6.0#m-room-topic type TopicEventContent struct { diff --git a/event/type.go b/event/type.go index 64431e9f..f1af8b88 100644 --- a/event/type.go +++ b/event/type.go @@ -107,9 +107,9 @@ func (et *Type) IsCustom() bool { func (et *Type) GuessClass() TypeClass { switch et.Type { case StateAliases.Type, StateCanonicalAlias.Type, StateCreate.Type, StateJoinRules.Type, StateMember.Type, - StatePowerLevels.Type, StateRoomName.Type, StateRoomAvatar.Type, StateTopic.Type, StatePinnedEvents.Type, - StateTombstone.Type, StateEncryption.Type, StateBridge.Type, StateHalfShotBridge.Type, StateSpaceParent.Type, - StateSpaceChild.Type: + StatePowerLevels.Type, StateRoomName.Type, StateRoomAvatar.Type, StateServerACL.Type, StateTopic.Type, + StatePinnedEvents.Type, StateTombstone.Type, StateEncryption.Type, StateBridge.Type, StateHalfShotBridge.Type, + StateSpaceParent.Type, StateSpaceChild.Type: return StateEventType case EphemeralEventReceipt.Type, EphemeralEventTyping.Type, EphemeralEventPresence.Type: return EphemeralEventType @@ -175,6 +175,7 @@ var ( StateTopic = Type{"m.room.topic", StateEventType} StateRoomAvatar = Type{"m.room.avatar", StateEventType} StatePinnedEvents = Type{"m.room.pinned_events", StateEventType} + StateServerACL = Type{"m.room.server_acl", StateEventType} StateTombstone = Type{"m.room.tombstone", StateEventType} StateEncryption = Type{"m.room.encryption", StateEventType} StateBridge = Type{"m.bridge", StateEventType}