matrix-mxid: return invite_sent so the dashboard can confirm the invite is on its way
This commit is contained in:
1 parent
e56d0456bb
commit
81b640ba74
1 file changed
+5
-1
+5
-1
@@ -2677,12 +2677,16 @@ async def broker_set_matrix_mxid(request: Request):
|
|||||||
set_member_matrix_mxid(email, mxid)
|
set_member_matrix_mxid(email, mxid)
|
||||||
# Invite the new account into the Space immediately (best-effort; the daily
|
# Invite the new account into the Space immediately (best-effort; the daily
|
||||||
# sync will also pick it up). Clear = no invite (just removes the mapping).
|
# sync will also pick it up). Clear = no invite (just removes the mapping).
|
||||||
|
invite_sent = True
|
||||||
if mxid:
|
if mxid:
|
||||||
try:
|
try:
|
||||||
await sync_matrix_space()
|
await sync_matrix_space()
|
||||||
except Exception as e:
|
except Exception as e:
|
||||||
logger.warning("matrix-mxid: immediate invite failed: %s", e)
|
logger.warning("matrix-mxid: immediate invite failed: %s", e)
|
||||||
return {"status": "saved", "matrix_mxid": mxid}
|
invite_sent = False
|
||||||
|
# invite_sent=False tells the dashboard the nightly sync will retry; the
|
||||||
|
# mapping is saved either way, so the member gets a confident confirmation.
|
||||||
|
return {"status": "saved", "matrix_mxid": mxid, "invite_sent": invite_sent}
|
||||||
|
|
||||||
|
|
||||||
async def broker_get_usage(email: str, days: int = 0) -> dict:
|
async def broker_get_usage(email: str, days: int = 0) -> dict:
|
||||||
|
|||||||
Reference in new issue
Block a user