mirror of
https://github.com/matrix-construct/construct
synced 2024-12-28 00:14:07 +01:00
ircd:Ⓜ️:vm: Add json::array eval ctor.
This commit is contained in:
parent
bb68dfc1e7
commit
70c901a894
2 changed files with 17 additions and 2 deletions
|
@ -49,13 +49,18 @@ struct ircd::m::vm::eval
|
||||||
|
|
||||||
uint64_t id {++id_ctr};
|
uint64_t id {++id_ctr};
|
||||||
ctx::ctx *ctx {ctx::current};
|
ctx::ctx *ctx {ctx::current};
|
||||||
|
|
||||||
const vm::opts *opts {&default_opts};
|
const vm::opts *opts {&default_opts};
|
||||||
const vm::copts *copts {nullptr};
|
const vm::copts *copts {nullptr};
|
||||||
|
|
||||||
|
uint64_t sequence {0};
|
||||||
|
db::txn *txn {nullptr};
|
||||||
|
|
||||||
string_view room_id;
|
string_view room_id;
|
||||||
const json::iov *issue {nullptr};
|
const json::iov *issue {nullptr};
|
||||||
const event *event_ {nullptr};
|
const event *event_ {nullptr};
|
||||||
uint64_t sequence {0};
|
json::array pdus;
|
||||||
db::txn *txn {nullptr};
|
|
||||||
event::id::buf event_id;
|
event::id::buf event_id;
|
||||||
|
|
||||||
public:
|
public:
|
||||||
|
@ -68,6 +73,7 @@ struct ircd::m::vm::eval
|
||||||
eval(const vm::opts &);
|
eval(const vm::opts &);
|
||||||
eval(const vm::copts &);
|
eval(const vm::copts &);
|
||||||
eval(const event &, const vm::opts & = default_opts);
|
eval(const event &, const vm::opts & = default_opts);
|
||||||
|
eval(const json::array &event, const vm::opts & = default_opts);
|
||||||
eval(json::iov &event, const json::iov &content, const vm::copts & = default_copts);
|
eval(json::iov &event, const json::iov &content, const vm::copts & = default_copts);
|
||||||
eval(const room &, json::iov &event, const json::iov &content);
|
eval(const room &, json::iov &event, const json::iov &content);
|
||||||
eval() = default;
|
eval() = default;
|
||||||
|
|
|
@ -999,6 +999,15 @@ ircd::m::vm::eval::eval(const event &event,
|
||||||
operator()(event);
|
operator()(event);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
ircd::m::vm::eval::eval(const json::array &event,
|
||||||
|
const vm::opts &opts)
|
||||||
|
:opts{&opts}
|
||||||
|
,pdus{event}
|
||||||
|
{
|
||||||
|
for(const json::object &pdu : this->pdus)
|
||||||
|
operator()(pdu);
|
||||||
|
}
|
||||||
|
|
||||||
ircd::m::vm::eval::eval(const vm::copts &opts)
|
ircd::m::vm::eval::eval(const vm::copts &opts)
|
||||||
:opts{&opts}
|
:opts{&opts}
|
||||||
,copts{&opts}
|
,copts{&opts}
|
||||||
|
|
Loading…
Reference in a new issue