storkit: merge 440_refactor_consolidate_is_permission_approval_into_chat_util
This commit is contained in:
@@ -9,6 +9,7 @@ use serde::{Deserialize, Serialize};
|
||||
|
||||
use crate::agents::AgentPool;
|
||||
use crate::chat::transport::matrix::{ConversationEntry, ConversationRole, RoomConversation};
|
||||
use crate::chat::util::is_permission_approval;
|
||||
use crate::slog;
|
||||
use crate::chat::ChatTransport;
|
||||
use crate::http::context::{PermissionDecision, PermissionForward};
|
||||
@@ -86,17 +87,6 @@ pub struct SlackWebhookContext {
|
||||
pub permission_timeout_secs: u64,
|
||||
}
|
||||
|
||||
// ── Permission approval detection ──────────────────────────────────────
|
||||
|
||||
/// Returns `true` if the message body should be interpreted as permission approval.
|
||||
fn is_permission_approval(body: &str) -> bool {
|
||||
let trimmed = body.trim().to_ascii_lowercase();
|
||||
matches!(
|
||||
trimmed.as_str(),
|
||||
"yes" | "y" | "approve" | "allow" | "ok"
|
||||
)
|
||||
}
|
||||
|
||||
// ── Incoming message dispatch ───────────────────────────────────────────
|
||||
|
||||
pub(super) async fn handle_incoming_message(
|
||||
|
||||
Reference in New Issue
Block a user