Skip to content
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

MSC3015: Room state personal overrides #3015

Open
wants to merge 61 commits into
base: old_master
Choose a base branch
from
Open
Changes from all commits
Commits
Show all changes
61 commits
Select commit Hold shift + click to select a range
e0e7133
Added proposial "Message Attachments"
MurzNN Nov 27, 2020
96fef8b
Assign 2881 number to MSC and some typos
MurzNN Nov 27, 2020
8065221
Added mentions of similar MSC
MurzNN Nov 27, 2020
0de8e47
Direct mxc links and improved alternative
MurzNN Nov 27, 2020
45c91fd
Improved description of 1'st alternative
MurzNN Nov 27, 2020
a226142
Added second implementation
MurzNN Nov 27, 2020
616dcba
Added unstable prefixes, fixed typo
MurzNN Nov 27, 2020
6b5ccbe
Added unstable to class to
MurzNN Nov 27, 2020
e343893
Moved fallback dispay to implementation 1
MurzNN Nov 27, 2020
d448559
Added example of media event to implentation 2
MurzNN Nov 27, 2020
c33ef1a
Move second implementation to main place
MurzNN Nov 27, 2020
ad7f2fa
Paraphrasing
MurzNN Nov 27, 2020
dd423aa
Described edits and improved description
MurzNN Nov 30, 2020
76e0522
Added fallback description
MurzNN Nov 30, 2020
9a7f694
Added edits composer description
MurzNN Nov 30, 2020
910be82
Added link to extensible events suggestion
MurzNN Nov 30, 2020
abc7edf
Added alternative with attachments after message
MurzNN Nov 30, 2020
108ffa7
Added redact action on remove media
MurzNN Nov 30, 2020
2be176c
Fixed typo
MurzNN Nov 30, 2020
eea1ba0
Fix typo again
MurzNN Nov 30, 2020
87bfff2
Added delete (redact action)
MurzNN Nov 30, 2020
ba19693
Added potential issue and hiding recommendation
MurzNN Nov 30, 2020
6147bd6
Added link to MSC2278
MurzNN Nov 30, 2020
6da8d3a
Fix typos and added link to MSC2675
MurzNN Nov 30, 2020
fa6f59b
Fix typo
MurzNN Nov 30, 2020
2e8536e
Added proposal for replacement to #2530 / #2529
MurzNN Nov 30, 2020
0eb7773
Added links to implementation examples
MurzNN Nov 30, 2020
00ade35
Improved description
MurzNN Nov 30, 2020
5df15b6
Description for implementation together with #2530
MurzNN Nov 30, 2020
a470fba
improve grammar
MurzNN Dec 16, 2020
39c08c4
Move back first alternative as option two
MurzNN Dec 16, 2020
12c0a3f
Fix typo
MurzNN Dec 16, 2020
21f14c2
Described replacing fallback to rich representation
MurzNN Dec 16, 2020
cfb8f55
Name options as primary-secondary
MurzNN Dec 17, 2020
ffad669
Create MSC for Personal room names
MurzNN Feb 19, 2021
6ff1393
Delete MSC from other branch
MurzNN Feb 19, 2021
f0e6037
Assign 3015 number to MSC and rename
MurzNN Feb 19, 2021
25a6d58
Better description of examples.
MurzNN Feb 19, 2021
381103a
Paraphrasing
MurzNN Feb 19, 2021
979eb47
Type as m.room_name_personal and modify deletion
MurzNN Feb 19, 2021
016d3f8
Update unstable prefix
MurzNN Feb 19, 2021
41733af
Remove > Clear
MurzNN Feb 19, 2021
359b003
Fix key and type of room account data
MurzNN Feb 19, 2021
985f30e
Extended alternatives
MurzNN Feb 19, 2021
50cfe4f
Links to Contacts feature
MurzNN Feb 19, 2021
74a25c6
Supplemented examples
MurzNN Feb 19, 2021
1bd1132
Paraphrasing
MurzNN Feb 19, 2021
e9d925b
Wrap long lines
MurzNN Feb 19, 2021
cc88c7e
grammar fix
MurzNN Feb 23, 2021
f859140
grammar fix
MurzNN Feb 23, 2021
415a7f4
grammar fix
MurzNN Feb 23, 2021
8c1fbce
grammar fix
MurzNN Feb 23, 2021
34acaed
grammar fix
MurzNN Feb 23, 2021
54795fc
grammar fix
MurzNN Feb 23, 2021
649b5b4
grammar fix
MurzNN Feb 23, 2021
42e5c7f
grammar fix
MurzNN Feb 23, 2021
3cc130e
grammar fix
MurzNN Feb 23, 2021
a56f5aa
Rewording
MurzNN Feb 23, 2021
9c94f4c
Rework to allow override also avatar and topic
MurzNN Apr 3, 2021
5ba4368
Added idea for override profiles as rooms
MurzNN Apr 3, 2021
74fa075
Added suggestion of room members overrides
MurzNN Apr 3, 2021
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
120 changes: 120 additions & 0 deletions proposals/3015-room-personal-overrides.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,120 @@
# MSC3015: Room state personal overrides

