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.
This commit is contained in:
Luke Barnard 2018-04-06 14:06:32 +01:00
parent 6bd1b7053e
commit 7945435587

View File

@ -407,6 +407,11 @@ class GroupsServerHandler(object):
group_description = yield self.store.get_group(group_id) group_description = yield self.store.get_group(group_id)
if group_description: 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) defer.returnValue(group_description)
else: else:
raise SynapseError(404, "Unknown group") raise SynapseError(404, "Unknown group")