0
0
Fork 0
mirror of https://github.com/matrix-construct/construct synced 2024-11-29 18:22:50 +01:00

modules/client/rooms/join: Process send_join response events.

This commit is contained in:
Jason Volk 2019-06-04 22:41:59 -07:00
parent 2c2ea2a668
commit 1a48bc3899

View file

@ -291,10 +291,63 @@ bootstrap(const string_view &host,
sj.wait(seconds(send_join_timeout));
const auto sjcode
const auto sj_code
{
sj.get()
};
const json::array &sj_response
{
sj
};
const uint more_sj_code
{
sj_response.at<uint>(0)
};
const json::object &sj_response_content
{
sj_response[1]
};
const json::string &their_origin
{
sj_response_content["origin"]
};
// Process auth_chain
{
m::vm::opts opts;
opts.infolog_accept = true;
opts.fetch = false;
const json::array &auth_chain
{
sj_response_content["auth_chain"]
};
m::vm::eval
{
auth_chain, opts
};
}
// Process state
{
m::vm::opts opts;
opts.fetch = false;
const json::array &state
{
sj_response_content["state"]
};
m::vm::eval
{
state, opts
};
}
return event_id;
}