mirror of
https://github.com/matrix-construct/construct
synced 2024-11-16 15:00:51 +01:00
modules/console: Add node key cmd for single key.
This commit is contained in:
parent
08fd63bf35
commit
b2badad065
1 changed files with 33 additions and 0 deletions
|
@ -3682,6 +3682,39 @@ console_cmd__node__keys(opt &out, const string_view &line)
|
|||
return true;
|
||||
}
|
||||
|
||||
bool
|
||||
console_cmd__node__key(opt &out, const string_view &line)
|
||||
{
|
||||
const params param{line, " ",
|
||||
{
|
||||
"node_id", "key_id"
|
||||
}};
|
||||
|
||||
const m::node &node
|
||||
{
|
||||
param.at(0)
|
||||
};
|
||||
|
||||
const auto &key_id
|
||||
{
|
||||
param[1]
|
||||
};
|
||||
|
||||
const m::node::room node_room{node};
|
||||
node_room.get("ircd.key", [&out]
|
||||
(const m::event &event)
|
||||
{
|
||||
const m::keys key
|
||||
{
|
||||
json::get<"content"_>(event)
|
||||
};
|
||||
|
||||
out << key << std::endl;
|
||||
});
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
//
|
||||
// feds
|
||||
//
|
||||
|
|
Loading…
Reference in a new issue