Use get_events_as_list rather than lots of calls to get_event
Use get_events_as_list rather than lots of calls to get_event

It's more efficient and clearer.

matrix-org/synapse,matrix-org/synapse,matrix-org/synapse,matrix-org/synapse,matrix-org/synapse,matrix-org/synapse