diff --git a/include/ircd/m/room/events.h b/include/ircd/m/room/events.h index 721205b7a..cced78373 100644 --- a/include/ircd/m/room/events.h +++ b/include/ircd/m/room/events.h @@ -21,10 +21,6 @@ /// struct ircd::m::room::events { - struct sounding; - struct missing; - struct horizon; - static conf::item viewport_size; m::room room; diff --git a/include/ircd/m/room/events_horizon.h b/include/ircd/m/room/horizon.h similarity index 92% rename from include/ircd/m/room/events_horizon.h rename to include/ircd/m/room/horizon.h index 4a8554d32..d3f97e6e9 100644 --- a/include/ircd/m/room/events_horizon.h +++ b/include/ircd/m/room/horizon.h @@ -9,14 +9,14 @@ // full license for this software is available in the LICENSE file. #pragma once -#define HAVE_IRCD_M_ROOM_EVENTS_HORIZON_H +#define HAVE_IRCD_M_ROOM_HORIZON_H /// Find missing room events. This is an interface to the event-horizon for /// this room. The event horizon is keyed by event_id and the value is the /// event::idx of the event referencing it. There can be multiple entries for /// an event_id. The closure is also invoked with the depth of the referencer. /// -struct ircd::m::room::events::horizon +struct ircd::m::room::horizon { using closure = util::function_bool < diff --git a/include/ircd/m/room/events_missing.h b/include/ircd/m/room/missing.h similarity index 94% rename from include/ircd/m/room/events_missing.h rename to include/ircd/m/room/missing.h index c561074ec..297f71ff9 100644 --- a/include/ircd/m/room/events_missing.h +++ b/include/ircd/m/room/missing.h @@ -9,7 +9,7 @@ // full license for this software is available in the LICENSE file. #pragma once -#define HAVE_IRCD_M_ROOM_EVENTS_MISSING_H +#define HAVE_IRCD_M_ROOM_MISSING_H /// Find missing room events. This is a breadth-first iteration of missing /// references from the tophead (or at the event provided in the room arg) @@ -18,7 +18,7 @@ /// to the server, followed by the depth and event::idx of the event making the /// reference. /// -struct ircd::m::room::events::missing +struct ircd::m::room::missing { using closure = util::function_bool < diff --git a/include/ircd/m/room/room.h b/include/ircd/m/room/room.h index 125fe249d..8f52efa58 100644 --- a/include/ircd/m/room/room.h +++ b/include/ircd/m/room/room.h @@ -112,6 +112,9 @@ namespace ircd::m struct ircd::m::room { struct events; + struct missing; + struct horizon; + struct sounding; struct state; struct members; struct origins; @@ -189,9 +192,9 @@ struct ircd::m::room }; #include "events.h" -#include "events_sounding.h" -#include "events_missing.h" -#include "events_horizon.h" +#include "sounding.h" +#include "missing.h" +#include "horizon.h" #include "state.h" #include "state_space.h" #include "state_history.h" diff --git a/include/ircd/m/room/events_sounding.h b/include/ircd/m/room/sounding.h similarity index 96% rename from include/ircd/m/room/events_sounding.h rename to include/ircd/m/room/sounding.h index 9147bad41..875d6556f 100644 --- a/include/ircd/m/room/events_sounding.h +++ b/include/ircd/m/room/sounding.h @@ -9,7 +9,7 @@ // full license for this software is available in the LICENSE file. #pragma once -#define HAVE_IRCD_M_ROOM_EVENTS_SOUNDING_H +#define HAVE_IRCD_M_ROOM_SOUNDING_H // The "viewport" is comprised of events starting from the tophead (most recent // in room timeline) and covering about ~20 events leading up to that. Note @@ -44,7 +44,7 @@ namespace ircd::m /// to calculate backfill requests, etc. This interface is depth-first oriented, /// rather than the breadth-first room::missing interface. /// -struct ircd::m::room::events::sounding +struct ircd::m::room::sounding { using range = std::pair; using closure = util::function_bool diff --git a/matrix/Makefile.am b/matrix/Makefile.am index b4fac72da..062f78f92 100644 --- a/matrix/Makefile.am +++ b/matrix/Makefile.am @@ -109,9 +109,9 @@ libircd_matrix_la_SOURCES += room_aliases.cc libircd_matrix_la_SOURCES += room_bootstrap.cc libircd_matrix_la_SOURCES += room_create.cc libircd_matrix_la_SOURCES += room_events.cc -libircd_matrix_la_SOURCES += room_events_sounding.cc -libircd_matrix_la_SOURCES += room_events_missing.cc -libircd_matrix_la_SOURCES += room_events_horizon.cc +libircd_matrix_la_SOURCES += room_sounding.cc +libircd_matrix_la_SOURCES += room_missing.cc +libircd_matrix_la_SOURCES += room_horizon.cc libircd_matrix_la_SOURCES += room_head.cc libircd_matrix_la_SOURCES += room_head_fetch.cc libircd_matrix_la_SOURCES += room_state_fetch.cc diff --git a/matrix/acquire.cc b/matrix/acquire.cc index 1c77a6283..5ac7c0385 100644 --- a/matrix/acquire.cc +++ b/matrix/acquire.cc @@ -164,7 +164,7 @@ ircd::m::acquire::fetch_history(event::idx &ref_min) if(size_t(depth_range.second - depth_range.first) < opts.viewport_size) depth_range.first -= std::min(long(opts.viewport_size), depth_range.first); - m::room::events::missing missing + m::room::missing missing { opts.room }; diff --git a/matrix/room_events_horizon.cc b/matrix/room_horizon.cc similarity index 92% rename from matrix/room_events_horizon.cc rename to matrix/room_horizon.cc index 596f673f9..f2e0fa39b 100644 --- a/matrix/room_events_horizon.cc +++ b/matrix/room_horizon.cc @@ -15,7 +15,7 @@ namespace ircd::m::dbs } size_t -ircd::m::room::events::horizon::rebuild() +ircd::m::room::horizon::rebuild() { m::dbs::opts opts; opts.appendix.reset(); @@ -54,7 +54,7 @@ ircd::m::room::events::horizon::rebuild() } size_t -ircd::m::room::events::horizon::count() +ircd::m::room::horizon::count() const { size_t ret{0}; @@ -69,7 +69,7 @@ const } bool -ircd::m::room::events::horizon::for_each(const closure &closure) +ircd::m::room::horizon::for_each(const closure &closure) const { const std::function in_room diff --git a/matrix/room_events_missing.cc b/matrix/room_missing.cc similarity index 75% rename from matrix/room_events_missing.cc rename to matrix/room_missing.cc index b615696c1..18ca92c0e 100644 --- a/matrix/room_events_missing.cc +++ b/matrix/room_missing.cc @@ -9,7 +9,7 @@ // full license for this software is available in the LICENSE file. size_t -ircd::m::room::events::missing::count() +ircd::m::room::missing::count() const { size_t ret{0}; @@ -24,15 +24,15 @@ const } bool -ircd::m::room::events::missing::for_each(const closure &closure) +ircd::m::room::missing::for_each(const closure &closure) const { return for_each({0L, 0L}, closure); } bool -ircd::m::room::events::missing::for_each(const pair &depth, - const closure &closure) +ircd::m::room::missing::for_each(const pair &depth, + const closure &closure) const { room::events it @@ -53,8 +53,8 @@ const } bool -ircd::m::room::events::missing::rfor_each(const pair &depth, - const closure &closure) +ircd::m::room::missing::rfor_each(const pair &depth, + const closure &closure) const { room::events it @@ -78,8 +78,8 @@ const } bool -ircd::m::room::events::missing::_each(m::room::events &it, - const closure &closure) +ircd::m::room::missing::_each(m::room::events &it, + const closure &closure) const { const m::event event diff --git a/matrix/room_events_sounding.cc b/matrix/room_sounding.cc similarity index 91% rename from matrix/room_events_sounding.cc rename to matrix/room_sounding.cc index f21c6b451..f3fb1ec7f 100644 --- a/matrix/room_events_sounding.cc +++ b/matrix/room_sounding.cc @@ -43,7 +43,7 @@ ircd::m::twain(const room &room) -1, 0 }; - const room::events::sounding s + const room::sounding s { room }; @@ -66,7 +66,7 @@ ircd::m::sounding(const room &room) -1, 0 }; - const room::events::sounding s + const room::sounding s { room }; @@ -90,7 +90,7 @@ ircd::m::hazard(const room &room) 0, 0 }; - const room::events::sounding s + const room::sounding s { room }; @@ -106,11 +106,11 @@ ircd::m::hazard(const room &room) } // -// room::events::sounding +// room::sounding // bool -ircd::m::room::events::sounding::rfor_each(const closure &closure) +ircd::m::room::sounding::rfor_each(const closure &closure) const { const int64_t depth @@ -155,7 +155,7 @@ const } bool -ircd::m::room::events::sounding::for_each(const closure &closure) +ircd::m::room::sounding::for_each(const closure &closure) const { const int64_t depth diff --git a/modules/console.cc b/modules/console.cc index 6d2df0c97..98db1011e 100644 --- a/modules/console.cc +++ b/modules/console.cc @@ -9415,7 +9415,7 @@ console_cmd__room(opt &out, const string_view &line) out << std::endl; out << "recent missing: " << std::endl; - const m::room::events::missing missing + const m::room::missing missing { room }; @@ -9463,7 +9463,7 @@ console_cmd__room(opt &out, const string_view &line) out << "recent gaps: " << std::endl; size_t gap_count(4); - const m::room::events::sounding gaps + const m::room::sounding gaps { room }; @@ -9832,7 +9832,7 @@ console_cmd__room__depth__gaps(opt &out, const string_view &line) return true; }}; - const m::room::events::sounding gaps + const m::room::sounding gaps { room }; @@ -11310,7 +11310,7 @@ console_cmd__room__events__missing(opt &out, const string_view &line) m::top(room) }; - const m::room::events::missing missing + const m::room::missing missing { room }; @@ -11386,7 +11386,7 @@ console_cmd__room__events__missing__count(opt &out, const string_view &line) room_id, event_id }; - const m::room::events::missing missing + const m::room::missing missing { room }; @@ -11418,7 +11418,7 @@ console_cmd__room__events__horizon(opt &out, const string_view &line) room_id }; - const m::room::events::horizon horizon + const m::room::horizon horizon { room }; @@ -11462,7 +11462,7 @@ console_cmd__room__events__horizon__count(opt &out, const string_view &line) room_id, event_id }; - const m::room::events::horizon horizon + const m::room::horizon horizon { room }; @@ -11489,7 +11489,7 @@ console_cmd__room__events__horizon__rebuild(opt &out, const string_view &line) room_id }; - m::room::events::horizon horizon + m::room::horizon horizon { room };