decord/source/actions/NotificationSettingsModalActionCreators.tsx

213 lines
9.6 KiB
TypeScript
Raw Normal View History

2026-08-08 06:10:11 +00:00
// Module ID: 5262
// Function ID: 5263
// Dependencies: [5, 4499, 676, 3941, 685, 709, 5257, 5259, 11, 4153, 1236, 1384, 530, 2]
2026-07-20 16:05:17 +00:00
2026-08-08 06:10:11 +00:00
// Module 5262
2026-07-23 10:11:24 +00:00
import dispatcher from "dispatcher";
2026-07-29 08:29:29 +00:00
import updateUserGuildSettingsInternal from "updateUserGuildSettingsInternal";
2026-07-23 10:11:24 +00:00
import { Endpoints } from "ME";
import { NotificationSettingsUpdateType as closure_6 } from "AccountNotificationFlags";
import { ChannelNotificationSettingsFlags as closure_7 } from "MAX_FAVORITES";
const require = arg1;
let result = require("ME").fileFinishedImporting("actions/NotificationSettingsModalActionCreators.tsx");
2026-07-20 16:05:17 +00:00
export default {
open(guildId) {
2026-07-29 08:29:29 +00:00
let obj = importDefault(709);
2026-07-20 16:05:17 +00:00
obj = { type: "NOTIFICATION_SETTINGS_MODAL_OPEN", guildId };
obj.dispatch(obj);
},
close() {
2026-07-29 08:29:29 +00:00
importDefault(709).dispatch({ type: "NOTIFICATION_SETTINGS_MODAL_CLOSE" });
2026-07-20 16:05:17 +00:00
},
2026-07-29 08:29:29 +00:00
updateGuildNotificationSettings(guildId, muteSettings, NotificationLabel, location) {
2026-08-08 06:10:11 +00:00
let obj = require(5257) /* UserNotificationSettings */;
2026-07-20 16:05:17 +00:00
const currentGuildSettings = obj.getCurrentGuildSettings(guildId);
2026-08-08 06:10:11 +00:00
const result = importDefault(5259).saveUserGuildSettings(guildId, muteSettings);
const obj2 = importDefault(5259);
2026-07-20 16:05:17 +00:00
obj = { type: "USER_GUILD_SETTINGS_GUILD_UPDATE", guildId, settings: muteSettings };
2026-07-29 08:29:29 +00:00
importDefault(709).dispatch(obj);
const obj3 = importDefault(709);
2026-08-08 06:10:11 +00:00
const result1 = require(5257) /* UserNotificationSettings */.trackGuildNotificationSettingsUpdate(guildId, muteSettings, currentGuildSettings, NotificationLabel, location);
2026-07-20 16:05:17 +00:00
},
2026-07-29 08:29:29 +00:00
updateGuildAndChannelNotificationSettings(guildId, channel_overrides, OptedIn, location) {
2026-07-23 10:11:24 +00:00
const _require = guildId;
2026-07-20 16:05:17 +00:00
const importDefault = channel_overrides;
const dependencyMap = OptedIn;
2026-07-29 08:29:29 +00:00
let dispatcher = location;
let obj = importDefault(11);
2026-07-20 16:05:17 +00:00
const keys = obj.keys(channel_overrides.channel_overrides);
2026-08-08 06:10:11 +00:00
const currentGuildSettings = _require(5257).getCurrentGuildSettings(guildId);
const obj2 = _require(5257);
const manyCurrentChannelSettings = _require(5257).getManyCurrentChannelSettings(guildId, keys);
const obj3 = _require(5257);
let result = importDefault(5259).saveUserGuildSettings(guildId, channel_overrides);
const obj4 = importDefault(5259);
2026-07-20 16:05:17 +00:00
obj = { type: "USER_GUILD_SETTINGS_GUILD_AND_CHANNELS_UPDATE", guildId, settings: channel_overrides };
2026-07-29 08:29:29 +00:00
importDefault(709).dispatch(obj);
const obj5 = importDefault(709);
2026-08-08 06:10:11 +00:00
const result1 = _require(5257).trackGuildNotificationSettingsUpdate(guildId, channel_overrides, currentGuildSettings, OptedIn, location);
const obj7 = _require(5257);
2026-07-29 08:29:29 +00:00
const keys1 = importDefault(11).keys(channel_overrides.channel_overrides);
2026-07-20 16:05:17 +00:00
const item = keys1.forEach((channelId) => {
2026-07-29 08:29:29 +00:00
const value = updateUserGuildSettingsInternal.get(channelId);
2026-07-23 10:11:24 +00:00
let obj = guildId(OptedIn[6]);
obj = { guildId, channelId, change: channel_overrides.channel_overrides[channelId], previous: value, label: OptedIn, location: dispatcher };
2026-07-20 16:05:17 +00:00
const result = obj.trackChannelNotificationSettingsUpdate(obj);
});
},
updateChannelOverrideSettings(guildId, id, muteSettings, NotificationLabel, location) {
2026-08-08 06:10:11 +00:00
let obj = require(5257) /* UserNotificationSettings */;
2026-07-20 16:05:17 +00:00
const currentChannelSettings = obj.getCurrentChannelSettings(guildId, id);
2026-08-08 06:10:11 +00:00
let obj1 = importDefault(5259);
2026-07-20 16:05:17 +00:00
obj = { [id]: muteSettings };
const result = obj1.saveUserGuildSettings(guildId, { channel_overrides: obj });
obj = { type: "USER_GUILD_SETTINGS_CHANNEL_UPDATE", guildId, channelId: id, settings: muteSettings };
2026-07-29 08:29:29 +00:00
importDefault(709).dispatch(obj);
2026-08-08 06:10:11 +00:00
const AccessibilityAnnouncer = require(4153) /* AccessibilityAnnouncer */.AccessibilityAnnouncer;
2026-07-29 08:29:29 +00:00
const intl = require(1236) /* getSystemLocale */.intl;
AccessibilityAnnouncer.announce(intl.string(require(1236) /* getSystemLocale */.t.MlIsJ8));
const obj4 = importDefault(709);
2026-07-20 16:05:17 +00:00
obj1 = { guildId, channelId: id, change: muteSettings, previous: currentChannelSettings, label: NotificationLabel, location };
2026-08-08 06:10:11 +00:00
const result1 = require(5257) /* UserNotificationSettings */.trackChannelNotificationSettingsUpdate(obj1);
2026-07-20 16:05:17 +00:00
},
2026-07-29 08:29:29 +00:00
updateChannelOverrideSettingsBulk(guildId, channel_overrides, OptedOut) {
2026-07-23 10:11:24 +00:00
const _require = guildId;
2026-07-20 16:05:17 +00:00
const importDefault = channel_overrides;
2026-07-29 08:29:29 +00:00
const dependencyMap = OptedOut;
2026-07-23 10:11:24 +00:00
let dispatcher = arg3;
2026-07-29 08:29:29 +00:00
let obj = importDefault(11);
2026-07-20 16:05:17 +00:00
const keys = obj.keys(channel_overrides);
2026-08-08 06:10:11 +00:00
const manyCurrentChannelSettings = _require(5257).getManyCurrentChannelSettings(guildId, keys);
const obj2 = _require(5257);
2026-07-20 16:05:17 +00:00
obj = { channel_overrides };
2026-08-08 06:10:11 +00:00
const result = importDefault(5259).saveUserGuildSettings(guildId, obj);
const obj3 = importDefault(5259);
2026-07-20 16:05:17 +00:00
obj = { type: "USER_GUILD_SETTINGS_CHANNEL_UPDATE_BULK", guildId, overrides: channel_overrides };
2026-07-29 08:29:29 +00:00
importDefault(709).dispatch(obj);
const obj5 = importDefault(709);
const keys1 = importDefault(11).keys(channel_overrides);
2026-07-20 16:05:17 +00:00
const item = keys1.forEach((channelId) => {
2026-07-29 08:29:29 +00:00
let obj = guildId(OptedOut[6]);
obj = { guildId, channelId, change: table[channelId], previous: updateUserGuildSettingsInternal.get(channelId), label: OptedOut, location: dispatcher };
2026-07-20 16:05:17 +00:00
return obj.trackChannelNotificationSettingsUpdate(obj);
});
},
updateAppDMOverrideSettings(guildId, id, id2, change, NotificationLabel2) {
2026-08-08 06:10:11 +00:00
let obj = require(5257) /* UserNotificationSettings */;
2026-07-20 16:05:17 +00:00
const currentChannelSettings = obj.getCurrentChannelSettings(guildId, id);
2026-08-08 06:10:11 +00:00
let obj1 = importDefault(5259);
2026-07-20 16:05:17 +00:00
obj = { [id]: change };
const result = obj1.saveUserGuildSettings(guildId, { channel_overrides: obj });
obj = { type: "USER_GUILD_SETTINGS_CHANNEL_UPDATE", guildId, channelId: id, settings: change };
2026-07-29 08:29:29 +00:00
importDefault(709).dispatch(obj);
2026-08-08 06:10:11 +00:00
const AccessibilityAnnouncer = require(4153) /* AccessibilityAnnouncer */.AccessibilityAnnouncer;
2026-07-29 08:29:29 +00:00
const intl = require(1236) /* getSystemLocale */.intl;
AccessibilityAnnouncer.announce(intl.string(require(1236) /* getSystemLocale */.t.MlIsJ8));
const obj4 = importDefault(709);
2026-07-20 16:05:17 +00:00
obj1 = { updateType: constants.AUTHORIZED_APP_DM, guildId, channelId: id, applicationId: id2, change, previous: currentChannelSettings, label: NotificationLabel2 };
2026-08-08 06:10:11 +00:00
const result1 = require(5257) /* UserNotificationSettings */.trackChannelNotificationSettingsUpdate(obj1);
2026-07-20 16:05:17 +00:00
},
setForumThreadsCreated(channel, arg1) {
2026-07-29 08:29:29 +00:00
if (arg1) {
let NEW_FORUM_THREADS_OFF = tmp.NEW_FORUM_THREADS_ON;
let tmp2 = tmp;
} else {
NEW_FORUM_THREADS_OFF = tmp.NEW_FORUM_THREADS_OFF;
tmp2 = tmp;
}
2026-08-08 06:10:11 +00:00
const NotificationLabel = require(5257) /* UserNotificationSettings */.NotificationLabel;
2026-07-29 08:29:29 +00:00
const result = this.updateChannelOverrideSettings(channel.guild_id, channel.id, { flags: channelFlags.getChannelFlags(channel) & ~(arg1 ? tmp2.NEW_FORUM_THREADS_OFF : tmp2.NEW_FORUM_THREADS_ON) | NEW_FORUM_THREADS_OFF }, NotificationLabel.forumThreadsCreated(arg1));
2026-07-20 16:05:17 +00:00
},
setAccountFlag(arg0, arg1) {
2026-07-23 10:11:24 +00:00
let closure_0 = arg0;
let closure_1 = arg1;
2026-07-29 08:29:29 +00:00
return callback(function*() {
if (c3 === 2) {
c3 = 3;
HermesBuiltin.throwTypeError();
} else if (tmp4 === 3) {
if (arg0 === 1) {
throw arg1;
} else if (arg0 === 2) {
let obj = { value: null, done: true };
obj[0] = arg1;
return obj;
} else {
2026-08-08 06:10:11 +00:00
return { value: "HermesInternal", done: null };
2026-07-29 08:29:29 +00:00
}
} else {
try {
c3 = 2;
if (0 === dependencyMap) {
if (arg0 === 1) {
c3 = 3;
throw arg1;
} else if (arg0 === 2) {
c3 = 3;
obj = { value: null, done: true };
obj[0] = arg1;
return obj;
} else {
let closure_1 = tmp2;
let c0 = tmp5;
c0 = undefined;
const setFlagResult = outer1_0(1384).setFlag(outer1_4.accountNotificationSettings.flags, outer1_0, outer1_1);
c0 = setFlagResult;
const HTTP = outer1_0(530).HTTP;
let obj1 = { url: null, body: null, rejectWithError: null };
obj1[0] = outer1_5.ACCOUNT_NOTIFICATION_SETTINGS;
const obj2 = { flags: null };
obj2[0] = setFlagResult;
obj1[1] = obj2;
const obj10 = outer1_0(1384);
obj1[2] = outer1_0(530).rejectWithMigratedError();
dependencyMap = 1;
c3 = 1;
const obj3 = { value: null, done: false };
obj3[0] = HTTP.patch(obj1);
return obj3;
}
} else if (1 === tmp5) {
if (arg0 === 1) {
c3 = 3;
throw arg1;
} else if (arg0 === 2) {
c3 = 3;
const obj4 = { value: null, done: true };
obj4[0] = arg1;
return obj4;
} else {
obj1 = outer1_1(709);
const obj5 = { type: "NOTIFICATION_SETTINGS_UPDATE", settings: null };
const obj6 = { flags: null };
obj6[0] = c0;
obj5[1] = obj6;
dependencyMap = 2;
c3 = 1;
const obj7 = { value: null, done: false };
obj7[0] = obj1.dispatch(obj5);
return obj7;
}
} else if (arg0 === 1) {
c3 = 3;
throw arg1;
} else if (arg0 === 2) {
c3 = 3;
obj = { value: null, done: true };
obj[0] = arg1;
return obj;
} else {
c3 = 3;
2026-08-08 06:10:11 +00:00
return { value: "HermesInternal", done: null };
2026-07-29 08:29:29 +00:00
}
} catch (tmp11) {
c3 = tmp;
throw tmp11;
}
}
2026-07-20 16:05:17 +00:00
})();
}
};