summary refs log tree commit diff
path: root/synapse/storage
diff options
context:
space:
mode:
authorAndrew Morgan <andrew@amorgan.xyz>2019-11-04 18:08:50 +0000
committerAndrew Morgan <andrew@amorgan.xyz>2019-11-04 18:08:50 +0000
commit0287d033eec86fb7f6bb84f929e756c99caf2113 (patch)
treed2e768244125ff188177fa04c1043e5f12c3e599 /synapse/storage
parentdocument the REPLICATE command a bit better (#6305) (diff)
downloadsynapse-0287d033eec86fb7f6bb84f929e756c99caf2113.tar.xz
Transfer upgraded rooms on groups
Diffstat (limited to 'synapse/storage')
-rw-r--r--synapse/storage/data_stores/main/group_server.py15
1 files changed, 15 insertions, 0 deletions
diff --git a/synapse/storage/data_stores/main/group_server.py b/synapse/storage/data_stores/main/group_server.py
index b3a2771f1b..13ad71a49c 100644
--- a/synapse/storage/data_stores/main/group_server.py
+++ b/synapse/storage/data_stores/main/group_server.py
@@ -552,6 +552,21 @@ class GroupServerStore(SQLBaseStore):
             keyvalues={"group_id": group_id, "role_id": role_id, "user_id": user_id},
             desc="remove_user_from_summary",
         )
+    
+    def get_local_groups_for_room(self, room_id):
+        """Get all of the local group that contain a given room
+        Args:
+            room_id (str): The ID of a room
+        Returns:
+            Deferred[list[str]]: A twisted.Deferred containing a list of group ids
+                containing this room
+        """
+        return self._simple_select_onecol(
+            table="group_rooms",
+            keyvalues={"room_id": room_id},
+            retcol="group_id",
+            desc="get_local_groups_for_room",
+        )
 
     def get_users_for_summary_by_role(self, group_id, include_private=False):
         """Get the users and roles that should be included in a summary request