181 lines
12 KiB
TypeScript
181 lines
12 KiB
TypeScript
/* Metro module 6613; source: actions/NotificationSettingsModalActionCreators.tsx; dependencies: [5, 4864, 661, 3796, 670, 694, 6610, 6612, 21, 4002, 1244, 1391, 507, 2] */
|
|
import Module00005 from '../by-id/module-00005.js'; /* Metro dependency 5 */
|
|
import SnowflakeUtils from '../utils/SnowflakeUtils.tsx'; /* Metro dependency 21 */
|
|
import Dispatcher from '../Dispatcher.tsx'; /* Metro dependency 694 */
|
|
import UserGuildSettingsStore from '../stores/UserGuildSettingsStore.tsx'; /* Metro dependency 4864 */
|
|
import UserGuildSettingsManager from '../modules/user_settings/UserGuildSettingsManager.tsx'; /* Metro dependency 6612 */
|
|
import * as FileImportTrackerModule from '../by-id/module-00002-FileImportTracker.js'; /* Metro dependency 2 */
|
|
import * as ConstantsModule from '../Constants.tsx'; /* Metro dependency 661 */
|
|
import * as UserSettingsConstantsModule from '../modules/user_settings/UserSettingsConstants.tsx'; /* Metro dependency 670 */
|
|
import * as IndexNativeModule from '../intl/index.native.tsx'; /* Metro dependency 1244 */
|
|
import * as NotificationConstantsModule from '../modules/notifications/NotificationConstants.tsx'; /* Metro dependency 3796 */
|
|
import * as SharedModule from '../design/shared.tsx'; /* Metro dependency 4002 */
|
|
import * as NotificationSettingsUtilsModule from '../utils/NotificationSettingsUtils.tsx'; /* Metro dependency 6610 */
|
|
|
|
function _fun52243(global, require, importDefault, importAll, module, exports, dependencyMap) { // fn#52243, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:6791:6, offset: 0x01323731, size: 287 bytes, params: 8, frame: 19
|
|
const env0_0 = require;
|
|
const Object = global.Object;
|
|
Object.defineProperty(exports, '__esModule', {value: true});
|
|
object = {open: open_52244, close: close_52245, updateGuildNotificationSettings: updateGuildNotificationSettings,
|
|
updateGuildAndChannelNotificationSettings: updateGuildAndChannelNotificationSettings,
|
|
updateChannelOverrideSettings: updateChannelOverrideSettings,
|
|
updateChannelOverrideSettingsBulk: updateChannelOverrideSettingsBulk,
|
|
updateAppDMOverrideSettings: updateAppDMOverrideSettings, setForumThreadsCreated: setForumThreadsCreated,
|
|
setAccountFlag: setAccountFlag};
|
|
(FileImportTrackerModule).fileFinishedImporting('actions/NotificationSettingsModalActionCreators.tsx');
|
|
exports.default = object;
|
|
function open_52244(a0) { // fn#52244, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:6791:223, offset: 0x01323850, size: 54 bytes, params: 2, frame: 13
|
|
(Dispatcher).dispatch({type: 'NOTIFICATION_SETTINGS_MODAL_OPEN',
|
|
guildId: a0});
|
|
}
|
|
|
|
function close_52245() { // fn#52245, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:6791:302, offset: 0x01323886, size: 47 bytes, params: 1, frame: 13
|
|
(Dispatcher).dispatch({type: 'NOTIFICATION_SETTINGS_MODAL_CLOSE'});
|
|
}
|
|
|
|
function updateGuildNotificationSettings(a0, a1, a2, a3) { // fn#52246, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:6791:372, offset: 0x013238b5, size: 147 bytes, params: 5, frame: 23
|
|
const currentGuildSettings = (NotificationSettingsUtilsModule).getCurrentGuildSettings(a0);
|
|
(UserGuildSettingsManager).saveUserGuildSettings(a0, a1);
|
|
(Dispatcher).dispatch({type: 'USER_GUILD_SETTINGS_GUILD_UPDATE',
|
|
guildId: a0, settings: a1});
|
|
(NotificationSettingsUtilsModule).trackGuildNotificationSettingsUpdate(a0, a1,
|
|
currentGuildSettings, a2, a3);
|
|
}
|
|
|
|
function updateGuildAndChannelNotificationSettings(a0, a1, a2, a3) { // fn#52247, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:6791:627, offset: 0x01323948, size: 264 bytes, params: 5, frame: 28
|
|
const env0_0 = a0;
|
|
const env0_1 = a1;
|
|
const env0_2 = a2;
|
|
const env0_3 = a3;
|
|
const defaultImport = SnowflakeUtils;
|
|
const value2 = defaultImport.keys(a1.channel_overrides);
|
|
let value = NotificationSettingsUtilsModule;
|
|
value = value.getCurrentGuildSettings(a0);
|
|
const env0_4 = (NotificationSettingsUtilsModule).getManyCurrentChannelSettings(a0,
|
|
value2);
|
|
(UserGuildSettingsManager).saveUserGuildSettings(a0, a1);
|
|
(Dispatcher).dispatch({type: 'USER_GUILD_SETTINGS_GUILD_AND_CHANNELS_UPDATE',
|
|
guildId: a0, settings: a1});
|
|
(NotificationSettingsUtilsModule).trackGuildNotificationSettingsUpdate(a0, a1,
|
|
value, a2, a3);
|
|
value = Reflect.apply(defaultImport.keys, value, [a1.channel_overrides]);
|
|
value.forEach(_fun52248);
|
|
function _fun52248(a0) { // fn#52248, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:6791:1028, offset: 0x01323a50, size: 112 bytes, params: 2, frame: 16
|
|
(NotificationSettingsUtilsModule).trackChannelNotificationSettingsUpdate({guildId: env0_0,
|
|
channelId: a0, change: require.channel_overrides[a0], previous: env0_4.get(a0), label: importDefault,
|
|
location: importAll});
|
|
}
|
|
|
|
}
|
|
|
|
function updateChannelOverrideSettings(a0, a1, a2, a3, a4) { // fn#52249, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:6791:1183, offset: 0x01323ac0, size: 265 bytes, params: 6, frame: 23
|
|
const currentChannelSettings = (NotificationSettingsUtilsModule).getCurrentChannelSettings(a0,
|
|
a1);
|
|
(UserGuildSettingsManager).saveUserGuildSettings(a0,
|
|
{channel_overrides: {[a1]: a2}});
|
|
(Dispatcher).dispatch({type: 'USER_GUILD_SETTINGS_CHANNEL_UPDATE',
|
|
guildId: a0, channelId: a1, settings: a2});
|
|
const AccessibilityAnnouncer = (SharedModule).AccessibilityAnnouncer;
|
|
const announce = AccessibilityAnnouncer.announce;
|
|
const intl = (IndexNativeModule).intl;
|
|
const string = intl.string;
|
|
const MlIsJ8 = (IndexNativeModule).t.MlIsJ8;
|
|
Reflect.apply(announce, AccessibilityAnnouncer, [Reflect.apply(string, intl, [MlIsJ8])]);
|
|
NotificationSettingsUtilsModule.trackChannelNotificationSettingsUpdate({guildId: a0, channelId: a1, change: a2,
|
|
previous: currentChannelSettings, label: a3, location: a4});
|
|
}
|
|
|
|
function updateChannelOverrideSettingsBulk(a0, a1, a2, a3) { // fn#52250, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:6791:1618, offset: 0x01323bc9, size: 205 bytes, params: 5, frame: 20
|
|
const env0_0 = a0;
|
|
const env0_1 = a1;
|
|
const env0_2 = a2;
|
|
const env0_3 = a3;
|
|
const env0_4 = (NotificationSettingsUtilsModule).getManyCurrentChannelSettings(a0,
|
|
(SnowflakeUtils).keys(a1));
|
|
(UserGuildSettingsManager).saveUserGuildSettings(a0,
|
|
{channel_overrides: a1});
|
|
(Dispatcher).dispatch({type: 'USER_GUILD_SETTINGS_CHANNEL_UPDATE_BULK',
|
|
guildId: a0, overrides: a1});
|
|
let value = SnowflakeUtils;
|
|
value = value.keys(a1);
|
|
value.forEach(_fun52251);
|
|
function _fun52251(a0) { // fn#52251, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:6791:1897, offset: 0x01323c96, size: 106 bytes, params: 2, frame: 15
|
|
let value = environment.__proto__;
|
|
value = require(6610) /* metro dependency 6610: NotificationSettingsUtils */;
|
|
const trackChannelNotificationSettingsUpdate = value.trackChannelNotificationSettingsUpdate;
|
|
const object = {};
|
|
object.guildId = env0_0;
|
|
object.channelId = a0;
|
|
object.change = require[a0];
|
|
object.previous = env0_4.get(a0);
|
|
object.label = importDefault;
|
|
object.location = importAll;
|
|
return Reflect.apply(trackChannelNotificationSettingsUpdate, value, [object]);
|
|
}
|
|
|
|
}
|
|
|
|
function updateAppDMOverrideSettings(a0, a1, a2, a3, a4) { // fn#52252, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:6791:2024, offset: 0x01323d00, size: 280 bytes, params: 6, frame: 24
|
|
const currentChannelSettings = (NotificationSettingsUtilsModule).getCurrentChannelSettings(a0,
|
|
a1);
|
|
(UserGuildSettingsManager).saveUserGuildSettings(a0,
|
|
{channel_overrides: {[a1]: a3}});
|
|
(Dispatcher).dispatch({type: 'USER_GUILD_SETTINGS_CHANNEL_UPDATE',
|
|
guildId: a0, channelId: a1, settings: a3});
|
|
const AccessibilityAnnouncer = (SharedModule).AccessibilityAnnouncer;
|
|
const announce = AccessibilityAnnouncer.announce;
|
|
const intl = (IndexNativeModule).intl;
|
|
const string = intl.string;
|
|
const MlIsJ8 = (IndexNativeModule).t.MlIsJ8;
|
|
Reflect.apply(announce, AccessibilityAnnouncer, [Reflect.apply(string, intl, [MlIsJ8])]);
|
|
const trackChannelNotificationSettingsUpdate = NotificationSettingsUtilsModule.trackChannelNotificationSettingsUpdate;
|
|
const AUTHORIZED_APP_DM = NotificationSettingsUpdateType.AUTHORIZED_APP_DM;
|
|
Reflect.apply(trackChannelNotificationSettingsUpdate, NotificationSettingsUtilsModule,
|
|
[{updateType: AUTHORIZED_APP_DM, guildId: a0, channelId: a1, applicationId: a2, change: a3,
|
|
previous: currentChannelSettings, label: a4}]);
|
|
}
|
|
|
|
function setForumThreadsCreated(a0, a1) { // fn#52253, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:6791:2493, offset: 0x01323e18, size: 158 bytes, params: 3, frame: 21
|
|
const r7 = a1 ? ChannelNotificationSettingsFlags.NEW_FORUM_THREADS_ON : ChannelNotificationSettingsFlags.NEW_FORUM_THREADS_OFF;
|
|
const r1 = a1 ? ChannelNotificationSettingsFlags.NEW_FORUM_THREADS_OFF : ChannelNotificationSettingsFlags.NEW_FORUM_THREADS_ON;
|
|
const channelFlags = UserGuildSettingsStore.getChannelFlags(a0);
|
|
const updateChannelOverrideSettings = this.updateChannelOverrideSettings;
|
|
const guild_id = a0.guild_id;
|
|
const id = a0.id;
|
|
const object = {flags: channelFlags & ~r1 | r7};
|
|
const NotificationLabel = (NotificationSettingsUtilsModule).NotificationLabel;
|
|
Reflect.apply(updateChannelOverrideSettings, this, [guild_id, id, object,
|
|
NotificationLabel.forumThreadsCreated(a1)]);
|
|
}
|
|
|
|
function setAccountFlag(a0, a1) { // fn#52254, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:6791:2782, offset: 0x01323eb6, size: 41 bytes, params: 3, frame: 11
|
|
const env0_0 = a0;
|
|
const env0_1 = a1;
|
|
return Module00005(_fun52256)();
|
|
function* _fun52256() { // fn#52256, original name: ?anon_0_, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:6791:2792, offset: 0x01323ee8, size: 219 bytes, params: 1, frame: 20
|
|
if (true) {
|
|
value = environment.__proto__.__proto__;
|
|
var flags = env2_4.accountNotificationSettings.flags;
|
|
var binding = env2_0;
|
|
var binding2 = env2_2;
|
|
var value5 = binding(binding2[11]).setFlag(flags, require, importDefault);
|
|
var HTTP = binding(binding2[12]).HTTP;
|
|
var patch = HTTP.patch;
|
|
var ACCOUNT_NOTIFICATION_SETTINGS = env2_5.ACCOUNT_NOTIFICATION_SETTINGS;
|
|
yield Reflect.apply(patch, HTTP, [{url: ACCOUNT_NOTIFICATION_SETTINGS, body: {flags: value5},
|
|
rejectWithError: false}]);
|
|
if (false) {
|
|
return undefined;
|
|
}
|
|
value = env2_1(env2_2[5]);
|
|
yield value.dispatch({type: 'NOTIFICATION_SETTINGS_UPDATE', settings: {flags: value5}});
|
|
}
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
global.__d(_fun52243, 6613, [5, 4864, 661, 3796, 670, 694, 6610, 6612, 21, 4002, 1244, 1391, 507,
|
|
2]) /* metro module 6613, dependencies: [5, 4864, 661, 3796, 670, 694, 6610, 6612, 21, 4002, 1244, 1391, 507, 2] */;
|