0
0
Fork 0
mirror of https://github.com/matrix-construct/construct synced 2024-12-25 15:04:10 +01:00

modules/m_event_append: Assertions that event being appended has fundamental fields.

This commit is contained in:
Jason Volk 2019-08-09 21:17:23 -07:00
parent 64a5eec565
commit 6d4acdd01a

View file

@ -125,6 +125,14 @@ ircd::m::event::append::append(json::stack::object &object,
};
#endif
// Assertions that the event being appended has some required fields. This
// is a central butt-end test of data coming through the system to here.
assert(event.event_id);
assert(defined(json::get<"type"_>(event)));
assert(defined(json::get<"sender"_>(event)));
//assert(json::get<"origin_server_ts"_>(event));
//assert(json::get<"origin_server_ts"_>(event) != json::undefined_number);
if(has_event_idx && !defined(json::get<"state_key"_>(event)) && m::redacted(*opts.event_idx))
{
log::debug