Further data structure issues

This commit is contained in:
Astra Logical 2026-07-23 10:53:16 -04:00
parent 4326dac96c
commit 6fce9ee607

View file

@ -18,6 +18,7 @@ from nio import (
KeyVerificationCancel,
ToDeviceError,
UnknownToDeviceEvent,
ToDeviceMessage,
)
# ------------------------------------------------------------------------------
@ -155,14 +156,19 @@ async def on_to_device(client: AsyncClient, event):
"methods": ["m.sas.v1"],
"transaction_id": tx_id,
}
resp = await client.to_device(
# Wrap the event type and dictionary in a ToDeviceMessage object
message = ToDeviceMessage(
"m.key.verification.ready",
{
event.sender: {
from_device: ready_content
}
},
}
)
resp = await client.to_device(message)
if isinstance(resp, ToDeviceError):
print(f"Failed to send verification ready: {resp}")
else: