mirror of
https://github.com/matrix-construct/construct
synced 2024-11-26 16:52:44 +01:00
modules/console: Show expiration time in cache list; improve output.
This commit is contained in:
parent
7b32e8bbad
commit
602e4bb5c3
1 changed files with 23 additions and 1 deletions
|
@ -8047,10 +8047,32 @@ console_cmd__room__alias__cache(opt &out, const string_view &line)
|
|||
param["server"]
|
||||
};
|
||||
|
||||
out
|
||||
<< std::left << std::setw(40) << "EXPIRES"
|
||||
<< " " << std::left << std::setw(48) << "ROOM ALIAS"
|
||||
<< " " << std::left << std::setw(48) << "ROOM ID"
|
||||
<< std::endl;
|
||||
|
||||
m::room::aliases::cache::for_each(server, [&out]
|
||||
(const m::room::alias &alias, const m::room::id &room_id)
|
||||
{
|
||||
out << std::left << std::setw(40) << alias << " " << room_id << std::endl;
|
||||
const auto expire_point
|
||||
{
|
||||
m::room::aliases::cache::expires(alias)
|
||||
};
|
||||
|
||||
char buf[48];
|
||||
const auto expires
|
||||
{
|
||||
timef(buf, expire_point, ircd::localtime)
|
||||
};
|
||||
|
||||
out
|
||||
<< std::left << std::setw(40) << expires
|
||||
<< " " << std::left << std::setw(48) << alias
|
||||
<< " " << std::left << std::setw(48) << room_id
|
||||
<< std::endl;
|
||||
|
||||
return true;
|
||||
});
|
||||
|
||||
|
|
Loading…
Reference in a new issue