fix private chat disconnect and member menu

This commit is contained in:
illusia committed 2026-09-01 23:23:47 +08:00
1 parent 8a06382cec
commit aa5c5e687f
4 files changed
+51 -15

No files matched your search

+17 -1
View File
@@ -2,7 +2,7 @@ import assert from "node:assert/strict";
import test from "node:test";
import { generateIdentity } from "@honeybbq/teamspeak-client";
import { parseTeamSpeakTarget } from "../src/domain/teamspeak-target.js";
import { TSClient } from "../src/server/ts-client.js";
import { TSClient, toTSChatMessage } from "../src/server/ts-client.js";
import { silentLogger } from "./helpers/logger.js";
test("TSClient keeps the supplied identity material for reconnects", () => {
@@ -10,3 +10,19 @@ test("TSClient keeps the supplied identity material for reconnects", () => {
const client = new TSClient({ target: parseTeamSpeakTarget("example.com:9987"), nickname: "Guest", identity }, silentLogger);
assert.equal(client.getIdentityString(), identity.toString());
});
test("TSClient preserves the TeamSpeak target id for private chat events", () => {
const message = toTSChatMessage({
invokerName: "Alice",
invokerUID: "uid-alice",
message: "hello",
invokerGroups: [],
targetMode: 1,
targetID: 42n,
invokerID: 7,
});
assert.equal(message.targetId, 42n);
assert.equal(message.invokerId, 7);
assert.equal(message.invokerUid, "uid-alice");
});