Fix sort order for VoIP events.

pull/977/head
Kegan Dougal 10 years ago
parent 51df65bb49
commit c3a298a5df

@ -1,6 +1,7 @@
{ {
"$schema": "http://json-schema.org/draft-04/schema#", "$schema": "http://json-schema.org/draft-04/schema#",
"type": "object", "type": "object",
"description": "This event is sent by the callee when they wish to answer the call.",
"allOf": [{ "allOf": [{
"$ref": "core#/definitions/room_event" "$ref": "core#/definitions/room_event"
}], }],

@ -63,7 +63,16 @@ class MatrixSections(Sections):
def render_voip_events(self): def render_voip_events(self):
def filterFn(eventType): def filterFn(eventType):
return eventType.startswith("m.call") 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 render_presence_events(self):
def filterFn(eventType): def filterFn(eventType):

Loading…
Cancel
Save