From 60cd3ba1ad3d5a1dbb93cff429fb8e5804ed0780 Mon Sep 17 00:00:00 2001 From: 0xf8 <0xf8.dev@proton.me> Date: Mon, 17 Apr 2023 06:07:44 -0400 Subject: [PATCH] Remove auto join code, too buggy --- src/main.rs | 19 ------------------- 1 file changed, 19 deletions(-) diff --git a/src/main.rs b/src/main.rs index cce81e9..cae2825 100644 --- a/src/main.rs +++ b/src/main.rs @@ -5,11 +5,9 @@ use matrix_sdk::{ message::{ MessageType, OriginalSyncRoomMessageEvent, Relation, RoomMessageEvent, }, - member::StrippedRoomMemberEvent }, OwnedRoomId, }, - Client, Error, LoopCtrl, }; use std::path::PathBuf; @@ -28,23 +26,6 @@ static ROOMS_CONFIG_FILE: Lazy = Lazy::new(|| DATA_DIR.join("rooms_conf static CONFIG: Lazy = Lazy::new(|| config::Config::load()); -// Autojoin rooms the bot is invited to -async fn on_stripped_state_member(room_member: StrippedRoomMemberEvent, client: Client, room: Room) { - if room_member.state_key != client.user_id().unwrap() { - return; - } - - if let Room::Invited(room) = room { - tokio::spawn(async move { - if let Err(err) = room.accept_invitation().await { - eprintln!("Err: {err:?}"); - if let Err(e) = room.reject_invitation().await { - eprintln!("Err: {e:?}"); - } - } - }); - } -} async fn on_room_message(event: OriginalSyncRoomMessageEvent, room: Room) -> anyhow::Result<()> { if let Room::Joined(room) = room {