217 lines
16 KiB
TypeScript
217 lines
16 KiB
TypeScript
/* Metro module 10941; source: modules/notifications/settings/utils/notficationSettingsChannelFlagUtils.tsx; dependencies: [57, 1379, 4864, 661, 4865, 670, 632, 4867, 10939, 6613, 10942, 6610, 2] */
|
|
import Module00057 from '../../../../by-id/module-00057.js'; /* Metro dependency 57 */
|
|
import ChannelStore from '../../../../stores/ChannelStore.tsx'; /* Metro dependency 1379 */
|
|
import UserGuildSettingsStore from '../../../../stores/UserGuildSettingsStore.tsx'; /* Metro dependency 4864 */
|
|
import NotificationSettingsModalActionCreators from '../../../../actions/NotificationSettingsModalActionCreators.tsx'; /* Metro dependency 6613 */
|
|
import * as FileImportTrackerModule from '../../../../by-id/module-00002-FileImportTracker.js'; /* Metro dependency 2 */
|
|
import * as UseStateFromStoresModule from '../../../../external/discord_common/js/packages/flux/useStateFromStores.tsx'; /* Metro dependency 632 */
|
|
import * as ConstantsModule from '../../../../Constants.tsx'; /* Metro dependency 661 */
|
|
import * as UserSettingsConstantsModule from '../../../user_settings/UserSettingsConstants.tsx'; /* Metro dependency 670 */
|
|
import * as ReadStateConstantsModule from '../../../read_states/ReadStateConstants.tsx'; /* Metro dependency 4865 */
|
|
import * as NotificationSettingsPresetUtilsModule from './notificationSettingsPresetUtils.tsx'; /* Metro dependency 4867 */
|
|
import * as NotificationSettingsUtilsModule from '../../../../utils/NotificationSettingsUtils.tsx'; /* Metro dependency 6610 */
|
|
import * as NotificationUtilsModule from '../../NotificationUtils.tsx'; /* Metro dependency 10939 */
|
|
import * as NotificationSettingsFlagUtilsModule from './notificationSettingsFlagUtils.tsx'; /* Metro dependency 10942 */
|
|
|
|
function _fun83886(global, require, importDefault, importAll, module, exports, dependencyMap) { // fn#83886, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:11127:6, offset: 0x01f2cee2, size: 283 bytes, params: 8, frame: 19
|
|
const env0_0 = require;
|
|
const Object = global.Object;
|
|
Object.defineProperty(exports, '__esModule', {value: true});
|
|
(FileImportTrackerModule).fileFinishedImporting('modules/notifications/settings/utils/notficationSettingsChannelFlagUtils.tsx');
|
|
exports.useChannelPresetSettings = useChannelPresetSettings;
|
|
exports.useChannelPresetInheritance = useChannelPresetInheritance;
|
|
exports.updateChannelPreset = updateChannelPreset;
|
|
exports.updateChannelToGuildDefault = updateChannelToGuildDefault;
|
|
exports.updateChannelUnreadSetting = updateChannelUnreadSetting;
|
|
exports.updateChannelNotificationSetting = updateChannelNotificationSetting;
|
|
function useChannelPresetSettings(a0) { // fn#83887, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:11127:366, offset: 0x01f2cffd, size: 142 bytes, params: 2, frame: 19
|
|
const env0_0 = a0;
|
|
const useStateFromStores = UseStateFromStoresModule.useStateFromStores;
|
|
const userGuildSettingsStoreBinding = UserGuildSettingsStore;
|
|
const value = Reflect.apply(useStateFromStores, UseStateFromStoresModule, [[userGuildSettingsStoreBinding],
|
|
_fun83888]);
|
|
const value2 = UseStateFromStoresModule.useStateFromStores([userGuildSettingsStoreBinding], _fun83889);
|
|
object = {unread: value, notification: value2};
|
|
object.preset = (require(4867) /* metro dependency 4867: notificationSettingsPresetUtils */).presetFromSettings(value,
|
|
value2);
|
|
return object;
|
|
function _fun83888() { // fn#83888, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:11127:441, offset: 0x01f2d08b, size: 27 bytes, params: 1, frame: 11
|
|
return UserGuildSettingsStore.resolveUnreadSetting(env0_0);
|
|
}
|
|
|
|
function _fun83889() { // fn#83889, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:11127:507, offset: 0x01f2d0a6, size: 27 bytes, params: 1, frame: 11
|
|
return UserGuildSettingsStore.resolvedMessageNotifications(env0_0);
|
|
}
|
|
|
|
}
|
|
|
|
function useChannelPresetInheritance(a0) { // fn#83890, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:11127:649, offset: 0x01f2d0c1, size: 208 bytes, params: 2, frame: 22
|
|
const env0_0 = a0;
|
|
let useStateFromStoresArray = UseStateFromStoresModule.useStateFromStoresArray;
|
|
const userGuildSettingsStoreBinding = UserGuildSettingsStore;
|
|
const value2 = Reflect.apply(useStateFromStoresArray, UseStateFromStoresModule, [[userGuildSettingsStoreBinding],
|
|
_fun83891]);
|
|
useStateFromStoresArray = UseStateFromStoresModule.useStateFromStoresArray;
|
|
const value = Module00057(Reflect.apply(useStateFromStoresArray, UseStateFromStoresModule, [[userGuildSettingsStoreBinding,
|
|
ChannelStore], _fun83892, [a0.guild_id, a0.parent_id, value2]]), 2);
|
|
return {inherited: !value2.includes(a0.id), inheritedFrom: value[0], inheritedPreset: value[1]};
|
|
function _fun83891() { // fn#83891, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:11127:732, offset: 0x01f2d191, size: 80 bytes, params: 1, frame: 14
|
|
const value = environment.__proto__;
|
|
const filterOverrides = NotificationUtilsModule.filterOverrides;
|
|
const userGuildSettingsStoreBinding = UserGuildSettingsStore;
|
|
const getChannelOverrides = userGuildSettingsStoreBinding.getChannelOverrides;
|
|
return Reflect.apply(filterOverrides, NotificationUtilsModule, [Reflect.apply(getChannelOverrides,
|
|
userGuildSettingsStoreBinding, [env0_0.guild_id]), {'ignoreMute': true, 'ignoreUnreadSetting': false,
|
|
'ignoreNotificationSetting': false}]);
|
|
}
|
|
|
|
function _fun83892() { // fn#83892, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:11127:906, offset: 0x01f2d1e1, size: 267 bytes, params: 1, frame: 19
|
|
var items2;
|
|
var binding;
|
|
var moduleValue;
|
|
var presetName;
|
|
var moduleValue2;
|
|
var presetFromSettings;
|
|
var userGuildSettingsStoreBinding;
|
|
var getGuildUnreadSetting;
|
|
var guild_id;
|
|
var getMessageNotifications;
|
|
var moduleValue3;
|
|
var moduleValue4;
|
|
let value = environment.__proto__;
|
|
const channel = ChannelStore.getChannel(env0_0.parent_id);
|
|
if (channel == null) {
|
|
moduleValue = require(4867) /* metro dependency 4867: notificationSettingsPresetUtils */;
|
|
presetName = moduleValue.presetName;
|
|
moduleValue2 = require(4867) /* metro dependency 4867: notificationSettingsPresetUtils */;
|
|
presetFromSettings = moduleValue2.presetFromSettings;
|
|
userGuildSettingsStoreBinding = UserGuildSettingsStore;
|
|
getGuildUnreadSetting = userGuildSettingsStoreBinding.getGuildUnreadSetting;
|
|
binding = env0_0;
|
|
guild_id = binding.guild_id;
|
|
value = Reflect.apply(getGuildUnreadSetting, userGuildSettingsStoreBinding, [guild_id]);
|
|
getMessageNotifications = userGuildSettingsStoreBinding.getMessageNotifications;
|
|
guild_id = binding.guild_id;
|
|
value = Reflect.apply(presetName, moduleValue, [Reflect.apply(presetFromSettings, moduleValue2, [value,
|
|
Reflect.apply(getMessageNotifications, userGuildSettingsStoreBinding, [guild_id])])]);
|
|
items2 = ['guild', value];
|
|
} else {
|
|
binding = env0_1;
|
|
if (binding.includes(channel.id)) {
|
|
moduleValue3 = require(4867) /* metro dependency 4867: notificationSettingsPresetUtils */;
|
|
presetName = moduleValue3.presetName;
|
|
moduleValue4 = require(4867) /* metro dependency 4867: notificationSettingsPresetUtils */;
|
|
presetFromSettings = moduleValue4.presetFromSettings;
|
|
userGuildSettingsStoreBinding = UserGuildSettingsStore;
|
|
value = userGuildSettingsStoreBinding.resolveUnreadSetting(channel);
|
|
value = Reflect.apply(presetName, moduleValue3, [Reflect.apply(presetFromSettings, moduleValue4, [value,
|
|
userGuildSettingsStoreBinding.resolvedMessageNotifications(channel)])]);
|
|
items2 = ['parent', value];
|
|
} else {
|
|
moduleValue = require(4867) /* metro dependency 4867: notificationSettingsPresetUtils */;
|
|
presetName = moduleValue.presetName;
|
|
moduleValue2 = require(4867) /* metro dependency 4867: notificationSettingsPresetUtils */;
|
|
presetFromSettings = moduleValue2.presetFromSettings;
|
|
userGuildSettingsStoreBinding = UserGuildSettingsStore;
|
|
getGuildUnreadSetting = userGuildSettingsStoreBinding.getGuildUnreadSetting;
|
|
binding = env0_0;
|
|
guild_id = binding.guild_id;
|
|
value = Reflect.apply(getGuildUnreadSetting, userGuildSettingsStoreBinding, [guild_id]);
|
|
getMessageNotifications = userGuildSettingsStoreBinding.getMessageNotifications;
|
|
guild_id = binding.guild_id;
|
|
value = Reflect.apply(presetName, moduleValue, [Reflect.apply(presetFromSettings, moduleValue2, [value,
|
|
Reflect.apply(getMessageNotifications, userGuildSettingsStoreBinding, [guild_id])])]);
|
|
items2 = ['guild', value];
|
|
}
|
|
}
|
|
return items2;
|
|
}
|
|
|
|
}
|
|
|
|
function updateChannelPreset(a0, a1, a2) { // fn#83893, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:11127:1373, offset: 0x01f2d2ec, size: 528 bytes, params: 4, frame: 24
|
|
var defaultImport;
|
|
var updateChannelOverrideSettings;
|
|
var object;
|
|
var moduleValue;
|
|
const NotificationLabels = (NotificationSettingsUtilsModule).NotificationLabels;
|
|
var defaultImport2;
|
|
var moduleValue2;
|
|
var defaultImport3;
|
|
var moduleValue3;
|
|
const channelIdFlags = UserGuildSettingsStore.getChannelIdFlags(a0, a1);
|
|
const Presets = (NotificationSettingsPresetUtilsModule).Presets;
|
|
const ALL_MESSAGES = Presets.ALL_MESSAGES;
|
|
if (a2 === ALL_MESSAGES) {
|
|
defaultImport3 = importDefault(6613) /* metro dependency 6613: NotificationSettingsModalActionCreators */;
|
|
updateChannelOverrideSettings = defaultImport3.updateChannelOverrideSettings;
|
|
object = {};
|
|
object.message_notifications = UserNotificationSettings.ALL_MESSAGES;
|
|
moduleValue3 = require(10942) /* metro dependency 10942: notificationSettingsFlagUtils */;
|
|
object.flags = moduleValue3.withChannelUnreadFlags(channelIdFlags,
|
|
ChannelNotificationSettingsFlags.UNREADS_ALL_MESSAGES);
|
|
Reflect.apply(updateChannelOverrideSettings, defaultImport3, [a0, a1, object, NotificationLabels.PresetAll]);
|
|
} else if (a2 === Presets.MENTIONS) {
|
|
defaultImport2 = importDefault(6613) /* metro dependency 6613: NotificationSettingsModalActionCreators */;
|
|
updateChannelOverrideSettings = defaultImport2.updateChannelOverrideSettings;
|
|
object = {};
|
|
object.message_notifications = UserNotificationSettings.ONLY_MENTIONS;
|
|
moduleValue2 = require(10942) /* metro dependency 10942: notificationSettingsFlagUtils */;
|
|
object.flags = moduleValue2.withChannelUnreadFlags(channelIdFlags,
|
|
ChannelNotificationSettingsFlags.UNREADS_ONLY_MENTIONS);
|
|
Reflect.apply(updateChannelOverrideSettings, defaultImport2, [a0, a1, object,
|
|
NotificationLabels.PresetMentions]);
|
|
} else if (a2 === Presets.NOTHING) {
|
|
defaultImport = importDefault(6613) /* metro dependency 6613: NotificationSettingsModalActionCreators */;
|
|
updateChannelOverrideSettings = defaultImport.updateChannelOverrideSettings;
|
|
object = {};
|
|
object.message_notifications = UserNotificationSettings.NO_MESSAGES;
|
|
moduleValue = require(10942) /* metro dependency 10942: notificationSettingsFlagUtils */;
|
|
object.flags = moduleValue.withChannelUnreadFlags(channelIdFlags,
|
|
ChannelNotificationSettingsFlags.UNREADS_ONLY_MENTIONS);
|
|
Reflect.apply(updateChannelOverrideSettings, defaultImport, [a0, a1, object, NotificationLabels.PresetNothing]);
|
|
}
|
|
}
|
|
|
|
function updateChannelToGuildDefault(a0, a1) { // fn#83894, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:11127:2125, offset: 0x01f2d4fc, size: 143 bytes, params: 3, frame: 23
|
|
const defaultImport = NotificationSettingsModalActionCreators;
|
|
const updateChannelOverrideSettings = defaultImport.updateChannelOverrideSettings;
|
|
const object = {};
|
|
const NULL = UserNotificationSettings.NULL;
|
|
object.message_notifications = NULL;
|
|
const resetChannelUnreadFlags = NotificationSettingsFlagUtilsModule.resetChannelUnreadFlags;
|
|
const userGuildSettingsStoreBinding = UserGuildSettingsStore;
|
|
const getChannelIdFlags = userGuildSettingsStoreBinding.getChannelIdFlags;
|
|
object.flags = Reflect.apply(resetChannelUnreadFlags, NotificationSettingsFlagUtilsModule,
|
|
[Reflect.apply(getChannelIdFlags, userGuildSettingsStoreBinding, [a0, a1])]);
|
|
const NotificationLabels = (NotificationSettingsUtilsModule).NotificationLabels;
|
|
const PresetDefault = NotificationLabels.PresetDefault;
|
|
Reflect.apply(updateChannelOverrideSettings, defaultImport, [a0, a1, object, PresetDefault]);
|
|
}
|
|
|
|
function updateChannelUnreadSetting(a0, a1, a2) { // fn#83895, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:11127:2378, offset: 0x01f2d58b, size: 181 bytes, params: 4, frame: 24
|
|
const channelIdFlags = UserGuildSettingsStore.getChannelIdFlags(a0, a1);
|
|
const defaultImport = NotificationSettingsModalActionCreators;
|
|
const updateChannelOverrideSettings = defaultImport.updateChannelOverrideSettings;
|
|
const object = {};
|
|
const withChannelUnreadFlags = NotificationSettingsFlagUtilsModule.withChannelUnreadFlags;
|
|
const ALL_MESSAGES = UnreadSetting.ALL_MESSAGES;
|
|
object.flags = Reflect.apply(withChannelUnreadFlags, NotificationSettingsFlagUtilsModule, [channelIdFlags,
|
|
a2 === ALL_MESSAGES ? ChannelNotificationSettingsFlags.UNREADS_ALL_MESSAGES : ChannelNotificationSettingsFlags.UNREADS_ONLY_MENTIONS]);
|
|
const NotificationLabel = (NotificationSettingsUtilsModule).NotificationLabel;
|
|
Reflect.apply(updateChannelOverrideSettings, defaultImport, [a0, a1, object, NotificationLabel.unreads(a2)]);
|
|
}
|
|
|
|
function updateChannelNotificationSetting(a0, a1, a2) { // fn#83896, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:11127:2678, offset: 0x01f2d640, size: 92 bytes, params: 4, frame: 19
|
|
const defaultImport = NotificationSettingsModalActionCreators;
|
|
const updateChannelOverrideSettings = defaultImport.updateChannelOverrideSettings;
|
|
const NotificationLabel = (NotificationSettingsUtilsModule).NotificationLabel;
|
|
Reflect.apply(updateChannelOverrideSettings, defaultImport, [a0, a1, {message_notifications: a2},
|
|
NotificationLabel.notifications(a2)]);
|
|
}
|
|
|
|
}
|
|
|
|
global.__d(_fun83886, 10941, [57, 1379, 4864, 661, 4865, 670, 632, 4867, 10939, 6613, 10942, 6610,
|
|
2]) /* metro module 10941, dependencies: [57, 1379, 4864, 661, 4865, 670, 632, 4867, 10939, 6613, 10942, 6610, 2] */;
|