diff --git a/include/ircd/m/vm.h b/include/ircd/m/vm.h index bb89f4aee..4eebf6b72 100644 --- a/include/ircd/m/vm.h +++ b/include/ircd/m/vm.h @@ -119,6 +119,17 @@ struct ircd::m::vm::opts /// update the optimized present state table of the room if it is proper. 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 /// true or false for all events in a room. bool history {true}; diff --git a/ircd/m/vm.cc b/ircd/m/vm.cc index 3b25aa09c..ecec6e7a7 100644 --- a/ircd/m/vm.cc +++ b/ircd/m/vm.cc @@ -444,6 +444,8 @@ ircd::m::vm::_eval_pdu(eval &eval, m::dbs::write_opts wopts; wopts.present = opts.present; wopts.history = opts.history; + wopts.head = opts.head; + wopts.refs = opts.refs; wopts.idx = eval.sequence; eval_hook(event);