mirror of
https://github.com/matrix-construct/construct
synced 2025-02-16 16:50:12 +01:00
modules/m_room_bootstrap: Simplify event_id check and return.
This commit is contained in:
parent
3e163d842c
commit
7481f55869
1 changed files with 3 additions and 8 deletions
|
@ -762,23 +762,18 @@ try
|
||||||
vmopts.eval = false;
|
vmopts.eval = false;
|
||||||
vmopts.user_id = user_id;
|
vmopts.user_id = user_id;
|
||||||
vmopts.room_version = room_version;
|
vmopts.room_version = room_version;
|
||||||
vm::eval eval
|
const vm::eval eval
|
||||||
{
|
{
|
||||||
event, content, vmopts
|
event, content, vmopts
|
||||||
};
|
};
|
||||||
|
|
||||||
const m::event::id::buf &ret
|
if(unlikely(!eval.event_id))
|
||||||
{
|
|
||||||
eval
|
|
||||||
};
|
|
||||||
|
|
||||||
if(unlikely(!ret))
|
|
||||||
throw m::UNAVAILABLE
|
throw m::UNAVAILABLE
|
||||||
{
|
{
|
||||||
"Unknown error"
|
"Unknown error"
|
||||||
};
|
};
|
||||||
|
|
||||||
return ret;
|
return eval.event_id;
|
||||||
}
|
}
|
||||||
catch(const std::exception &e)
|
catch(const std::exception &e)
|
||||||
{
|
{
|
||||||
|
|
Loading…
Add table
Reference in a new issue