@ -115,7 +115,7 @@ class MatrixSections(Sections):
schemas = self . units . get ( " event_schemas " )
schemas = self . units . get ( " event_schemas " )
renders = { }
renders = { }
for event_type in schemas :
for event_type in schemas :
underscored_event_type = event_type . replace ( " . " , " _ " ) . replace ( " # " , " _ " )
underscored_event_type = event_type . replace ( " . " , " _ " ) . replace ( " $ " , " _ " )
renders [ underscored_event_type + " _event " ] = self . _render_events (
renders [ underscored_event_type + " _event " ] = self . _render_events (
lambda x : x == event_type , sorted
lambda x : x == event_type , sorted
)
)
@ -125,7 +125,7 @@ class MatrixSections(Sections):
def filterFn ( eventType ) :
def filterFn ( eventType ) :
return (
return (
eventType . startswith ( " m.room " ) and
eventType . startswith ( " m.room " ) and
not eventType . startswith ( " m.room.message # m." )
not eventType . startswith ( " m.room.message $ m." )
)
)
return self . _render_events ( filterFn , sorted )
return self . _render_events ( filterFn , sorted )
@ -138,22 +138,22 @@ class MatrixSections(Sections):
] [ " subtitle " ]
] [ " subtitle " ]
sections = [ ]
sections = [ ]
msgtype_order = [
msgtype_order = [
" m.room.message #m.text" , " m.room.message# m.emote" ,
" m.room.message $m.text" , " m.room.message$ m.emote" ,
" m.room.message #m.notice" , " m.room.message# m.image" ,
" m.room.message $m.notice" , " m.room.message$ m.image" ,
" m.room.message # m.file"
" m.room.message $ m.file"
]
]
excluded_types = [
excluded_types = [
# We exclude server notices from here because we handle them in a
# We exclude server notices from here because we handle them in a
# dedicated module. We do not want to confuse developers this early
# dedicated module. We do not want to confuse developers this early
# in the spec.
# in the spec.
" m.room.message # m.server_notice" ,
" m.room.message $ m.server_notice" ,
]
]
other_msgtypes = [
other_msgtypes = [
k for k in schemas . keys ( ) if k . startswith ( " m.room.message # " ) and
k for k in schemas . keys ( ) if k . startswith ( " m.room.message $ " ) and
k not in msgtype_order and k not in excluded_types
k not in msgtype_order and k not in excluded_types
]
]
for event_name in ( msgtype_order + other_msgtypes ) :
for event_name in ( msgtype_order + other_msgtypes ) :
if not event_name . startswith ( " m.room.message # m." ) :
if not event_name . startswith ( " m.room.message $ m." ) :
continue
continue
sections . append ( template . render (
sections . append ( template . render (
example = examples [ event_name ] [ 0 ] ,
example = examples [ event_name ] [ 0 ] ,