Very often users want to personally rename rooms to see it in list like they wants, especially for DM rooms. But room
name is shared thing, so if they rename it for yourself, all other members will see this rename too.

Examples of problem:

1. Very often other people want to rename DM rooms with me and can do this, because we both are admins. So they set the
alternative name of that DM room (eg `Korepov Alexey` instead of `Alexey Murz Korepov`) - this works well on their
side. But, as result on my side, I see that room in my rooms list with my name, instead of remote user name.

2. The user has two DM rooms with different Matrix users, but both have name "Alice" without avatar. As result they see
two identical rooms in the list with same name and it is unclear which room is which.
If attempting to solve this problem via renaming rooms, the problem described in 1 occurs.

3. This problem often happens for rooms from bridged networks, when we talk with same person via different networks, and
want to mark each room personally. This can be solved via adding suffixes with remote network name to room name on
Bridge side, but people want to change other parts of room name too. For example, one person can have different names
in each network (eg "Alexey Korepov" on VK, "Korepov Alexey" on Skype, "Alex" on WhatsApp, "Murz" on Telegram), and I
want to see all rooms with him as similar names, and also maybe attach personal avatar to that rooms.

4. Some networks (eg IRC, Slack) also have no per-room avatars, so they are bridged with empty or identical avatars, that
makes harder to diffirentiate them in avatar-only list of rooms, so users want to override the avatars personally too.

Most of other modern messengers (Telegram, Skype, Viber, WhatsApp) already have this feature, but only for DM rooms via
reusing smartphone's addressbook to store personal names of contacts. And moving from that messengers to Matrix confuses
the people, because they can't rename personal chats in his own list like before.

# Proposal

