Whisper settings: incoming whisper rights, sound, history auto-open/cleanup

Options -> Whispern like TS3: allow/block by default with per-contact
overrides (new Whisper field in contacts) or block all. The connector drops
blocked whispers before decoding (whisperpolicy stdin command) and reports
accepted ones as whisperReceived, which logs them in the whisper history,
plays the new whisper sound and can open the history.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01Hu2cuPLqpuKVfd9wWFFakU
This commit is contained in:
MoepchiandClaude Opus 5.5 committed 2026-10-23 19:01:53 +00:00
1 parent 2e6b295185
commit 7b98cb2d7c
11 files changed
+295 -6

No files matched your search

+4
View File
@@ -882,6 +882,10 @@ wss.on("connection", (socket: WebSocket, req: IncomingMessage) => {
await connection?.setNickname(msg.nickname);
break;
}
case "setWhisperPolicy": {
connection?.setWhisperPolicy(msg.block === true, Array.isArray(msg.exceptions) ? msg.exceptions : []);
break;
}
case "setWhisperTargets": {
await connection?.setWhisperTargets(msg.channelIds ?? [], msg.clientIds ?? []);
break;
+8
View File
@@ -153,6 +153,7 @@ export type Ts3ConnectionEvent =
| { type: "poke"; from: string; message: string }
| { type: "audioOut"; pcm: string }
| { type: "talkers"; clients: number[] }
| { type: "whisperReceived"; clientId: number }
| { type: "disconnected"; reason: string }
| { type: "reconnecting"; reason: string }
| { type: "reconnected" }
@@ -363,6 +364,7 @@ export class Ts3Connection {
| { type: "poke"; from: string; message: string }
| { type: "audioOut"; pcm: string }
| { type: "talkers"; clients: number[] }
| { type: "whisperReceived"; clientId: number }
| { type: "disconnected"; reason: string }
| { type: "reconnecting"; reason: string }
| { type: "reconnected" }
@@ -959,6 +961,12 @@ export class Ts3Connection {
if (sanitized) this.writeLine(`nickname ${sanitized}`);
}
/** Incoming whispers: allowed or blocked by default; `exceptions` (client ids) get the opposite. */
setWhisperPolicy(block: boolean, exceptions: unknown[]): void {
const ids = exceptions.map(Number).filter(Number.isInteger);
this.writeLine(`whisperpolicy ${block ? "block" : "allow"};${ids.join(",")}`);
}
/** Empty channelIds/clientIds clears whisper mode, returning outgoing
* voice to the normal current-channel broadcast. */
async setWhisperTargets(channelIds: number[], clientIds: number[]): Promise<void> {