summary refs log tree commit diff
path: root/synapse/storage/registration.py
diff options
context:
space:
mode:
authorRichard van der Hoff <richard@matrix.org>2018-05-11 00:17:11 +0100
committerRichard van der Hoff <richard@matrix.org>2018-05-15 15:11:59 +0100
commit47815edcfae73c5b938f8354853a09c0b80ef27e (patch)
treea68e0f4ff14809f5a30b4446c3837aa1eb725957 /synapse/storage/registration.py
parentMerge remote-tracking branch 'origin/master' into develop (diff)
downloadsynapse-47815edcfae73c5b938f8354853a09c0b80ef27e.tar.xz
ConsentResource to gather policy consent from users
Hopefully there are enough comments and docs in this that it makes sense on its
own.
Diffstat (limited to 'synapse/storage/registration.py')
-rw-r--r--synapse/storage/registration.py18
1 files changed, 18 insertions, 0 deletions
diff --git a/synapse/storage/registration.py b/synapse/storage/registration.py
index a50717db2d..6ffc397861 100644
--- a/synapse/storage/registration.py
+++ b/synapse/storage/registration.py
@@ -286,6 +286,24 @@ class RegistrationStore(RegistrationWorkerStore,
             "user_set_password_hash", user_set_password_hash_txn
         )
 
+    def user_set_consent_version(self, user_id, consent_version):
+        """Updates the user table to record privacy policy consent
+
+        Args:
+            user_id (str): full mxid of the user to update
+            consent_version (str): version of the policy the user has consented
+                to
+
+        Raises:
+            StoreError(404) if user not found
+        """
+        return self._simple_update_one(
+            table='users',
+            keyvalues={'name': user_id, },
+            updatevalues={'consent_version': consent_version, },
+            desc="user_set_consent_version"
+        )
+
     def user_delete_access_tokens(self, user_id, except_token_id=None,
                                   device_id=None):
         """