Skip to content

Commit

Permalink
Add constants used in space summaries (#402)
Browse files Browse the repository at this point in the history
Add some constants used in space summaries / room hierarchy (
matrix-org/dendrite#3134 )

### Pull Request Checklist

* [x] Pull request includes a [sign
off](https://github.com/matrix-org/dendrite/blob/master/docs/CONTRIBUTING.md#sign-off)

Signed-off-by: `Sam Wedgwood <[email protected]>`
  • Loading branch information
swedgwood authored Jul 13, 2023
1 parent 226d208 commit cf82e01
Show file tree
Hide file tree
Showing 3 changed files with 27 additions and 1 deletion.
4 changes: 3 additions & 1 deletion eventcontent.go
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ import (

// CreateContent is the JSON content of a m.room.create event along with
// the top level keys needed for auth.
// See https://matrix.org/docs/spec/client_server/r0.2.0.html#m-room-create for descriptions of the fields.
// See https://spec.matrix.org/v1.7/client-server-api/#mroomcreate for descriptions of the fields.
type CreateContent struct {
// We need the domain of the create event when checking federatability.
senderDomain string
Expand All @@ -44,6 +44,8 @@ type CreateContent struct {
RoomVersion *RoomVersion `json:"room_version,omitempty"`
// The predecessor of the room.
Predecessor *PreviousRoom `json:"predecessor,omitempty"`
// The room type.
RoomType string `json:"type,omitempty"`
}

// PreviousRoom is the "Previous Room" structure defined at https://matrix.org/docs/spec/client_server/r0.5.0#m-room-create
Expand Down
4 changes: 4 additions & 0 deletions spec/eventtypes.go
Original file line number Diff line number Diff line change
Expand Up @@ -68,4 +68,8 @@ const (
MPresence = "m.presence"
// MRoomMembership https://github.com/matrix-org/matrix-doc/blob/clokep/restricted-rooms/proposals/3083-restricted-rooms.md
MRoomMembership = "m.room_membership"
// MSpaceChild https://spec.matrix.org/v1.7/client-server-api/#mspacechild-relationship
MSpaceChild = "m.space.child"
// MSpaceParent https://spec.matrix.org/v1.7/client-server-api/#mspaceparent-relationships
MSpaceParent = "m.space.parent"
)
20 changes: 20 additions & 0 deletions spec/roomtypes.go
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
// Copyright 2023 The Matrix.org Foundation C.I.C.
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
// http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in writing, software
// distributed under the License is distributed on an "AS IS" BASIS,
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
// See the License for the specific language governing permissions and
// limitations under the License.

package spec

const (
// MSpace https://spec.matrix.org/v1.7/client-server-api/#types
MSpace = "m.space"
)

0 comments on commit cf82e01

Please sign in to comment.