Clarify the room-naming behaviour

Make behaviour on empty `m.room.name` and `m.room.canonical_alias` events
explicit.
pull/977/head
Richard van der Hoff 9 years ago
parent bb54adc790
commit d4194dd24e

@ -1,7 +1,14 @@
--- ---
allOf: allOf:
- $ref: core-event-schema/state_event.yaml - $ref: core-event-schema/state_event.yaml
description: This event is used to inform the room about which alias should be considered the canonical one. This could be for display purposes or as suggestion to users which alias to use to advertise the room. description: |-
This event is used to inform the room about which alias should be
considered the canonical one. This could be for display purposes or as
suggestion to users which alias to use to advertise the room.
A room with an ``m.room.canonical_alias`` event with an empty or absent
``alias`` field should be treated the same as a room with no
``m.room.canonical_alias`` event.
properties: properties:
content: content:
properties: properties:
@ -9,6 +16,8 @@ properties:
description: The canonical alias. description: The canonical alias.
type: string type: string
type: object type: object
required:
- alias
state_key: state_key:
description: A zero-length string. description: A zero-length string.
pattern: '^$' pattern: '^$'

@ -1,7 +1,17 @@
--- ---
allOf: allOf:
- $ref: core-event-schema/state_event.yaml - $ref: core-event-schema/state_event.yaml
description: 'A room has an opaque room ID which is not human-friendly to read. A room alias is human-friendly, but not all rooms have room aliases. The room name is a human-friendly string designed to be displayed to the end-user. The room name is not unique, as multiple rooms can have the same room name set. The room name can also be set when creating a room using ``/createRoom`` with the ``name`` key.' description: |-
A room has an opaque room ID which is not human-friendly to read. A room
alias is human-friendly, but not all rooms have room aliases. The room name
is a human-friendly string designed to be displayed to the end-user. The
room name is not unique, as multiple rooms can have the same room name set.
A room with an ``m.room.name`` event with an absent or empty ``name`` field
should be treated the same as a room with no ``m.room.name`` event.
An event of this type is automatically created when creating a room using
``/createRoom`` with the ``name`` key.
properties: properties:
content: content:
properties: properties:

@ -189,13 +189,13 @@ of possibilities for choosing a useful name. To ensure that rooms are named
consistently across clients, clients SHOULD use the following algorithm to consistently across clients, clients SHOULD use the following algorithm to
choose a name: choose a name:
1. If the room has an `m.room.name`_ state event, use the name given by that 1. If the room has an `m.room.name`_ state event with a non-empty ``name``
event. field, use the name given by that field.
#. If the room has an `m.room.canonical_alias`_ state event, use the alias #. If the room has an `m.room.canonical_alias`_ state event with a non-empty
given by that event. ``alias`` field, use the alias given by that field as the name.
#. If neither of the above events are present, a name should be composed based #. If neither of the above conditions are met, a name should be composed based
on the members of the room. Clients should consider `m.room.member`_ events on the members of the room. Clients should consider `m.room.member`_ events
for users other than the logged-in user, with ``membership: join`` or for users other than the logged-in user, with ``membership: join`` or
``membership: invite``. ``membership: invite``.
@ -235,18 +235,18 @@ choose a name:
See https://matrix.org/jira/browse/SPEC-267 for further discussion. See https://matrix.org/jira/browse/SPEC-267 for further discussion.
#. If the room has no ``m.room.name`` or ``m.room.canonical_alias`` events, and #. If the room has no non-empty ``m.room.name`` or ``m.room.canonical_alias``
no active members other than the current user, clients should consider event, and no active members other than the current user, clients should
``m.room.member`` events with ``membership: leave``. If such events exist, a consider ``m.room.member`` events with ``membership: leave``. If such events
display name such as "Empty room (was <user1> and <N> others)" (or a exist, a display name such as "Empty room (was <user1> and <N> others)" (or
localised variant thereof) should be used, following similar rules as for a localised variant thereof) should be used, following similar rules as for
active members (see `above <active_members_>`_). active members (see `above <active_members_>`_).
#. A complete absence of ``m.room.name``, ``m.room.canonical_alias``, and #. A complete absence of room name, canonical alias, and room members is likely
``m.room.member`` events is likely to indicate a problem with creating the to indicate a problem with creating the room or synchronising the state
room or synchronising the state table; however clients should still handle table; however clients should still handle this situation. A display name
this situation. A display name such as "Empty room" (or a localised variant such as "Empty room" (or a localised variant thereof) should be used in this
thereof) should be used in this situation. situation.
.. _`disambiguated display name`: `Calculating the display name for a user`_ .. _`disambiguated display name`: `Calculating the display name for a user`_

Loading…
Cancel
Save