0
0
Fork 0
mirror of https://github.com/matrix-construct/construct synced 2024-12-25 23:14:13 +01:00

modules/m_relation: Fix failure to obtain event_id from m.in_reply_to competing format.

This commit is contained in:
Jason Volk 2020-05-12 03:06:56 -07:00
parent b2bb4b1be6
commit de0b1d9b33

View file

@ -75,9 +75,16 @@ try
if(!m_relates_to || json::type(m_relates_to) != json::OBJECT)
return;
const event::id &event_id
const json::object &m_in_reply_to
{
m_relates_to.get<json::string>("event_id")
content["m.in_reply_to"]
};
const m::event::id &event_id
{
json::type(m_in_reply_to, std::nothrow) == json::OBJECT?
m_in_reply_to.get<json::string>("event_id"):
m_relates_to.get<json::string>("event_id")
};
// If the relates_to is a prev_event then the vm::fetch unit will perform