From 17b011ba0793e6e2a86eee56bf6888f428237c57 Mon Sep 17 00:00:00 2001 From: Johannes Becker Date: Mon, 18 Jul 2022 19:08:13 +0200 Subject: [PATCH 1/6] Clarify the power levels integer range Signed-off-by: Johannes Becker --- data/event-schemas/schema/m.room.power_levels.yaml | 2 ++ 1 file changed, 2 insertions(+) diff --git a/data/event-schemas/schema/m.room.power_levels.yaml b/data/event-schemas/schema/m.room.power_levels.yaml index ae38f88c4..4cb7c17eb 100644 --- a/data/event-schemas/schema/m.room.power_levels.yaml +++ b/data/event-schemas/schema/m.room.power_levels.yaml @@ -5,6 +5,8 @@ description: |- This event specifies the minimum level a user must have in order to perform a certain action. It also specifies the levels of each user in the room. + The allowed range of power levels is specified by the [Canonical JSON specification](https://spec.matrix.org/v1.3/appendices/#canonical-json). + If a `user_id` is in the `users` list, then that `user_id` has the associated power level. Otherwise they have the default level `users_default`. If `users_default` is not supplied, it is assumed to be From 66c8ab365c1133406c72031b0b088692756f0b16 Mon Sep 17 00:00:00 2001 From: Johannes Becker Date: Mon, 18 Jul 2022 19:42:18 +0200 Subject: [PATCH 2/6] Make link relative Signed-off-by: Johannes Becker --- .../schema/m.room.power_levels.yaml | 22 +++++++++---------- 1 file changed, 11 insertions(+), 11 deletions(-) diff --git a/data/event-schemas/schema/m.room.power_levels.yaml b/data/event-schemas/schema/m.room.power_levels.yaml index 4cb7c17eb..ec24db343 100644 --- a/data/event-schemas/schema/m.room.power_levels.yaml +++ b/data/event-schemas/schema/m.room.power_levels.yaml @@ -5,7 +5,7 @@ description: |- This event specifies the minimum level a user must have in order to perform a certain action. It also specifies the levels of each user in the room. - The allowed range of power levels is specified by the [Canonical JSON specification](https://spec.matrix.org/v1.3/appendices/#canonical-json). + The allowed range of power levels is specified by the [Canonical JSON specification](/appendices/#canonical-json). If a `user_id` is in the `users` list, then that `user_id` has the associated power level. Otherwise they have the default level @@ -58,8 +58,8 @@ properties: type: object events_default: description: |- - The default level required to send message events. Can be - overridden by the `events` key. Defaults to 0 if unspecified. + The default level required to send message events. Can be + overridden by the `events` key. Defaults to 0 if unspecified. type: integer invite: description: The level required to invite a user. Defaults to 0 if unspecified. @@ -72,8 +72,8 @@ properties: type: integer state_default: description: |- - The default level required to send state events. Can be overridden - by the `events` key. Defaults to 50 if unspecified. + The default level required to send state events. Can be overridden + by the `events` key. Defaults to 50 if unspecified. type: integer users: additionalProperties: @@ -83,9 +83,9 @@ properties: type: object users_default: description: |- - The default power level for every user in the room, unless their - `user_id` is mentioned in the `users` key. Defaults to 0 if - unspecified. + The default power level for every user in the room, unless their + `user_id` is mentioned in the `users` key. Defaults to 0 if + unspecified. type: integer notifications: properties: @@ -95,14 +95,14 @@ properties: additionalProperties: type: integer description: |- - The power level requirements for specific notification types. - This is a mapping from `key` to power level for that notifications key. + The power level requirements for specific notification types. + This is a mapping from `key` to power level for that notifications key. title: Notifications type: object type: object state_key: description: A zero-length string. - pattern: '^$' + pattern: "^$" type: string type: enum: From fad9feb80c804bc0c3d6c1cba2ee36f9be79daa2 Mon Sep 17 00:00:00 2001 From: Johannes Becker Date: Mon, 18 Jul 2022 19:44:44 +0200 Subject: [PATCH 3/6] Revert intendation by IDE auto-formatter Signed-off-by: Johannes Becker --- .../schema/m.room.power_levels.yaml | 20 +++++++++---------- 1 file changed, 10 insertions(+), 10 deletions(-) diff --git a/data/event-schemas/schema/m.room.power_levels.yaml b/data/event-schemas/schema/m.room.power_levels.yaml index ec24db343..3d04b9549 100644 --- a/data/event-schemas/schema/m.room.power_levels.yaml +++ b/data/event-schemas/schema/m.room.power_levels.yaml @@ -58,8 +58,8 @@ properties: type: object events_default: description: |- - The default level required to send message events. Can be - overridden by the `events` key. Defaults to 0 if unspecified. + The default level required to send message events. Can be + overridden by the `events` key. Defaults to 0 if unspecified. type: integer invite: description: The level required to invite a user. Defaults to 0 if unspecified. @@ -72,8 +72,8 @@ properties: type: integer state_default: description: |- - The default level required to send state events. Can be overridden - by the `events` key. Defaults to 50 if unspecified. + The default level required to send state events. Can be overridden + by the `events` key. Defaults to 50 if unspecified. type: integer users: additionalProperties: @@ -83,9 +83,9 @@ properties: type: object users_default: description: |- - The default power level for every user in the room, unless their - `user_id` is mentioned in the `users` key. Defaults to 0 if - unspecified. + The default power level for every user in the room, unless their + `user_id` is mentioned in the `users` key. Defaults to 0 if + unspecified. type: integer notifications: properties: @@ -95,14 +95,14 @@ properties: additionalProperties: type: integer description: |- - The power level requirements for specific notification types. - This is a mapping from `key` to power level for that notifications key. + The power level requirements for specific notification types. + This is a mapping from `key` to power level for that notifications key. title: Notifications type: object type: object state_key: description: A zero-length string. - pattern: "^$" + pattern: '^$' type: string type: enum: From 8935edec97cb0a7d03636f87744f01aa22d255b0 Mon Sep 17 00:00:00 2001 From: Johannes Becker Date: Wed, 28 Sep 2022 12:49:34 +0200 Subject: [PATCH 4/6] Rephrase and move to bottom Signed-off-by: Johannes Becker --- data/event-schemas/schema/m.room.power_levels.yaml | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/data/event-schemas/schema/m.room.power_levels.yaml b/data/event-schemas/schema/m.room.power_levels.yaml index 3d04b9549..a7f5d3984 100644 --- a/data/event-schemas/schema/m.room.power_levels.yaml +++ b/data/event-schemas/schema/m.room.power_levels.yaml @@ -5,8 +5,6 @@ description: |- This event specifies the minimum level a user must have in order to perform a certain action. It also specifies the levels of each user in the room. - The allowed range of power levels is specified by the [Canonical JSON specification](/appendices/#canonical-json). - If a `user_id` is in the `users` list, then that `user_id` has the associated power level. Otherwise they have the default level `users_default`. If `users_default` is not supplied, it is assumed to be @@ -44,6 +42,9 @@ description: |- `m.room.power_levels` event as soon as it is created. See also the documentation of the `/createRoom` API. + Note: the allowed range for power level values is `[-(2**53)+1, (2**53)-1]`, + as specified by the [Canonical JSON specification](/appendices/#canonical-json). + properties: content: properties: From 11a16ad5d4beeedfca7546cca5d0495e508a25a2 Mon Sep 17 00:00:00 2001 From: Johannes Becker Date: Wed, 28 Sep 2022 13:01:09 +0200 Subject: [PATCH 5/6] Add changelog clarification --- changelogs/client_server/newsfragments/1169.clarification | 1 + 1 file changed, 1 insertion(+) create mode 100644 changelogs/client_server/newsfragments/1169.clarification diff --git a/changelogs/client_server/newsfragments/1169.clarification b/changelogs/client_server/newsfragments/1169.clarification new file mode 100644 index 000000000..6d550dbc0 --- /dev/null +++ b/changelogs/client_server/newsfragments/1169.clarification @@ -0,0 +1 @@ +Clarify the power levels integer range. \ No newline at end of file From 2e486dcb106bc4d5cf6dbe84caea585c4088fbf5 Mon Sep 17 00:00:00 2001 From: Richard van der Hoff <1389908+richvdh@users.noreply.github.com> Date: Tue, 22 Nov 2022 15:40:07 +0000 Subject: [PATCH 6/6] Update data/event-schemas/schema/m.room.power_levels.yaml --- data/event-schemas/schema/m.room.power_levels.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/data/event-schemas/schema/m.room.power_levels.yaml b/data/event-schemas/schema/m.room.power_levels.yaml index a7f5d3984..f9d5d124a 100644 --- a/data/event-schemas/schema/m.room.power_levels.yaml +++ b/data/event-schemas/schema/m.room.power_levels.yaml @@ -43,7 +43,7 @@ description: |- documentation of the `/createRoom` API. Note: the allowed range for power level values is `[-(2**53)+1, (2**53)-1]`, - as specified by the [Canonical JSON specification](/appendices/#canonical-json). + as required by the [Canonical JSON specification](/appendices/#canonical-json). properties: content: