mirror of
https://git.anonymousland.org/anonymousland/synapse.git
synced 2025-08-01 15:36:04 -04:00
expose number of real reserved users
This commit is contained in:
parent
b041115415
commit
0ddf486724
3 changed files with 55 additions and 3 deletions
|
@ -146,6 +146,23 @@ class MonthlyActiveUsersStore(SQLBaseStore):
|
|||
return count
|
||||
return self.runInteraction("count_users", _count_users)
|
||||
|
||||
@defer.inlineCallbacks
|
||||
def get_reserved_real_user_account(self):
|
||||
"""Of the reserved threepids defined in config, how many are associated
|
||||
with registered users?
|
||||
|
||||
Returns:
|
||||
Defered[int]: Number of real reserved users
|
||||
"""
|
||||
count = 0
|
||||
for tp in self.hs.config.mau_limits_reserved_threepids:
|
||||
user_id = yield self.hs.get_datastore().get_user_id_by_threepid(
|
||||
tp["medium"], tp["address"]
|
||||
)
|
||||
if user_id:
|
||||
count = count + 1
|
||||
defer.returnValue(count)
|
||||
|
||||
@defer.inlineCallbacks
|
||||
def upsert_monthly_active_user(self, user_id):
|
||||
"""
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue