mirror of
https://github.com/matrix-org/matrix-spec
synced 2026-04-10 05:14:09 +02:00
Compare commits
10 commits
85e34712e9
...
92d78c9f3e
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
92d78c9f3e | ||
|
|
cc2623f8da | ||
|
|
ef010cd408 | ||
|
|
1d1fa4cb5b | ||
|
|
6264b34caf | ||
|
|
917f1dd8c1 | ||
|
|
909395ab3c | ||
|
|
b6198973e0 | ||
|
|
b09d59bd37 | ||
|
|
68d92cf254 |
|
|
@ -0,0 +1 @@
|
|||
Clarify the requiredness of `event_id` in `predecessor`.
|
||||
|
|
@ -0,0 +1 @@
|
|||
Clarify meaning of floating-point powerlevels.
|
||||
|
|
@ -43,8 +43,8 @@ They must be explicitly set during the `/upgrade` call.
|
|||
{{% /boxes/note %}}
|
||||
|
||||
{{% boxes/note %}}
|
||||
{{% added-in v="1.16" %}} When upgrading to room version 12 or later, the `predecessor` field MAY NOT contain
|
||||
an `event_id`.
|
||||
{{% added-in v="1.16" %}} When upgrading to room version 12 or later, the `event_id` property inside
|
||||
`predecessor` MAY be omitted.
|
||||
{{% /boxes/note %}}
|
||||
|
||||
3. Replicates transferable state events to the new room. The exact
|
||||
|
|
|
|||
41
content/rooms/fragments/v1-floaty-power-levels.md
Normal file
41
content/rooms/fragments/v1-floaty-power-levels.md
Normal file
|
|
@ -0,0 +1,41 @@
|
|||
|
||||
##### `m.room.power_levels` events accept values as floats
|
||||
|
||||
When the value is a float
|
||||
* First, exponential notation is applied: `5.114698E4` becomes `51146.98`
|
||||
* Second, the value is truncated at the decimal point: `51146.98` becomes `51146`.
|
||||
|
||||
Values outside the range represented by IEE754 binary64 (a "double") cause the
|
||||
powerlevel event to be rejected.
|
||||
|
||||
For example, this 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:example.org": 100,
|
||||
"@alice:localhost": 50,
|
||||
"@bob:localhost": 50.57
|
||||
},
|
||||
"users_default": 0
|
||||
},
|
||||
"origin_server_ts": 1432735824653,
|
||||
"room_id": "!jEsUZKDJdhlrceRyVU:example.org",
|
||||
"sender": "@example:example.org",
|
||||
"state_key": "",
|
||||
"type": "m.room.power_levels"
|
||||
}
|
||||
```
|
||||
|
||||
In this example, both `@bob:localhost` and `@alice:localhost` have the same effective
|
||||
power level of `50`, even though the values are technically different.
|
||||
|
||||
Note that, since this room version does not enforce that events comply with the requirements
|
||||
of [Canonical JSON](/appendices#canonical-json), power levels can be formatted as floats.
|
||||
|
|
@ -59,6 +59,8 @@ Events in version 1 rooms have the following structure:
|
|||
|
||||
{{% rver-fragment name="v1-stringy-power-levels" %}}
|
||||
|
||||
{{% rver-fragment name="v1-floaty-power-levels" %}}
|
||||
|
||||
### Authorization rules
|
||||
|
||||
{{% rver-fragment name="v1-auth-rules" %}}
|
||||
|
|
|
|||
|
|
@ -57,6 +57,8 @@ Events in rooms of this version have the following structure:
|
|||
|
||||
{{% rver-fragment name="v1-stringy-power-levels" %}}
|
||||
|
||||
{{% rver-fragment name="v1-floaty-power-levels" %}}
|
||||
|
||||
### Authorization rules
|
||||
|
||||
{{% rver-fragment name="v1-auth-rules" %}}
|
||||
|
|
|
|||
|
|
@ -87,6 +87,8 @@ The complete structure of a event in a v3 room is shown below.
|
|||
|
||||
{{% rver-fragment name="v1-stringy-power-levels" %}}
|
||||
|
||||
{{% rver-fragment name="v1-floaty-power-levels" %}}
|
||||
|
||||
### Authorization rules
|
||||
|
||||
{{% boxes/note %}}
|
||||
|
|
|
|||
|
|
@ -76,6 +76,8 @@ the changes in this room version.
|
|||
|
||||
{{% rver-fragment name="v1-stringy-power-levels" %}}
|
||||
|
||||
{{% rver-fragment name="v1-floaty-power-levels" %}}
|
||||
|
||||
### Authorization rules
|
||||
|
||||
{{% rver-fragment name="v3-auth-rules" %}}
|
||||
|
|
|
|||
|
|
@ -58,6 +58,8 @@ completeness.
|
|||
|
||||
{{% rver-fragment name="v1-stringy-power-levels" %}}
|
||||
|
||||
{{% rver-fragment name="v1-floaty-power-levels" %}}
|
||||
|
||||
### Authorization rules
|
||||
|
||||
{{% rver-fragment name="v3-auth-rules" %}}
|
||||
|
|
|
|||
Loading…
Reference in a new issue