Pass account correctly

This commit is contained in:
Astra Logical 2026-07-23 14:11:25 -04:00
parent dab9bae8f7
commit 0db71275f6

View file

@ -429,14 +429,14 @@ async def main():
"device_id": client.device_id "device_id": client.device_id
}, f) }, f)
# Ensure an Olm crypto account exists in the store for this specific mxid BEFORE initializing OlmMachine # Ensure an Olm crypto account exists in the store BEFORE initializing OlmMachine
account = await crypto_store.get_account(client.mxid) account = await crypto_store.get_account()
if not account: if not account:
log.info("Creating new Olm account...") log.info("Creating new Olm account...")
account = OlmAccount() account = OlmAccount()
await crypto_store.put_account(account, client.mxid) await crypto_store.put_account(account)
# Initialize OlmMachine after the account is guaranteed to exist under the correct key # Initialize OlmMachine after the account is guaranteed to exist
client.crypto = OlmMachine(client, crypto_store, state_store) client.crypto = OlmMachine(client, crypto_store, state_store)
# Register Event Handlers # Register Event Handlers