summary refs log tree commit diff
path: root/synapse/storage
diff options
context:
space:
mode:
authorErik Johnston <erik@matrix.org>2017-10-27 09:58:13 +0100
committerErik Johnston <erik@matrix.org>2017-10-27 09:58:13 +0100
commit195abfe7a5ec3b0d52812a3d7a04264f97376771 (patch)
treed519fda77a66948f8553b09539297ef8357df367 /synapse/storage
parentLog if we try to do attestations for our own user and group (diff)
downloadsynapse-195abfe7a5ec3b0d52812a3d7a04264f97376771.tar.xz
Remove incorrect attestations
Diffstat (limited to 'synapse/storage')
-rw-r--r--synapse/storage/group_server.py18
1 files changed, 18 insertions, 0 deletions
diff --git a/synapse/storage/group_server.py b/synapse/storage/group_server.py
index 9e63db5c6c..ed2ee61ad2 100644
--- a/synapse/storage/group_server.py
+++ b/synapse/storage/group_server.py
@@ -1086,6 +1086,24 @@ class GroupServerStore(SQLBaseStore):
             desc="update_remote_attestion",
         )
 
+    def remove_attestation_renewal(self, group_id, user_id):
+        """Remove an attestation that we thought we should renew, but actually
+        shouldn't. Ideally this would never get called as we would never
+        incorrectly try and do attestations for local users on local groups.
+
+        Args:
+            group_id (str)
+            user_id (str)
+        """
+        return self._simple_update_one(
+            table="_simple_delete",
+            keyvalues={
+                "group_id": group_id,
+                "user_id": user_id,
+            },
+            desc="remove_attestation_renewal",
+        )
+
     @defer.inlineCallbacks
     def get_remote_attestation(self, group_id, user_id):
         """Get the attestation that proves the remote agrees that the user is