From 750d980bc063a556775da789822dc22e3ba040f7 Mon Sep 17 00:00:00 2001 From: Brendan Abolivier Date: Fri, 14 Jul 2017 15:30:56 +0100 Subject: [PATCH] Room member (#950) * Fixed an incorrect membership on example * Added precision on membership upon profile update * Changed first example into a join * Changed the state/{eventType}/{stateKey} example with an actual state key --- api/client-server/room_state.yaml | 8 +++++--- changelogs/client_server.rst | 3 +++ event-schemas/examples/m.room.member | 16 ---------------- .../examples/m.room.member#invite_room_state | 2 +- specification/client_server_api.rst | 4 ++-- 5 files changed, 11 insertions(+), 22 deletions(-) diff --git a/api/client-server/room_state.yaml b/api/client-server/room_state.yaml index d9064f0a6..f6a452f27 100644 --- a/api/client-server/room_state.yaml +++ b/api/client-server/room_state.yaml @@ -56,20 +56,22 @@ paths: name: eventType description: The type of event to send. required: true - x-example: "m.room.name" + x-example: "m.room.member" - in: path type: string name: stateKey description: The state_key for the state to send. Defaults to the empty string. required: true - x-example: "" + x-example: "@alice:example.com" - in: body name: body schema: type: object example: |- { - "name": "New name for the room" + "membership": "join", + "avatar_url": "mxc://localhost/SEsfnsuifSDFSSEF#auto", + "displayname": "Alice Margatroid" } responses: 200: diff --git a/changelogs/client_server.rst b/changelogs/client_server.rst index 9bc027cd4..dfa776740 100644 --- a/changelogs/client_server.rst +++ b/changelogs/client_server.rst @@ -51,6 +51,9 @@ - Spec clarifications: + - Fixed examples of ``m.room.member`` event and room state change, + and added a clarification on the membership event sent upon profile update + (`#950 `_). - Spell out the way that state is handled by ``POST /createRoom`` (`#362 `_). - Clarify the fields which are applicable to different types of push rule diff --git a/event-schemas/examples/m.room.member b/event-schemas/examples/m.room.member index 133cad96b..2495145ba 100644 --- a/event-schemas/examples/m.room.member +++ b/event-schemas/examples/m.room.member @@ -5,22 +5,6 @@ "avatar_url": "mxc://localhost/SEsfnsuifSDFSSEF#auto", "displayname": "Alice Margatroid" }, - "invite_room_state": [ - { - "type": "m.room.name", - "state_key": "", - "content": { - "name": "Forest of Magic" - } - }, - { - "type": "m.room.join_rules", - "state_key": "", - "content": { - "join_rules": "invite" - } - } - ], "state_key": "@alice:localhost", "origin_server_ts": 1431961217939, "event_id": "$WLGTSEFSEF:localhost", diff --git a/event-schemas/examples/m.room.member#invite_room_state b/event-schemas/examples/m.room.member#invite_room_state index 133cad96b..130be9741 100644 --- a/event-schemas/examples/m.room.member#invite_room_state +++ b/event-schemas/examples/m.room.member#invite_room_state @@ -1,7 +1,7 @@ { "age": 242352, "content": { - "membership": "join", + "membership": "invite", "avatar_url": "mxc://localhost/SEsfnsuifSDFSSEF#auto", "displayname": "Alice Margatroid" }, diff --git a/specification/client_server_api.rst b/specification/client_server_api.rst index 16ce0a7d1..2973d1d8d 100644 --- a/specification/client_server_api.rst +++ b/specification/client_server_api.rst @@ -1341,8 +1341,8 @@ many places of a client's display, changes to these fields cause an automatic propagation event to occur, informing likely-interested parties of the new values. This change is conveyed using two separate mechanisms: -- a ``m.room.member`` event is sent to every room the user is a member of, - to update the ``displayname`` and ``avatar_url``. +- a ``m.room.member`` event (with a ``join`` membership) is sent to every room + the user is a member of, to update the ``displayname`` and ``avatar_url``. - a ``m.presence`` presence status update is sent, again containing the new values of the ``displayname`` and ``avatar_url`` keys, in addition to the required ``presence`` key containing the current presence state of the user.