mirror of
https://github.com/matrix-construct/construct
synced 2025-03-14 05:20:17 +01:00
modules/m_presence: Canonize the user_id mismatch check.
This commit is contained in:
parent
a6b4bc976f
commit
e1b6ff3838
1 changed files with 9 additions and 0 deletions
|
@ -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
|
||||
|
|
Loading…
Add table
Reference in a new issue