Skip to content

Commit

Permalink
coffee: do not report stats on people who are not in the room
Browse files Browse the repository at this point in the history
  • Loading branch information
adriaandegroot committed Jan 14, 2022
1 parent 594a7fd commit c6983b1
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions src/coffee.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -96,8 +96,14 @@ class Coffee::Private

void stats(Bot* bot)
{
const auto roomUsers = bot->userIds();
for (const auto& u : m_stats)
{
if (!roomUsers.contains(u.m_user))
{
// We have data on a user, but they are no longer in the room
continue;
}
QStringList info{u.m_user};
if (u.m_coffee > 0)
{
Expand Down

0 comments on commit c6983b1

Please sign in to comment.