From 22d079f0792583f731592ac8126597a6f40c9a56 Mon Sep 17 00:00:00 2001 From: Astra Logical Date: Thu, 23 Jul 2026 13:44:11 -0400 Subject: [PATCH] Hallucinatin bots... --- matrix_keycloak_bot.py | 19 +++++-------------- 1 file changed, 5 insertions(+), 14 deletions(-) diff --git a/matrix_keycloak_bot.py b/matrix_keycloak_bot.py index 8357306..f58a06f 100644 --- a/matrix_keycloak_bot.py +++ b/matrix_keycloak_bot.py @@ -428,20 +428,11 @@ async def main(): "access_token": client.api.token, "device_id": client.device_id }, f) - - # Bootstrap Cross-Signing and Key Recovery using the environment variable - recovery_key = os.getenv("MATRIX_RECOVERY_KEY") - if recovery_key and client.crypto: - try: - log.info("Verifying recovery key and bootstrapping cross-signing...") - await client.crypto.verify_recovery_key(recovery_key) - if not await client.crypto.has_cross_signing_keys(): - await client.crypto.bootstrap_cross_signing( - auth_data={"password": MATRIX_BOT_PASSWORD} - ) - log.info("Cross-signing and key recovery initialized successfully.") - except Exception as e: - log.error(f"Failed to initialize cross-signing/recovery: {e}") + + # Create a new Olm account if one wasn't loaded from the crypto store + if not client.crypto.account: + log.info("Creating new Olm account...") + await client.crypto.create_account() # Register Event Handlers client.add_event_handler(EventType.ROOM_MEMBER, on_invite)