From e046402a4aee277b06e698a83e2f2626c9ede1f8 Mon Sep 17 00:00:00 2001 From: Kegan Dougal Date: Wed, 27 May 2015 16:51:07 +0100 Subject: [PATCH] Shift msgtype section order to have common (implemented) types first. --- templating/matrix_templates/sections.py | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) diff --git a/templating/matrix_templates/sections.py b/templating/matrix_templates/sections.py index 5e210371..6cb0ad5d 100644 --- a/templating/matrix_templates/sections.py +++ b/templating/matrix_templates/sections.py @@ -34,7 +34,16 @@ class MatrixSections(Sections): examples = self.units.get("event_examples") schemas = self.units.get("event_schemas") sections = [] - for event_name in sorted(schemas): + msgtype_order = [ + "m.room.message#m.text", "m.room.message#m.emote", + "m.room.message#m.notice", "m.room.message#m.image", + "m.room.message#m.file" + ] + other_msgtypes = [ + k for k in schemas.keys() if k.startswith("m.room.message#") and + k not in msgtype_order + ] + for event_name in (msgtype_order + other_msgtypes): if not event_name.startswith("m.room.message#m."): continue sections.append(template.render(