mirror of
https://github.com/matrix-construct/construct
synced 2024-12-26 15:33:54 +01:00
modules/console: Add room top command.
This commit is contained in:
parent
02bc9032e8
commit
a91c4314d4
1 changed files with 24 additions and 0 deletions
|
@ -2024,6 +2024,30 @@ console_cmd__rooms(opt &out, const string_view &line)
|
|||
// room
|
||||
//
|
||||
|
||||
bool
|
||||
console_cmd__room__top(opt &out, const string_view &line)
|
||||
{
|
||||
const params param{line, " ",
|
||||
{
|
||||
"room_id",
|
||||
}};
|
||||
|
||||
const auto &room_id
|
||||
{
|
||||
m::room_id(param.at(0))
|
||||
};
|
||||
|
||||
const auto top
|
||||
{
|
||||
m::top(std::nothrow, room_id)
|
||||
};
|
||||
|
||||
out << "idx: " << std::get<m::event::idx>(top) << std::endl;
|
||||
out << "depth: " << std::get<int64_t>(top) << std::endl;
|
||||
out << "event: " << std::get<m::event::id::buf>(top) << std::endl;
|
||||
return true;
|
||||
}
|
||||
|
||||
bool
|
||||
console_cmd__room__head(opt &out, const string_view &line)
|
||||
{
|
||||
|
|
Loading…
Reference in a new issue