Skip to content

Commit 6bee650

Browse files
committed
Rewrite/Split user's attributes away
user's user-given attributes now defined in [MSC3865](matrix-org#3865)
1 parent c31d8d9 commit 6bee650

File tree

1 file changed

+96
-119
lines changed

1 file changed

+96
-119
lines changed

proposals/3864-room-nicknames.md

Lines changed: 96 additions & 119 deletions
Original file line numberDiff line numberDiff line change
@@ -1,132 +1,131 @@
1-
# MSC3864: User-given nicknames & descriptions for rooms & users
2-
3-
User-given Nicknames or names loaded from an addressbook are great,
4-
they allow you to personalize your experience in using an IM
5-
while others do not need to change anything.
6-
Like when you write with privacy-concerned users,
7-
they might use a nickname for their account on their own,
8-
but you may want to have them listed by their real name
9-
or any other funny nickname you've given them.
10-
Or people are using their display name to present statements like "(away until X)"
11-
and you want to set an end to that (for yourself).
12-
13-
The same for groups, sometimes, the *global* room name works fine,
1+
# MSC3864: User-given nicknames & descriptions for rooms
2+
3+
> This MSC is similar to [MSC3865](https://github.com/matrix-org/matrix-spec-proposals/pull/3865),
4+
> which specifies user-given attributes for rooms.
5+
> They were split because it makes more sense for now to store user attributes in another way
6+
> and because it shall be possible to set a user-given name for any MXID restricted to a single room.
7+
> However, they may share the same ideas and reasonings.
8+
9+
Sometimes, the *global* room name works fine,
1410
but it would be funnier or easier for you to use another one.
1511
Maybe because you've grouped similar rooms together into a (personal) space,
1612
so parts of the name become irrelevant.
1713
Like in a space called "My Long Cooperation Name",
1814
where every room is called like "My Long Cooperation Name - IT Team Chat",
1915
maybe shorter names like "IT Team" or "MLCN - IT Team" are better suited to you.
2016
Or maybe because the admin is just too lazy or stubborn to improve the room name.
17+
Or because you prefer them in another language to make your daily life easier.
18+
19+
Also, sometimes you just may want to append a description to a room,
20+
so you know why you joined the room of have fast access to more information.
21+
Especially when rooms change their descriptions,
22+
but you still want to retain some links you connect to this group,
23+
or these links do only apply for you.
2124

22-
Also, sometimes you just may want to append a description to a room or user,
23-
so you know why you joined the room or are knowning the user.
24-
Descriptions like "old class mate from XYZ School" can certainly improve your UX,
25-
especially when users or rooms change their names due to personal reasons ("new name is cooler, duh")
26-
and you stop recognizing who they are and need to ask them for their real life name
27-
or read through the chat history (happened multiple times to me personally).
25+
The same reasons apply to the room's avatar.
26+
If you have a better one, you shall be able to select that one for yourself.
2827

2928

3029
## Definitions
3130

3231
Further on, for the sake of simplicity and clarity:
33-
- **global name** is the display name
34-
- a user set for itself, visible globally to all other Matrix users.
35-
- a room was given, visible globally to all other users who can see the room.
36-
- **user-given name** refers to the name defined here a user shall be able to set,
37-
only visible for itself, for other users or rooms,
38-
replacing the global name.
39-
- **global description** is the display description
40-
a room was given, visible globally to all other users who can see the room.
41-
- **user-given description** refers to the description defined here a user shall be able to set,
42-
only visible for itself, for rooms,
43-
extending the global description.
32+
- the prefix **global** refers to the attribute which are set for a room,
33+
visible globally to all Matrix users.
34+
- the prefix **user-given** refers to the overrided/extended attribute a user defines for a room,
35+
only visible to the former user.
36+
These are newly defined by this MSC.
4437

4538

4639
## Proposal
4740

4841

4942
### Reasoning
5043

51-
Allowing users to set user-given names and descriptions for rooms and other users is useful
44+
Allowing users to set user-given attributes for rooms is useful
5245
because it let users increase their usability and accessibility to the Matrix infrastructure on their own and as required.
53-
These names shall stay private to the user itself and may not be seen to others,
46+
These attributes shall stay private to the user itself and may not be seen to others,
5447
so users are able to choose what they see fit best
55-
without thinking about privacy issues or the feelings of the room or users renamed.
48+
without thinking about privacy issues or the feelings of the users in the rooms affected.
5649

57-
Adding this feature to the spec has the advantage that presumable most clients will implement support for displaying and hopefully also setting names and descriptions.
50+
Adding this feature to the spec has the advantage
51+
that presumable most clients will implement support for displaying
52+
and hopefully also setting these user-given attributes.
5853
It also allows a more unified experience accross all clients and devices
59-
because user-given names and descriptions are synced using the home server of the user.
54+
because user-given attributes are synced using the home server of the user.
6055
For the same reason, this proposal includes a description of the expected user experience.
6156

6257
This proposal takes advantage of the already implemented
6358
[client config feature](https://spec.matrix.org/unstable/client-server-api/#client-config) (a.k.a. `account_data`)
6459
so the API and the server implementations do not need to change.
65-
The user-given names and descriptions will be saved scoped to the room and in an own namespace.
66-
Client configs are only visible to the user who set them and are synced accross all devices of the user,
60+
The user-given attributes will be saved scoped to the room and in an own event type.
61+
Client configs are only visible to the user who set them and are synced across all devices of the user,
6762
which makes them a perfect fit for storing user-given names and user-given description.
6863

6964

7065
### Implementation
7166

72-
For user-given names, a new event type called `m.name.user_given` may be added.
73-
The content of this event will be `{"content": "<USER_GIVEN_NAME>"}`
67+
For each state event of a room which present the aesthetic information about the room,
68+
a new event type for the user-given counterpart shall be defined.
69+
To get the new event type, the prefix `m.` will be replaced with `m.user_given.`.
70+
Keeping the subpart `room` prevents name clashings with user's user-defined attributes
71+
from [MSC3865](https://github.com/matrix-org/matrix-spec-proposals/pull/3865).
72+
For the currently defined aesthetic state events, the new event types are listed below.
7473

75-
For user-given descriptions, a new event type called `m.description.user_given` may be added.
76-
The content of this event will be `{"content": "<USER_GIVEN_DESCRIPTION>"}`
74+
| Current room attribute name | User-defined event type | Content type |
75+
| --------------------------- | ------------------------------- | ------------ |
76+
| `m.room.name` | `m.user_given.room.name` | `string` |
77+
| `m.room.avatar` | `m.user_given.room.avatar` | `URI` |
78+
| `m.room.topic` | `m.user_given.room.description` | `string` |
7779

78-
Clients shall store & read those event types scoped to the selected / affected room.
79-
This means they will GET / PUT following URL:
80-
`/_matrix/client/v3/user/{userId}/rooms/{roomId}/account_data/{type}`
81-
with parameters as follows:
82-
- `{userId}`: The user id of the current user.
83-
- `{roomId}`: The room id of the selected / affected room id.
84-
- `{type}`: Either `m.name.user_given` or `m.description.user_given`
80+
However, when rooms get a new aesthetic state event,
81+
the same rules may apply to it to store its user-defined counterparts.
8582

86-
When setting user-given names and descriptions to other users,
87-
clients shall scope the events to the room both users use to exchange 1:1 direct messages
88-
(according to [MSC2199](https://github.com/matrix-org/matrix-spec-proposals/pull/2199)).
89-
If a user may leave the last DM room, the user-given names and descriptions may be lost as well.
90-
This behavior may or may not be expected, depending on the user's preference.
91-
Clients may inform the user about this circumstance so they can make an informed choice.
83+
The user-defined event must contain the keys `type` with its event type
84+
and `content` which must have the same type as the overriden/extended room state event.
85+
The following shall serve as an example value of the event type `m.user_given.room.name`,
86+
which a client requested with the listed request:
9287

88+
- `GET /_matrix/client/v3/user/{userId}/room/{roomId}/account_data/m.user_given.room.name`
9389

94-
### User Experience
95-
96-
Clients shall replace most occurencies of the global name of a room with user-given name, if set.
97-
Clients may still display the global name in some occurencies
98-
according to the section [User Experience Issues](#user-experience-issues) below.
99-
When the user wants to change the global name of a room,
100-
or the user gets informed about a change of the global name of a room,
101-
the global name may also not be replaced with the user-given name.
102-
However in such events, the user-given name may be displayed as well.
90+
```json
91+
{
92+
"content": "Support Group: Gaming",
93+
"type": "m.user_given.room.name"
94+
}
95+
```
10396

104-
Clients shall append the user-given description to most occurencies of the global description of a room.
105-
Clients shall display both in a way so the user can separate them and interpret them correctly.
10697

107-
Clients shall also replace most occurencies of another user's global name with its user-given name.
108-
Aside from the DM room both users are using to exchange DMs,
109-
this may include occurencies like in events or in member lists of other rooms.
110-
When the user gets informed about a change of the global name of an user,
111-
the global name may also not be replaced with the user-given name.
112-
However in such events, the user-given name may be displayed as well, if not already.
98+
### User Experience
11399

114-
For both rooms and other users, the client must not replace the Matrix ID of rooms / users.
100+
Clients shall replace most occurencies of a room's global attribute with its user-given attribute.
101+
When the user gets informed about a change of a global attribute of a room,
102+
this occurency may not be replaced with the user-given attribute.
103+
However, in such events, the user-given attribute may be displayed as well, if possible and not already.
104+
The client must not replace the IDs of these rooms.
105+
106+
In some cases, the client may display both attributes (global and user-given) alongside each other,
107+
if it makes sense in context of the attribute
108+
and both attributes can be distinguished from one and another
109+
(see [User Experience Issues](#user-experience-issues) for approaches on how to make them distinguishable).
110+
However, the user-given attribute shall take precendece over the global one,
111+
especially if the client can or wants to only display one of both
112+
(see [Alternatives](#alternatives) for reasoning).
113+
As an example, the client may display the name of a room as `USER_GIVEN_NAME (GLOBAL_NAME)`
114+
with only the user-given avatar
115+
but both the user-given description and the global description in this order
116+
(assuming all user-given attributes were set).
117+
118+
If clients want to divert from the user experience declared here,
119+
but still want to confirm to this MSC,
120+
they may implement the user experience from above and their own approach
121+
and make them configurable for the user.
122+
As long as a configuration option is easily available,
123+
clients may choose their own approach as the default.
115124

116125

117126
## Potential Issues
118127

119128

120-
### Implementation Issues
121-
122-
Some issues I discovered while writing or applying this MSC.
123-
These are listed here as points open to discuss further.
124-
125-
#### Non-unique DM room
126-
127-
This issue will be solved by [MSC2199](https://github.com/matrix-org/matrix-spec-proposals/pull/2199).
128-
129-
130129
### Privacy Issues
131130

132131
Because account data in general is sent unencrypted to the home server (for now),
@@ -138,46 +137,32 @@ however this is a task for another MSC to solve, preferably for all account data
138137

139138
### User Experience Issues
140139

141-
Using user-given names and forgetting that the user has configured them
140+
Using user-given attributes forgetting that the user has configured them
142141
could lead into the bad UX that users think their client stopped working correctly,
143-
as a new name of the room or user is not displayed correctly.
144-
This may be mitigated by clients by informing users about that the name is custom, either by:
145-
- displaying user-given names in a custom font, style (e.g. **bold** or *italics*) or color
146-
- displaying the global name aside in brackets ("USER_GIVEN_NAME (GLOBAL_NAME)", e.g. "Sweatheart (Erika Musterfrau)")
147-
- this may only happen when reading messages of the room
148-
- displaying the global name when hovering with the cursor over the user-given name
149-
150-
Clients may choose how they want to display and annotate user-given name and global name
151-
by implementing none or any or some or all points from above as they see fit.
152-
However, the user-given name shall be displayed as the primary name
153-
(e.g. displaying as "**GLOBAL_NAME** (USER_GIVEN_NAME)"
154-
or displaying the user-given name with less contrast than the global name
155-
shall be prohibited, see [Alternatives](#alternatives) for reasoning).
142+
as a new attribute of the room is not updated correctly.
143+
This may be mitigated by clients by informing users about that the attribute is custom, either by:
156144

157-
The same problem should not occur in the same way to the user-given descriptions
158-
as they shall expand the global description instead of replacing it.
159-
However, clients should still display them either separated and labeled
160-
or at least in way so users can separate them from one and another easily.
145+
- displaying user-given attributes in a custom style (e.g. **bold** or *italics*), border or color,
146+
- displaying the global attribute aside ("USER_GIVEN_NAME (GLOBAL_NAME)", e.g. "Support Group: Gaming (Gaming Buddies)"),
147+
- displaying the global attribute when hovering with the cursor over the user-given attribute,
148+
- or by another, similar approach.
161149

150+
Clients may choose how they want to display and annotate user-given attributes and global attributes
151+
by implementing none or any or some or all points from above as they see fit.
162152

163-
## Alternatives
164153

165-
User-given names and descriptions set for others users only may be stored into the general account data.
166-
This would circumvent the problem with [non-unique DM rooms](#non-unique-dm-room) particular for this MSC.
167-
However, clients may still need to solve this problem for other implementations,
168-
so no complexity would be saved in the end.
169-
It instead places them near other configurations like client-dependent (not room-dependent) configuration options,
170-
and the user-given names and description may be lost when another user changes its Matrix ID
171-
and it also lets the implementation for rooms and users differ more.
154+
## Alternatives
172155

173-
Conceptually, the user-given name could also be displayed as a secondary attribute alongside the global name
174-
("GLOBAL_NAME (USER_GIVEN_NAME)", e.g. "Erika Musterfrau (Sweatheart)").
156+
Conceptually, the user-given attribute could also be displayed as a secondary attribute alongside the global attribute
157+
("GLOBAL_NAME (USER_GIVEN_NAME)", e.g. "Gaming Buddies (Support Group: Gaming)").
175158
This could prevent some [UX issues](#user-experience-issues),
176159
however this prevents users to customize their experience in certain ways
177160
(e.g. when they don't want to read the global name).
178161
With this implementation, a user is still able to display (parts of) the global name
179162
as they like by adding it to the user-given name theirselves.
180163
It only would not be updated automatically.
164+
Clients which do not want to agree may implement both approaches and make the configurable to the user
165+
as stated above in [User Experience](#user-experience).
181166

182167

183168
## Security considerations
@@ -190,7 +175,7 @@ ans so should not create any security-releated issues.
190175

191176
Until this MSC is merged, clients shall use event type names
192177
where the `m.` prefix is replaced with `work.banananet.msc3864.`
193-
(e.g. use `work.banananet.msc3864.name.user_given` instead of `m.name.user_given`).
178+
(e.g. use `work.banananet.msc3864.user_given.room.name` instead of `m.user_given.room.name`).
194179
Event types with the former prefix are further called *official event types*.
195180
event types with the latter *unstable event types*.
196181

@@ -206,11 +191,3 @@ prefereable automtatically and in the background when finding such a event type.
206191
The migration policy might cause old clients to "lose" the user-given ones,
207192
however hopefully this will move clients to migrate as well
208193
and users to update their clients.
209-
210-
211-
## Dependencies
212-
213-
This MSC formaly depends on [MSC2199](https://github.com/matrix-org/matrix-spec-proposals/pull/2199).
214-
However, as long as clients can resolve an 1:1 DM room successfully by other means
215-
(hopefully compatible to other clients as well),
216-
clients should be able to implement this one.

0 commit comments

Comments
 (0)