guest users should not be part of mau total

This commit is contained in:
Neil Johnson 2018-09-05 22:30:36 +01:00
parent dfba1d843d
commit 61b05727fa
2 changed files with 48 additions and 3 deletions

View file

@ -192,14 +192,19 @@ class MonthlyActiveUsersStore(SQLBaseStore):
))
@defer.inlineCallbacks
def populate_monthly_active_users(self, user_id):
def populate_monthly_active_users(self, user_id, is_guest=False):
"""Checks on the state of monthly active user limits and optionally
add the user to the monthly active tables
Args:
user_id(str): the user_id to query
"""
if self.hs.config.limit_usage_by_mau:
# Guests should not be included as part of MAU group
if is_guest:
return
is_trial = yield self.is_trial_user(user_id)
if is_trial:
# we don't track trial users in the MAU table.