mirror of
https://github.com/matrix-construct/construct
synced 2025-01-23 04:50:00 +01:00
modules/console: Add fed invite diagnostic cmd.
This commit is contained in:
parent
a7211b6a02
commit
f4747d96ff
1 changed files with 56 additions and 0 deletions
|
@ -15740,6 +15740,62 @@ console_cmd__fed__join(opt &out, const string_view &line)
|
|||
return true;
|
||||
}
|
||||
|
||||
bool
|
||||
console_cmd__fed__invite(opt &out, const string_view &line)
|
||||
{
|
||||
const params param{line, " ",
|
||||
{
|
||||
"event_id", "remote", "op", "oparg"
|
||||
}};
|
||||
|
||||
const m::event::id &event_id
|
||||
{
|
||||
param.at("event_id")
|
||||
};
|
||||
|
||||
const string_view remote
|
||||
{
|
||||
param.at("remote")
|
||||
};
|
||||
|
||||
const string_view &op
|
||||
{
|
||||
param["op"]
|
||||
};
|
||||
|
||||
const m::event::fetch event
|
||||
{
|
||||
event_id
|
||||
};
|
||||
|
||||
const unique_buffer<mutable_buffer> buf
|
||||
{
|
||||
16_KiB
|
||||
};
|
||||
|
||||
m::fed::invite2::opts opts;
|
||||
opts.remote = remote;
|
||||
m::fed::invite2 request
|
||||
{
|
||||
at<"room_id"_>(event),
|
||||
event_id,
|
||||
event.source,
|
||||
buf,
|
||||
std::move(opts),
|
||||
};
|
||||
|
||||
request.get(out.timeout);
|
||||
const json::object response
|
||||
{
|
||||
request
|
||||
};
|
||||
|
||||
out
|
||||
<< string_view{response}
|
||||
<< std::endl;
|
||||
return true;
|
||||
}
|
||||
|
||||
bool
|
||||
console_cmd__fed__state(opt &out, const string_view &line)
|
||||
{
|
||||
|
|
Loading…
Add table
Reference in a new issue