This commit is contained in:
janisslsm committed 2026-11-01 12:12:55 +02:00
1 parent 1781d25a15
commit 732c0ad767
33051 files changed
+2591613 -3019689

No files matched your search

@@ -0,0 +1,72 @@
// Metro module 10312 (f10313).
import ChannelStore from "../../../../stores/ChannelStore";
import UserGuildSettingsStore from "../../../../stores/UserGuildSettingsStore";
import { UserNotificationSettings } from "../../../../Constants";
import { UnreadSetting } from "../../../read_states/ReadStateConstants";
import { ChannelNotificationSettingsFlags } from "../../../user_settings/UserSettingsConstants";
import { useStateFromStores, useStateFromStoresArray } from "../../../../_bundle/defaultAreStatesEqual";
import { presetFromSettings, presetName, Presets } from "./notificationSettingsPresetUtils";
import { filterOverrides } from "../../NotificationUtils";
import NotificationSettingsModalActionCreators from "../../../../actions/NotificationSettingsModalActionCreators";
import { withChannelUnreadFlags, resetChannelUnreadFlags } from "./notificationSettingsFlagUtils";
import { NotificationLabels, NotificationLabel } from "../../../../utils/NotificationSettingsUtils";
export function useChannelPresetSettings(c17861_0) {
const stateFromStores = useStateFromStores([UserGuildSettingsStore], () => UserGuildSettingsStore.resolveUnreadSetting(c17861_0));
const stateFromStores2 = useStateFromStores([UserGuildSettingsStore], () => UserGuildSettingsStore.resolvedMessageNotifications(c17861_0));
return {
unread: stateFromStores,
notification: stateFromStores2,
preset: presetFromSettings(stateFromStores, stateFromStores2)
};
}
export function useChannelPresetInheritance(a0) {
const stateFromStoresArray = useStateFromStoresArray([UserGuildSettingsStore], () => filterOverrides(UserGuildSettingsStore.getChannelOverrides(a0.guild_id), {
ignoreMute: true,
ignoreUnreadSetting: false,
ignoreNotificationSetting: false
}));
const [inheritedFrom, inheritedPreset] = useStateFromStoresArray([UserGuildSettingsStore, ChannelStore], () => {
const channel = ChannelStore.getChannel(a0.parent_id);
return channel != null && stateFromStoresArray.includes(channel.id) ? ["parent", presetName(presetFromSettings(UserGuildSettingsStore.resolveUnreadSetting(channel), UserGuildSettingsStore.resolvedMessageNotifications(channel)))] : ["guild", presetName(presetFromSettings(UserGuildSettingsStore.getGuildUnreadSetting(a0.guild_id), UserGuildSettingsStore.getMessageNotifications(a0.guild_id)))];
}, [a0.guild_id, a0.parent_id, stateFromStoresArray]);
return {
inherited: !stateFromStoresArray.includes(a0.id),
inheritedFrom,
inheritedPreset
};
}
export function updateChannelPreset(a0, a1, a2) {
const channelIdFlags = UserGuildSettingsStore.getChannelIdFlags(a0, a1);
if (a2 === Presets.ALL_MESSAGES) {
NotificationSettingsModalActionCreators.updateChannelOverrideSettings(a0, a1, {
message_notifications: UserNotificationSettings.ALL_MESSAGES,
flags: withChannelUnreadFlags(channelIdFlags, ChannelNotificationSettingsFlags.UNREADS_ALL_MESSAGES)
}, NotificationLabels.PresetAll);
} else if (a2 === Presets.MENTIONS) {
NotificationSettingsModalActionCreators.updateChannelOverrideSettings(a0, a1, {
message_notifications: UserNotificationSettings.ONLY_MENTIONS,
flags: withChannelUnreadFlags(channelIdFlags, ChannelNotificationSettingsFlags.UNREADS_ONLY_MENTIONS)
}, NotificationLabels.PresetMentions);
} else if (a2 === Presets.NOTHING) {
NotificationSettingsModalActionCreators.updateChannelOverrideSettings(a0, a1, {
message_notifications: UserNotificationSettings.NO_MESSAGES,
flags: withChannelUnreadFlags(channelIdFlags, ChannelNotificationSettingsFlags.UNREADS_ONLY_MENTIONS)
}, NotificationLabels.PresetNothing);
}
}
export function updateChannelToGuildDefault(a0, a1) {
NotificationSettingsModalActionCreators.updateChannelOverrideSettings(a0, a1, {
message_notifications: UserNotificationSettings.NULL,
flags: resetChannelUnreadFlags(UserGuildSettingsStore.getChannelIdFlags(a0, a1))
}, NotificationLabels.PresetDefault);
}
export function updateChannelUnreadSetting(a0, a1, a2) {
NotificationSettingsModalActionCreators.updateChannelOverrideSettings(a0, a1, {
flags: withChannelUnreadFlags(UserGuildSettingsStore.getChannelIdFlags(a0, a1), a2 === UnreadSetting.ALL_MESSAGES ? ChannelNotificationSettingsFlags.UNREADS_ALL_MESSAGES : ChannelNotificationSettingsFlags.UNREADS_ONLY_MENTIONS)
}, NotificationLabel.unreads(a2));
}
export function updateChannelNotificationSetting(a0, a1, a2) {
NotificationSettingsModalActionCreators.updateChannelOverrideSettings(a0, a1, {
message_notifications: a2
}, NotificationLabel.notifications(a2));
}
@@ -0,0 +1,15 @@
// Metro module 10313 (f10314).
import { ChannelNotificationSettingsFlags, GuildNotificationSettingsFlags } from "../../../user_settings/UserSettingsConstants";
import { removeFlags, addFlag } from "../../../../_bundle/Module1384";
export function resetGuildUnreadFlags(a0) {
return removeFlags(a0, GuildNotificationSettingsFlags.UNREADS_ALL_MESSAGES, GuildNotificationSettingsFlags.UNREADS_ONLY_MENTIONS);
}
export function withGuildUnreadFlags(a0, a1) {
return addFlag(removeFlags(a0, GuildNotificationSettingsFlags.UNREADS_ALL_MESSAGES, GuildNotificationSettingsFlags.UNREADS_ONLY_MENTIONS), a1);
}
export function resetChannelUnreadFlags(a0) {
return removeFlags(a0, ChannelNotificationSettingsFlags.UNREADS_ALL_MESSAGES, ChannelNotificationSettingsFlags.UNREADS_ONLY_MENTIONS);
}
export function withChannelUnreadFlags(a0, a1) {
return addFlag(removeFlags(a0, ChannelNotificationSettingsFlags.UNREADS_ALL_MESSAGES, ChannelNotificationSettingsFlags.UNREADS_ONLY_MENTIONS), a1);
}
@@ -0,0 +1,37 @@
// Metro module 10318 (f10319).
import UserGuildSettingsStore from "../../../../stores/UserGuildSettingsStore";
import { UserNotificationSettings } from "../../../../Constants";
import { GuildNotificationSettingsFlags } from "../../../user_settings/UserSettingsConstants";
import { Presets, presetFromSettings } from "./notificationSettingsPresetUtils";
import NotificationSettingsModalActionCreators from "../../../../actions/NotificationSettingsModalActionCreators";
import { withGuildUnreadFlags } from "./notificationSettingsFlagUtils";
import { NotificationLabels } from "../../../../utils/NotificationSettingsUtils";
import { useStateFromStores } from "../../../../_bundle/defaultAreStatesEqual";
export function updateGuildPreset(a0, a1) {
const guildFlags = UserGuildSettingsStore.getGuildFlags(a0);
if (a1 === Presets.ALL_MESSAGES) {
NotificationSettingsModalActionCreators.updateGuildNotificationSettings(a0, {
message_notifications: UserNotificationSettings.ALL_MESSAGES,
flags: withGuildUnreadFlags(guildFlags, GuildNotificationSettingsFlags.UNREADS_ALL_MESSAGES)
}, NotificationLabels.PresetAll);
} else if (a1 === Presets.MENTIONS) {
NotificationSettingsModalActionCreators.updateGuildNotificationSettings(a0, {
message_notifications: UserNotificationSettings.ONLY_MENTIONS,
flags: withGuildUnreadFlags(guildFlags, GuildNotificationSettingsFlags.UNREADS_ONLY_MENTIONS)
}, NotificationLabels.PresetMentions);
} else if (a1 === Presets.NOTHING) {
NotificationSettingsModalActionCreators.updateGuildNotificationSettings(a0, {
message_notifications: UserNotificationSettings.NO_MESSAGES,
flags: withGuildUnreadFlags(guildFlags, GuildNotificationSettingsFlags.UNREADS_ONLY_MENTIONS)
}, NotificationLabels.PresetNothing);
}
}
export function useGuildPresetSettings(c17866_0) {
const stateFromStores = useStateFromStores([UserGuildSettingsStore], () => UserGuildSettingsStore.getGuildUnreadSetting(c17866_0));
const stateFromStores2 = useStateFromStores([UserGuildSettingsStore], () => UserGuildSettingsStore.getMessageNotifications(c17866_0));
return {
unread: stateFromStores,
notification: stateFromStores2,
preset: presetFromSettings(stateFromStores, stateFromStores2)
};
}
@@ -0,0 +1,26 @@
// Metro module 10320 (f10321).
import { UserNotificationSettings } from "../../../../Constants";
import { UnreadSetting } from "../../../read_states/ReadStateConstants";
import { intl, t } from "../../../../intl/index.native";
export function getPushNotificationSelectOptions() {
return [{
label: intl.string(t["HVah/3"]),
value: UserNotificationSettings.ALL_MESSAGES
}, {
label: intl.string(t["tu+ZWJ"]),
value: UserNotificationSettings.ONLY_MENTIONS
}, {
label: intl.string(t.X4wWUi),
value: UserNotificationSettings.NO_MESSAGES
}];
}
export function getUnreadSelectOptions(a0) {
return [{
label: intl.string(t["HVah/3"]),
value: UnreadSetting.ALL_MESSAGES
}, {
value: UnreadSetting.ONLY_MENTIONS,
label: intl.string(t["tu+ZWJ"]),
disabled: a0?.notificationSetting === UserNotificationSettings.ALL_MESSAGES
}];
}
@@ -0,0 +1,21 @@
// Metro module 4388 (f4389).
import { UserNotificationSettings } from "../../../../Constants";
import { UnreadSetting } from "../../../read_states/ReadStateConstants";
import { match } from "../../../../_bundle/Module4389";
import { intl, t } from "../../../../intl/index.native";
let c2602_4 = {
ALL_MESSAGES: "all_messages",
MENTIONS: "mentions",
NOTHING: "nothing",
CUSTOM: "custom"
};
export { c2602_4 as Presets };
export function presetFromSettings(a0, a1) {
return match([a1, a0]).with([UserNotificationSettings.ALL_MESSAGES, UnreadSetting.ALL_MESSAGES], () => c2602_4.ALL_MESSAGES).with([UserNotificationSettings.ONLY_MENTIONS, UnreadSetting.UNSET], () => c2602_4.MENTIONS).with([UserNotificationSettings.ONLY_MENTIONS, UnreadSetting.ONLY_MENTIONS], () => c2602_4.MENTIONS).with([UserNotificationSettings.NO_MESSAGES, UnreadSetting.UNSET], () => c2602_4.NOTHING).with([UserNotificationSettings.NO_MESSAGES, UnreadSetting.ONLY_MENTIONS], () => c2602_4.NOTHING).otherwise(() => c2602_4.CUSTOM);
}
export function presetName(a0) {
return match(a0).with(c2602_4.ALL_MESSAGES, () => intl.string(t.hZrr6k)).with(c2602_4.MENTIONS, () => intl.string(t.y59NJm)).with(c2602_4.NOTHING, () => intl.string(t["pGn/bJ"])).with(c2602_4.CUSTOM, () => intl.string(t["32yow9"])).exhaustive();
}
export function arePresetSettingsUnset(a0, a1) {
return !(a0 != null && a0 !== UnreadSetting.UNSET || a1 != null && a1 !== UserNotificationSettings.NULL);
}