summary refs log tree commit diff
path: root/synapse/storage/registration.py
diff options
context:
space:
mode:
authorErik Johnston <erikj@jki.re>2017-06-15 13:24:16 +0100
committerGitHub <noreply@github.com>2017-06-15 13:24:16 +0100
commit24df57679521925a16595423d0b37db58668dcd7 (patch)
tree622f89499facd34cd020537659c1e381a8b2533a /synapse/storage/registration.py
parentMerge branch 'release-v0.21.0' of github.com:matrix-org/synapse (diff)
parentBump version and changelog (diff)
downloadsynapse-24df57679521925a16595423d0b37db58668dcd7.tar.xz
Merge pull request #2282 from matrix-org/release-v0.21.1 v0.21.1
Release v0.21.1
Diffstat (limited to 'synapse/storage/registration.py')
-rw-r--r--synapse/storage/registration.py13
1 files changed, 13 insertions, 0 deletions
diff --git a/synapse/storage/registration.py b/synapse/storage/registration.py
index ec2c52ab93..20acd58fcf 100644
--- a/synapse/storage/registration.py
+++ b/synapse/storage/registration.py
@@ -438,6 +438,19 @@ class RegistrationStore(background_updates.BackgroundUpdateStore):
         defer.returnValue(ret)
 
     @defer.inlineCallbacks
+    def count_nonbridged_users(self):
+        def _count_users(txn):
+            txn.execute("""
+                SELECT COALESCE(COUNT(*), 0) FROM users
+                WHERE appservice_id IS NULL
+            """)
+            count, = txn.fetchone()
+            return count
+
+        ret = yield self.runInteraction("count_users", _count_users)
+        defer.returnValue(ret)
+
+    @defer.inlineCallbacks
     def find_next_generated_user_id_localpart(self):
         """
         Gets the localpart of the next generated user ID.