mirror of
https://github.com/EchoSixHIYA/WebSpeak-client-for-TeamSpeak.git
synced 2026-12-03 03:52:50 +08:00
fix: consolidate audited dev updates
This commit is contained in:
1 parent
568b8fd8be
commit
0a552f7ee8
58 files changed
+1930
-132
No files matched your search
@@ -30,6 +30,7 @@ const eventLabels: Record<string, AdminTranslationKey> = {
|
||||
};
|
||||
const errorLabels: Record<string, AdminTranslationKey> = {
|
||||
INVALID_PASSWORD: "invalidPassword", INVALID_ADMIN_PASSWORD: "setupPasswordShort", PASSWORD_CHANGE_REQUIRED: "changePasswordLead", RATE_LIMITED: "rateLimited",
|
||||
INVALID_WEBRTC_PUBLIC_HOST: "invalidWebRtcNetworkError", INVALID_WEBRTC_STUN_SERVER: "invalidWebRtcNetworkError", INVALID_WEBRTC_IPV6: "invalidWebRtcNetworkError",
|
||||
INVALID_WEBRTC_PORT_RANGE: "invalidWebRtcPortRangeError", WEBRTC_PORT_LOCKED: "webRtcPortLockedError",
|
||||
INVALID_RELAY_NAME: "invalidRelayNameError", INVALID_RELAY_TARGET: "invalidRelayTargetError", INVALID_RELAY_TOKEN: "invalidRelayTokenError",
|
||||
INVALID_TARGET: "invalidTargetError", PING_UNAVAILABLE: "icmpUnavailableError", HOST_NOT_FOUND: "probeHostNotFoundError",
|
||||
|
||||
@@ -13,11 +13,11 @@ interface Options { api: AdminApi; errorMessage: Ref<string>; errorText(code?: s
|
||||
function emptyForm() {
|
||||
return { address: "", port: "9987", serverPassword: "", passwordAction: "keep" as SecretAction, hasPassword: false,
|
||||
accessMode: "fixed" as "fixed" | "open", siteName: "WebSpeak", welcomeText: "", welcomeTextEn: "", welcomeTextDe: "", welcomeTextRu: "", welcomeTextJa: "",
|
||||
welcomeDefaults: { ...DEFAULT_WELCOME_TEXTS }, webRtcEnabled: false, webRtcUdpStart: 40000, webRtcUdpEnd: 40099,
|
||||
welcomeDefaults: { ...DEFAULT_WELCOME_TEXTS }, webRtcPublicHost: "", webRtcIpv6Enabled: false, webRtcStunServer: "", webRtcEnabled: false, webRtcUdpStart: 40000, webRtcUdpEnd: 40099,
|
||||
relayNodes: [] as RelayNodeForm[], lastTestAt: null as string | null, lastTestLatencyMs: null as number | null };
|
||||
}
|
||||
type ServerForm = ReturnType<typeof emptyForm>;
|
||||
const editable = ["address", "port", "accessMode", "siteName", "welcomeText", "welcomeTextEn", "welcomeTextDe", "welcomeTextRu", "welcomeTextJa", "webRtcEnabled", "webRtcUdpStart", "webRtcUdpEnd"] as const;
|
||||
const editable = ["address", "port", "accessMode", "siteName", "welcomeText", "welcomeTextEn", "welcomeTextDe", "welcomeTextRu", "welcomeTextJa", "webRtcEnabled", "webRtcPublicHost", "webRtcIpv6Enabled", "webRtcStunServer", "webRtcUdpStart", "webRtcUdpEnd"] as const;
|
||||
const snapshot = (form: ServerForm): ServerForm => JSON.parse(JSON.stringify(form));
|
||||
|
||||
export function useAdminServerSettings(options: Options) {
|
||||
@@ -97,6 +97,7 @@ export function useAdminServerSettings(options: Options) {
|
||||
return { target: combineTeamSpeakTarget(serverForm.address, serverForm.port), serverPassword: serverForm.passwordAction === "replace" ? serverForm.serverPassword : undefined,
|
||||
passwordAction: serverForm.passwordAction, accessMode: serverForm.accessMode, siteName: serverForm.siteName,
|
||||
welcomeText: serverForm.welcomeText, welcomeTextEn: serverForm.welcomeTextEn, welcomeTextDe: serverForm.welcomeTextDe, welcomeTextRu: serverForm.welcomeTextRu, welcomeTextJa: serverForm.welcomeTextJa,
|
||||
webRtcPublicHost: serverForm.webRtcPublicHost, webRtcIpv6Enabled: serverForm.webRtcIpv6Enabled, webRtcStunServer: serverForm.webRtcStunServer,
|
||||
webRtcEnabled: serverForm.webRtcEnabled, webRtcUdpStart: serverForm.webRtcUdpStart, webRtcUdpEnd: serverForm.webRtcUdpEnd,
|
||||
relayNodes: serverForm.relayNodes.map(node => ({ id: node.id, name: node.name, target: node.target, enabled: node.enabled, tokenAction: node.tokenAction, ...(node.tokenAction === "replace" ? { token: node.token } : {}) })) };
|
||||
}
|
||||
|
||||
@@ -3,12 +3,12 @@ import { listInstalledSkins, loadLocalPreferences, saveLocalPreferences } from "
|
||||
import { BUILTIN_SKIN_CATALOG, getPublicDefaultSkinId, isPublicSkinEnabled, listPublicSkins, type SkinCatalogEntry } from "../services/skin-catalog.js";
|
||||
import { activateSkin, BUILTIN_DARK_SKIN, BUILTIN_LIGHT_SKIN, clearCustomSkinStyle, getStoredSkinId } from "../services/skin-runtime.js";
|
||||
import { createSkinOperation } from "../services/skin-operation.js";
|
||||
import { applyTheme, getStoredTheme, isDarkTheme, saveTheme } from "../services/theme.js";
|
||||
import { getStoredTheme, isDarkTheme, saveTheme, type ThemeMode } from "../services/theme.js";
|
||||
import type { InstalledSkin } from "../services/skin-pack.js";
|
||||
|
||||
interface PublicSkinOptions {
|
||||
activeSkin?: Ref<InstalledSkin | null>;
|
||||
themeMode?: Ref<"light" | "dark">;
|
||||
themeMode?: Ref<ThemeMode>;
|
||||
appVersion?: () => string;
|
||||
timeoutMs?: number;
|
||||
}
|
||||
@@ -34,7 +34,7 @@ export function usePublicSkin(options: PublicSkinOptions = {}) {
|
||||
}
|
||||
onScopeDispose(() => { disposed = true; cancel(); });
|
||||
|
||||
async function apply(id: string, operation: ReturnType<typeof createSkinOperation>, persist = true) {
|
||||
async function apply(id: string, operation: ReturnType<typeof createSkinOperation>, persist = true, updateTheme = false) {
|
||||
operation.check();
|
||||
const entry = catalogSkins.value.find(skin => skin.id === id);
|
||||
const skin = await operation.wait(activateSkin(id, entry?.version, options.appVersion?.(), { signal: operation.signal }));
|
||||
@@ -43,9 +43,12 @@ export function usePublicSkin(options: PublicSkinOptions = {}) {
|
||||
activeSkinId.value = skin?.id ?? (builtin(id) ? id : fallbackId());
|
||||
const mode = activeSkinId.value === BUILTIN_LIGHT_SKIN ? "light"
|
||||
: activeSkinId.value === BUILTIN_DARK_SKIN ? "dark" : isDarkTheme(getStoredTheme()) ? "dark" : "light";
|
||||
if (options.themeMode) options.themeMode.value = mode;
|
||||
if (options.themeMode && updateTheme) {
|
||||
options.themeMode.value = mode;
|
||||
saveTheme(mode);
|
||||
}
|
||||
if (persist) void saveLocalPreferences({ schemaVersion: 1, skinId: activeSkinId.value,
|
||||
...(options.themeMode ? { theme: mode } : {}) }, operation.signal).catch(() => undefined);
|
||||
...(options.themeMode && updateTheme ? { theme: mode } : {}) }, operation.signal).catch(() => undefined);
|
||||
}
|
||||
async function recover(error: unknown, operation: ReturnType<typeof createSkinOperation>) {
|
||||
if (!owns(operation) || (error as { name?: string })?.name === "AbortError") return;
|
||||
@@ -66,7 +69,7 @@ export function usePublicSkin(options: PublicSkinOptions = {}) {
|
||||
installedSkins.value = installed;
|
||||
catalogSkins.value = available;
|
||||
if (options.themeMode && !localStorage.getItem("webspeak:theme")) {
|
||||
if (preferences.theme) options.themeMode.value = isDarkTheme(preferences.theme) ? "dark" : "light";
|
||||
if (preferences.theme) options.themeMode.value = preferences.theme;
|
||||
saveTheme(options.themeMode.value);
|
||||
}
|
||||
// Only an explicit user choice overrides the instance default.
|
||||
@@ -80,7 +83,7 @@ export function usePublicSkin(options: PublicSkinOptions = {}) {
|
||||
const operation = begin();
|
||||
try {
|
||||
try { localStorage.setItem("webspeak:skin-choice", id); } catch { /* Optional storage. */ }
|
||||
await apply(id, operation);
|
||||
await apply(id, operation, true, true);
|
||||
} catch (error) { await recover(error, operation); }
|
||||
finally { if (owns(operation)) skinReady.value = true; operation.finish(); }
|
||||
}
|
||||
@@ -91,10 +94,11 @@ export function usePublicSkin(options: PublicSkinOptions = {}) {
|
||||
activeSkin.value = null;
|
||||
installedSkins.value = [];
|
||||
catalogSkins.value = [...BUILTIN_SKIN_CATALOG];
|
||||
const mode = isDarkTheme("system") ? "dark" : "light";
|
||||
const mode: ThemeMode = "system";
|
||||
if (options.themeMode) options.themeMode.value = mode;
|
||||
applyTheme(mode);
|
||||
activeSkinId.value = mode === "dark" ? BUILTIN_DARK_SKIN : BUILTIN_LIGHT_SKIN;
|
||||
saveTheme(mode);
|
||||
const builtInMode = isDarkTheme(mode) ? "dark" : "light";
|
||||
activeSkinId.value = builtInMode === "dark" ? BUILTIN_DARK_SKIN : BUILTIN_LIGHT_SKIN;
|
||||
skinReady.value = true;
|
||||
try { catalogSkins.value = await operation.wait(listPublicSkins({ signal: operation.signal })); }
|
||||
catch { /* Reset remains usable even if refreshing the optional catalog fails. */ }
|
||||
|
||||
@@ -12,6 +12,7 @@ import { createAudioDiagnostics, type AudioPermission, type VoiceAudioStatusSamp
|
||||
export type { AudioPermission, BrowserVoiceAudioStats, VoiceAudioStatusSample } from "../voice/audio-diagnostics.js";
|
||||
import type { SinkAudioElement } from "../voice/webrtc-playback.js";
|
||||
import { createScreenShareController } from "../voice/screen-share.js";
|
||||
import { requestMediaBeforeAudioResume } from "../services/microphone-start.js";
|
||||
export type { ScreenShareOutputSettings, ScreenShareCaptureStats, ScreenSharePeerStats, ScreenShareWebRtcStats } from "../voice/screen-share.js";
|
||||
import { parseServerMessage } from "../../../src/shared/server-messages.js";
|
||||
import type { ChatMessage } from "../../../src/shared/voice-models.js";
|
||||
@@ -323,7 +324,9 @@ export function useVoiceWebSocket() {
|
||||
onDecodeError: () => audioDiagnostics.count("decodeErrors"),
|
||||
onDrop: () => audioDiagnostics.count("framesDropped"),
|
||||
});
|
||||
let webRtcStunServer = "";
|
||||
const webrtc = createWebRtcTransport({
|
||||
stunServer: () => webRtcStunServer,
|
||||
prepareMicrophone: async () => {
|
||||
await ensureMicrophone();
|
||||
return micStream ? { context: getAudioCtx(), stream: micStream,
|
||||
@@ -677,11 +680,10 @@ export function useVoiceWebSocket() {
|
||||
let nextCapture: MicrophoneCapture | null = null;
|
||||
let factoryOwnsStream = false;
|
||||
try {
|
||||
if (ctx.state === "suspended") {
|
||||
try { await ctx.resume(); } catch { /* the audio context notice explains the silence */ }
|
||||
}
|
||||
assertCurrent();
|
||||
nextStream = await navigator.mediaDevices.getUserMedia({ audio: microphoneConstraints() });
|
||||
nextStream = await requestMediaBeforeAudioResume(
|
||||
() => navigator.mediaDevices.getUserMedia({ audio: microphoneConstraints() }),
|
||||
() => ctx.state === "suspended" ? ctx.resume() : Promise.resolve(),
|
||||
);
|
||||
assertCurrent();
|
||||
audioPermission.value = "granted";
|
||||
factoryOwnsStream = true;
|
||||
@@ -1051,6 +1053,7 @@ export function useVoiceWebSocket() {
|
||||
// native TeamSpeak users even before WebRTC negotiation completes.
|
||||
sendCmd("setMicrophoneMuted", { muted: microphoneMuted.value });
|
||||
screenShare.setIceServers(msg.screenShareIceServers);
|
||||
webRtcStunServer = msg.webRtcStunServer ?? "";
|
||||
sessionState.connected(msg);
|
||||
applyWhisperState(msg.whisperTargetIds, msg.whisperActive);
|
||||
if (typeof msg.identity === "string" && msg.identity.length <= 8192) {
|
||||
|
||||
@@ -1,5 +1,6 @@
|
||||
import { computed, nextTick, onScopeDispose, ref, watch, type Ref } from "vue";
|
||||
import type { ChannelInfo, ChannelMember, ChatMessage } from "./useVoiceWebSocket.js";
|
||||
import { loadChatHistory, normalizeChatHistoryServerKey, saveChatHistoryMessage } from "../services/local-persistence.js";
|
||||
|
||||
export type WebClientChatTab = "channel" | "server" | "private" | "events";
|
||||
|
||||
@@ -19,7 +20,7 @@ interface UseWebClientChatOptions {
|
||||
clientId: Readonly<Ref<number>>;
|
||||
connected: Readonly<Ref<boolean>>;
|
||||
sessionEpoch: Readonly<Ref<number>>;
|
||||
memberConversationKey: (id: number) => string | undefined;
|
||||
serverKey: Readonly<Ref<string>>;
|
||||
isMobileViewport: Readonly<Ref<boolean>>;
|
||||
mobileSection: Ref<"channels" | "chat" | "voice" | "more">;
|
||||
closeMemberMenu: () => void;
|
||||
@@ -39,7 +40,7 @@ export function useWebClientChat({
|
||||
clientId,
|
||||
connected,
|
||||
sessionEpoch,
|
||||
memberConversationKey,
|
||||
serverKey,
|
||||
isMobileViewport,
|
||||
mobileSection,
|
||||
closeMemberMenu,
|
||||
@@ -60,12 +61,24 @@ export function useWebClientChat({
|
||||
const pending = new Map<string, object>();
|
||||
const errors = new Map<string, string>();
|
||||
let disposed = false;
|
||||
const recipient = computed(() => members.find(member => member.id === privateClientId.value && memberConversationKey(member.id) === privateConversationKey.value));
|
||||
let followingLatest = true;
|
||||
let scrollGeneration = 0;
|
||||
let historyGeneration = 0;
|
||||
const persistedMessageIds = new Set<string>();
|
||||
const memberKey = (member: ChannelMember) => member.uid ? `uid:${member.uid}` : `client:${JSON.stringify([member.id, member.nickname])}`;
|
||||
const recipient = computed(() => members.find(member => member.id === privateClientId.value && memberKey(member) === privateConversationKey.value));
|
||||
const destination = computed(() => `${sessionEpoch.value}:${tab.value}:${tab.value === "private" ? privateConversationKey.value : tab.value === "channel" ? currentChannel.value?.id ?? selectedChannelId.value : ""}`);
|
||||
const canSend = computed(() => connected.value && !sending.value && tab.value !== "events" && (tab.value !== "private" || Boolean(recipient.value)));
|
||||
const status = computed(() => sendError.value ? t(sendError.value) : sending.value ? t("chatSending")
|
||||
: !connected.value ? t("chatNotConnected") : tab.value === "private" && !recipient.value ? t("chatTargetUnavailable") : "");
|
||||
const messageKey = (message: ChatMessage) => message.conversationKey ?? `legacy:${message.id}`;
|
||||
const messageKey = (message: ChatMessage) => {
|
||||
if (message.scope !== "private") return `legacy:${message.id}`;
|
||||
if (message.conversationKey?.startsWith("uid:")) return message.conversationKey;
|
||||
if (message.senderUid && !message.isSelf) return `uid:${message.senderUid}`;
|
||||
const id = Number(message.conversationId) || message.senderId || 0;
|
||||
const name = message.conversationName || (message.isSelf ? "" : message.invokerName);
|
||||
return id ? `client:${JSON.stringify([id, name])}` : `legacy:${message.id}`;
|
||||
};
|
||||
|
||||
const conversations = computed<PrivateConversation[]>(() => {
|
||||
const byConversation = new Map<string, PrivateConversation>();
|
||||
@@ -74,7 +87,7 @@ export function useWebClientChat({
|
||||
const id = Number(message.conversationId);
|
||||
if (!id) continue;
|
||||
const key = messageKey(message);
|
||||
const member = members.find(candidate => memberConversationKey(candidate.id) === key);
|
||||
const member = members.find(candidate => memberKey(candidate) === key);
|
||||
const existing = byConversation.get(key);
|
||||
byConversation.set(key, {
|
||||
id: member?.id ?? id, key,
|
||||
@@ -105,13 +118,29 @@ export function useWebClientChat({
|
||||
|
||||
function scrollToEnd(): void {
|
||||
const list = listElement.value;
|
||||
if (!disposed && list) list.scrollTo({ top: list.scrollHeight, behavior: "smooth" });
|
||||
if (!disposed && list && (!isMobileViewport.value || mobileSection.value === "chat")) {
|
||||
followingLatest = true;
|
||||
list.scrollTo({ top: list.scrollHeight, behavior: "auto" });
|
||||
}
|
||||
}
|
||||
|
||||
function onScroll(): void {
|
||||
const list = listElement.value;
|
||||
if (list && list.clientHeight > 0) followingLatest = list.scrollHeight - list.scrollTop - list.clientHeight < 48;
|
||||
}
|
||||
|
||||
function scrollIfFollowing(): void {
|
||||
if (!followingLatest) return;
|
||||
const generation = scrollGeneration;
|
||||
void nextTick(() => {
|
||||
if (generation === scrollGeneration && followingLatest) scrollToEnd();
|
||||
});
|
||||
}
|
||||
|
||||
function openPrivateChat(targetClientId: number): void {
|
||||
const member = members.find(candidate => candidate.id === targetClientId);
|
||||
const key = memberConversationKey(targetClientId);
|
||||
if (!member || !key || targetClientId === clientId.value) return;
|
||||
if (!member || targetClientId === clientId.value) return;
|
||||
const key = memberKey(member);
|
||||
openConversation({ id: targetClientId, key, name: member.nickname, lastMessage: 0 });
|
||||
}
|
||||
|
||||
@@ -122,7 +151,8 @@ export function useWebClientChat({
|
||||
tab.value = "private";
|
||||
if (isMobileViewport.value) mobileSection.value = "chat";
|
||||
closeMemberMenu();
|
||||
void nextTick(scrollToEnd);
|
||||
followingLatest = true;
|
||||
scrollIfFollowing();
|
||||
}
|
||||
|
||||
async function submitMessage(): Promise<void> {
|
||||
@@ -161,12 +191,17 @@ export function useWebClientChat({
|
||||
}
|
||||
|
||||
watch(destination, (next, previous) => {
|
||||
scrollGeneration++;
|
||||
followingLatest = true;
|
||||
scrollIfFollowing();
|
||||
drafts.set(previous, messageDraft.value);
|
||||
messageDraft.value = drafts.get(next) ?? "";
|
||||
sending.value = pending.has(next);
|
||||
sendError.value = errors.get(next) ?? "";
|
||||
}, { flush: "sync" });
|
||||
watch(sessionEpoch, () => {
|
||||
historyGeneration++;
|
||||
persistedMessageIds.clear();
|
||||
drafts.clear();
|
||||
pending.clear();
|
||||
errors.clear();
|
||||
@@ -180,7 +215,34 @@ export function useWebClientChat({
|
||||
}, { flush: "sync" });
|
||||
onScopeDispose(() => { disposed = true; drafts.clear(); pending.clear(); errors.clear(); sending.value = false; });
|
||||
|
||||
watch([() => messages.length, tab, privateClientId], () => { void nextTick(scrollToEnd); });
|
||||
watch([connected, sessionEpoch, serverKey], async ([isConnected, _epoch, target]) => {
|
||||
const generation = ++historyGeneration;
|
||||
persistedMessageIds.clear();
|
||||
if (!isConnected || !target) return;
|
||||
const normalizedKey = normalizeChatHistoryServerKey(target);
|
||||
const history = await loadChatHistory(normalizedKey);
|
||||
if (disposed || generation !== historyGeneration || !connected.value || normalizeChatHistoryServerKey(serverKey.value) !== normalizedKey) return;
|
||||
const existingIds = new Set(messages.map(message => message.id));
|
||||
const additions = history.filter(message => !existingIds.has(message.id));
|
||||
if (additions.length) messages.splice(0, messages.length, ...[...messages, ...additions].sort((left, right) => left.timestamp - right.timestamp));
|
||||
for (const message of messages) if (!message.isHistory) persistedMessageIds.add(message.id);
|
||||
}, { immediate: true });
|
||||
|
||||
watch(() => messages.length, () => {
|
||||
if (!connected.value || !serverKey.value) return;
|
||||
const key = normalizeChatHistoryServerKey(serverKey.value);
|
||||
for (const message of messages) {
|
||||
if (message.isHistory || message.scope === "system" || persistedMessageIds.has(message.id)) continue;
|
||||
persistedMessageIds.add(message.id);
|
||||
void saveChatHistoryMessage(key, message);
|
||||
}
|
||||
}, { flush: "sync" });
|
||||
|
||||
watch(() => visibleMessages.value.at(-1)?.id, () => {
|
||||
if (visibleMessages.value.at(-1)?.isSelf) followingLatest = true;
|
||||
scrollIfFollowing();
|
||||
});
|
||||
watch(mobileSection, (section) => { if (section === "chat") scrollIfFollowing(); });
|
||||
watch(() => messages.length, (length, previousLength) => {
|
||||
const latest = messages[length - 1];
|
||||
if (latest && length > previousLength && latest.scope === "private" && !latest.isSelf) notifyPrivateMessage();
|
||||
@@ -202,5 +264,7 @@ export function useWebClientChat({
|
||||
openConversation,
|
||||
submitMessage,
|
||||
scrollToEnd,
|
||||
onScroll,
|
||||
scrollIfFollowing,
|
||||
};
|
||||
}
|
||||
@@ -46,6 +46,7 @@ interface UseWebClientConnectionOptions {
|
||||
saveNickname: (nickname: string) => void;
|
||||
showToast: (message: string) => void;
|
||||
t: (key: string) => string;
|
||||
beforeConnect?: () => void;
|
||||
}
|
||||
|
||||
export function useWebClientConnection({
|
||||
@@ -77,6 +78,7 @@ export function useWebClientConnection({
|
||||
saveNickname,
|
||||
showToast,
|
||||
t,
|
||||
beforeConnect,
|
||||
}: UseWebClientConnectionOptions) {
|
||||
const canJoin = computed(() => Boolean(
|
||||
initialized.value
|
||||
@@ -90,6 +92,7 @@ export function useWebClientConnection({
|
||||
|
||||
function doConnect(): void {
|
||||
if (!canJoin.value || isConnecting.value) return;
|
||||
beforeConnect?.();
|
||||
clearError();
|
||||
nickname.value = nickname.value.trim();
|
||||
saveNickname(nickname.value);
|
||||
|
||||
@@ -18,6 +18,7 @@ interface UseWebClientMembersOptions {
|
||||
setWhisperTargets: (clientIds: number[]) => void;
|
||||
sendPoke: (clientId: number, message: string) => void;
|
||||
setAway: (away: boolean, message: string) => void;
|
||||
onManualStatusChange?: () => void;
|
||||
stopWhisperTalk: () => void;
|
||||
localizedMessage: (message: string) => string;
|
||||
showToast: (message: string) => void;
|
||||
@@ -34,6 +35,7 @@ export function useWebClientMembers({
|
||||
setWhisperTargets,
|
||||
sendPoke,
|
||||
setAway,
|
||||
onManualStatusChange,
|
||||
stopWhisperTalk,
|
||||
localizedMessage,
|
||||
showToast,
|
||||
@@ -243,11 +245,18 @@ export function useWebClientMembers({
|
||||
}
|
||||
|
||||
function toggleAway(): void {
|
||||
onManualStatusChange?.();
|
||||
away.value = !away.value;
|
||||
awayMessage.value = away.value ? (window.prompt(t("awayPrompt"), awayMessage.value) ?? "") : "";
|
||||
setAway(away.value, awayMessage.value);
|
||||
}
|
||||
|
||||
function setAutomaticAway(value: boolean): void {
|
||||
away.value = value;
|
||||
if (!value) awayMessage.value = "";
|
||||
setAway(value, awayMessage.value);
|
||||
}
|
||||
|
||||
function isSpeaking(member: ChannelMember): boolean {
|
||||
return speakingIds.has(member.id);
|
||||
}
|
||||
@@ -268,6 +277,7 @@ export function useWebClientMembers({
|
||||
memberMoveMenuOtherChannels,
|
||||
openMemberMenu,
|
||||
openMemberActions,
|
||||
setAutomaticAway,
|
||||
toggleMemberMoveMenu,
|
||||
moveMemberDirect,
|
||||
onMemberDragStart,
|
||||
|
||||
Reference in new issue
Block a user