From e213578646291b7379d9138fecabcd3c20104586 Mon Sep 17 00:00:00 2001 From: ErrorNoInternet Date: Mon, 31 Mar 2025 16:54:11 -0400 Subject: [PATCH] feat(matrix): add matrix_init event --- src/matrix/mod.rs | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/matrix/mod.rs b/src/matrix/mod.rs index 3877554..88643bc 100644 --- a/src/matrix/mod.rs +++ b/src/matrix/mod.rs @@ -14,7 +14,7 @@ use serde::{Deserialize, Serialize}; use tokio::fs; use verification::{on_device_key_verification_request, on_room_message_verification_request}; -use crate::{State, lua::matrix::client::Client as LuaClient}; +use crate::{State, events::call_listeners, lua::matrix::client::Client as LuaClient}; #[derive(Clone)] struct Context { @@ -62,7 +62,6 @@ pub async fn login(state: &State, options: &Table, globals: &Table, name: String options.get::("username")?, &options.get::("password")?, ); - let root_dir = dirs::data_dir() .context("no data directory")? .join("errornowatcher") @@ -130,6 +129,7 @@ pub async fn login(state: &State, options: &Table, globals: &Table, name: String let client = Arc::new(client); globals.set("matrix", LuaClient(client.clone()))?; + call_listeners(state, "matrix_init", || Ok(())).await?; client .sync_with_result_callback(sync_settings, |sync_result| async {