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.
pull/3046/head
Luke Barnard 2018-04-06 14:06:32 +01:00
parent 6bd1b7053e
commit 7945435587
1 changed files with 5 additions and 0 deletions

View File

@ -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")