summary refs log tree commit diff
path: root/synapse/storage
diff options
context:
space:
mode:
authorErik Johnston <erik@matrix.org>2017-08-08 14:19:07 +0100
committerErik Johnston <erik@matrix.org>2017-08-08 14:19:41 +0100
commitb880ff190a82d4f337b94115fc017d703e53878d (patch)
tree2c0d8f0eb890bc26cb4703d3e42654dd16021831 /synapse/storage
parentStore whether the user wants to publicise their membership of a group (diff)
downloadsynapse-b880ff190a82d4f337b94115fc017d703e53878d.tar.xz
Allow update group publicity
Diffstat (limited to 'synapse/storage')
-rw-r--r--synapse/storage/group_server.py15
1 files changed, 15 insertions, 0 deletions
diff --git a/synapse/storage/group_server.py b/synapse/storage/group_server.py
index 31514f3cdb..10e757e975 100644
--- a/synapse/storage/group_server.py
+++ b/synapse/storage/group_server.py
@@ -835,6 +835,21 @@ class GroupServerStore(SQLBaseStore):
             desc="add_room_to_group",
         )
 
+    def update_group_publicity(self, group_id, user_id, publicise):
+        """Update whether the user is publicising their membership of the group
+        """
+        return self._simple_update_one(
+            table="local_group_membership",
+            keyvalues={
+                "group_id": group_id,
+                "user_id": user_id,
+            },
+            updatevalues={
+                "is_publicised": publicise,
+            },
+            desc="update_group_publicity"
+        )
+
     @defer.inlineCallbacks
     def register_user_group_membership(self, group_id, user_id, membership,
                                        is_admin=False, content={},