From c0009a074518af01cd0310d694b415cc37b6997a Mon Sep 17 00:00:00 2001 From: Jason Volk Date: Thu, 28 Feb 2019 14:19:44 -0800 Subject: [PATCH] ircd::m: Add central linkage for is_complete(room). --- include/ircd/m/room/messages.h | 3 +++ ircd/m.cc | 13 +++++++++++++ modules/m_room.cc | 7 +++---- 3 files changed, 19 insertions(+), 4 deletions(-) diff --git a/include/ircd/m/room/messages.h b/include/ircd/m/room/messages.h index c58e40d28..cafa6baf1 100644 --- a/include/ircd/m/room/messages.h +++ b/include/ircd/m/room/messages.h @@ -20,6 +20,9 @@ namespace ircd::m size_t count_since(const room &, const m::event::id &, const m::event::id &); size_t count_since(const m::event::idx &, const m::event::idx &); size_t count_since(const m::event::id &, const m::event::id &); + + // [GET] Check if fully acquired locally + std::pair is_complete(const room &); } /// Interface to room messages diff --git a/ircd/m.cc b/ircd/m.cc index a565c2703..16b1af9b3 100644 --- a/ircd/m.cc +++ b/ircd/m.cc @@ -3719,6 +3719,19 @@ ircd::m::commit(const room &room, return eval.event_id; } +std::pair +ircd::m::is_complete(const room &r) +{ + using prototype = std::pair (const room &); + + static mods::import call + { + "m_room", "ircd::m::is_complete" + }; + + return call(r); +} + size_t ircd::m::count_since(const m::event::id &a, const m::event::id &b) diff --git a/modules/m_room.cc b/modules/m_room.cc index 40f961ee1..a5044de7a 100644 --- a/modules/m_room.cc +++ b/modules/m_room.cc @@ -298,11 +298,10 @@ make_prev__buf(const m::room &room, }; } -extern "C" std::pair -is_complete(const m::room &room) +std::pair +IRCD_MODULE_EXPORT +ircd::m::is_complete(const room &room) { - using namespace ircd::m; - static const event::keys::include fkeys { "depth"