sync: invite members to MATRIX_EXTRA_ROOMS too (restricted rooms aren't federation-discoverable until joined)
This commit is contained in:
1 parent
24f0c0f745
commit
106b563748
1 file changed
+7
@@ -200,6 +200,11 @@ MATRIX_HOMESERVER = os.environ.get("MATRIX_HOMESERVER", "https://matrix.inferenc
|
|||||||
MATRIX_BOT_TOKEN = os.environ.get("MATRIX_BOT_TOKEN", "")
|
MATRIX_BOT_TOKEN = os.environ.get("MATRIX_BOT_TOKEN", "")
|
||||||
MATRIX_SPACE_ID = os.environ.get("MATRIX_SPACE_ID", "")
|
MATRIX_SPACE_ID = os.environ.get("MATRIX_SPACE_ID", "")
|
||||||
MATRIX_GENERAL_ROOM = os.environ.get("MATRIX_GENERAL_ROOM", "")
|
MATRIX_GENERAL_ROOM = os.environ.get("MATRIX_GENERAL_ROOM", "")
|
||||||
|
# Additional member-facing rooms that every member gets invited to (comma-separated
|
||||||
|
# room IDs). Restricted rooms are NOT discoverable over federation until a member
|
||||||
|
# has joined (the space hierarchy omits them for remote servers), so new rooms need
|
||||||
|
# an explicit invite pass — either here or a one-off script.
|
||||||
|
MATRIX_EXTRA_ROOMS = [r.strip() for r in os.environ.get("MATRIX_EXTRA_ROOMS", "").split(",") if r.strip()]
|
||||||
LOOMIO_GROUP_ID = os.environ.get("LOOMIO_GROUP_ID", "")
|
LOOMIO_GROUP_ID = os.environ.get("LOOMIO_GROUP_ID", "")
|
||||||
# Operator accounts that must always remain in the Loomio group (never removed
|
# Operator accounts that must always remain in the Loomio group (never removed
|
||||||
# by the remove_absent reconciliation), comma-separated.
|
# by the remove_absent reconciliation), comma-separated.
|
||||||
@@ -934,6 +939,8 @@ async def sync_matrix_space() -> dict:
|
|||||||
await invite(mxid, MATRIX_SPACE_ID)
|
await invite(mxid, MATRIX_SPACE_ID)
|
||||||
if MATRIX_GENERAL_ROOM:
|
if MATRIX_GENERAL_ROOM:
|
||||||
await invite(mxid, MATRIX_GENERAL_ROOM)
|
await invite(mxid, MATRIX_GENERAL_ROOM)
|
||||||
|
for room in MATRIX_EXTRA_ROOMS:
|
||||||
|
await invite(mxid, room)
|
||||||
invited_count += 1
|
invited_count += 1
|
||||||
if invited_count:
|
if invited_count:
|
||||||
logger.info("Matrix space invites sent: %s", invited_count)
|
logger.info("Matrix space invites sent: %s", invited_count)
|
||||||
|
|||||||
Reference in new issue
Block a user