summary refs log tree commit diff
path: root/synapse
diff options
context:
space:
mode:
authorNeil Johnson <neil@matrix.org>2018-09-06 17:45:55 +0100
committerGitHub <noreply@github.com>2018-09-06 17:45:55 +0100
commitc5440b2ca0342b76a393d895483ef76b3ff58bd9 (patch)
tree802d7f519bb1b6d485c81da683165864e6df2bd5 /synapse
parentMerge pull request #3805 from matrix-org/erikj/limit_transaction_pdus_edus (diff)
parentensure guests never enter mau list (diff)
downloadsynapse-c5440b2ca0342b76a393d895483ef76b3ff58bd9.tar.xz
Merge pull request #3800 from matrix-org/neilj/remove-guests-from-mau-count hhs-6
guest users should not be part of mau total
Diffstat (limited to 'synapse')
-rw-r--r--synapse/storage/monthly_active_users.py6
1 files changed, 5 insertions, 1 deletions
diff --git a/synapse/storage/monthly_active_users.py b/synapse/storage/monthly_active_users.py
index c7899d7fd2..b890c152db 100644
--- a/synapse/storage/monthly_active_users.py
+++ b/synapse/storage/monthly_active_users.py
@@ -199,10 +199,14 @@ class MonthlyActiveUsersStore(SQLBaseStore):
         Args:
             user_id(str): the user_id to query
         """
+
         if self.hs.config.limit_usage_by_mau:
+            # Trial users and guests should not be included as part of MAU group
+            is_guest = yield self.is_guest(user_id)
+            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.
                 return
 
             last_seen_timestamp = yield self.user_last_seen_monthly_active(user_id)