mirror of
https://github.com/getpaseo/paseo.git
synced 2026-07-29 12:01:31 +00:00
fix(chat): skip archived agent notifications
This commit is contained in:
@@ -211,6 +211,14 @@ room_participant_ids() {
|
||||
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() {
|
||||
local target_agent_id="$1"
|
||||
local room="$2"
|
||||
@@ -224,6 +232,10 @@ notify_agent() {
|
||||
return
|
||||
fi
|
||||
|
||||
if agent_is_archived "$target_agent_id"; then
|
||||
return
|
||||
fi
|
||||
|
||||
local sender_label
|
||||
if [[ -n "$sender_agent_name" ]]; then
|
||||
sender_label="$sender_agent_name ($sender_agent_id)"
|
||||
|
||||
Reference in New Issue
Block a user