0
0
Fork 0
mirror of https://github.com/matrix-construct/construct synced 2024-06-02 01:59:33 +02:00

modules/m_presence: Canonize the user_id mismatch check.

This commit is contained in:
Jason Volk 2018-09-04 23:05:05 -07:00
parent a6b4bc976f
commit e1b6ff3838

View file

@ -102,6 +102,15 @@ try
m::presence::get(std::nothrow, user_id, [&event, &object, &useful]
(const m::event &existing_event, const json::object &existing_object)
{
// This check shouldn't have to exist. I think this was a result of corrupting
// my DB during development and it fails on only one user. Nevertheless, it's
// a valid assertion so might as well keep it.
if(unlikely(json::get<"user_id"_>(object) != unquote(existing_object.get("user_id"))))
{
//log::critical("%s != %s", json::get<"user_id"_>(object), unquote(existing_object.get("user_id")));
return;
}
assert(json::get<"user_id"_>(object) == unquote(existing_object.get("user_id")));
const auto &prev_active_ago