summary refs log tree commit diff
path: root/synapse/storage
diff options
context:
space:
mode:
authorDavid Baker <dave@matrix.org>2015-04-17 19:53:47 +0100
committerDavid Baker <dave@matrix.org>2015-04-17 19:53:47 +0100
commit8db6832db8a8ad1a68ff6781b90f3e2cb1a72fc0 (patch)
tree61e65d287b349cf314042db86350e7cea421addb /synapse/storage
parentAdd endpoint to get threepids from server (diff)
downloadsynapse-8db6832db8a8ad1a68ff6781b90f3e2cb1a72fc0.tar.xz
Password reset, finally.
Diffstat (limited to 'synapse/storage')
-rw-r--r--synapse/storage/registration.py16
1 files changed, 15 insertions, 1 deletions
diff --git a/synapse/storage/registration.py b/synapse/storage/registration.py
index 08d60f0817..ab43856023 100644
--- a/synapse/storage/registration.py
+++ b/synapse/storage/registration.py
@@ -196,4 +196,18 @@ class RegistrationStore(SQLBaseStore):
             ['medium', 'address', 'validated_at', 'added_at'],
             'user_get_threepids'
         )
-        defer.returnValue(ret)
\ No newline at end of file
+        defer.returnValue(ret)
+
+    @defer.inlineCallbacks
+    def get_user_by_threepid(self, medium, address):
+        ret = yield self._simple_select_one(
+            "user_threepids",
+            {
+                "medium": medium,
+                "address": address
+            },
+            ['user'], True, 'get_user_by_threepid'
+        )
+        if ret:
+            defer.returnValue(ret['user'])
+        defer.returnValue(None)
\ No newline at end of file