Merge upstream/main into GreenTeaSpeak main to resolve PR #4 conflicts.

Keep TeaSpeak/GTS multi-tab work while integrating channel-password prompts and the Pulse theme.

Co-authored-by: Cursor <cursoragent@cursor.com>
This commit is contained in:
Nico B.andCursor committed 2026-09-06 00:54:04 +02:00
commit 3db5d90d89
7 files changed
+719 -20

No files matched your search

+9 -2
View File
@@ -131,6 +131,7 @@ export type Ts3ConnectionEvent =
| { type: "talkers"; clients: number[] }
| { type: "disconnected"; reason: string }
| { type: "error"; message: string }
| { type: "channelPasswordRequired"; channelId: number }
| ({ type: "serverLog" } & ServerLogEntry)
| {
type: "clientConnectionInfo";
@@ -293,6 +294,7 @@ export class Ts3Connection {
| { type: "talkers"; clients: number[] }
| { type: "disconnected"; reason: string }
| { type: "error"; message: string }
| { type: "channelPasswordRequired"; channel_id: number }
| ({ type: "serverLog" } & ServerLogEntry)
| {
type: "clientConnectionInfo";
@@ -516,6 +518,8 @@ export class Ts3Connection {
message: event.message,
timestamp: event.timestamp,
});
} else if (event.type === "channelPasswordRequired") {
this.emit({ type: "channelPasswordRequired", channelId: event.channel_id });
} else {
this.emit(event);
}
@@ -537,10 +541,13 @@ export class Ts3Connection {
});
}
async switchChannel(channelId: number): Promise<void> {
async switchChannel(channelId: number, channelPassword?: string): Promise<void> {
const id = Number(channelId);
if (!Number.isFinite(id)) return;
this.child?.stdin.write(`switch ${id}\n`);
// The password travels base64-encoded on this line-based stdin protocol
// so it can safely contain spaces or other characters.
const passwordArg = channelPassword ? ` ${Buffer.from(channelPassword, "utf8").toString("base64")}` : "";
this.child?.stdin.write(`switch ${id}${passwordArg}\n`);
}
async getClientConnectionInfo(clientId: number): Promise<void> {