Skip to content

Commit 792d514

Browse files
committed
Turn device_ids into a map and spell out lack of interaction with user_ids
1 parent 357d82b commit 792d514

1 file changed

Lines changed: 17 additions & 3 deletions

File tree

proposals/4296-device-id-mentions.md

Lines changed: 17 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -11,16 +11,30 @@ the message. This proposal makes it possible to mention specific devices via the
1111

1212
## Proposal
1313

14-
A new optional property `device_ids` is introduced in [`m.mentions`] to allow specifying an array
15-
of device IDs to be mentioned by the message.
14+
A new optional property `device_ids` is introduced in [`m.mentions`] to allow specifying device IDs
15+
to be mentioned by a message. Since device IDs need to be namespaced to user IDs, `device_ids` is a
16+
a map from user ID to an array of device IDs.
1617

1718
```json5
1819
"m.mentions": {
19-
"device_ids": ["ABC1234"]
20+
"device_ids": {
21+
"@alice:example.org": ["ABC1234"]
22+
}
2023
}
2124
```
2225

2326
It is legal for `room` and `user_ids` to be present within `m.mentions` simultaneously to `device_ids`.
27+
As before, when applying mentions, the different properties inside `m.mentions` are OR'ed. This means
28+
the following example should mention all of Bob's devices _and_ one of Alice's devices.
29+
30+
```json5
31+
"m.mentions": {
32+
"user_ids": ["@bob:example.org"],
33+
"device_ids": {
34+
"@alice:example.org": ["ABC1234"]
35+
}
36+
}
37+
```
2438

2539
## Potential issues
2640

0 commit comments

Comments
 (0)