summary refs log tree commit diff
path: root/synapse/storage/monthly_active_users.py
diff options
context:
space:
mode:
authorNeil Johnson <neil@fragile.org.uk>2018-09-05 22:30:36 +0100
committerNeil Johnson <neil@fragile.org.uk>2018-09-05 22:30:36 +0100
commit61b05727fa6ba879f507d13ff40c0197916ef795 (patch)
tree3dfe928bd92ffe2ac8060f94b9b2f39387795882 /synapse/storage/monthly_active_users.py
parentMerge pull request #3790 from matrix-org/rav/respect_event_format_in_filter (diff)
downloadsynapse-61b05727fa6ba879f507d13ff40c0197916ef795.tar.xz
guest users should not be part of mau total
Diffstat (limited to 'synapse/storage/monthly_active_users.py')
-rw-r--r--synapse/storage/monthly_active_users.py7
1 files changed, 6 insertions, 1 deletions
diff --git a/synapse/storage/monthly_active_users.py b/synapse/storage/monthly_active_users.py
index c7899d7fd2..e34e16c079 100644
--- a/synapse/storage/monthly_active_users.py
+++ b/synapse/storage/monthly_active_users.py
@@ -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.