fix: enforce WebRTC microphone mute at gateway

This commit is contained in:
illusia committed 2026-09-03 15:25:34 +08:00
1 parent e14ddc9465
commit 83a8fd0d5a
5 files changed
+32 -6

No files matched your search

+10
View File
@@ -73,3 +73,13 @@ test("voice protocol validates whisper targets and its independent push state",
error: { code: "INVALID_WHISPER_STATE", message: "私语状态无效" },
});
});
test("voice protocol accepts and validates the microphone mute state", () => {
assert.deepEqual(parseClientCommand(JSON.stringify({ type: "setMicrophoneMuted", payload: { muted: true } })), {
type: "setMicrophoneMuted",
payload: { muted: true },
});
assert.deepEqual(parseClientCommand(JSON.stringify({ type: "setMicrophoneMuted", payload: { muted: "yes" } })), {
error: { code: "INVALID_MICROPHONE_STATE", message: "麦克风状态无效" },
});
});