Mxid to pickle
This commit is contained in:
parent
322e418a81
commit
a95a3e274f
1 changed files with 3 additions and 3 deletions
|
|
@ -45,8 +45,8 @@ log = logging.getLogger("keycloak_bot")
|
||||||
# Custom Pickle-Backed Crypto Store for Persistence
|
# Custom Pickle-Backed Crypto Store for Persistence
|
||||||
# ------------------------------------------------------------------------------
|
# ------------------------------------------------------------------------------
|
||||||
class PickleCryptoStore(MemoryCryptoStore):
|
class PickleCryptoStore(MemoryCryptoStore):
|
||||||
def __init__(self, filepath: str):
|
def __init__(self, filepath: str, account_id: str = "bot", pickle_key: str = ""):
|
||||||
super().__init__()
|
super().__init__(account_id=account_id, pickle_key=pickle_key)
|
||||||
self.filepath = filepath
|
self.filepath = filepath
|
||||||
self.load()
|
self.load()
|
||||||
|
|
||||||
|
|
@ -406,7 +406,7 @@ async def main():
|
||||||
|
|
||||||
# Initialize stores using Pickle and Custom Memory State Stores
|
# Initialize stores using Pickle and Custom Memory State Stores
|
||||||
state_store = CustomMemoryStateStore(client.mxid)
|
state_store = CustomMemoryStateStore(client.mxid)
|
||||||
crypto_store = PickleCryptoStore(CRYPTO_STORE_FILE)
|
crypto_store = PickleCryptoStore(CRYPTO_STORE_FILE, account_id=client.mxid)
|
||||||
|
|
||||||
client.state_store = state_store
|
client.state_store = state_store
|
||||||
client.crypto = OlmMachine(client, crypto_store, state_store)
|
client.crypto = OlmMachine(client, crypto_store, state_store)
|
||||||
|
|
|
||||||
Loading…
Add table
Reference in a new issue