Skip to content

MSC4325: Presence privacy #4325

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

Open
wants to merge 12 commits into
base: main
Choose a base branch
from

Conversation

HarHarLinks
Copy link
Contributor

@HarHarLinks HarHarLinks commented Aug 9, 2025

Rendered

Co-written with @TobiasFella at Matrix Community Summit 2025.

Signed-off-by: HarHarLinks [email protected]

In line with matrix-org/matrix-spec#1700, the following disclosure applies:

I am employed at Nordeck, Matrix community member, and Member of the Matrix.org Foundation Governing Board. This proposal was written and published a community member.

HarHarLinks and others added 9 commits August 5, 2025 19:41
Signed-off-by: HarHarLinks <[email protected]>
Signed-off-by: Tobias Fella <[email protected]>
Signed-off-by: HarHarLinks <[email protected]>
Signed-off-by: HarHarLinks <[email protected]>
Signed-off-by: HarHarLinks <[email protected]>
Signed-off-by: HarHarLinks <[email protected]>
Signed-off-by: HarHarLinks <[email protected]>
Signed-off-by: HarHarLinks <[email protected]>
@HarHarLinks HarHarLinks changed the title MSC0000: Presence privacy MSC4325: Presence privacy Aug 9, 2025
Signed-off-by: HarHarLinks <[email protected]>
Signed-off-by: HarHarLinks <[email protected]>
@turt2live turt2live added proposal A matrix spec change proposal client-server Client-Server API kind:feature MSC for not-core and not-maintenance stuff needs-implementation This MSC does not have a qualifying implementation for the SCT to review. The MSC cannot enter FCP. labels Aug 11, 2025
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
  • Server

To do this, the server follows this algorithm:
1. Send presence to all users matching a user ID explicitly listed, or matching a glob in, `allowed_users`
2. Send presence to all users in a room with a room ID listed in `allowed_users` in membership state `join` (here, we do *not* allow globs, since there generally are no groups of rooms sharing useful patterns in their room ID), **unless**
1. The user is [ignored](https://spec.matrix.org/latest/client-server-api/#ignoring-users)
Copy link
Contributor

Choose a reason for hiding this comment

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

Should this override apply for 1. at the very top (user is in allowed_users), too?

2. The receiving user is listed in `denied_users` explicitly or by matching a glob
3. The room's ID is listed under `denied_users`

This makes it explicit that a server MUST NOT send presence to any user that the sending user does share a room with or lists in `allowed_users`.
Copy link
Contributor

Choose a reason for hiding this comment

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

Is the negation off here? Should the server not ONLY send presence to such users?

Comment on lines +135 to +136
However this would introduce the minor risk of discrepancy that the receiving server sees a different member
list than the sending server.
Copy link
Contributor

Choose a reason for hiding this comment

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

Is the worst that could happen here that a user joins the room in between the EDU being sent and received? If so this seems somewhat negligible since the new user would be included (or not) in the next update anyway?

Comment on lines +31 to +35
- A default value (allow or deny)
- A list of MXIDs to be treated as exceptions to the default
- A list of servers to be treated as exceptions to the default
- Allowing to share presence with all users the user shares a DM with
- Per-room settings to share presence with everyone in this room
Copy link
Contributor

Choose a reason for hiding this comment

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

Some example configurations might be helpful to understand the scheme below.

For instance, IIUC, a block list would use empty allowed_users (because * would short-circuit on point 1. and prevent exclusions)? An allow list, on the other hand, would use * in denied_users?

1. Send presence to all users matching a user ID explicitly listed, or matching a glob in, `allowed_users`
2. Send presence to all users in a room with a room ID listed in `allowed_users` in membership state `join` (here, we do *not* allow globs, since there generally are no groups of rooms sharing useful patterns in their room ID), **unless**
1. The user is [ignored](https://spec.matrix.org/latest/client-server-api/#ignoring-users)
2. The receiving user is listed in `denied_users` explicitly or by matching a glob
Copy link
Contributor

Choose a reason for hiding this comment

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

Should this exclude globs as otherwise denied_users = ["*"] would make it impossible to add exceptions for rooms?

some of these rooms are listed under `denied_users`, the user still receives presence, as long as they share at
least one room which is not listed in `denied_users`. If *all* shared rooms are listed under `denied_users`, the user does not receive presence.

Clients SHOULD update the list of room IDs in the exception list when following room upgrades.
Copy link
Contributor

Choose a reason for hiding this comment

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

Would it also be advisable for clients to let users choose their presence sharing configuration before joining a room? I guess the join itself exposes presence-like information, too, so not sure if it's really relevant or not?

Signed-off-by: HarHarLinks <[email protected]>
A possible solution would be for servers to federate presence to servers with many recipients less frequently or based
on additional heuristics (e.g. prioritise DMs, invite-only rooms, etc).

TODO: event size limit EDU?
Copy link
Contributor Author

@HarHarLinks HarHarLinks Aug 21, 2025

Choose a reason for hiding this comment

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

@TobiasFella wdyt? 256 MXIDs of up to 255 bytes each means O(64k).

Suggested change
TODO: event size limit EDU?
Though the spec does not currently limit the size of EDUs, this proposal can lead to extremely long lists of `allowed_recipients` being sent over federation, e.g. when presence is shared with big rooms.
We recommend to chunk the presence EDUs to chunks of 256 MXIDs per presence EDU.
This is trivial to implement, any remaining MXIDs can be transmitted in a second EDU.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
client-server Client-Server API kind:feature MSC for not-core and not-maintenance stuff needs-implementation This MSC does not have a qualifying implementation for the SCT to review. The MSC cannot enter FCP. proposal A matrix spec change proposal
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants