Files
discord-decomp/sources/modules/channel/usePrivateChannelWaveEligible.tsx
2026-07-28 01:06:53 +03:00

79 lines
5.2 KiB
TypeScript

/* Metro module 14473; source: modules/channel/usePrivateChannelWaveEligible.tsx; dependencies: [4814, 3793, 1386, 661, 566, 21, 3826, 3738, 11290, 2] */
import SnowflakeUtils from '../../utils/SnowflakeUtils.tsx'; /* Metro dependency 21 */
import Module03738 from '../../by-id/module-03738.js'; /* Metro dependency 3738 */
import RelationshipStore from '../../stores/RelationshipStore.tsx'; /* Metro dependency 3793 */
import MessageStore from '../../stores/MessageStore.tsx'; /* Metro dependency 4814 */
import * as FileImportTrackerModule from '../../by-id/module-00002-FileImportTracker.js'; /* Metro dependency 2 */
import * as FluxModule from '../../external/discord_common/js/packages/flux/index.tsx'; /* Metro dependency 566 */
import * as ConstantsModule from '../../Constants.tsx'; /* Metro dependency 661 */
import * as ChannelConstantsModule from './ChannelConstants.tsx'; /* Metro dependency 1386 */
import * as DateUtilsModule from '../../utils/DateUtils.tsx'; /* Metro dependency 3826 */
import * as UseStrangerDangerWarningModule from '../self_mod/stranger_danger/hooks/useStrangerDangerWarning.tsx'; /* Metro dependency 11290 */
function _fun109513(global, require, importDefault, importAll, module, exports, dependencyMap) { // fn#109513, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:14670:6, offset: 0x0234fe24, size: 178 bytes, params: 8, frame: 19
const env0_0 = require;
const Object = global.Object;
Object.defineProperty(exports, '__esModule', {value: true});
(FileImportTrackerModule).fileFinishedImporting('modules/channel/usePrivateChannelWaveEligible.tsx');
exports.usePrivateChannelWaveEligible = usePrivateChannelWaveEligible;
function usePrivateChannelWaveEligible(a0, a1) { // fn#109514, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:14670:277, offset: 0x0234fed6, size: 447 bytes, params: 3, frame: 27
var r5;
var value2;
const env0_0 = a0;
let r0 = a0.isDM() && !a0.isSystemDM() && !a0.rawRecipients.some(function(a0) {
return a0.bot;
});
value = null;
if (r0) {
value2 = a0.getRecipientId();
}
let useStateFromStores = FluxModule.useStateFromStores;
const relationshipStoreBinding = RelationshipStore;
const value4 = Reflect.apply(useStateFromStores, FluxModule, [[relationshipStoreBinding], _fun109516]);
const value5 = FluxModule.useStateFromStores([relationshipStoreBinding], _fun109517);
useStateFromStores = FluxModule.useStateFromStores;
const messageStoreBinding = MessageStore;
const value6 = Reflect.apply(useStateFromStores, FluxModule, [[messageStoreBinding], _fun109518]);
const hasFlag = a0.hasFlag;
const HAS_ONLY_SYSTEM_MESSAGES = ChannelFlags.HAS_ONLY_SYSTEM_MESSAGES;
const hasFlag2 = Reflect.apply(hasFlag, a0, [HAS_ONLY_SYSTEM_MESSAGES]);
const value7 = FluxModule.useStateFromStores([messageStoreBinding], _fun109519);
const defaultImport = SnowflakeUtils;
const value8 = defaultImport.extractTimestamp(a0.id);
const isWithinInterval2 = DateUtilsModule.isWithinInterval((Module03738)(),
(Module03738)(value8), 1814400000);
const value11 = (UseStrangerDangerWarningModule).useStrangerDangerWarning(a0.id);
r0 = r0 && value4 && !value5;
if (r0) {
r5 = hasFlag2 || value == a1;
r5 = !r5 ? value6 : r5;
r0 = r5;
}
r0 = r0 && !value7 && isWithinInterval2 && value == value11;
return r0;
function _fun109516() { // fn#109516, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:14670:450, offset: 0x02350095, size: 40 bytes, params: 1, frame: 12
return env0_1 != null && RelationshipStore.isFriend(env0_1);
}
function _fun109517() { // fn#109517, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:14670:513, offset: 0x023500bd, size: 40 bytes, params: 1, frame: 12
return env0_1 != null && RelationshipStore.isIgnored(env0_1);
}
function _fun109518() { // fn#109518, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:14670:577, offset: 0x023500e5, size: 87 bytes, params: 1, frame: 13
const value = environment.__proto__;
const messages = MessageStore.getMessages(env0_0.id);
return messages.length === 1 && messages.first()?.type === MessageTypes.FRIEND_REQUEST_ACCEPTED;
}
function _fun109519() { // fn#109519, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:14670:772, offset: 0x0235013c, size: 32 bytes, params: 1, frame: 11
const messageStoreBinding = MessageStore;
return messageStoreBinding.hasCurrentUserSentWaveBlockingMessage(env0_0.id);
}
}
}
global.__d(_fun109513, 14473, [4814, 3793, 1386, 661, 566, 21, 3826, 3738, 11290,
2]) /* metro module 14473, dependencies: [4814, 3793, 1386, 661, 566, 21, 3826, 3738, 11290, 2] */;