Remove auto join code, too buggy
This commit is contained in:
parent
d757fffb8a
commit
60cd3ba1ad
19
src/main.rs
19
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<PathBuf> = Lazy::new(|| DATA_DIR.join("rooms_conf
|
||||
|
||||
static CONFIG: Lazy<config::Config> = 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 {
|
||||
|
Loading…
Reference in New Issue
Block a user