modules/console: Add well_known matrix client diagnostic.

This commit is contained in:
Jason Volk 2023-04-25 17:51:18 -07:00
parent 62a1c850cc
commit 5f0b98e5d1
1 changed files with 29 additions and 0 deletions

View File

@ -18476,6 +18476,35 @@ console_cmd__well_known__matrix__server(opt &out, const string_view &line)
return true;
}
bool
console_cmd__well_known__matrix__client(opt &out, const string_view &line)
{
const params param{line, " ",
{
"remote"
}};
const fmt::bsprintf<512> url
{
"https://%s/.well-known/matrix/client",
param.at("remote"),
};
char buf[1024];
const json::object response
{
rest::get
{
buf, string_view{url}
}
};
out
<< string_view{response}
<< std::endl;
return true;
}
//
// bridge
//