mirror of
https://github.com/matrix-construct/construct
synced 2024-11-29 18:22:50 +01:00
modules/client/rooms/join: Throw error rather than returning empty event_id.
modules/client/rooms/join: Minor simplify. modules/client/rooms/join: Use room room_version in event eval opts.
This commit is contained in:
parent
6f7949eb2c
commit
bb7cf992ae
1 changed files with 18 additions and 11 deletions
|
@ -251,8 +251,8 @@ ircd::m::room::bootstrap(const m::room::id &room_id,
|
|||
bootstrap_make_join(host, room_id, user_id)
|
||||
};
|
||||
|
||||
assert(event_id);
|
||||
bootstrap(event_id, host); // asynchronous; returns quickly
|
||||
|
||||
return event_id;
|
||||
}
|
||||
|
||||
|
@ -643,6 +643,11 @@ try
|
|||
request.in.content
|
||||
};
|
||||
|
||||
const json::string &room_version
|
||||
{
|
||||
response.get("room_version", "1")
|
||||
};
|
||||
|
||||
const json::object &proto
|
||||
{
|
||||
response.at("event")
|
||||
|
@ -712,19 +717,21 @@ try
|
|||
|
||||
m::vm::copts vmopts;
|
||||
vmopts.infolog_accept = true;
|
||||
vmopts.fetch_auth_check = false;
|
||||
vmopts.fetch_state_check = false;
|
||||
vmopts.fetch_prev_check = false;
|
||||
vmopts.fetch = false;
|
||||
vmopts.eval = false;
|
||||
const m::event::id::buf event_id
|
||||
vmopts.room_version = room_version;
|
||||
const m::event::id::buf ret{vm::eval
|
||||
{
|
||||
m::vm::eval
|
||||
{
|
||||
event, content, vmopts
|
||||
}
|
||||
};
|
||||
event, content, vmopts
|
||||
}};
|
||||
|
||||
return event_id;
|
||||
if(unlikely(!ret))
|
||||
throw m::UNAVAILABLE
|
||||
{
|
||||
"Unknown error"
|
||||
};
|
||||
|
||||
return ret;
|
||||
}
|
||||
catch(const std::exception &e)
|
||||
{
|
||||
|
|
Loading…
Reference in a new issue