diff --git a/modules/m_room.cc b/modules/m_room.cc index 8c131de57..4609a5527 100644 --- a/modules/m_room.cc +++ b/modules/m_room.cc @@ -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; } diff --git a/modules/m_user.cc b/modules/m_user.cc index 1ceb6cbc6..c4d8e5011 100644 --- a/modules/m_user.cc +++ b/modules/m_user.cc @@ -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);