Skipped 1 file(s) >100MB (GitHub limit): source/__polyfill/04xxx/module_4973.js (118.4 MB)
126 lines
3.9 KiB
TypeScript
126 lines
3.9 KiB
TypeScript
// Module ID: 9650
|
|
// Function ID: 9651
|
|
// Name: useIsSpeaking
|
|
// Dependencies: [5256, 2095, 5668, 4807, 504, 2]
|
|
// Exports: default, getIsSpeaking
|
|
|
|
// Module 9650 (useIsSpeaking)
|
|
import SoundboardStore from "SoundboardStore" /* 5256 */;
|
|
import SelectedChannelStore from "SelectedChannelStore" /* 2095 */;
|
|
import SpeakingStore from "SpeakingStore" /* 5668 */;
|
|
import VoiceStateStore from "VoiceStateStore" /* 4807 */;
|
|
|
|
const require = globalThis.__r;
|
|
|
|
const require = fn;
|
|
const size = fn(2);
|
|
const result = size.fileFinishedImporting("hooks/useIsSpeaking.tsx");
|
|
|
|
export default function useIsSpeaking(checkSoundboardSounds) {
|
|
({ userId: require, checkSoundSharing } = checkSoundboardSounds);
|
|
if (checkSoundSharing === undefined) {
|
|
checkSoundSharing = false;
|
|
}
|
|
let flag = checkSoundboardSounds.checkSoundboardSounds;
|
|
if (flag === undefined) {
|
|
flag = true;
|
|
}
|
|
let flag2 = checkSoundboardSounds.checkIsMuted;
|
|
if (flag2 === undefined) {
|
|
flag2 = false;
|
|
}
|
|
const context = checkSoundboardSounds.context;
|
|
flag2 = undefined;
|
|
const items = [VoiceStateStore, context];
|
|
const stateFromStores = require("initialize").useStateFromStores(items, () => {
|
|
const voiceChannelId = SelectedChannelStore.getVoiceChannelId();
|
|
let voiceStateForChannel = null;
|
|
if (null != voiceChannelId) {
|
|
voiceStateForChannel = VoiceStateStore.getVoiceStateForChannel(voiceChannelId, require);
|
|
}
|
|
return voiceStateForChannel;
|
|
});
|
|
if (flag2) {
|
|
let mute;
|
|
if (stateFromStores != null) {
|
|
mute = stateFromStores.mute;
|
|
}
|
|
if (!mute) {
|
|
let selfMute;
|
|
if (stateFromStores != null) {
|
|
selfMute = stateFromStores.selfMute;
|
|
}
|
|
mute = selfMute;
|
|
}
|
|
flag2 = mute;
|
|
}
|
|
const obj = require("initialize");
|
|
const items1 = [flag2];
|
|
let stateFromStores1 = require("initialize").useStateFromStores(items1, () => {
|
|
let isSpeakingResult = SpeakingStore.isSpeaking(require, context);
|
|
if (isSpeakingResult) {
|
|
isSpeakingResult = !flag2;
|
|
}
|
|
return isSpeakingResult;
|
|
});
|
|
const tmpResult = require("initialize");
|
|
const items2 = [flag2];
|
|
const stateFromStores2 = require("initialize").useStateFromStores(items2, () => SpeakingStore.isSoundSharing(require) && checkSoundSharing);
|
|
const tmpResult3 = require("initialize");
|
|
const items3 = [flag];
|
|
if (!stateFromStores1) {
|
|
stateFromStores1 = tmpResult4.useStateFromStores(items3, () => SoundboardStore.isUserPlayingSounds(require) && flag);
|
|
}
|
|
if (!stateFromStores1) {
|
|
stateFromStores1 = stateFromStores2;
|
|
}
|
|
return stateFromStores1;
|
|
};
|
|
export const getIsSpeaking = function getIsSpeaking(checkSoundboardSounds) {
|
|
({ userId, checkSoundSharing } = checkSoundboardSounds);
|
|
if (checkSoundSharing === undefined) {
|
|
checkSoundSharing = false;
|
|
}
|
|
let flag = checkSoundboardSounds.checkSoundboardSounds;
|
|
if (flag === undefined) {
|
|
flag = true;
|
|
}
|
|
let flag2 = checkSoundboardSounds.checkIsMuted;
|
|
if (flag2 === undefined) {
|
|
flag2 = false;
|
|
}
|
|
let tmp = arg1;
|
|
if (arg1 === undefined) {
|
|
const items = [VoiceStateStore, SelectedChannelStore, SpeakingStore, SoundboardStore];
|
|
tmp = items;
|
|
}
|
|
[obj, obj2, obj3, obj4] = tmp;
|
|
const voiceChannelId = obj2.getVoiceChannelId();
|
|
let voiceStateForChannel = null;
|
|
if (null != voiceChannelId) {
|
|
voiceStateForChannel = obj.getVoiceStateForChannel(voiceChannelId, userId);
|
|
}
|
|
if (flag2) {
|
|
let mute;
|
|
if (voiceStateForChannel != null) {
|
|
mute = voiceStateForChannel.mute;
|
|
}
|
|
if (!mute) {
|
|
let selfMute;
|
|
if (voiceStateForChannel != null) {
|
|
selfMute = voiceStateForChannel.selfMute;
|
|
}
|
|
mute = selfMute;
|
|
}
|
|
flag2 = mute;
|
|
}
|
|
let tmp10 = obj3.isSpeaking(userId, checkSoundboardSounds.context) && !flag2;
|
|
const tmp11 = obj3.isSoundSharing(userId) && checkSoundSharing;
|
|
if (!tmp10) {
|
|
tmp10 = tmp12;
|
|
}
|
|
if (!tmp10) {
|
|
tmp10 = tmp11;
|
|
}
|
|
return tmp10;
|
|
};
|