decord/alpha/source/modules/channel/shouldShowVoiceChannelChangeConfirmation.tsx

40 lines
1.5 KiB
TypeScript
Raw Normal View History

// Module ID: 12696
// Function ID: 12697
2026-07-20 16:05:17 +00:00
// Name: shouldShowVoiceChannelChangeConfirmation
// Dependencies: [4862, 1184, 502, 2066, 4864, 2]
2026-07-20 16:05:17 +00:00
// Exports: shouldShowVoiceChannelChangeConfirmation
// Module 12696 (shouldShowVoiceChannelChangeConfirmation)
import GameConsoleStore from "GameConsoleStore" /* 4862 */;
import UnsyncedUserSettingsStore from "UnsyncedUserSettingsStore" /* 1184 */;
import AuthenticationStore from "AuthenticationStore" /* 502 */;
import GuildStore from "GuildStore" /* 2066 */;
import VoiceStateStore from "VoiceStateStore" /* 4864 */;
2026-07-23 10:11:24 +00:00
const size = fn(2);
const result = size.fileFinishedImporting("modules/channel/shouldShowVoiceChannelChangeConfirmation.tsx");
2026-07-20 16:05:17 +00:00
export const shouldShowVoiceChannelChangeConfirmation = function shouldShowVoiceChannelChangeConfirmation(id) {
if (UnsyncedUserSettingsStore.disableVoiceChannelChangeAlert) {
2026-07-20 16:05:17 +00:00
return false;
} else {
const remoteSessionId = GameConsoleStore.getRemoteSessionId();
if (null != VoiceStateStore.getVoiceStateForSession(AuthenticationStore.getId(), remoteSessionId)) {
2026-07-20 16:05:17 +00:00
return false;
2026-07-29 08:29:29 +00:00
} else if (obj.isCurrentClientInVoiceChannel()) {
if (obj.isInChannel(id.id)) {
2026-07-20 16:05:17 +00:00
return false;
} else {
const guild = GuildStore.getGuild(id.getGuildId());
2026-07-20 16:05:17 +00:00
let afkChannelId;
2026-07-29 08:29:29 +00:00
if (guild != null) {
2026-07-20 16:05:17 +00:00
afkChannelId = guild.afkChannelId;
}
2026-07-29 08:29:29 +00:00
return null == afkChannelId || !obj.isInChannel(guild.afkChannelId);
2026-07-20 16:05:17 +00:00
}
} else {
return false;
}
}
};