0
0
Fork 0
mirror of https://github.com/matrix-construct/construct synced 2024-06-16 08:58:20 +02:00

modules/console: Add room top command.

This commit is contained in:
Jason Volk 2018-04-18 15:05:15 -07:00
parent 02bc9032e8
commit a91c4314d4

View file

@ -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)
{