From 4480553bf96b859d9a289db989dcd187a4a16f1e Mon Sep 17 00:00:00 2001 From: David Baker Date: Wed, 5 Oct 2016 13:12:14 +0100 Subject: [PATCH] Move m.direct description to the swagger Also change the swagger to yaml so I can put that description in it without having to figure out how to embed that in json. --- event-schemas/schema/m.direct | 44 +++++++++++++++++------------------ specification/modules/dm.rst | 12 +++------- 2 files changed, 24 insertions(+), 32 deletions(-) diff --git a/event-schemas/schema/m.direct b/event-schemas/schema/m.direct index 4f568078..b8a9cfc2 100644 --- a/event-schemas/schema/m.direct +++ b/event-schemas/schema/m.direct @@ -1,23 +1,21 @@ -{ - "type": "object", - "title": "Direct Message Map Event", - "description": "Account Data event used to store which rooms are 'direct chats' for which users.", - "allOf": [{ - "$ref": "core-event-schema/event.yaml" - }], - "properties": { - "type": { - "type": "string", - "enum": ["m.direct"] - }, - "content": { - "type": "object", - "description": "Object mapping user IDs to lists of room IDs.", - "additionalProperties": { - "title": "User ID", - "type": "array" - } - } - }, - "required": ["type", "content"] -} +--- +allOf: + - $ref: core-event-schema/event.yaml +description: |- + A map of which rooms are considered 'direct' rooms for specific users + is kept in ``account_data`` in an event of type ``m.direct``. The + content of this event is an object where the keys are the user IDs + and values are lists of room ID strings of the 'direct' rooms for + that user ID. +properties: + content: + additionalProperties: + type: array + title: User ID + type: object + type: + enum: + - m.direct + type: string +title: Direct Chat Mapping +type: object diff --git a/specification/modules/dm.rst b/specification/modules/dm.rst index f204583e..5ebfb169 100644 --- a/specification/modules/dm.rst +++ b/specification/modules/dm.rst @@ -32,21 +32,15 @@ whether a chat is 'direct' to an invitee. Events ------ -A map of which rooms are considered 'direct' rooms for specific users -is kept in ``account_data`` in an event of type ``m.direct``. The -content of this event is an object where the keys are the user IDs -and values are lists of room ID strings of the 'direct' rooms for -that user ID. +{{m_direct_event}} +Client behaviour +---------------- When creating a room, the ``is_direct`` flag may be specified to signal to the invitee that this is a direct chat. See `POST /_matrix/client/%CLIENT_MAJOR_VERSION%/createRoom`_. This flag appears as ``is_direct`` in the member event: see `m.room.member`_. -{{m_direct_event}} - -Client behaviour ----------------- The invitee's client may use the ``is_direct`` flag to automatically mark the room as a direct message but this is not required: it may for example, prompt the user, ignore the flag altogether.