move threepid checker to config, add missing yields

This commit is contained in:
Neil Johnson 2018-08-31 17:11:11 +01:00
parent e8e540630e
commit 0b01281e77
6 changed files with 41 additions and 21 deletions

View file

@ -219,17 +219,3 @@ class MonthlyActiveUsersStore(SQLBaseStore):
yield self.upsert_monthly_active_user(user_id)
elif now - last_seen_timestamp > LAST_SEEN_GRANULARITY:
yield self.upsert_monthly_active_user(user_id)
def is_threepid_reserved(self, threepid):
"""Check the threepid against the reserved threepid config
Args:
threepid(dict) - The threepid to test for
Returns:
boolean Is the threepid undertest reserved_user
"""
for tp in self.hs.config.mau_limits_reserved_threepids:
if (threepid['medium'] == tp['medium']
and threepid['address'] == tp['address']):
return True
else:
return False