Merge pull request #1518 from turt2live/travis/c2s/create-room-improvements
Add general clarity to the /createRoom endpoint
This commit is contained in:
commit
e4f5c3d55e
2 changed files with 41 additions and 21 deletions
|
@ -39,16 +39,20 @@ paths:
|
||||||
apply the events implied by the request in the following order:
|
apply the events implied by the request in the following order:
|
||||||
|
|
||||||
0. A default ``m.room.power_levels`` event, giving the room creator
|
0. A default ``m.room.power_levels`` event, giving the room creator
|
||||||
(and not other members) permission to send state events.
|
(and not other members) permission to send state events. Overridden
|
||||||
|
by the ``power_level_content_override`` parameter.
|
||||||
|
|
||||||
1. Events set by the ``preset``.
|
1. Events set by the ``preset``. Currently these are the ``m.room.join_rules``,
|
||||||
|
``m.room.history_visibility``, and ``m.room.guest_access`` state events.
|
||||||
|
|
||||||
2. Events listed in ``initial_state``, in the order that they are
|
2. Events listed in ``initial_state``, in the order that they are
|
||||||
listed.
|
listed.
|
||||||
|
|
||||||
3. Events implied by ``name`` and ``topic``.
|
3. Events implied by ``name`` and ``topic`` (``m.room.name`` and ``m.room.topic``
|
||||||
|
state events).
|
||||||
|
|
||||||
4. Invite events implied by ``invite`` and ``invite_3pid``.
|
4. Invite events implied by ``invite`` and ``invite_3pid`` (``m.room.member`` with
|
||||||
|
``membership: invite`` and ``m.room.third_party_invite``).
|
||||||
|
|
||||||
The available presets do the following with respect to room state:
|
The available presets do the following with respect to room state:
|
||||||
|
|
||||||
|
@ -60,6 +64,9 @@ paths:
|
||||||
``public_chat`` ``public`` ``shared`` ``forbidden``
|
``public_chat`` ``public`` ``shared`` ``forbidden``
|
||||||
======================== ============== ====================== ================ =========
|
======================== ============== ====================== ================ =========
|
||||||
|
|
||||||
|
The server will create a ``m.room.create`` event in the room with the
|
||||||
|
requesting user as the creator, alongside other keys provided in the
|
||||||
|
``creation_content``.
|
||||||
operationId: createRoom
|
operationId: createRoom
|
||||||
security:
|
security:
|
||||||
- accessToken: []
|
- accessToken: []
|
||||||
|
@ -70,14 +77,14 @@ paths:
|
||||||
schema:
|
schema:
|
||||||
type: object
|
type: object
|
||||||
example: {
|
example: {
|
||||||
"preset": "public_chat",
|
"preset": "public_chat",
|
||||||
"room_alias_name": "thepub",
|
"room_alias_name": "thepub",
|
||||||
"name": "The Grand Duke Pub",
|
"name": "The Grand Duke Pub",
|
||||||
"topic": "All about happy hour",
|
"topic": "All about happy hour",
|
||||||
"creation_content": {
|
"creation_content": {
|
||||||
"m.federate": false
|
"m.federate": false
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
}
|
||||||
properties:
|
properties:
|
||||||
visibility:
|
visibility:
|
||||||
type: string
|
type: string
|
||||||
|
@ -98,6 +105,9 @@ paths:
|
||||||
created the room. For example, if this was set to "foo" and
|
created the room. For example, if this was set to "foo" and
|
||||||
sent to the homeserver "example.com" the complete room alias
|
sent to the homeserver "example.com" the complete room alias
|
||||||
would be ``#foo:example.com``.
|
would be ``#foo:example.com``.
|
||||||
|
|
||||||
|
The complete room alias will become the canonical alias for
|
||||||
|
the room.
|
||||||
name:
|
name:
|
||||||
type: string
|
type: string
|
||||||
description: |-
|
description: |-
|
||||||
|
@ -141,10 +151,10 @@ paths:
|
||||||
title: CreationContent
|
title: CreationContent
|
||||||
type: object
|
type: object
|
||||||
description: |-
|
description: |-
|
||||||
Extra keys to be added to the content of the ``m.room.create``.
|
Extra keys, such as ``m.federate``, to be added to the content
|
||||||
The server will clobber the following keys: ``creator``. Future
|
of the `m.room.create`_ event. The server will clobber the following
|
||||||
versions of the specification may allow the server to clobber
|
keys: ``creator``. Future versions of the specification may allow
|
||||||
other keys.
|
the server to clobber other keys.
|
||||||
initial_state:
|
initial_state:
|
||||||
type: array
|
type: array
|
||||||
description: |-
|
description: |-
|
||||||
|
@ -175,16 +185,25 @@ paths:
|
||||||
description: |-
|
description: |-
|
||||||
Convenience parameter for setting various default state events
|
Convenience parameter for setting various default state events
|
||||||
based on a preset.
|
based on a preset.
|
||||||
|
|
||||||
|
If unspecified, the server should use the ``visibility`` to determine
|
||||||
|
which preset to use. A visbility of ``public`` equates to a preset of
|
||||||
|
``public_chat`` and ``private`` visibility equates to a preset of
|
||||||
|
``private_chat``.
|
||||||
is_direct:
|
is_direct:
|
||||||
type: boolean
|
type: boolean
|
||||||
description: |-
|
description: |-
|
||||||
This flag makes the server set the ``is_direct`` flag on the
|
This flag makes the server set the ``is_direct`` flag on the
|
||||||
``m.room.member`` events sent to the users in ``invite`` and
|
``m.room.member`` events sent to the users in ``invite`` and
|
||||||
``invite_3pid``. See `Direct Messaging`_ for more information.
|
``invite_3pid``. See `Direct Messaging`_ for more information.
|
||||||
guest_can_join:
|
power_level_content_override:
|
||||||
type: boolean
|
title: Power Level Event Content
|
||||||
|
type: object
|
||||||
description: |-
|
description: |-
|
||||||
Allows guests to join the room. See `Guest Access`_ for more information.
|
The power level content to override in the default power level
|
||||||
|
event. This object is applied on top of the generated `m.room.power_levels`_
|
||||||
|
event content prior to it being sent to the room. Defaults to
|
||||||
|
overriding nothing.
|
||||||
responses:
|
responses:
|
||||||
200:
|
200:
|
||||||
description: Information about the newly created room.
|
description: Information about the newly created room.
|
||||||
|
@ -196,10 +215,11 @@ paths:
|
||||||
type: string
|
type: string
|
||||||
description: |-
|
description: |-
|
||||||
The created room's ID.
|
The created room's ID.
|
||||||
|
required: ['room_id']
|
||||||
examples:
|
examples:
|
||||||
application/json: {
|
application/json: {
|
||||||
"room_id": "!sefiuhWgwghwWgh:example.com"
|
"room_id": "!sefiuhWgwghwWgh:example.com"
|
||||||
}
|
}
|
||||||
400:
|
400:
|
||||||
description: |-
|
description: |-
|
||||||
|
|
||||||
|
@ -218,6 +238,5 @@ paths:
|
||||||
``M_INVALID_ROOM_STATE``).
|
``M_INVALID_ROOM_STATE``).
|
||||||
schema:
|
schema:
|
||||||
"$ref": "definitions/errors/error.yaml"
|
"$ref": "definitions/errors/error.yaml"
|
||||||
|
|
||||||
tags:
|
tags:
|
||||||
- Room creation
|
- Room creation
|
||||||
|
|
|
@ -0,0 +1 @@
|
||||||
|
Document additional parameters on the ``/createRoom`` API.
|
Loading…
Add table
Add a link
Reference in a new issue