mirror of
https://github.com/matrix-construct/construct
synced 2024-11-15 14:31:11 +01:00
ircd:Ⓜ️:dbs: Rename room_head_refs to room_head_resolve.
This commit is contained in:
parent
32cc7ee61a
commit
6fe7329189
6 changed files with 14 additions and 14 deletions
|
@ -195,7 +195,7 @@ enum ircd::m::dbs::appendix::index
|
||||||
|
|
||||||
/// Whether the event removes the prev_events it references from the
|
/// Whether the event removes the prev_events it references from the
|
||||||
/// room_head. This defaults to true and should almost always be true.
|
/// room_head. This defaults to true and should almost always be true.
|
||||||
ROOM_HEAD_REFS,
|
ROOM_HEAD_RESOLVE,
|
||||||
|
|
||||||
/// Involves room_events table.
|
/// Involves room_events table.
|
||||||
ROOM_EVENTS,
|
ROOM_EVENTS,
|
||||||
|
@ -219,7 +219,7 @@ namespace ircd::m::dbs
|
||||||
void _index__room_state(db::txn &, const event &, const write_opts &);
|
void _index__room_state(db::txn &, const event &, const write_opts &);
|
||||||
void _index__room_events(db::txn &, const event &, const write_opts &, const string_view &);
|
void _index__room_events(db::txn &, const event &, const write_opts &, const string_view &);
|
||||||
void _index__room_joined(db::txn &, const event &, const write_opts &);
|
void _index__room_joined(db::txn &, const event &, const write_opts &);
|
||||||
void _index__room_head_refs(db::txn &, const event &, const write_opts &);
|
void _index__room_head_resolve(db::txn &, const event &, const write_opts &);
|
||||||
void _index__room_head(db::txn &, const event &, const write_opts &);
|
void _index__room_head(db::txn &, const event &, const write_opts &);
|
||||||
string_view _index_state(db::txn &, const event &, const write_opts &);
|
string_view _index_state(db::txn &, const event &, const write_opts &);
|
||||||
string_view _index_redact(db::txn &, const event &, const write_opts &);
|
string_view _index_redact(db::txn &, const event &, const write_opts &);
|
||||||
|
|
|
@ -200,7 +200,7 @@ struct ircd::m::vm::opts
|
||||||
/// Toggles whether the prev_events of this event are removed from the
|
/// 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
|
/// room head table, now that this event has referenced them. It is safe
|
||||||
/// for this to always be true.
|
/// for this to always be true.
|
||||||
bool room_refs {true};
|
bool room_head_resolve {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.
|
||||||
|
|
|
@ -996,8 +996,8 @@ ircd::m::dbs::_index_room(db::txn &txn,
|
||||||
if(opts.appendix.test(appendix::ROOM_HEAD))
|
if(opts.appendix.test(appendix::ROOM_HEAD))
|
||||||
_index__room_head(txn, event, opts);
|
_index__room_head(txn, event, opts);
|
||||||
|
|
||||||
if(opts.appendix.test(appendix::ROOM_HEAD_REFS))
|
if(opts.appendix.test(appendix::ROOM_HEAD_RESOLVE))
|
||||||
_index__room_head_refs(txn, event, opts);
|
_index__room_head_resolve(txn, event, opts);
|
||||||
|
|
||||||
if(opts.appendix.test(appendix::STATE) && defined(json::get<"state_key"_>(event)))
|
if(opts.appendix.test(appendix::STATE) && defined(json::get<"state_key"_>(event)))
|
||||||
return _index_state(txn, event, opts);
|
return _index_state(txn, event, opts);
|
||||||
|
@ -1164,11 +1164,11 @@ ircd::m::dbs::_index__room_head(db::txn &txn,
|
||||||
}
|
}
|
||||||
|
|
||||||
void
|
void
|
||||||
ircd::m::dbs::_index__room_head_refs(db::txn &txn,
|
ircd::m::dbs::_index__room_head_resolve(db::txn &txn,
|
||||||
const event &event,
|
const event &event,
|
||||||
const write_opts &opts)
|
const write_opts &opts)
|
||||||
{
|
{
|
||||||
assert(opts.appendix.test(appendix::ROOM_HEAD_REFS));
|
assert(opts.appendix.test(appendix::ROOM_HEAD_RESOLVE));
|
||||||
|
|
||||||
//TODO: If op is DELETE and we are deleting this event and thereby
|
//TODO: If op is DELETE and we are deleting this event and thereby
|
||||||
//TODO: potentially creating a gap in the reference graph (just for us
|
//TODO: potentially creating a gap in the reference graph (just for us
|
||||||
|
|
|
@ -122,7 +122,7 @@ ircd::m::room::state::force_present(const m::event &event)
|
||||||
opts.present = true;
|
opts.present = true;
|
||||||
opts.history = false;
|
opts.history = false;
|
||||||
opts.appendix.reset(dbs::appendix::ROOM_HEAD);
|
opts.appendix.reset(dbs::appendix::ROOM_HEAD);
|
||||||
opts.appendix.reset(dbs::appendix::ROOM_HEAD_REFS);
|
opts.appendix.reset(dbs::appendix::ROOM_HEAD_RESOLVE);
|
||||||
|
|
||||||
m::dbs::_index__room_state(txn, event, opts);
|
m::dbs::_index__room_state(txn, event, opts);
|
||||||
m::dbs::_index__room_joined(txn, event, opts);
|
m::dbs::_index__room_joined(txn, event, opts);
|
||||||
|
@ -160,7 +160,7 @@ ircd::m::room::state::rebuild_present(const state &state)
|
||||||
opts.present = true;
|
opts.present = true;
|
||||||
opts.history = false;
|
opts.history = false;
|
||||||
opts.appendix.reset(dbs::appendix::ROOM_HEAD);
|
opts.appendix.reset(dbs::appendix::ROOM_HEAD);
|
||||||
opts.appendix.reset(dbs::appendix::ROOM_HEAD_REFS);
|
opts.appendix.reset(dbs::appendix::ROOM_HEAD_RESOLVE);
|
||||||
|
|
||||||
m::dbs::_index__room_state(txn, event, opts);
|
m::dbs::_index__room_state(txn, event, opts);
|
||||||
m::dbs::_index__room_joined(txn, event, opts);
|
m::dbs::_index__room_joined(txn, event, opts);
|
||||||
|
@ -211,7 +211,7 @@ ircd::m::room::state::rebuild_history(const state &state)
|
||||||
opts.present = false;
|
opts.present = false;
|
||||||
opts.history = true;
|
opts.history = true;
|
||||||
opts.appendix.reset(dbs::appendix::ROOM_HEAD);
|
opts.appendix.reset(dbs::appendix::ROOM_HEAD);
|
||||||
opts.appendix.reset(dbs::appendix::ROOM_HEAD_REFS);
|
opts.appendix.reset(dbs::appendix::ROOM_HEAD_RESOLVE);
|
||||||
|
|
||||||
int64_t depth{0};
|
int64_t depth{0};
|
||||||
for(; it; ++it)
|
for(; it; ++it)
|
||||||
|
|
|
@ -11728,7 +11728,7 @@ console_cmd__fed__backfill(opt &out, const string_view &line)
|
||||||
m::vm::opts vmopts;
|
m::vm::opts vmopts;
|
||||||
vmopts.non_conform.set(m::event::conforms::MISSING_PREV_STATE);
|
vmopts.non_conform.set(m::event::conforms::MISSING_PREV_STATE);
|
||||||
vmopts.room_head = false;
|
vmopts.room_head = false;
|
||||||
vmopts.room_refs = true;
|
vmopts.room_head_resolve = true;
|
||||||
vmopts.fetch_prev_check = false;
|
vmopts.fetch_prev_check = false;
|
||||||
vmopts.fetch_state_check = false;
|
vmopts.fetch_state_check = false;
|
||||||
char rembuf[256];
|
char rembuf[256];
|
||||||
|
|
|
@ -845,7 +845,7 @@ ircd::m::vm::write_append(eval &eval,
|
||||||
wopts.present = opts.present;
|
wopts.present = opts.present;
|
||||||
wopts.history = opts.history;
|
wopts.history = opts.history;
|
||||||
wopts.appendix.set(dbs::appendix::ROOM_HEAD, opts.room_head);
|
wopts.appendix.set(dbs::appendix::ROOM_HEAD, opts.room_head);
|
||||||
wopts.appendix.set(dbs::appendix::ROOM_HEAD_REFS, opts.room_refs);
|
wopts.appendix.set(dbs::appendix::ROOM_HEAD_RESOLVE, opts.room_head_resolve);
|
||||||
wopts.json_source = opts.json_source;
|
wopts.json_source = opts.json_source;
|
||||||
wopts.event_idx = eval.sequence;
|
wopts.event_idx = eval.sequence;
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue