From 4f83735d4187aec9438ca3ae56821458b483ebf4 Mon Sep 17 00:00:00 2001 From: Johannes Marbach Date: Wed, 4 Jun 2025 15:32:29 +0200 Subject: [PATCH 1/4] MSC4296: Mentions for device IDs Signed-off-by: Johannes Marbach --- proposals/4296-device-id-mentions.md | 47 ++++++++++++++++++++++++++++ 1 file changed, 47 insertions(+) create mode 100644 proposals/4296-device-id-mentions.md diff --git a/proposals/4296-device-id-mentions.md b/proposals/4296-device-id-mentions.md new file mode 100644 index 00000000000..ad5fba4b22e --- /dev/null +++ b/proposals/4296-device-id-mentions.md @@ -0,0 +1,47 @@ +# MSC4296: Mentions for device IDs + +The [`m.mentions`] content property on events allows senders to include an indicator about whether +the event should triggger a specialised notification for some or all room members. Among others, +this can be used to direct events at a certain recipient group within the room. It is, however, +not currently possible to direct events at a certain subset of devices within a room. This can +be helpful, for instance, in cases where devices with different capabilities are participating +in the room and the sender wants to provide a hint on which devices the recipient should pick up +the message. This proposal makes it possible to mention specific devices via the existing +[`m.mentions`] mechanism. + +## Proposal + +A new optional property `device_ids` is introduced in [`m.mentions`] to allow specifying an array +of device IDs to be mentioned by the message. + +```json5 +"m.mentions": { + "device_ids": ["ABC1234"] +} +``` + +It is legal for `room` and `user_ids` to be present within `m.mentions` simultaneously to `device_ids`. + +## Potential issues + +None. + +## Alternatives + +None. + +## Security considerations + +Device IDs are already disclosed when sending messages in encrypted rooms. Allowing their use within +`m.mentions` does, therefore, not present an additional metadata leak. + +## Unstable prefix + +Until this proposal is accepted into the spec, implementations should refer to `device_ids` as +`de.gematik.msc4296.device_ids`. + +## Dependencies + +None. + +[`m.mentions`]: https://spec.matrix.org/v1.14/client-server-api/#definition-mmentions From 357d82b187f536ee16c185df68fe5ef9c0a02fc9 Mon Sep 17 00:00:00 2001 From: Johannes Marbach Date: Wed, 4 Jun 2025 15:36:15 +0200 Subject: [PATCH 2/4] Fix typo --- proposals/4296-device-id-mentions.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/proposals/4296-device-id-mentions.md b/proposals/4296-device-id-mentions.md index ad5fba4b22e..6653a5571eb 100644 --- a/proposals/4296-device-id-mentions.md +++ b/proposals/4296-device-id-mentions.md @@ -1,7 +1,7 @@ # MSC4296: Mentions for device IDs The [`m.mentions`] content property on events allows senders to include an indicator about whether -the event should triggger a specialised notification for some or all room members. Among others, +the event should trigger a specialised notification for some or all room members. Among others, this can be used to direct events at a certain recipient group within the room. It is, however, not currently possible to direct events at a certain subset of devices within a room. This can be helpful, for instance, in cases where devices with different capabilities are participating From 792d51492c2d51f5bd33f93467129656323c6564 Mon Sep 17 00:00:00 2001 From: Johannes Marbach Date: Thu, 5 Jun 2025 10:30:34 +0200 Subject: [PATCH 3/4] Turn device_ids into a map and spell out lack of interaction with user_ids --- proposals/4296-device-id-mentions.md | 20 +++++++++++++++++--- 1 file changed, 17 insertions(+), 3 deletions(-) diff --git a/proposals/4296-device-id-mentions.md b/proposals/4296-device-id-mentions.md index 6653a5571eb..cee441fcb3a 100644 --- a/proposals/4296-device-id-mentions.md +++ b/proposals/4296-device-id-mentions.md @@ -11,16 +11,30 @@ the message. This proposal makes it possible to mention specific devices via the ## Proposal -A new optional property `device_ids` is introduced in [`m.mentions`] to allow specifying an array -of device IDs to be mentioned by the message. +A new optional property `device_ids` is introduced in [`m.mentions`] to allow specifying device IDs +to be mentioned by a message. Since device IDs need to be namespaced to user IDs, `device_ids` is a +a map from user ID to an array of device IDs. ```json5 "m.mentions": { - "device_ids": ["ABC1234"] + "device_ids": { + "@alice:example.org": ["ABC1234"] + } } ``` It is legal for `room` and `user_ids` to be present within `m.mentions` simultaneously to `device_ids`. +As before, when applying mentions, the different properties inside `m.mentions` are OR'ed. This means +the following example should mention all of Bob's devices _and_ one of Alice's devices. + +```json5 +"m.mentions": { + "user_ids": ["@bob:example.org"], + "device_ids": { + "@alice:example.org": ["ABC1234"] + } +} +``` ## Potential issues From b159d19eff9c41c68974170c5d53bc77e91a442e Mon Sep 17 00:00:00 2001 From: Johannes Marbach Date: Thu, 5 Jun 2025 10:33:55 +0200 Subject: [PATCH 4/4] Add lack of fallback to potential issues --- proposals/4296-device-id-mentions.md | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/proposals/4296-device-id-mentions.md b/proposals/4296-device-id-mentions.md index cee441fcb3a..6eeaccf757e 100644 --- a/proposals/4296-device-id-mentions.md +++ b/proposals/4296-device-id-mentions.md @@ -38,7 +38,8 @@ the following example should mention all of Bob's devices _and_ one of Alice's d ## Potential issues -None. +Clients that don't support this proposal will recognise no mentions for their logged in user at all if +only `device_ids` is specified within `m.mentions`. ## Alternatives