|
| 1 | +# MSC2867: Marking rooms as unread |
| 2 | + |
| 3 | +There is currently no way to mark a room for later attention. A common use-case is receiving a |
| 4 | +notification on the go and opening the corresponding room but then deciding to deal with it at a later time. |
| 5 | + |
| 6 | +This MSC introduces an option to manually mark an room as *Unread*. |
| 7 | + |
| 8 | +In the above use-case the user would just mark the room as unread and when later opening a matrix |
| 9 | +client on their desktop PC that room would appear prominently in their room list waiting for attention. |
| 10 | + |
| 11 | +A related use-case solved by this proposal is wanting to mute a room's notifications while there's an |
| 12 | +ongoing discussion but still flag it for catching up later. |
| 13 | + |
| 14 | +Both WhatsApp and Telegram offer this functionality. |
| 15 | + |
| 16 | +## Proposal |
| 17 | + |
| 18 | +We add a [room account data](https://matrix.org/docs/spec/client_server/r0.6.1#put-matrix-client-r0-user-userid-rooms-roomid-account-data-type) |
| 19 | +field `m.marked_unread` which just stores the following: |
| 20 | + |
| 21 | +```json |
| 22 | +{ |
| 23 | + "unread": true | false |
| 24 | +} |
| 25 | +``` |
| 26 | + |
| 27 | +When this is true a client should show the room with an indeterminate unread marker. This marker should |
| 28 | +be of similar visual importance to a non-highlight notification badge without the notification count. For example if |
| 29 | +you have a red circle with small numbers inside for counting notifications next to a room, then a room |
| 30 | +without notifications but marked as unread should have just the red circle. If a client gets new |
| 31 | +notifications after marking a room as unread the notification count should be displayed instead as normal. |
| 32 | + |
| 33 | +The `m.fully_read` marker should not be touched when marking a room as unread to keep the users read position |
| 34 | +in the room. |
| 35 | + |
| 36 | +Marking a room as read, if a client implements such a functionality, now involves sending a read receipt for the last |
| 37 | +event, as well as setting `m.marked_unread` to false. |
| 38 | + |
| 39 | +The unread flag should be cleared when opening the room again. |
| 40 | + |
| 41 | +## Potential issues |
| 42 | + |
| 43 | +Client not aware of this feature will not clear the unread flag, when reading the room. In addition they'll obviously |
| 44 | +not show the room with a special badge. This seems preferable to the alternative of clearing the unread flag of a room |
| 45 | +without intending to because it didn't actually show up as unread. |
| 46 | + |
| 47 | +This proposal has no support for marking threads as unread. This should be handled in a future MSC. |
| 48 | + |
| 49 | +## Alternatives |
| 50 | + |
| 51 | +There are multiple possible alternatives here: |
| 52 | + |
| 53 | +* Marking individual messages as unread as discussed [here](https://github.com/matrix-org/matrix-doc/issues/2506): |
| 54 | + This is a far more complex feature that has possible interactions with server-side implementations and notification |
| 55 | + counts. This proposal aims to be a far more lightweight alternative. Looking at other messengers marking a room as |
| 56 | + unread is a more common operation than marking messages as unread, so it could be argued that others already found |
| 57 | + this to strike a good balance of complexity and use-cases covered. |
| 58 | +* Modifying the `m.fully_read` marker instead of introducing a new `m.marked_unread` field: |
| 59 | + Another idea was setting the `m.fully_read` marker to some earlier event which would then cause clients to show |
| 60 | + unread messages again. This has two problems: |
| 61 | + * It makes it harder to distinguish between rooms which happen to have unread messages that you don't necessarily |
| 62 | + care about and rooms which were manually marked as such and thus should be shown much more prominently. |
| 63 | + * When trying to work around this, by setting the marker at a special location like the room creation event, we completely |
| 64 | + lose the user's actual read position in a room whenever they use this feature. |
| 65 | +* Read receipts could be allowed to go "backwards" to restore notification |
| 66 | + counts, though this is likely to be riddled with bugs and unexpected |
| 67 | + behaviour for users. It's better for everyone to keep read receipts linearly |
| 68 | + progressing forwards. |
| 69 | + |
| 70 | +## Security considerations |
| 71 | + |
| 72 | +None. |
| 73 | + |
| 74 | +## Unstable prefix |
| 75 | + |
| 76 | +While this feature is not yet fully specced, implementers can use the `com.famedly.marked_unread` room |
| 77 | +account data type. |
| 78 | + |
| 79 | +Implementations using this unstable prefix in a released version should automatically migrate |
| 80 | +user's unread rooms to `m.marked_unread` when this is released as stable. |
| 81 | +This ensures user's unread rooms are not lost. |
0 commit comments