0
0
Fork 0
mirror of https://github.com/matrix-construct/construct synced 2024-12-28 08:24:08 +01:00

ircd:Ⓜ️:event: Add explicit event::id conversion.

This commit is contained in:
Jason Volk 2019-06-01 18:30:53 -07:00
parent 0772e462bb
commit dd49243224

View file

@ -131,6 +131,8 @@ struct ircd::m::event
json::object source; // Contextual availability only.
explicit operator id() const;
using super_type::tuple;
event(const json::object &);
event(const json::object &, const keys &);
@ -150,3 +152,12 @@ struct ircd::m::event
#include "conforms.h"
#include "append.h"
#include "pretty.h"
inline ircd::m::event::operator
id()
const
{
return json::get<"event_id"_>(*this)?
id{json::get<"event_id"_>(*this)}:
id{};
}