diff --git a/include/ircd/m/room.h b/include/ircd/m/room.h index b1ee4c85c..82d2ed238 100644 --- a/include/ircd/m/room.h +++ b/include/ircd/m/room.h @@ -43,6 +43,10 @@ namespace ircd::m id::event::buf head(std::nothrow_t, const id::room &); id::event::buf head(const id::room &); + // [GET] Current Event idx (non-locking) (one only) + event::idx head_idx(std::nothrow_t, const id::room &); + event::idx head_idx(const id::room &); + // [GET] Current Event depth (non-locking) (one only) int64_t depth(std::nothrow_t, const id::room &); int64_t depth(const id::room &); diff --git a/ircd/m/room.cc b/ircd/m/room.cc index 570c40e1c..9d1e28e75 100644 --- a/ircd/m/room.cc +++ b/ircd/m/room.cc @@ -23,6 +23,19 @@ ircd::m::depth(std::nothrow_t, return std::get(top(std::nothrow, room_id)); } +ircd::m::event::idx +ircd::m::head_idx(const id::room &room_id) +{ + return std::get(top(room_id)); +} + +ircd::m::event::idx +ircd::m::head_idx(std::nothrow_t, + const id::room &room_id) +{ + return std::get(top(std::nothrow, room_id)); +} + ircd::m::event::id::buf ircd::m::head(const id::room &room_id) {