decord/beta/source/modules/channel/shouldShowVoiceChannelChangeConfirmation.tsx
2026-10-07 22:43:51 +00:00

40 lines
1.6 KiB
TypeScript

// Module ID: 12732
// Function ID: 12733
// Name: shouldShowVoiceChannelChangeConfirmation
// Dependencies: [4907, 1195, 502, 2074, 4909, 2]
// Exports: shouldShowVoiceChannelChangeConfirmation
// Module 12732 (shouldShowVoiceChannelChangeConfirmation)
import GameConsoleStore from "GameConsoleStore" /* 4907 */;
import UnsyncedUserSettingsStore from "UnsyncedUserSettingsStore" /* 1195 */;
import AuthenticationStore from "AuthenticationStore" /* 502 */;
import GuildStore from "GuildStore" /* 2074 */;
import VoiceStateStore from "VoiceStateStore" /* 4909 */;
import size from "module_2" /* 2 */;
const result = size.fileFinishedImporting("modules/channel/shouldShowVoiceChannelChangeConfirmation.tsx");
export const shouldShowVoiceChannelChangeConfirmation = function shouldShowVoiceChannelChangeConfirmation(id) {
if (UnsyncedUserSettingsStore.disableVoiceChannelChangeAlert) {
return false;
} else {
const remoteSessionId = GameConsoleStore.getRemoteSessionId();
if (null != VoiceStateStore.getVoiceStateForSession(AuthenticationStore.getId(), remoteSessionId)) {
return false;
} else if (VoiceStateStore.isCurrentClientInVoiceChannel()) {
if (VoiceStateStore.isInChannel(id.id)) {
return false;
} else {
const guild = GuildStore.getGuild(id.getGuildId());
let afkChannelId;
if (guild != null) {
afkChannelId = guild.afkChannelId;
}
const tmp9 = null == afkChannelId || !VoiceStateStore.isInChannel(guild.afkChannelId);
return tmp9;
}
} else {
return false;
}
}
};