Skip to content

MSC4296: Mentions for device IDs #4296

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Draft
wants to merge 4 commits into
base: main
Choose a base branch
from
Draft
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
62 changes: 62 additions & 0 deletions proposals/4296-device-id-mentions.md
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Implementation requirements:

  • Client (sending)
  • Client (receiving)
  • Server

Original file line number Diff line number Diff line change
@@ -0,0 +1,62 @@
# MSC4296: Mentions for device IDs

The [`m.mentions`] content property on events allows senders to include an indicator about whether
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
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
Comment on lines +7 to +9
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Like what? What features would this support?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'm planning to use this as a dependency for another proposal that I'm currently working out. I think it won't get much clearer before that, sorry (and it could possibly still be a bad idea after all).

Maybe I should have delayed publishing this proposal but it seemed atomic enough and I wanted to get feedback on it as early as possible. Your other comment below shows me that this wasn't entirely futile at least.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

No problem, I'm just unable to come up with plausible ideas myself! Looking forward to seeing it.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I was planning to use this in connection with MSC4300 and MSC4301 for device-to-device communication but it looks like the use case I had in mind may not materialize. I'll move this back into draft for the moment.

[`m.mentions`] mechanism.

## Proposal

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": {
"@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

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

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