From ed4ce6950c325e2cab30b28ec01ab7edea23f36a Mon Sep 17 00:00:00 2001 From: Kegan Dougal Date: Thu, 21 May 2015 15:51:23 +0100 Subject: [PATCH] Template up common event fields from the 'core' json schema file. --- specification/20_events.rst | 61 +------------------ templating/templates/common-event-fields.tmpl | 4 +- 2 files changed, 5 insertions(+), 60 deletions(-) diff --git a/specification/20_events.rst b/specification/20_events.rst index ada4980e0..6916e793d 100644 --- a/specification/20_events.rst +++ b/specification/20_events.rst @@ -5,66 +5,11 @@ All communication in Matrix is expressed in the form of data objects called Events. These are the fundamental building blocks common to the client-server, server-server and application-service APIs, and are described below. +{{common_event_fields}} +{{common_room_event_fields}} -Common event fields -------------------- -All events MUST have the following fields: - -``event_id`` - Type: - String. - Description: - Represents the globally unique ID for this event. - -``type`` - Type: - String. - Description: - Contains the event type, e.g. ``m.room.message`` - -``content`` - Type: - JSON Object. - Description: - Contains the content of the event. When interacting with the REST API, this is the HTTP body. - -``room_id`` - Type: - String. - Description: - Contains the ID of the room associated with this event. - -``user_id`` - Type: - String. - Description: - Contains the fully-qualified ID of the user who *sent* this event. - -State events have the additional fields: - -``state_key`` - Type: - String. - Description: - Contains the state key for this state event. If there is no state key for this state event, this - will be an empty string. The presence of ``state_key`` makes this event a state event. - -``required_power_level`` - Type: - Integer. - Description: - Contains the minimum power level a user must have before they can update this event. - -``prev_content`` - Type: - JSON Object. - Description: - Optional. Contains the previous ``content`` for this event. If there is no previous content, this - key will be missing. - -.. TODO-spec - How do "age" and "ts" fit in to all this? Which do we expose? +{{common_state_event_fields}} Room Events diff --git a/templating/templates/common-event-fields.tmpl b/templating/templates/common-event-fields.tmpl index adcb31bd1..2a3f7ec5d 100644 --- a/templating/templates/common-event-fields.tmpl +++ b/templating/templates/common-event-fields.tmpl @@ -1,5 +1,5 @@ -{{common_event.title}} -{{(common_event.title | length) * '-'}} +{{common_event.title}} Fields +{{(7 + common_event.title | length) * '-'}} {{common_event.desc | wrap(80)}}