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#",
"type": "object",
"description": "This event is sent by the callee when they wish to answer the call.",
"allOf": [{
"$ref": "core#/definitions/room_event"
}],

@ -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):

Loading…
Cancel
Save