From f13472826856941a0253b07feeeb42e985420a7d Mon Sep 17 00:00:00 2001 From: Kegan Dougal Date: Thu, 28 May 2015 11:57:44 +0100 Subject: [PATCH] Link to msgtypes from the description of m.room.message. --- specification/20_events.rst | 2 +- templating/matrix_templates/units.py | 10 +++++++++- 2 files changed, 10 insertions(+), 2 deletions(-) diff --git a/specification/20_events.rst b/specification/20_events.rst index b8e2d1bf..b0d5d716 100644 --- a/specification/20_events.rst +++ b/specification/20_events.rst @@ -29,7 +29,7 @@ m.room.message msgtypes How a client should handle unknown message types. -Each ``m.room.message`` MUST have a ``msgtype`` key which identifies the type +Each `m.room.message`_ MUST have a ``msgtype`` key which identifies the type of message being sent. Each type has their own required and optional keys, as outlined below. diff --git a/templating/matrix_templates/units.py b/templating/matrix_templates/units.py index 027a9ab0..bf0fefa6 100644 --- a/templating/matrix_templates/units.py +++ b/templating/matrix_templates/units.py @@ -194,7 +194,15 @@ class MatrixUnits(Units): if msgtype: schema["msgtype"] = msgtype[0] # enum prop - # Assign state key info + # link to msgtypes for m.room.message + if schema["type"] == "m.room.message" and not msgtype: + schema["desc"] += ( + " For more information on ``msgtypes``, see "+ + "`m.room.message msgtypes`_." + ) + + + # Assign state key info if it has some if schema["typeof"] == "State Event": skey_desc = Units.prop( json_schema, "properties/state_key/description"