Add bulk group publicised lookup API

This commit is contained in:
Erik Johnston 2017-08-09 13:36:22 +01:00
parent b880ff190a
commit ef8e578677
5 changed files with 142 additions and 0 deletions

View file

@ -835,6 +835,20 @@ class GroupServerStore(SQLBaseStore):
desc="add_room_to_group",
)
def get_publicised_groups_for_user(self, user_id):
"""Get all groups a user is publicising
"""
return self._simple_select_onecol(
table="local_group_membership",
keyvalues={
"user_id": user_id,
"membership": "join",
"is_publicised": True,
},
retcol="group_id",
desc="get_publicised_groups_for_user",
)
def update_group_publicity(self, group_id, user_id, publicise):
"""Update whether the user is publicising their membership of the group
"""