mirror of
https://git.anonymousland.org/anonymousland/synapse.git
synced 2025-11-11 22:26:34 -05:00
Use join_policy API instead of joinable
The API is now under
/groups/$group_id/setting/m.join_policy
and expects a JSON blob of the shape
```json
{
"m.join_policy": {
"type": "invite"
}
}
```
where "invite" could alternatively be "open".
This commit is contained in:
parent
c5de6987c2
commit
eb8d8d6f57
7 changed files with 58 additions and 23 deletions
|
|
@ -30,16 +30,16 @@ _DEFAULT_ROLE_ID = ""
|
|||
|
||||
|
||||
class GroupServerStore(SQLBaseStore):
|
||||
def set_group_joinable(self, group_id, is_joinable):
|
||||
def set_group_join_policy(self, group_id, join_policy):
|
||||
return self._simple_update_one(
|
||||
table="groups",
|
||||
keyvalues={
|
||||
"group_id": group_id,
|
||||
},
|
||||
updatevalues={
|
||||
"is_joinable": is_joinable,
|
||||
"join_policy": join_policy,
|
||||
},
|
||||
desc="set_group_joinable",
|
||||
desc="set_group_join_policy",
|
||||
)
|
||||
|
||||
def get_group(self, group_id):
|
||||
|
|
|
|||
|
|
@ -13,4 +13,10 @@
|
|||
* limitations under the License.
|
||||
*/
|
||||
|
||||
ALTER TABLE groups ADD COLUMN is_joinable SMALLINT DEFAULT 0 NOT NULL;
|
||||
/*
|
||||
* This isn't a real ENUM because sqlite doesn't support it
|
||||
* and we use a default of NULL for inserted rows and interpret
|
||||
* NULL at the python store level as necessary so that existing
|
||||
* rows are given the correct default policy.
|
||||
*/
|
||||
ALTER TABLE groups ADD COLUMN join_policy TEXT DEFAULT NULL;
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue