0
0
Fork 0
mirror of https://github.com/matrix-construct/construct synced 2024-12-27 07:54:05 +01:00

ircd:Ⓜ️:vm: Add vmopts for room_head related.

This commit is contained in:
Jason Volk 2018-05-04 20:42:25 -07:00
parent 35fee056f9
commit ab2490ce73
2 changed files with 13 additions and 0 deletions

View file

@ -119,6 +119,17 @@ struct ircd::m::vm::opts
/// update the optimized present state table of the room if it is proper. /// update the optimized present state table of the room if it is proper.
bool present {true}; bool present {true};
/// Toggles whether event may be added to the room head table which means
/// it is considered unreferenced by any other event at this time. It is
/// safe for this to always be true if events are evaluated in order. If
/// `present` is false this should be set to false but they are not tied.
bool head {true};
/// Toggles whether the prev_events of this event are removed from the
/// room head table, now that this event has referenced them. It is safe
/// for this to always be true.
bool refs {true};
/// Toggles whether the state btree is updated; this should be consistently /// Toggles whether the state btree is updated; this should be consistently
/// true or false for all events in a room. /// true or false for all events in a room.
bool history {true}; bool history {true};

View file

@ -444,6 +444,8 @@ ircd::m::vm::_eval_pdu(eval &eval,
m::dbs::write_opts wopts; m::dbs::write_opts wopts;
wopts.present = opts.present; wopts.present = opts.present;
wopts.history = opts.history; wopts.history = opts.history;
wopts.head = opts.head;
wopts.refs = opts.refs;
wopts.idx = eval.sequence; wopts.idx = eval.sequence;
eval_hook(event); eval_hook(event);