-
Notifications
You must be signed in to change notification settings - Fork 385
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
MSC4052: Hiding read receipts UI in certain rooms #4052
Closed
Closed
Changes from all commits
Commits
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
72 changes: 72 additions & 0 deletions
72
proposals/4052-hiding-client-ui-in-certain-bridged-rooms.md
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,72 @@ | ||
# MSC4052: Hiding read receipts UI in certain rooms | ||
|
||
Displaying read receipts is not relevant or useful in all kinds of | ||
rooms. This MSC proposes a hint for clients that they shouldn't | ||
display read receipts in the UI for certain rooms. | ||
|
||
## Proposal | ||
|
||
A new room state event `m.hide_ui` with state key `read_receipts` | ||
determines whether read receipts should be hidden in the UI. To opt-in | ||
to hiding read receipts, the event should contain `{"hidden": true}`. | ||
Other properties are ignored. If `hidden` is not `true` then read | ||
receipts are not hidden. | ||
|
||
An example use-case is when rooms are bridged to other platforms but | ||
those platforms don't support all of Matrix's features. As a practical | ||
example, read receipts are not a feature on IRC. Any IRC rooms bridged | ||
with Matrix will show each user as only having read messages that they | ||
themselves sent. Implementing this proposal would make the behaviour | ||
consistent between Matrix users and bridged users. | ||
|
||
Another example use-case is for announcement rooms which may be read | ||
by thousands of users. Users probably don't care whether other users | ||
have read the latest update, so the read receipt UI is noise in these | ||
rooms. Hiding it would provide a better experience. | ||
|
||
The `m.hide_ui` event is designed to be sent by a compatible | ||
appservice bridge when it manages a bridged room. It can also be sent | ||
manually for any reason. | ||
|
||
In the future, this concept could be extended to hide other parts of | ||
the UI using other state keys. Sticking with IRC as an example, the | ||
bridge bot may ask clients to hide "add reaction" buttons, "create | ||
rich reply" buttons, "upload file" buttons and so on, if it knows that | ||
it cannot handle those events in a satisfactory way. The exact details | ||
are out of scope for MSC4052. MSC4052 only specifies hiding read | ||
receipts in the UI. | ||
|
||
## Potential issues | ||
|
||
Since this flag applies to the entire room, users on the Matrix side | ||
of the bridge will not be able to see read receipts from other Matrix | ||
users, even when those read receipts are correct. See below. | ||
|
||
## Alternatives | ||
|
||
Rather than hiding all read receipts, it may be desirable to only hide | ||
read receipts of bridged users. However, this comes with its own | ||
issues: without a visible read receipt a particular user might not be | ||
perceived by others to be part of the room. | ||
|
||
## Security considerations | ||
|
||
The default power level required to send state events, including | ||
`m.hide_ui`, is PL 50. This should be fine for most rooms. PL 100 | ||
might be a better fit. | ||
|
||
Not all clients will follow this spec, so read receipts might still be | ||
displayed. We may want clients to also send private read receipts (see | ||
MSC2285 which is merged) for rooms in this mode. Otherwise, users | ||
might not realise they are leaking what messages they've viewed. | ||
|
||
## Unstable prefix | ||
|
||
When unstable, the event type `chat.schildi.hide_ui` should be used | ||
instead. (The state key is still `read_receipts` and the content is | ||
still `{"hidden": true}`.) | ||
|
||
## Implementations | ||
|
||
* [SchildiChat (client)](https://github.com/SchildiChat/matrix-react-sdk/pull/18) | ||
* [Out Of Your Element (bridge)](https://gitdab.com/cadence/out-of-your-element/commit/5e6bb0cd2edaa8c340b5f27d5ccfce622c22fc8e#diff-1712f73f1ef677367997f55e69a76b0cc2a2b425) |
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
My drive-by take on this is that this is probably better handled by having a state event, say
m.room.features
contain a dictionary of supported features in the room;read_receipts
being one of them.A room then created by an IRC bridge would set the
read_receipt
feature tofalse
, and clients could adjust their UI accordingly.There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I thought about this at the time, but I decided having a separate state key for each feature would work better, to avoid a similar hassle to how difficult it is to update power levels.
For example, to update power levels currently, one has to fetch the current power levels state, make changes to it in memory, and then set that modified dictionary as the state: https://github.com/matrix-org/matrix-appservice-bridge/blob/2334b0bae28a285a767fe7244dad59f5a5963037/src/components/intent.ts#L352 While this works, it is hard to read and prone to bugs.
It's also a similar problem to updating
m.direct
in account data, which also requires one to fetch the existing event first and modify it so that they don't accidentally erase all of the existing data.I can bypass that problem by having each event in a separate state key. Then to hide or show a particular feature, I can unconditionally send a state event of
{"hidden": true}
without being concerned about what was already there.There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I see, and that makes sense. I suppose my main point was to eliminate the "UI" wording in the state event. So we could still use individual state keys for each feature, but the type would be
m.room.feature
(now singular), instead ofm.hide_ui
.