mirror of
https://github.com/matrix-construct/construct
synced 2024-09-27 11:18:51 +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:
parent
0e6e556d50
commit
be9bee5968
2 changed files with 2 additions and 2 deletions
|
@ -84,7 +84,7 @@ ircd::m::count_since(const m::room &room,
|
||||||
size_t ret{0};
|
size_t ret{0};
|
||||||
// Hit the iterator once first otherwise the count will always increment
|
// Hit the iterator once first otherwise the count will always increment
|
||||||
// to `1` erroneously when it ought to show `0`.
|
// 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;
|
return ret;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -112,7 +112,7 @@ highlighted_count__between(const user &user,
|
||||||
};
|
};
|
||||||
|
|
||||||
size_t ret{0};
|
size_t ret{0};
|
||||||
for(++it; it && it.event_idx() <= b; ++it)
|
for(++it; it && it.event_idx() < b; ++it)
|
||||||
{
|
{
|
||||||
const event &event{*it};
|
const event &event{*it};
|
||||||
ret += highlighted_event(event, user);
|
ret += highlighted_event(event, user);
|
||||||
|
|
Loading…
Reference in a new issue