146 lines
6.1 KiB
TypeScript
146 lines
6.1 KiB
TypeScript
/* Metro module 4612; source: hooks/useIsSpeaking.tsx; dependencies: [4613, 1934, 4607, 4297, 566, 2] */
|
|
function _fun39574(global, require, importDefault, importAll, module, exports, dependencyMap) { // fn#39574, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:4790:6, offset: 0x010e5b07, size: 180 bytes, params: 8, frame: 19
|
|
const env0_0 = require;
|
|
const _checkIsSpeaking = function(a0, a1, a2) {
|
|
var value = a0;
|
|
var value2 = a1;
|
|
var value3 = a2;
|
|
var r0 = value || value2;
|
|
r0 = !r0 ? value3 : r0;
|
|
return r0;
|
|
};
|
|
const Object = global.Object;
|
|
Object.defineProperty(exports, '__esModule', {value: true});
|
|
const soundboardStore = importDefault(4613) /* metro dependency 4613: SoundboardStore */;
|
|
const selectedChannelStore = importDefault(1934) /* metro dependency 1934: SelectedChannelStore */;
|
|
const speakingStore = importDefault(4607) /* metro dependency 4607: SpeakingStore */;
|
|
const voiceStateStore = importDefault(4297) /* metro dependency 4297: VoiceStateStore */;
|
|
(require(2) /* metro dependency 2 */).fileFinishedImporting('hooks/useIsSpeaking.tsx');
|
|
exports.default = useIsSpeaking;
|
|
exports.getIsSpeaking = getIsSpeaking;
|
|
}
|
|
|
|
function useIsSpeaking({userId, checkSoundSharing, checkSoundboardSounds, checkIsMuted, context}) { // fn#39576, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:4790:251, offset: 0x010e5bd2, size: 308 bytes, params: 2, frame: 21
|
|
if (checkSoundSharing !== undefined) {
|
|
}
|
|
if (checkSoundboardSounds !== undefined) {
|
|
}
|
|
checkIsMuted = !(checkIsMuted === undefined) && checkIsMuted;
|
|
const fluxModule = require(566) /* metro dependency 566: flux */;
|
|
let useStateFromStores = fluxModule.useStateFromStores;
|
|
const value6 = Reflect.apply(useStateFromStores, fluxModule, [[VoiceStateStore, SelectedChannelStore], _fun39577]);
|
|
const env0_4 = checkIsMuted && (value6?.mute || value6?.selfMute);
|
|
const value7 = fluxModule.useStateFromStores([SpeakingStore], _fun39578);
|
|
const value8 = fluxModule.useStateFromStores([SpeakingStore], function() {
|
|
return SpeakingStore.isSoundSharing(userId) && checkSoundSharing;
|
|
});
|
|
const _checkIsSpeakingBinding = _checkIsSpeaking;
|
|
const moduleValue4 = fluxModule;
|
|
useStateFromStores = moduleValue4.useStateFromStores;
|
|
return _checkIsSpeakingBinding(value7, Reflect.apply(useStateFromStores, moduleValue4, [[SoundboardStore],
|
|
function() {
|
|
return SoundboardStore.isUserPlayingSounds(userId) && checkSoundboardSounds;
|
|
}]), value8);
|
|
}
|
|
|
|
function getIsSpeaking({userId, checkSoundSharing, checkSoundboardSounds, checkIsMuted, context}) { // fn#39581, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:4790:788, offset: 0x010e5da7, size: 364 bytes, params: 2, frame: 25
|
|
var r2;
|
|
var r3;
|
|
var r9;
|
|
var r10;
|
|
var r6;
|
|
var item3;
|
|
var item4;
|
|
var item5;
|
|
let value = a1;
|
|
checkSoundSharing = !(checkSoundSharing === undefined) && checkSoundSharing;
|
|
checkSoundboardSounds = checkSoundboardSounds === undefined || checkSoundboardSounds;
|
|
checkIsMuted = !(checkIsMuted === undefined) && checkIsMuted;
|
|
const iterator = (value !== undefined ? value : [VoiceStateStore, SelectedChannelStore, SpeakingStore,
|
|
SoundboardStore])[Symbol.iterator]();
|
|
const iterator2 = iterator.next;
|
|
let item2 = Reflect.apply(iterator2, iterator, []);
|
|
let item = item2.value;
|
|
item2 = item2.done ? undefined : iterator;
|
|
const r12 = item2 === undefined ? undefined : item;
|
|
if (value) {
|
|
r3 = item2;
|
|
r9 = undefined;
|
|
r10 = value;
|
|
} else {
|
|
item3 = Reflect.apply(iterator2, item2, []);
|
|
item = item3.value;
|
|
item3 = item3.done ? undefined : item2;
|
|
value = item3 === undefined;
|
|
if (value) {
|
|
r3 = item3;
|
|
r9 = undefined;
|
|
r10 = value;
|
|
} else {
|
|
r3 = item3;
|
|
r9 = item;
|
|
r10 = value;
|
|
}
|
|
}
|
|
if (r10) {
|
|
r2 = undefined;
|
|
} else {
|
|
item4 = Reflect.apply(iterator2, r3, []);
|
|
item = item4.value;
|
|
item4 = item4.done ? undefined : r3;
|
|
value = item4 === undefined;
|
|
if (value) {
|
|
r2 = undefined;
|
|
r3 = item4;
|
|
r10 = value;
|
|
} else {
|
|
r2 = item;
|
|
r3 = item4;
|
|
r10 = value;
|
|
}
|
|
}
|
|
if (r10) {
|
|
r6 = undefined;
|
|
} else {
|
|
item5 = Reflect.apply(iterator2, r3, []);
|
|
item = item5.value;
|
|
item5 = item5.done ? undefined : r3;
|
|
value = item5 === undefined;
|
|
if (value) {
|
|
r3 = item5;
|
|
r6 = undefined;
|
|
r10 = value;
|
|
} else {
|
|
r3 = item5;
|
|
r6 = item;
|
|
r10 = value;
|
|
}
|
|
}
|
|
if (!r10) {
|
|
r3.return();
|
|
}
|
|
value = r9.getVoiceChannelId();
|
|
if (value != null) {
|
|
value = r12.getVoiceStateForChannel(value, userId);
|
|
r10 = value;
|
|
} else {
|
|
r10 = null;
|
|
}
|
|
r3 = r2.isSpeaking(userId, context) && !(checkIsMuted && (r10?.mute || r10?.selfMute));
|
|
r2 = r2.isSoundSharing(userId) && checkSoundSharing;
|
|
return _checkIsSpeaking(r3, r6.isUserPlayingSounds(userId) && checkSoundboardSounds, r2);
|
|
}
|
|
|
|
function _fun39577() { // fn#39577, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:4790:404, offset: 0x010e5d06, size: 51 bytes, params: 1, frame: 14
|
|
const value = environment.__proto__;
|
|
const voiceChannelId = SelectedChannelStore.getVoiceChannelId();
|
|
const value3 = null;
|
|
return value3 != voiceChannelId ? VoiceStateStore.getVoiceStateForChannel(voiceChannelId, userId) : value3;
|
|
}
|
|
|
|
function _fun39578() { // fn#39578, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:4790:585, offset: 0x010e5d39, size: 42 bytes, params: 1, frame: 14
|
|
const value = environment.__proto__;
|
|
return SpeakingStore.isSpeaking(userId, context) && !env0_4;
|
|
}
|
|
|