fix(matrix): accept repeat invites before provisioning
This commit is contained in:
parent
37643a9695
commit
8efc91b02b
2 changed files with 4 additions and 2 deletions
|
|
@ -20,12 +20,12 @@ async def handle_invite(client: Any, room: Any, event: Any, platform, store, aut
|
||||||
matrix_user_id = getattr(event, "sender", "")
|
matrix_user_id = getattr(event, "sender", "")
|
||||||
display_name = getattr(room, "display_name", None) or matrix_user_id
|
display_name = getattr(room, "display_name", None) or matrix_user_id
|
||||||
|
|
||||||
|
await client.join(room.room_id)
|
||||||
|
|
||||||
existing = await get_user_meta(store, matrix_user_id)
|
existing = await get_user_meta(store, matrix_user_id)
|
||||||
if existing and existing.get("space_id"):
|
if existing and existing.get("space_id"):
|
||||||
return
|
return
|
||||||
|
|
||||||
await client.join(room.room_id)
|
|
||||||
|
|
||||||
user = await platform.get_or_create_user(
|
user = await platform.get_or_create_user(
|
||||||
external_id=matrix_user_id,
|
external_id=matrix_user_id,
|
||||||
platform="matrix",
|
platform="matrix",
|
||||||
|
|
|
||||||
|
|
@ -179,7 +179,9 @@ async def test_invite_event_is_idempotent_per_user():
|
||||||
runtime.chat_mgr,
|
runtime.chat_mgr,
|
||||||
)
|
)
|
||||||
|
|
||||||
|
assert client.join.await_count == 2
|
||||||
assert client.room_create.await_count == 2
|
assert client.room_create.await_count == 2
|
||||||
|
client.room_send.assert_awaited_once()
|
||||||
|
|
||||||
|
|
||||||
async def test_bot_ignores_its_own_messages():
|
async def test_bot_ignores_its_own_messages():
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue