Add option to set related groups for created rooms

This commit is contained in:
Tulir Asokan
2019-06-30 19:05:17 +03:00
parent 860b635188
commit 0f7eebd683
3 changed files with 14 additions and 0 deletions
+5
View File
@@ -189,6 +189,8 @@ class Config(DictWithRecursion):
copy("appservice.bot_displayname")
copy("appservice.bot_avatar")
copy("appservice.community_id")
copy("appservice.as_token")
copy("appservice.hs_token")
@@ -352,3 +354,6 @@ class Config(DictWithRecursion):
"sender_localpart": self["appservice.bot_username"],
"rate_limited": False
}
if self["appservice.community_id"]:
self._registration["namespaces"]["users"][0]["group_id"] \
= self["appservice.community_id"]
+5
View File
@@ -397,6 +397,11 @@ class Portal:
"type": "m.room.power_levels",
"content": power_levels,
}]
if config["appservice.community_id"]:
initial_state.append({
"type": "m.room.related_groups",
"content": {"groups": [config["appservice.community_id"]]},
})
room_id = await self.main_intent.create_room(alias=alias, is_public=public,
is_direct=direct, invitees=invites or [],