mirror of
https://github.com/matrix-construct/construct
synced 2024-11-26 00:32:35 +01:00
ircd:Ⓜ️ Add central linkage for is_complete(room).
This commit is contained in:
parent
43b8ea9de7
commit
c0009a0745
3 changed files with 19 additions and 4 deletions
|
@ -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<bool, int64_t> is_complete(const room &);
|
||||
}
|
||||
|
||||
/// Interface to room messages
|
||||
|
|
13
ircd/m.cc
13
ircd/m.cc
|
@ -3719,6 +3719,19 @@ ircd::m::commit(const room &room,
|
|||
return eval.event_id;
|
||||
}
|
||||
|
||||
std::pair<bool, int64_t>
|
||||
ircd::m::is_complete(const room &r)
|
||||
{
|
||||
using prototype = std::pair<bool, int64_t> (const room &);
|
||||
|
||||
static mods::import<prototype> 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)
|
||||
|
|
|
@ -298,11 +298,10 @@ make_prev__buf(const m::room &room,
|
|||
};
|
||||
}
|
||||
|
||||
extern "C" std::pair<bool, int64_t>
|
||||
is_complete(const m::room &room)
|
||||
std::pair<bool, int64_t>
|
||||
IRCD_MODULE_EXPORT
|
||||
ircd::m::is_complete(const room &room)
|
||||
{
|
||||
using namespace ircd::m;
|
||||
|
||||
static const event::keys::include fkeys
|
||||
{
|
||||
"depth"
|
||||
|
|
Loading…
Reference in a new issue