mirror of
https://git.anonymousland.org/anonymousland/synapse.git
synced 2025-05-02 22:14:55 -04:00
Add joinability for groups
Adds API to set the 'joinable' flag, and corresponding flag in the table.
This commit is contained in:
parent
8efe773ef1
commit
79452edeee
7 changed files with 102 additions and 1 deletions
|
@ -1,5 +1,6 @@
|
|||
# -*- coding: utf-8 -*-
|
||||
# Copyright 2017 Vector Creations Ltd
|
||||
# Copyright 2018 New Vector Ltd
|
||||
#
|
||||
# Licensed under the Apache License, Version 2.0 (the "License");
|
||||
# you may not use this file except in compliance with the License.
|
||||
|
@ -29,6 +30,18 @@ _DEFAULT_ROLE_ID = ""
|
|||
|
||||
|
||||
class GroupServerStore(SQLBaseStore):
|
||||
def set_group_joinable(self, group_id, is_joinable):
|
||||
return self._simple_update_one(
|
||||
table="groups",
|
||||
keyvalues={
|
||||
"group_id": group_id,
|
||||
},
|
||||
updatevalues={
|
||||
"is_joinable": is_joinable,
|
||||
},
|
||||
desc="set_group_joinable",
|
||||
)
|
||||
|
||||
def get_group(self, group_id):
|
||||
return self._simple_select_one(
|
||||
table="groups",
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue