huskies: merge 824
This commit is contained in:
@@ -565,6 +565,35 @@ pub(in crate::chat::transport::matrix::bot) async fn on_room_message(
|
||||
}
|
||||
}
|
||||
|
||||
// Check for the cleanup_worktrees command, which requires async worktree
|
||||
// removal and cannot be handled by the sync command registry.
|
||||
if let Some(cleanup_cmd) =
|
||||
super::super::super::cleanup_worktrees::extract_cleanup_worktrees_command(
|
||||
&user_message,
|
||||
&ctx.services.bot_name,
|
||||
ctx.matrix_user_id.as_str(),
|
||||
)
|
||||
{
|
||||
let confirm =
|
||||
cleanup_cmd == super::super::super::cleanup_worktrees::CleanupWorktreesCommand::Confirm;
|
||||
slog!("[matrix-bot] Handling cleanup_worktrees command from {sender}: confirm={confirm}");
|
||||
let response = super::super::super::cleanup_worktrees::handle_cleanup_worktrees(
|
||||
&effective_root,
|
||||
confirm,
|
||||
)
|
||||
.await;
|
||||
let html = markdown_to_html(&response);
|
||||
if let Ok(msg_id) = ctx
|
||||
.transport
|
||||
.send_message(&room_id_str, &response, &html)
|
||||
.await
|
||||
&& let Ok(event_id) = msg_id.parse()
|
||||
{
|
||||
ctx.bot_sent_event_ids.lock().await.insert(event_id);
|
||||
}
|
||||
return;
|
||||
}
|
||||
|
||||
// Check for the timer command, which requires async file I/O and cannot
|
||||
// be handled by the sync command registry.
|
||||
if let Some(timer_cmd) = crate::service::timer::extract_timer_command(
|
||||
|
||||
Reference in New Issue
Block a user