2022-05-30 22:15:25 +02:00
|
|
|
---
|
|
|
|
|
toc_hide: true
|
|
|
|
|
---
|
|
|
|
|
|
2022-06-07 19:38:42 +02:00
|
|
|
##### `m.room.power_levels` events accept values as strings
|
2022-05-30 21:48:27 +02:00
|
|
|
|
|
|
|
|
In order to maintain backwards compatibility with early implementations,
|
|
|
|
|
power levels can optionally be represented in string format instead of
|
|
|
|
|
integer format. A homeserver must be prepared to deal with this by parsing
|
|
|
|
|
the power level from a string. In these cases, the following formatting of the
|
|
|
|
|
power level string is allowed:
|
|
|
|
|
|
2022-06-07 19:38:42 +02:00
|
|
|
* a single base 10 integer, no float values or decimal points, optionally with
|
2022-05-30 21:48:27 +02:00
|
|
|
any number of leading zeroes (`"100"`, `"000100"`);
|
|
|
|
|
* optionally with any number of leading or trailing whitespace characters (`" 100 "`,
|
|
|
|
|
`" 00100 "`);
|
|
|
|
|
* optionally prefixed with a single `-` or `+` character before the integer
|
|
|
|
|
but after leading whitespace padding (`" +100 "`, `" -100 "`, `"+100"`,
|
|
|
|
|
`"-100"`).
|
2022-05-30 21:53:26 +02:00
|
|
|
|
|
|
|
|
{{% boxes/note %}}
|
2022-06-07 19:38:42 +02:00
|
|
|
The integer represented by the string must still be within the `[-(2**53)+1, (2**53)-1]`
|
2022-05-30 21:53:26 +02:00
|
|
|
range accepted by normal, non-string, power level values.
|
|
|
|
|
{{% /boxes/note %}}
|