0
0
Fork 0
mirror of https://github.com/matrix-construct/construct synced 2024-11-29 10:12:39 +01:00

ircd:Ⓜ️:fed::event: Minor cleanup.

This commit is contained in:
Jason Volk 2019-08-29 18:27:08 -07:00
parent b39676f85a
commit fb8e3de485

View file

@ -21,17 +21,8 @@ struct ircd::m::v1::event
{
struct opts;
explicit operator json::object() const
{
const json::object object{in.content};
const json::array pdus{object.at("pdus")};
return pdus.at(0);
}
explicit operator m::event() const
{
return json::object{*this};
}
explicit operator json::object() const;
explicit operator m::event() const;
event(const m::event::id &, const mutable_buffer &, opts);
event() = default;
@ -46,3 +37,29 @@ struct ircd::m::v1::event::opts
const struct server::request::opts *sopts {nullptr};
bool dynamic {false};
};
inline
ircd::m::v1::event::operator
ircd::m::event()
const
{
return json::object{*this};
}
inline
ircd::m::v1::event::operator
ircd::json::object()
const
{
const json::object object
{
in.content
};
const json::array pdus
{
object.at("pdus")
};
return pdus.at(0);
}