/* Metro module 10914; source: modules/threads/ThreadNotificationSettings.tsx; dependencies: [1379, 4864, 3786, 1243, 661, 1391, 566, 2] */ import ChannelStore from '../../stores/ChannelStore.tsx'; /* Metro dependency 1379 */ import JoinedThreadsStore from './JoinedThreadsStore.tsx'; /* Metro dependency 3786 */ import UserGuildSettingsStore from '../../stores/UserGuildSettingsStore.tsx'; /* Metro dependency 4864 */ 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 ThreadConstantsModule from './ThreadConstants.tsx'; /* Metro dependency 1243 */ import * as FlagUtilsModule from '../../external/discord_common/js/shared/utils/FlagUtils.tsx'; /* Metro dependency 1391 */ function _fun83640(global, require, importDefault, importAll, module, exports, dependencyMap) { // fn#83640, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:11100:6, offset: 0x01f21fa7, size: 207 bytes, params: 8, frame: 20 let env0_0 = require; const computeThreadNotificationSetting2 = computeThreadNotificationSetting; const Object = global.Object; Object.defineProperty(exports, '__esModule', {value: true}); (FileImportTrackerModule).fileFinishedImporting('modules/threads/ThreadNotificationSettings.tsx'); exports.computeThreadNotificationSetting = computeThreadNotificationSetting2; exports.useThreadNotificationSetting = function(a0) { var env0_0 = a0; return require(dependencyMap[6]).useStateFromStores([JoinedThreadsStore, UserGuildSettingsStore, ChannelStore], _fun83643, [a0]); }; function computeThreadNotificationSetting({id, parent_id}) { // fn#83641, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:11100:189, offset: 0x01f22076, size: 407 bytes, params: 2, frame: 20 let value = a1; const value2 = a2; const value3 = a3; const r4 = value !== undefined ? value : JoinedThreadsStore; const r3 = value2 !== undefined ? value2 : UserGuildSettingsStore; const r5 = value3 !== undefined ? value3 : ChannelStore; value = r4.flags(id); if (value == null) { value = environment; return ThreadMemberFlags.NO_MESSAGES; } let hasFlag = FlagUtilsModule.hasFlag; const ALL_MESSAGES = ThreadMemberFlags.ALL_MESSAGES; if (Reflect.apply(hasFlag, FlagUtilsModule, [value, ALL_MESSAGES])) { return ThreadMemberFlags.ALL_MESSAGES; } hasFlag = FlagUtilsModule.hasFlag; const ONLY_MENTIONS = ThreadMemberFlags.ONLY_MENTIONS; if (Reflect.apply(hasFlag, FlagUtilsModule, [value, ONLY_MENTIONS])) { return ThreadMemberFlags.ONLY_MENTIONS; } hasFlag = FlagUtilsModule.hasFlag; let NO_MESSAGES = ThreadMemberFlags.NO_MESSAGES; if (Reflect.apply(hasFlag, FlagUtilsModule, [value, NO_MESSAGES])) { return ThreadMemberFlags.NO_MESSAGES; } value = r5.getChannel(parent_id); if (value == null) { return ThreadMemberFlags.NO_MESSAGES; } if (r3.isGuildOrCategoryOrChannelMuted(value.guild_id, value.id)) { return ThreadMemberFlags.NO_MESSAGES; } value = r3.resolvedMessageNotifications(value); NO_MESSAGES = UserNotificationSettings.NO_MESSAGES; return value === NO_MESSAGES ? ThreadMemberFlags.NO_MESSAGES : value === UserNotificationSettings.ONLY_MENTIONS ? ThreadMemberFlags.ONLY_MENTIONS : ThreadMemberFlags.ALL_MESSAGES; } function useThreadNotificationSetting(a0) { // fn#83642, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:11100:923, offset: 0x01f2220d, size: 91 bytes, params: 2, frame: 17 const env0_0 = a0; return (FluxModule).useStateFromStores([JoinedThreadsStore, UserGuildSettingsStore, ChannelStore], _fun83643, [a0]); function _fun83643() { // fn#83643, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:11100:1007, offset: 0x013a4b60, size: 23 bytes, params: 1, frame: 11 return computeThreadNotificationSetting(env0_0); } } } global.__d(_fun83640, 10914, [1379, 4864, 3786, 1243, 661, 1391, 566, 2]) /* metro module 10914, dependencies: [1379, 4864, 3786, 1243, 661, 1391, 566, 2] */;