summary refs log tree commit diff
path: root/synapse/storage/registration.py
diff options
context:
space:
mode:
authorRichard van der Hoff <1389908+richvdh@users.noreply.github.com>2018-05-16 07:19:18 +0100
committerGitHub <noreply@github.com>2018-05-16 07:19:18 +0100
commit8030a825c8ea375652a856929d29d7ae28096cc1 (patch)
treefd1a3c6d59b793fb5ceca6d08187e12753bcaac1 /synapse/storage/registration.py
parentMerge pull request #3201 from matrix-org/dbkr/leave_rooms_on_deactivate (diff)
parentConsentResource to gather policy consent from users (diff)
downloadsynapse-8030a825c8ea375652a856929d29d7ae28096cc1.tar.xz
Merge pull request #3213 from matrix-org/rav/consent_handler
ConsentResource to gather policy consent from users
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 c05ce4612f..8d1a01f1ee 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):
         """