fix: log broadcast says 'this party' again

Routing log_notify through .party-notify had turned the announcement
into 'started logging the party'. The helper takes an optional object
phrase, defaulting to 'the party' for the join/leave hooks, and
log_notify passes 'this party'. Both wordings are now pinned by stub
tests, which had no coverage of the broadcast text before.
This commit is contained in:
veg 2026-09-21 11:37:30 +00:00
parent 733633bd65
commit 471ee5875c
2 changed files with 34 additions and 8 deletions

17
party
View file

@ -567,12 +567,12 @@ tmux="$PARTY_TMUX"
EOF
cat >> "$notify_script" <<'EOF'
# Auto-generated by party. Fan a display-message out to every client
# of the party server. Args: $1 = socket, $2 = user, $3 = verb (e.g.
# "joined", "left", "started logging", "stopped logging")
sock="$1"; user="$2"; verb="$3"
# of the party server. Args: $1 = socket, $2 = user, $3 = verb
# ("joined", "left", "started logging"), $4 = object (default "the party")
sock="$1"; user="$2"; verb="$3"; obj="${4:-the party}"
"$tmux" -S "$sock" list-clients -F '#{client_name}' 2>/dev/null \
| while read -r c; do
"$tmux" -S "$sock" display-message -c "$c" "$user $verb the party" 2>/dev/null || :
"$tmux" -S "$sock" display-message -c "$c" "$user $verb $obj" 2>/dev/null || :
done
EOF
chmod 0755 "$notify_script"
@ -1105,11 +1105,12 @@ EOF
# Tell everyone in the room when recording starts or stops: a
# transcript nobody knew about is the kind of surprise the social
# design exists to avoid. Reuses the .party-notify script generated at
# host time, so the broadcast reads "$USER started logging the party"
# / "$USER stopped logging the party". Tolerant of failure: a missing
# or unreadable notify script shouldn't abort logging.
# host time; the broadcast reads "$USER started logging this party".
# Tolerant of failure: a missing or unreadable notify script shouldn't
# abort logging.
log_notify() {
"${RR_SOCKET%/sock}/.party-notify" "$RR_SOCKET" "$USER" "$1 logging" || :
"${RR_SOCKET%/sock}/.party-notify" "$RR_SOCKET" "$USER" \
"$1 logging" "this party" || :
}
cmd_log() {