f61de718b8
This patch ensures that operations on `RoomEvents` happen in one block, by sharing the same lock. 2 new methods are created: `replace_all_events_by` and `append_new_events`.