Fix borrowing issue for matrix

legacy
Charlotte Som 2022-04-08 12:15:32 +01:00
parent 0649ea0503
commit 82bff1b904
1 changed files with 9 additions and 6 deletions

View File

@ -468,12 +468,15 @@ pub async fn create_matrix_client(
let event_handler = Arc::new(MatrixHandler { message_tx }); let event_handler = Arc::new(MatrixHandler { message_tx });
{
let on_msg_ctx = event_handler.clone(); let on_msg_ctx = event_handler.clone();
let client_2 = client.clone();
client client
.register_event_handler(move |ev, room| { .register_event_handler(move |ev, room| {
on_room_message_event(client.clone(), on_msg_ctx.clone(), ev, room) on_room_message_event(client_2.clone(), on_msg_ctx.clone(), ev, room)
}) })
.await; .await;
}
let on_redact_ctx = event_handler.clone(); let on_redact_ctx = event_handler.clone();
client client