fix(chat): skip archived agent notifications
This commit is contained in:
@@ -211,6 +211,14 @@ room_participant_ids() {
|
|||||||
awk 'NF && $0 != "manual" && !seen[$0]++'
|
awk 'NF && $0 != "manual" && !seen[$0]++'
|
||||||
}
|
}
|
||||||
|
|
||||||
|
agent_is_archived() {
|
||||||
|
local target_agent_id="$1"
|
||||||
|
local archived_at
|
||||||
|
|
||||||
|
archived_at="$("$paseo_bin" inspect "$target_agent_id" --json 2>/dev/null | jq -r '.ArchivedAt // empty' 2>/dev/null)" || archived_at=""
|
||||||
|
[[ -n "$archived_at" ]]
|
||||||
|
}
|
||||||
|
|
||||||
notify_agent() {
|
notify_agent() {
|
||||||
local target_agent_id="$1"
|
local target_agent_id="$1"
|
||||||
local room="$2"
|
local room="$2"
|
||||||
@@ -224,6 +232,10 @@ notify_agent() {
|
|||||||
return
|
return
|
||||||
fi
|
fi
|
||||||
|
|
||||||
|
if agent_is_archived "$target_agent_id"; then
|
||||||
|
return
|
||||||
|
fi
|
||||||
|
|
||||||
local sender_label
|
local sender_label
|
||||||
if [[ -n "$sender_agent_name" ]]; then
|
if [[ -n "$sender_agent_name" ]]; then
|
||||||
sender_label="$sender_agent_name ($sender_agent_id)"
|
sender_label="$sender_agent_name ($sender_agent_id)"
|
||||||
|
|||||||
Reference in New Issue
Block a user