decord/source/modules/notifications/settings/utils/notificationSettingsGuildFlagUtils.tsx

54 lines
2.7 KiB
TypeScript
Raw Normal View History

2026-09-02 09:53:35 +00:00
// Module ID: 10262
// Function ID: 10263
2026-07-20 16:05:17 +00:00
// Name: updateGuildPreset
2026-09-02 09:53:35 +00:00
// Dependencies: [4701, 673, 682, 4704, 5495, 10255, 5490, 644, 2]
2026-07-20 16:05:17 +00:00
// Exports: updateGuildPreset, useGuildPresetSettings
2026-09-02 09:53:35 +00:00
// Module 10262 (updateGuildPreset)
2026-09-01 10:26:29 +00:00
import Presets from "Presets" /* 4704 */;
2026-09-02 09:53:35 +00:00
import _modDef5495 from "module_5495" /* 5495 */;
2026-09-01 10:26:29 +00:00
import closure_3 from "updateUserGuildSettingsInternal" /* 4701 */;
2026-09-02 09:53:35 +00:00
import { UserNotificationSettings } from "ME" /* 673 */;
import { GuildNotificationSettingsFlags as closure_5 } from "MAX_FAVORITES" /* 682 */;
2026-07-23 10:11:24 +00:00
2026-08-24 06:08:38 +00:00
require = arg1;
let result = require("set").fileFinishedImporting("modules/notifications/settings/utils/notificationSettingsGuildFlagUtils.tsx");
2026-07-20 16:05:17 +00:00
export const updateGuildPreset = function updateGuildPreset(guildId, arg1) {
2026-07-23 10:11:24 +00:00
guildFlags = guildFlags.getGuildFlags(guildId);
2026-08-24 06:08:38 +00:00
if (arg1 === Presets.Presets.ALL_MESSAGES) {
2026-07-29 08:29:29 +00:00
let obj = { message_notifications: null, flags: null };
obj[0] = UserNotificationSettings.ALL_MESSAGES;
2026-09-02 09:53:35 +00:00
let tmp2Result = tmp2(10255);
2026-07-29 08:29:29 +00:00
obj[1] = tmp2Result.withGuildUnreadFlags(guildFlags, constants.UNREADS_ALL_MESSAGES);
2026-09-02 09:53:35 +00:00
const result = _modDef5495.updateGuildNotificationSettings(guildId, obj, tmp2(5490).NotificationLabels.PresetAll);
const obj4 = _modDef5495;
2026-09-01 10:26:29 +00:00
} else if (arg1 === tmp2(4704).Presets.MENTIONS) {
2026-09-02 09:53:35 +00:00
obj = _modDef5495;
2026-07-29 08:29:29 +00:00
obj = { message_notifications: null, flags: null };
obj[0] = UserNotificationSettings.ONLY_MENTIONS;
2026-09-02 09:53:35 +00:00
tmp2Result = tmp2(10255);
2026-07-29 08:29:29 +00:00
obj[1] = tmp2Result.withGuildUnreadFlags(guildFlags, constants.UNREADS_ONLY_MENTIONS);
2026-09-02 09:53:35 +00:00
const result1 = obj.updateGuildNotificationSettings(guildId, obj, tmp2(5490).NotificationLabels.PresetMentions);
2026-09-01 10:26:29 +00:00
} else if (arg1 === tmp2(4704).Presets.NOTHING) {
2026-08-24 06:08:38 +00:00
obj1 = { message_notifications: null, flags: null };
2026-07-29 08:29:29 +00:00
obj1[0] = UserNotificationSettings.NO_MESSAGES;
2026-09-02 09:53:35 +00:00
const obj7 = _modDef5495;
obj1[1] = tmp2(10255).withGuildUnreadFlags(guildFlags, constants.UNREADS_ONLY_MENTIONS);
const result2 = obj7.updateGuildNotificationSettings(guildId, obj1, tmp2(5490).NotificationLabels.PresetNothing);
const tmp2Result1 = tmp2(10255);
2026-07-20 16:05:17 +00:00
}
};
export const useGuildPresetSettings = function useGuildPresetSettings(guildId) {
2026-07-23 10:11:24 +00:00
const _require = guildId;
2026-09-02 09:53:35 +00:00
let obj = _require(644);
2026-08-24 06:08:38 +00:00
const items = [closure_3];
const stateFromStores = obj.useStateFromStores(items, () => closure_1_3.getGuildUnreadSetting(closure_0));
const items1 = [closure_3];
2026-09-02 09:53:35 +00:00
const stateFromStores1 = _require(644).useStateFromStores(items1, () => closure_1_3.getMessageNotifications(closure_0));
2026-07-29 08:29:29 +00:00
obj = { unread: stateFromStores, notification: stateFromStores1, preset: null };
2026-09-02 09:53:35 +00:00
const obj2 = _require(644);
2026-09-01 10:26:29 +00:00
obj[2] = _require(4704).presetFromSettings(stateFromStores, stateFromStores1);
2026-07-20 16:05:17 +00:00
return obj;
};