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.
pull/977/head
David Baker 8 years ago
parent b789251f70
commit 4480553bf9

@ -1,23 +1,21 @@
{ ---
"type": "object", allOf:
"title": "Direct Message Map Event", - $ref: core-event-schema/event.yaml
"description": "Account Data event used to store which rooms are 'direct chats' for which users.", description: |-
"allOf": [{ A map of which rooms are considered 'direct' rooms for specific users
"$ref": "core-event-schema/event.yaml" 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
"properties": { and values are lists of room ID strings of the 'direct' rooms for
"type": { that user ID.
"type": "string", properties:
"enum": ["m.direct"] content:
}, additionalProperties:
"content": { type: array
"type": "object", title: User ID
"description": "Object mapping user IDs to lists of room IDs.", type: object
"additionalProperties": { type:
"title": "User ID", enum:
"type": "array" - m.direct
} type: string
} title: Direct Chat Mapping
}, type: object
"required": ["type", "content"]
}

@ -32,21 +32,15 @@ whether a chat is 'direct' to an invitee.
Events Events
------ ------
A map of which rooms are considered 'direct' rooms for specific users {{m_direct_event}}
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.
Client behaviour
----------------
When creating a room, the ``is_direct`` flag may be specified to signal to the When creating a room, the ``is_direct`` flag may be specified to signal to the
invitee that this is a direct chat. See `POST invitee that this is a direct chat. See `POST
/_matrix/client/%CLIENT_MAJOR_VERSION%/createRoom`_. This flag appears as /_matrix/client/%CLIENT_MAJOR_VERSION%/createRoom`_. This flag appears as
``is_direct`` in the member event: see `m.room.member`_. ``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 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 room as a direct message but this is not required: it may for example, prompt
the user, ignore the flag altogether. the user, ignore the flag altogether.

Loading…
Cancel
Save