0
0
Fork 0
mirror of https://github.com/matrix-construct/construct synced 2024-09-30 04:38:52 +02:00

modules/client/sync: Fix index minmax for stable notification counting.

This commit is contained in:
Jason Volk 2018-09-27 00:59:17 -07:00
parent 2c054ec9ca
commit d5c3724428

View file

@ -1209,7 +1209,7 @@ ircd::m::sync::highlight_count(const room &r,
"m_user", "highlighted_count__between"
};
return count(u, r, std::min(a, b), std::max(a, b));
return count(u, r, a, a < b? b : a);
}
long
@ -1217,5 +1217,5 @@ ircd::m::sync::notification_count(const room &room,
const event::idx &a,
const event::idx &b)
{
return m::count_since(room, std::min(a, b), std::max(a, b));
return m::count_since(room, a, a < b? b : a);
}