0
0
Fork 0
mirror of https://github.com/matrix-construct/construct synced 2024-06-16 08:58:20 +02:00

modules/m_room: Make notification count iteration upper bound exclusive.

modules/m_user: Make highlight count iteration exclusive.
This commit is contained in:
Jason Volk 2019-03-27 23:55:14 -07:00
parent 0e6e556d50
commit be9bee5968
2 changed files with 2 additions and 2 deletions

View file

@ -84,7 +84,7 @@ ircd::m::count_since(const m::room &room,
size_t ret{0};
// Hit the iterator once first otherwise the count will always increment
// to `1` erroneously when it ought to show `0`.
for(++it; it && it.event_idx() <= b; ++it, ++ret);
for(++it; it && it.event_idx() < b; ++it, ++ret);
return ret;
}

View file

@ -112,7 +112,7 @@ highlighted_count__between(const user &user,
};
size_t ret{0};
for(++it; it && it.event_idx() <= b; ++it)
for(++it; it && it.event_idx() < b; ++it)
{
const event &event{*it};
ret += highlighted_event(event, user);