docs-matrix-spec/content/rooms/fragments/v1-stringy-power-levels.md
Travis Ralston f14e18131b
Specify room version 10: knock_restricted and int power levels (#1099)
* Clarification on historical power level handling

* Revert "Clarification on historical power level handling"

This reverts commit f443b3d5a9afac3095b14a72ec471ba06f4cc78b.

* Clean up

* Let us try this again not using VS Code

* Markdown is full of mysteries

* Move stringy power levels to room versions

* Describe range

* Fix minor issues with previous room version stuff

* Copy/paste v9 into v10

* Describe deprecated formatting

* Paste unmodified auth rules from v8 into v10

* Move 9.1 to 9.3, add 9.1 and 9.2 for integer enforcement

* Add knock_restricted to v10 auth

* Misc cleanup and clarification for fragments

* Describe `knock_restricted` client changes

* Changelogs

* spelling

* Apply suggestions from code review

Co-authored-by: Richard van der Hoff <1389908+richvdh@users.noreply.github.com>

* Apply code review suggestions manually

* Fix v9 redactions

* Fix auth rules clarity issues

* Apply suggestions from code review

Co-authored-by: Richard van der Hoff <1389908+richvdh@users.noreply.github.com>

* Remove false integer requirements

Co-authored-by: Neil Alexander <neilalexander@users.noreply.github.com>
Co-authored-by: Richard van der Hoff <1389908+richvdh@users.noreply.github.com>
2022-06-08 15:22:47 -06:00

43 lines
1.3 KiB
Markdown

---
toc_hide: true
---
##### `m.room.power_levels` events accept values as strings
In order to maintain backwards compatibility with early implementations,
each of the integer-valued properties within
[`m.room.power_levels`](/client-server-api#mroompower_levels) events can
be encoded as strings instead of integers. This includes the nested values
within the `events`, `notifications` and `users` properties.
For example, the following is a valid `m.room.power_levels` event in this room version:
```json
{
"content": {
"ban": "50",
"events": {
"m.room.power_levels": "100"
},
"events_default": "0",
"state_default": "50",
"users": {
"@example:localhost": "100"
},
"users_default": "0"
},
"origin_server_ts": 1432735824653,
"room_id": "!jEsUZKDJdhlrceRyVU:example.org",
"sender": "@example:example.org",
"state_key": "",
"type": "m.room.power_levels"
}
```
When the value is representative of an integer, they must be the following format:
* a single base 10 integer, no float values or decimal points, optionally with
any number of leading zeroes (`"100"`, `"000100"`);
* optionally prefixed with a single `-` or `+` character before the integer (`"+100"`,
`"-100"`).
* optionally with any number of leading or trailing whitespace characters (`" 100 "`,
`" 00100 "`, `" +100 "`, `" -100 "`);