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:
parent
b39676f85a
commit
fb8e3de485
1 changed files with 28 additions and 11 deletions
|
@ -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);
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue