From b4e24d443a09eb4566a13a40d566303ad116d859 Mon Sep 17 00:00:00 2001 From: Richard van der Hoff Date: Tue, 17 Oct 2017 16:34:50 +0100 Subject: [PATCH] Clarify what happens when there is no power_levels event --- api/client-server/create_room.yaml | 3 +++ event-schemas/schema/m.room.power_levels | 11 +++++++++++ templating/matrix_templates/templates/events.tmpl | 3 ++- 3 files changed, 16 insertions(+), 1 deletion(-) diff --git a/api/client-server/create_room.yaml b/api/client-server/create_room.yaml index 8b9ea6f0..5c80716a 100644 --- a/api/client-server/create_room.yaml +++ b/api/client-server/create_room.yaml @@ -37,6 +37,9 @@ paths: the new room, including checking power levels for each event. It MUST apply the events implied by the request in the following order: + 0. A default ``m.room.power_levels`` event, giving the room creator + (and not other members) permission to send state events. + 1. Events set by ``presets``. 2. Events listed in ``initial_state``, in the order that they are diff --git a/event-schemas/schema/m.room.power_levels b/event-schemas/schema/m.room.power_levels index 0353b166..351c9d30 100644 --- a/event-schemas/schema/m.room.power_levels +++ b/event-schemas/schema/m.room.power_levels @@ -29,6 +29,17 @@ description: |- to 50 if they are not specified in the ``m.room.power_levels`` event, or if the room contains no ``m.room.power_levels`` event. + .. NOTE:: + + As noted above, in the absence of an ``m.room.power_levels`` event, the + ``state_default`` is 0, and all users are considered to have power level 0. + That means that **any** member of the room can send an + ``m.room.power_levels`` event, changing the permissions in the room. + + Server implementations should therefore ensure that each room has an + ``m.room.power_levels`` event as soon as it is created. See also the + documentation of the ``/createRoom`` API. + properties: content: properties: diff --git a/templating/matrix_templates/templates/events.tmpl b/templating/matrix_templates/templates/events.tmpl index 95edff57..ded33859 100644 --- a/templating/matrix_templates/templates/events.tmpl +++ b/templating/matrix_templates/templates/events.tmpl @@ -9,7 +9,8 @@ {% endif -%} -{{event.desc | wrap(80)}} +{{event.desc}} + {% for table in event.content_fields %} {{"``"+table.title+"``" if table.title else "" }}