For solve this problem I propose to use [room's account
data](https://matrix.org/docs/spec/client_server/r0.6.0#put-matrix-client-r0-user-userid-rooms-roomid-account-data-type)
item with same key as overriden state event type, but with `override.` prefix, to store personal overrides of needed
uhoreg marked this conversation as resolved.
Show resolved Hide resolved
state any room for each user individually, and overriden content, here is example for room name and avatar overrides:

**`override.m.room.name`**
Copy link
Member

Choose a reason for hiding this comment

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

Naming keys that way effectively imposes a new top-level namespace, which we don't have as yet. Any particular reasons against m.room.name.override (and so on)? You already use this form in the unstable prefix section, by the way.

(I tend to agree that a marker that this is a user-specific override, not a part of the server-tracked room state, is important).

Copy link
Contributor Author

Choose a reason for hiding this comment

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

By making an new top-level namespace, I tried to separate overrides from other groups of namespaces, to not mix different things in one namespace. But if top level namespace is bad idea, I can rework this to use suffix instead of prefix...

Copy link
Member

Choose a reason for hiding this comment

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

The primary problem with adding a top-level namespace here is that we use reverse-DNS notation, and can't guarantee that override won't end up being a legit DNS TLD. More formally, it would probably be the second occasion when we use a non-m., non-revDNS top-level namespace, and I'd rather follow the existing overarching convention. If you're not quite happy with override as a postfix, m.override.room.* (and org.matrix.msc3015.override.room.* for the unstable form - mind that m. can be replaced with the unstable prefix in this case) should probably be fine too.

(For the record, the first non-m. top-level namespace was u., for room tags; I don't advise employing it here since u. tags are defined at the discretion of end users, not the spec.)

```json
{
"name": "The room name"
}
```
**`override.m.room.avatar`**
```json
{
"info": {
"h": 398,
"mimetype": "image/jpeg",
"size": 31037,
"w": 394
},
"url": "mxc://example.org/JWEIFJgwEIhweiWJE"
}
```

By default those items are absent. They are added only when user make the personal override, and cleared if user
remove the personal name for room (or make it empty). Regarding to spec, the account data's key can't be deleted,
so if user wants to remove the personal override (aka "Reset to default"), the value of the key should become
empty (`{}`).
Copy link
Member

Choose a reason for hiding this comment

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

What if someone wants to override the room name with an empty string?

Copy link
Contributor Author

@MurzNN MurzNN Jul 6, 2021

Choose a reason for hiding this comment

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

For this task value for override.m.room.name must be:

{
  "name": ""
}

like regular room state item, when room admin removes the name of room.

Copy link
Member

Choose a reason for hiding this comment

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

Yeah, I guess it's worth putting that in the MSC text, for clarity.

Choose a reason for hiding this comment

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

What would happen if user override it as empty string?


Those overrides can be used for all types of rooms: DMs (to rename personal contacts or set custom photo to avatar,
add notes to topic), public rooms (to set desired personal name, eg in user's native language), public Spaces, etc.

For not allow to override bad things, I think we must define an allowlist of state types, that can be overriden:
- `m.room.name`
- `m.room.avatar`
- `m.room.topic`
Copy link
Member

Choose a reason for hiding this comment

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

Room topic is generally a message from the room admins, so I don't think it's really something that people should be overriding. (Similar for message pinning.) I can see the value in being able to add your own notes on a room and bookmark certain messages in a room, but I think those should be separate information, in addition to the topic and pinned messages, rather than overriding those.

- and maybe also `m.room.pinned_events` for implement personal pinning?

Also we can allow even `m.room.member` for personally override room members names and avatars too. But for this task
may be better to wait for user profiles implementation from [MSC1769: Extensible profiles as rooms](https://github.com/matrix-org/matrix-doc/pull/1769),
to override profile info values via same technic like in regular rooms, this will allow even complements the remote
profiles: add personal phone number for your contact, that missed in public profile and know only by you, leave personal
notes about that contact, etc.

# Client support

## Displaying:

When client displays the room information (eg in room list), for all allowlisted state keys it should lookup the
corresponding room's account data key with `override.` prefix, if it exists and not empty - replace the content
of that state event to overriden before rendering. Clients may show both values (global and personal) and explain
that this room have an overriden personal value, that is seen only for current user.

## Adding, removing, renaming:

Clients should provide a way to privately override allowed room state values and clearly explain the difference
between global and personally overriden values.

In room list this can be implemented via "Rename room personally" or "Set personal name for room" menu item in
right-click menu, and similar way for avatar.

In room settings page personal name can be implemented via button "Set personal name for this room", which will be
available even if user have no permission to change the room name, and same for avatar. If personal value is filled,
it should be shown near the global room value, with ability to remove it.

# Server support

This MSC does not need any changes on server side.

# Potential issues

1. User can set a personal value that is identical to the current global room value. This may cause confusion as the

Choose a reason for hiding this comment

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

We can store inside our metadata object copy of original value.
And later client app can compare it with current value for room (or user if that 1on1 room) and if it changed -- render exclamation mark.

client will not see future global value changes. Clients should consider providing the user a suggestion to remove
personal override for follow future renames of room. And for other renames - explain that personal override will not
follow the future changing of global value.

# Alternatives

1. Instead of setting personal name for rooms via
[room's account_data](https://matrix.org/docs/spec/client_server/r0.6.0#put-matrix-client-r0-user-userid-rooms-roomid-account-data-type)
we can set personal names directly for Matrix users (mxid), like other messengers (Telegram, WhatsApp, etc) doing.
This will give similar behavior for DM rooms, but will make impossible to set personal names of rooms with several
users (or DM rooms with bots), and intersects with per-room display names feature. And this way will be better to
implement together with "[Contacts](https://github.com/vector-im/roadmap/issues/10)" feature, which is planned in
Element and in issue [Contact List & Renaming Contacts](https://github.com/matrix-org/matrix-doc/issues/2936).

# Unstable prefix

Clients should use `org.matrix.msc3015.[m.state.type].override` for room account data key instead of proposed, while this
MSC has not been included in a spec release.