diff --git a/event-schemas/schema/v1/m.call.answer b/event-schemas/schema/v1/m.call.answer index 78b68ce1..598554f0 100644 --- a/event-schemas/schema/v1/m.call.answer +++ b/event-schemas/schema/v1/m.call.answer @@ -1,6 +1,7 @@ { "$schema": "http://json-schema.org/draft-04/schema#", "type": "object", + "description": "This event is sent by the callee when they wish to answer the call.", "allOf": [{ "$ref": "core#/definitions/room_event" }], diff --git a/templating/matrix_templates/sections.py b/templating/matrix_templates/sections.py index a4a9c27f..0b94e100 100644 --- a/templating/matrix_templates/sections.py +++ b/templating/matrix_templates/sections.py @@ -63,7 +63,16 @@ class MatrixSections(Sections): def render_voip_events(self): def filterFn(eventType): return eventType.startswith("m.call") - return self._render_events(filterFn, sorted) + def sortFn(eventTypes): + ordering = [ + "m.call.invite", "m.call.candidates", "m.call.answer", + "m.call.hangup" + ] + rest = [ + k for k in eventTypes if k not in ordering + ] + return ordering + rest + return self._render_events(filterFn, sortFn) def render_presence_events(self): def filterFn(eventType):