Add server notices support

As per [MSC1452](https://github.com/matrix-org/matrix-doc/issues/1452) 

Fixes https://github.com/matrix-org/matrix-doc/issues/1254

Although MSC1452 focuses on just the warnings part of the server notices, the base for notices has not been established in the spec. This commit adds the needed support to be able to handle notices.

No intentional divergences from the proposal are included in this changeset. There are a few additions which are used in practice although not defined in the proposal, such as who is responsible for aesthetics, sending notices, and other misc rules.
This commit is contained in:
Travis Ralston 2019-05-26 20:42:21 -06:00
parent 5c268ef21f
commit 5eea4a477f
9 changed files with 154 additions and 5 deletions

View file

@ -846,6 +846,7 @@ class MatrixUnits(Units):
"title": None,
"desc": None,
"msgtype": None,
"type_with_msgtype": None, # for the template's sake
"content_fields": [
# <TypeTable>
]
@ -884,6 +885,7 @@ class MatrixUnits(Units):
)
if msgtype:
schema["msgtype"] = msgtype[0] # enum prop
schema["type_with_msgtype"] = schema["type"] + " (" + msgtype[0] + ")"
# link to msgtypes for m.room.message
if schema["type"] == "m.room.message" and not msgtype: