summary refs log tree commit diff
path: root/synapse
diff options
context:
space:
mode:
authorLuke Barnard <luke@matrix.org>2018-04-06 14:06:32 +0100
committerLuke Barnard <luke@matrix.org>2018-04-06 15:43:27 +0100
commit7945435587704c5abd075140bdd46c11db93c255 (patch)
tree62a546e00602cbac174a2c8e1af2696d60298883 /synapse
parentBy default, join policy is "invite" (diff)
downloadsynapse-7945435587704c5abd075140bdd46c11db93c255.tar.xz
When exposing group state, return is_openly_joinable
as opposed to join_policy, which is really only pertinent to the
synapse implementation of the group server.

By doing this we keep the group server concept extensible by
allowing arbitrarily complex rules for deciding whether a group
is openly joinable.
Diffstat (limited to 'synapse')
-rw-r--r--synapse/groups/groups_server.py5
1 files changed, 5 insertions, 0 deletions
diff --git a/synapse/groups/groups_server.py b/synapse/groups/groups_server.py
index 8310dea031..290eec7127 100644
--- a/synapse/groups/groups_server.py
+++ b/synapse/groups/groups_server.py
@@ -407,6 +407,11 @@ class GroupsServerHandler(object):
         group_description = yield self.store.get_group(group_id)
 
         if group_description:
+            join_policy = group_description['join_policy']
+            del group_description['join_policy']
+
+            group_description['is_openly_joinable'] = join_policy == "open"
+
             defer.returnValue(group_description)
         else:
             raise SynapseError(404, "Unknown group")