0
0
Fork 0
mirror of https://github.com/matrix-construct/construct synced 2024-07-04 17:48:35 +02:00

modules/console: Add an eval option to fed event.

This commit is contained in:
Jason Volk 2018-04-07 02:00:30 -07:00
parent ac0d7e9a78
commit e7c7a295c4

View file

@ -2563,6 +2563,11 @@ console_cmd__fed__event(opt &out, const string_view &line)
token(line, ' ', 1, event_id.host())
};
const string_view op
{
token(line, ' ', 2, {})
};
m::v1::event::opts opts;
opts.remote = remote;
const unique_buffer<mutable_buffer> buf
@ -2604,6 +2609,25 @@ console_cmd__fed__event(opt &out, const string_view &line)
if(!conforms.clean())
out << "- " << conforms << std::endl;
if(has(op, "raw"))
out << string_view{response} << std::endl;
if(!has(op, "eval"))
return true;
m::vm::opts vmopts;
vmopts.non_conform.set(m::event::conforms::MISSING_PREV_STATE);
vmopts.non_conform.set(m::event::conforms::MISSING_MEMBERSHIP);
vmopts.prev_check_exists = false;
vmopts.head_must_exist = false;
vmopts.history = false;
vmopts.notify = false;
m::vm::eval eval
{
vmopts
};
eval(event);
return true;
}