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

+62
View File
@@ -0,0 +1,62 @@
// Metro module 10255 (f10256).
import SelfPresenceStore from "../../stores/SelfPresenceStore";
import { NotificationSettingsUpdateType } from "./NotificationConstants";
import { AnalyticEvents, StatusTypes } from "../../Constants";
import { FocusMode, FocusModeExpiresAtSetting } from "../user_settings/UserSettings";
import { PreloadedUserSettingsActionCreators, UserSettingsDelay } from "../user_settings/UserSettingsProtoActionCreators";
import { BoolValue } from "../../_bundle/Module1337";
import AnalyticsUtils from "../../utils/AnalyticsUtils";
import AlertActionCreators from "../../actions/AlertActionCreators";
import { intl, t } from "../../intl/index.native";
import setUserStatus from "../multi_account/setUserStatus";
export function useFocusModeEnabled() {
let r13 = FocusMode.useSetting();
const setting = FocusModeExpiresAtSetting.useSetting();
if (r13) {
r13 = setting === "0" || new Date(Number(setting)).getTime() - new Date().getTime() > 0;
}
return r13;
}
export function getFocusModeEnabled() {
let r13 = FocusMode.getSetting();
const setting = FocusModeExpiresAtSetting.getSetting();
if (r13) {
r13 = setting != null;
}
if (r13) {
r13 = new Date(Number(setting)).getTime() - new Date().getTime() > 0;
}
return r13;
}
export function setFocusMode(a0, a1) {
const value = a0;
const setting = FocusMode.getSetting();
PreloadedUserSettingsActionCreators.updateAsync("notifications", (a0) => {
a0.quietMode = BoolValue.create({
value
});
let focusModeExpiresAtMs = "0";
if (value) {
focusModeExpiresAtMs = a1 != null ? `${Date.now() + a1}` : "0";
}
a0.focusModeExpiresAtMs = focusModeExpiresAtMs;
}, UserSettingsDelay.INFREQUENT_USER_ACTION);
AnalyticsUtils.track(AnalyticEvents.NOTIFICATION_SETTINGS_UPDATED, {
update_type: NotificationSettingsUpdateType.ACCOUNT,
quiet_mode_enabled: a0,
quiet_mode_enabled_old: setting
});
if (SelfPresenceStore.getStatus() === StatusTypes.DND && a0 && a1 == null) {
AlertActionCreators.show({
title: intl.string(t["B+cbLS"]),
body: intl.string(t.CYVgLI),
cancelText: intl.string(t.f3Pet9),
confirmText: intl.string(t.BddRzS),
onConfirm: () => {
setUserStatus({
nextStatus: StatusTypes.ONLINE
});
}
});
}
}
@@ -0,0 +1,61 @@
// Metro module 12773 (f12774).
import SelfPresenceStore from "../../stores/SelfPresenceStore";
import { StatusTypes } from "../../Constants";
import Durations from "../../utils/Durations";
import { StatusExpiresAtSetting } from "../user_settings/UserSettings";
import Dispatcher from "../../Dispatcher";
import Module589 from "../../_bundle/Module589";
let $mk90389 = function() {
return (a0) => a0 < Date.now() - 3 * Durations.Millis.DAY;
};
let sessionStartsWithDND = [];
let c8804_6 = false;
class HabitualDNDStore extends Module589.PersistedStore {
static displayName = "HabitualDNDStore";
static persistKey = "habitualDND";
initialize(a0) {
this.waitFor(SelfPresenceStore);
if (a0 != null && Array.isArray(a0.sessionStartsWithDND)) {
sessionStartsWithDND = a0.sessionStartsWithDND;
}
}
showNagBar() {
return c8804_6;
}
getState() {
return {
sessionStartsWithDND
};
}
getTemp() {
return {
x: StatusExpiresAtSetting.getSetting()
};
}
}
const habitualDNDStore = new HabitualDNDStore(Dispatcher, {
POST_CONNECTION_OPEN: function handleConnect() {
L7: {
if (SelfPresenceStore.getStatus() === StatusTypes.DND && StatusExpiresAtSetting.getSetting() === "0") {
sessionStartsWithDND.push(Date.now());
const r27 = sessionStartsWithDND.filter((item) => item > Date.now() - 5 * Durations.Millis.DAY);
sessionStartsWithDND = r27;
if (!(r27.length >= 4 && sessionStartsWithDND.some($mk90389()))) {
break L7;
}
setTimeout(() => {
Dispatcher.dispatch({
type: "HABITUAL_DND_CLEAR"
});
}, 15 * Durations.Millis.SECOND);
} else {
sessionStartsWithDND = [];
}
}
},
HABITUAL_DND_CLEAR: function handleDNDClear() {
c8804_6 = !!(sessionStartsWithDND.length >= 4 && sessionStartsWithDND.some($mk90389()));
sessionStartsWithDND = [];
}
});
export default habitualDNDStore;
@@ -0,0 +1,23 @@
// Metro module 4863 (f4864).
import { createApexExperiment } from "../experiments/apex/index";
const apexExperiment = createApexExperiment({
name: "2026-01-ios-push-notif-json-fix",
kind: "user",
defaultConfig: {
enabled: false
},
variations: {
1: {
enabled: true
}
}
});
const enabled = null;
export function isIOSPushNotificationRawPayloadFixExperimentEnabled() {
if (enabled == null) {
enabled = apexExperiment.getConfig({
location: "isIOSPushNotificationRawPayloadFixExperiment"
}).enabled;
}
return enabled;
}
@@ -0,0 +1,157 @@
// Metro module 5131 (f5132).
import GuildMemberStore from "../../stores/GuildMemberStore";
import UserGuildSettingsStore from "../../stores/UserGuildSettingsStore";
import UserStore from "../../stores/UserStore";
import Dispatcher from "../../Dispatcher";
import Module589 from "../../_bundle/Module589";
let c3093_5 = null;
let c3093_6 = null;
let c3093_7 = null;
let c3093_8 = null;
let c3093_9 = {};
let c3093_10 = {};
let c3093_11 = {};
let c3093_12 = {};
class LastMentionTimestampStore extends Module589.Store {
initialize() {
this.waitFor(GuildMemberStore, UserGuildSettingsStore, UserStore);
}
getGlobalStats() {
const approx_seconds_since_last_notification = c3093_5 == null ? null : Math.floor((Date.now() - c3093_5) / 1000);
const approx_seconds_since_last_mention = c3093_6 == null ? null : Math.floor((Date.now() - c3093_6) / 1000);
const approx_seconds_since_last_role_mention = c3093_7 == null ? null : Math.floor((Date.now() - c3093_7) / 1000);
return {
approx_seconds_since_last_notification,
approx_seconds_since_last_mention,
approx_seconds_since_last_role_mention,
approx_seconds_since_last_everyone_mention: c3093_8 == null ? null : Math.floor((Date.now() - c3093_8) / 1000)
};
}
getStats(a0) {
const approx_seconds_since_last_notification = c3093_5 == null ? null : Math.floor((Date.now() - c3093_5) / 1000);
const approx_seconds_since_last_mention = c3093_6 == null ? null : Math.floor((Date.now() - c3093_6) / 1000);
const approx_seconds_since_last_role_mention = c3093_7 == null ? null : Math.floor((Date.now() - c3093_7) / 1000);
const approx_seconds_since_last_everyone_mention = c3093_8 == null ? null : Math.floor((Date.now() - c3093_8) / 1000);
const r54 = a0 == null;
let approx_seconds_since_last_guild_notification = null;
if (!r54) {
const r11 = c3093_9[a0];
approx_seconds_since_last_guild_notification = r11 == null ? null : Math.floor((Date.now() - r11) / 1000);
}
const r67 = a0 == null;
let approx_seconds_since_last_guild_mention = null;
if (!r67) {
const r70 = c3093_10[a0];
approx_seconds_since_last_guild_mention = r70 == null ? null : Math.floor((Date.now() - r70) / 1000);
}
const r82 = a0 == null;
let approx_seconds_since_last_guild_role_mention = null;
if (!r82) {
const r85 = c3093_12[a0];
approx_seconds_since_last_guild_role_mention = r85 == null ? null : Math.floor((Date.now() - r85) / 1000);
}
const r97 = a0 == null;
let approx_seconds_since_last_guild_everyone_mention = null;
if (!r97) {
const r100 = c3093_11[a0];
approx_seconds_since_last_guild_everyone_mention = r100 == null ? null : Math.floor((Date.now() - r100) / 1000);
}
return {
approx_seconds_since_last_notification,
approx_seconds_since_last_mention,
approx_seconds_since_last_role_mention,
approx_seconds_since_last_everyone_mention,
approx_seconds_since_last_guild_notification,
approx_seconds_since_last_guild_mention,
approx_seconds_since_last_guild_role_mention,
approx_seconds_since_last_guild_everyone_mention
};
}
}
const lastMentionTimestampStore = new LastMentionTimestampStore(Dispatcher, {
CONNECTION_OPEN: function handleConnectionOpen() {
const r7 = c3093_5;
if (!(r7 != null && Date.now() - r7 < 60000)) {
c3093_5 = null;
}
const r19 = c3093_6;
if (!(r19 != null && Date.now() - r19 < 60000)) {
c3093_6 = null;
}
const r27 = c3093_7;
if (!(r27 != null && Date.now() - r27 < 60000)) {
c3093_7 = null;
}
const r35 = c3093_8;
if (!(r35 != null && Date.now() - r35 < 60000)) {
c3093_8 = null;
}
for (const key in c3093_9) {
const r14 = c3093_9[key];
if (!(r14 != null && Date.now() - r14 < 60000)) {
delete c3093_9[key];
}
}
for (const key2 in c3093_10) {
const r58 = c3093_10[key2];
if (!(r58 != null && Date.now() - r58 < 60000)) {
delete c3093_10[key2];
}
}
for (const key3 in c3093_12) {
const r72 = c3093_12[key3];
if (!(r72 != null && Date.now() - r72 < 60000)) {
delete c3093_12[key3];
}
}
for (const key4 in c3093_11) {
const r84 = key4;
const r86 = c3093_11[r84];
if (!(r86 != null && Date.now() - r86 < 60000)) {
delete c3093_11[r84];
}
}
},
MESSAGE_NOTIFICATION_SHOWN: function handleMessageNotificationShown({ guildId, mentioned, roleMentioned, everyoneMentioned }) {
const r10 = Date.now();
c3093_5 = r10;
if (guildId != null) {
c3093_9[guildId] = r10;
}
if (mentioned) {
c3093_6 = r10;
if (guildId != null) {
c3093_10[guildId] = r10;
}
}
if (roleMentioned) {
c3093_7 = r10;
if (guildId != null) {
c3093_12[guildId] = r10;
}
}
if (everyoneMentioned) {
c3093_8 = r10;
if (guildId != null) {
c3093_11[guildId] = r10;
}
}
}
});
export default lastMentionTimestampStore;
export function trackMessageNotificationTimestamps(a0, a1) {
const id2 = UserStore.getCurrentUser()?.id;
let member;
const id = id2;
const isSuppressEveryoneEnabled = UserGuildSettingsStore.isSuppressEveryoneEnabled(a1);
const isSuppressRolesEnabled = UserGuildSettingsStore.isSuppressRolesEnabled(a1);
const mentioned = a0.mentions != null && a0.mentions.some((mention) => mention.id === id);
member = a1 == null ? null : id == null ? null : GuildMemberStore.getMember(a1, id);
Dispatcher.dispatch({
type: "MESSAGE_NOTIFICATION_SHOWN",
guildId: a1,
mentioned,
roleMentioned: a0.mention_roles != null && member != null && member.roles != null && a0.mention_roles.some((mention_role) => member.roles.includes(mention_role)) && !isSuppressRolesEnabled,
everyoneMentioned: a0.mention_everyone === true && !isSuppressEveryoneEnabled
});
}
@@ -0,0 +1,16 @@
// Metro module 3829 (f3830).
const r10 = {
USE_NEW_NOTIFICATIONS: 16,
16: "USE_NEW_NOTIFICATIONS",
MENTION_ON_ALL_MESSAGES: 32,
32: "MENTION_ON_ALL_MESSAGES"
};
const r14 = {
GUILD: "guild",
CHANNEL: "channel",
ACCOUNT: "account",
AUTHORIZED_APP_DM: "authorized_app_dm",
AUTHORIZED_APP_DM_PUSH_NOTIFICATION: "authorized_app_dm_push_notification"
};
export { r10 as AccountNotificationFlags };
export { r14 as NotificationSettingsUpdateType };
@@ -0,0 +1,132 @@
// Metro module 2517 (f2518).
import { loadJsonAsset } from "../asset_json/native/AssetJsonUtils";
import * as _Module2518 from "../../_bundle/Module2518";
import * as _Module2519 from "../../_bundle/Module2519";
import * as _Module2520 from "../../_bundle/Module2520";
import * as _Module2521 from "../../_bundle/Module2521";
import * as _Module2522 from "../../_bundle/Module2522";
import * as _Module2523 from "../../_bundle/Module2523";
import * as _Module2524 from "../../_bundle/Module2524";
import * as _Module2525 from "../../_bundle/Module2525";
import * as _Module2526 from "../../_bundle/Module2526";
import * as _Module2527 from "../../_bundle/Module2527";
import * as _Module2528 from "../../_bundle/Module2528";
import * as _Module2529 from "../../_bundle/Module2529";
import * as _Module2530 from "../../_bundle/Module2530";
import * as _Module2531 from "../../_bundle/Module2531";
import * as _Module2532 from "../../_bundle/Module2532";
import * as _Module2533 from "../../_bundle/Module2533";
import * as _Module2534 from "../../_bundle/Module2534";
import * as _Module2535 from "../../_bundle/Module2535";
import * as _Module2536 from "../../_bundle/Module2536";
import * as _Module2537 from "../../_bundle/Module2537";
import * as _Module2538 from "../../_bundle/Module2538";
import * as _Module2539 from "../../_bundle/Module2539";
import * as _Module2540 from "../../_bundle/Module2540";
import * as _Module2541 from "../../_bundle/Module2541";
import * as _Module2542 from "../../_bundle/Module2542";
import * as _Module2543 from "../../_bundle/Module2543";
import * as _Module2544 from "../../_bundle/Module2544";
import * as _Module2545 from "../../_bundle/Module2545";
import * as _Module2546 from "../../_bundle/Module2546";
import * as _Module2547 from "../../_bundle/Module2547";
import * as _Module2548 from "../../_bundle/Module2548";
import { createLoader, makeMessagesProxy } from "../../_bundle/Module1274";
const loader = createLoader({
bg: () => loadJsonAsset(_Module2518).then((result) => ({
default: result
})),
cs: () => loadJsonAsset(_Module2519).then((result) => ({
default: result
})),
da: () => loadJsonAsset(_Module2520).then((result) => ({
default: result
})),
de: () => loadJsonAsset(_Module2521).then((result) => ({
default: result
})),
el: () => loadJsonAsset(_Module2522).then((result) => ({
default: result
})),
"en-GB": () => loadJsonAsset(_Module2523).then((result) => ({
default: result
})),
"es-419": () => loadJsonAsset(_Module2524).then((result) => ({
default: result
})),
"es-ES": () => loadJsonAsset(_Module2525).then((result) => ({
default: result
})),
fi: () => loadJsonAsset(_Module2526).then((result) => ({
default: result
})),
fr: () => loadJsonAsset(_Module2527).then((result) => ({
default: result
})),
hi: () => loadJsonAsset(_Module2528).then((result) => ({
default: result
})),
hr: () => loadJsonAsset(_Module2529).then((result) => ({
default: result
})),
hu: () => loadJsonAsset(_Module2530).then((result) => ({
default: result
})),
it: () => loadJsonAsset(_Module2531).then((result) => ({
default: result
})),
ja: () => loadJsonAsset(_Module2532).then((result) => ({
default: result
})),
ko: () => loadJsonAsset(_Module2533).then((result) => ({
default: result
})),
lt: () => loadJsonAsset(_Module2534).then((result) => ({
default: result
})),
nl: () => loadJsonAsset(_Module2535).then((result) => ({
default: result
})),
no: () => loadJsonAsset(_Module2536).then((result) => ({
default: result
})),
pl: () => loadJsonAsset(_Module2537).then((result) => ({
default: result
})),
"pt-BR": () => loadJsonAsset(_Module2538).then((result) => ({
default: result
})),
ro: () => loadJsonAsset(_Module2539).then((result) => ({
default: result
})),
ru: () => loadJsonAsset(_Module2540).then((result) => ({
default: result
})),
"sv-SE": () => loadJsonAsset(_Module2541).then((result) => ({
default: result
})),
th: () => loadJsonAsset(_Module2542).then((result) => ({
default: result
})),
tr: () => loadJsonAsset(_Module2543).then((result) => ({
default: result
})),
uk: () => loadJsonAsset(_Module2544).then((result) => ({
default: result
})),
vi: () => loadJsonAsset(_Module2545).then((result) => ({
default: result
})),
"zh-CN": () => loadJsonAsset(_Module2546).then((result) => ({
default: result
})),
"zh-TW": () => loadJsonAsset(_Module2547).then((result) => ({
default: result
})),
"en-US": () => loadJsonAsset(_Module2548).then((result) => ({
default: result
}))
}, "en-US");
const r51 = makeMessagesProxy(loader);
export default r51;
export { loader as messagesLoader };
@@ -0,0 +1,251 @@
// Metro module 13509 (f13510).
import NotificationSettings_messages from "./NotificationSettings.messages";
import { NotifSettings } from "../../_bundle/Module13510";
import { NotifTypes } from "../../_bundle/Module13511";
const behavior3 = {
badge: true,
visibility: "popup",
vibrate: true,
sound: true
};
const behavior2 = {
badge: true,
visibility: "default",
vibrate: true,
sound: true
};
const behavior = {
badge: true,
visibility: "default",
vibrate: false,
sound: false
};
const r19 = [{
title: NotificationSettings_messages.S5cB9e,
string_id: "111_realtime"
}, {
title: NotificationSettings_messages["UzRF+8"],
string_id: "222_social"
}, {
title: NotificationSettings_messages.zRKbpz,
string_id: "333_server"
}, {
title: NotificationSettings_messages.q5M7HV,
string_id: "444_other"
}];
const r41 = [{
title: NotificationSettings_messages["IUH/Oe"],
id: NotifSettings.CALLS,
string_id: "calls",
category: "111_realtime",
behavior: {
badge: false,
ringtone: "call_ringing",
visibility: "popup",
vibrate: true,
sound: true
},
systemOnly: true
}, {
title: NotificationSettings_messages.VeBD1N,
id: NotifSettings.VOICE_CONNECTED,
string_id: "mediaConnections",
category: "111_realtime",
behavior: {
badge: false,
visibility: "default",
vibrate: false,
sound: true
},
systemOnly: true
}, {
title: NotificationSettings_messages.NGdNZb,
id: NotifSettings.DMS,
string_id: "directMessages",
category: "222_social",
behavior: behavior3,
systemOnly: true
}, {
title: NotificationSettings_messages.NxgGZA,
id: NotifSettings.FRIEND_REQUESTS,
string_id: "friendRequests",
category: "222_social",
behavior: behavior3,
systemOnly: true
}, {
title: NotificationSettings_messages.MOjygY,
id: NotifSettings.POLLS,
string_id: "polls",
category: "222_social",
behavior: behavior2,
systemOnly: true
}, {
title: NotificationSettings_messages.wv4QHR,
id: NotifSettings.REACTIONS,
string_id: "reactions",
category: "222_social",
behavior: behavior2
}, {
title: NotificationSettings_messages.n0Wp6j,
id: NotifSettings.MISSED_MESSAGES_LOW,
string_id: "missed_messages_low",
category: "222_social",
behavior,
experiment: "2026-05-noisier-notif-settings-defaults",
variations: [0, 2, 3, 4]
}, {
title: NotificationSettings_messages.n0Wp6j,
id: NotifSettings.MISSED_MESSAGES_DEFAULT,
string_id: "missed_messages_default",
category: "222_social",
behavior: behavior2,
experiment: "2026-05-noisier-notif-settings-defaults",
variations: [1]
}, {
title: NotificationSettings_messages.n0Wp6j,
id: NotifSettings.MISSED_MESSAGES_DEFAULT,
string_id: "missed_messages_default",
category: "222_social",
behavior: behavior2,
experiment: "2026-05-noisier-notif-settings-defaults",
variations: [5]
}, {
title: NotificationSettings_messages.Iy9grw,
id: NotifSettings.VOICE_ACTIVITY_LOW,
string_id: "voice_activity_low",
category: "222_social",
behavior,
experiment: "2026-05-noisier-notif-settings-defaults",
variations: [0, 1, 3, 4]
}, {
title: NotificationSettings_messages.Iy9grw,
id: NotifSettings.VOICE_ACTIVITY_DEFAULT,
string_id: "voice_activity_default",
category: "222_social",
behavior: behavior2,
experiment: "2026-05-noisier-notif-settings-defaults",
variations: [2]
}, {
title: NotificationSettings_messages.Iy9grw,
id: NotifSettings.VOICE_ACTIVITY_DEFAULT,
string_id: "voice_activity_default",
category: "222_social",
behavior: behavior2,
experiment: "2026-05-noisier-notif-settings-defaults",
variations: [5]
}, {
title: NotificationSettings_messages["9EDo+/"],
id: NotifSettings.GAMING_LOW,
string_id: "gaming_low",
category: "222_social",
behavior,
experiment: "2026-05-noisier-notif-settings-defaults",
variations: [0, 1, 2, 4]
}, {
title: NotificationSettings_messages["9EDo+/"],
id: NotifSettings.GAMING_DEFAULT,
string_id: "gaming_default",
category: "222_social",
behavior: behavior2,
experiment: "2026-05-noisier-notif-settings-defaults",
variations: [3]
}, {
title: NotificationSettings_messages["9EDo+/"],
id: NotifSettings.GAMING_DEFAULT,
string_id: "gaming_default",
category: "222_social",
behavior: behavior2,
experiment: "2026-05-noisier-notif-settings-defaults",
variations: [5]
}, {
title: NotificationSettings_messages.vcrTV5,
id: NotifSettings.FRIEND_ACTIVITY_LOW,
string_id: "social",
category: "222_social",
behavior,
systemOnly: true,
experiment: "2026-05-noisier-notif-settings-defaults",
variations: [0, 1, 2, 3]
}, {
title: NotificationSettings_messages.vcrTV5,
id: NotifSettings.FRIEND_ACTIVITY_DEFAULT,
string_id: "social",
category: "222_social",
behavior: behavior2,
systemOnly: true,
experiment: "2026-05-noisier-notif-settings-defaults",
variations: [4]
}, {
title: NotificationSettings_messages.vcrTV5,
id: NotifSettings.FRIEND_ACTIVITY_DEFAULT,
string_id: "social",
category: "222_social",
behavior: behavior2,
systemOnly: true,
experiment: "2026-05-noisier-notif-settings-defaults",
variations: [5]
}, {
title: NotificationSettings_messages["4qWUAO"],
id: NotifSettings.GUILD_MESSAGES,
string_id: "messages",
category: "333_server",
behavior: behavior3,
systemOnly: true
}, {
title: NotificationSettings_messages.HibKoy,
id: NotifSettings.FORUM_NOTIFICATIONS,
string_id: "forumThreadCreated",
category: "333_server",
behavior: behavior3,
systemOnly: true
}, {
title: NotificationSettings_messages["40TIqW"],
id: NotifSettings.GUILD_EVENT_NOTIFICATIONS,
string_id: "guildEventLive",
category: "333_server",
behavior: behavior3,
systemOnly: true
}, {
title: NotificationSettings_messages["4n388K"],
id: NotifSettings.STAGE_NOTIFICATIONS,
string_id: "stageLive",
category: "333_server",
behavior: behavior3,
systemOnly: true
}, {
title: NotificationSettings_messages.kIrLfg,
id: NotifSettings.OTHER_GUILD,
string_id: "other",
category: "333_server",
behavior,
systemOnly: true
}, {
title: NotificationSettings_messages["T+79Eo"],
id: NotifSettings.OTHER,
string_id: "default",
category: "444_other",
behavior,
systemOnly: true
}, {
title: NotificationSettings_messages.zJlwvV,
id: NotifSettings.SYSTEM,
string_id: "systemMessages",
category: "444_other",
behavior: behavior3,
systemOnly: true
}];
const r246 = {};
r246[NotifTypes.GUILD_STREAM_START] = [NotifSettings.VOICE_ACTIVITY_LOW, NotifSettings.VOICE_ACTIVITY_DEFAULT];
r246[NotifTypes.STAGE_INSTANCE_CREATE] = [NotifSettings.STAGE_NOTIFICATIONS];
r246[NotifTypes.GO_LIVE_NOTIFICATION] = [NotifSettings.VOICE_ACTIVITY_LOW, NotifSettings.VOICE_ACTIVITY_DEFAULT];
r246[NotifTypes.VOICE_CHANNEL_ACTIVITY] = [NotifSettings.VOICE_ACTIVITY_LOW, NotifSettings.VOICE_ACTIVITY_DEFAULT];
r246[NotifTypes.VOICE_CHANNEL_ACTIVITY_PEAK_AFFINITY] = [NotifSettings.VOICE_ACTIVITY_LOW, NotifSettings.VOICE_ACTIVITY_DEFAULT];
r246[NotifTypes.MISSED_MESSAGE_PUSH] = [NotifSettings.MISSED_MESSAGES_LOW, NotifSettings.MISSED_MESSAGES_DEFAULT];
r246[NotifTypes.FRIEND_GAMING_ACTIVITY_PUSH] = [NotifSettings.GAMING_LOW, NotifSettings.GAMING_DEFAULT];
r246[NotifTypes.FRIENDS_PLAYING_GAME] = [NotifSettings.GAMING_LOW, NotifSettings.GAMING_DEFAULT];
r246[NotifTypes.PARENTAL_CONSENT_FINAL_WARNING] = [NotifSettings.SYSTEM];
r246[NotifTypes.CUSTOM_STATUS_UPDATE] = [NotifSettings.FRIEND_ACTIVITY_LOW, NotifSettings.FRIEND_ACTIVITY_DEFAULT];
r246[NotifTypes.PROFILE_UPDATES_NOTIFICATION] = [NotifSettings.FRIEND_ACTIVITY_LOW, NotifSettings.FRIEND_ACTIVITY_DEFAULT];
export { r19 as NOTIF_CATEGORIES };
export { r41 as NOTIF_SETTINGS };
export { r246 as NOTIF_SETTING_MAPPING };
@@ -0,0 +1,29 @@
// Metro module 13516 (f13517).
import { createApexExperiment } from "../experiments/apex/index";
const r22 = {
"2026-05-noisier-notif-settings-defaults": createApexExperiment({
name: "2026-05-noisier-notif-settings-defaults",
kind: "user",
defaultConfig: {
variation: 0
},
variations: {
1: {
variation: 1
},
2: {
variation: 2
},
3: {
variation: 3
},
4: {
variation: 4
},
5: {
variation: 5
}
}
})
};
export { r22 as knownExperimentConfigs };
@@ -0,0 +1,41 @@
// Metro module 13515 (f13516).
import { NOTIF_SETTINGS, NOTIF_SETTING_MAPPING } from "./NotificationSettingsConstants";
import { knownExperimentConfigs } from "./NotificationSettingsExperiments";
export function getAssignedNotifSettingsAndMappings() {
const settings = [];
const mappings = [];
const set = new Set();
for (const item of NOTIF_SETTINGS) {
if (item.experiment != null) {
const r45 = knownExperimentConfigs[item.experiment];
if (r45.definition.name !== item.experiment) {
throw new Error(`Experiment called ${r45.definition.name} assigned to name ${item.experiment}`);
}
if (!item.variations.includes(r45.getConfig({
location: "getAssignedNotifSettingsAndMappings"
}).variation)) {
continue;
}
}
settings.push(item);
set.add(item.id);
}
loop10: for (const r87 of Object.entries(NOTIF_SETTING_MAPPING)) {
const [r91, r92] = r87;
const notifType = parseInt(r91);
for (const item2 of r92) {
if (!set.has(item2)) {
continue;
}
mappings.push({
notifType,
notifSetting: item2
});
continue loop10;
}
}
return {
settings,
mappings
};
}
@@ -0,0 +1,453 @@
// Metro module 10249 (f10250).
import EmbeddedActivitiesStore from "../activities/EmbeddedActivitiesStore";
import LurkingStore from "../lurker_mode/LurkingStore";
import MessageRequestStore from "../message_request/MessageRequestStore";
import JoinedThreadsStore from "../threads/JoinedThreadsStore";
import VoicePanelStore from "../voice_panel/VoicePanelStore";
import { GUILD_VOCAL_CHANNEL_TYPES, THREAD_CHANNEL_TYPES } from "../../records/ChannelRecord";
import ChannelStore from "../../stores/ChannelStore";
import GuildStore from "../../stores/GuildStore";
import RTCConnectionStore from "../../stores/RTCConnectionStore";
import RelationshipStore from "../../stores/RelationshipStore";
import SelectedChannelStore from "../../stores/SelectedChannelStore";
import SelectedGuildStore from "../../stores/SelectedGuildStore";
import SelfPresenceStore from "../../stores/SelfPresenceStore";
import UserGuildSettingsStore from "../../stores/UserGuildSettingsStore";
import UserRequiredActionStore from "../../stores/UserRequiredActionStore";
import UserStore from "../../stores/UserStore";
import RpcNotificationSettingsStore from "./RpcNotificationSettingsStore";
import { ActivityActionTypes, ChannelTypes, MessageFlags, MessageTypes, MessageTypesSets, StatusTypes, UserFlags } from "../../Constants";
import { ActivityPanelModes } from "../activities/panel/ActivityPanelConstants";
import { ThreadMemberFlags } from "../threads/ThreadConstants";
import { isChannelContentGated } from "../age_gate/AgeGateUtils";
import { FocusMode, ShowInAppNotifications } from "../user_settings/UserSettings";
import * as _Module1384 from "../../_bundle/Module1384";
import { isChannelCurrentlyVisible } from "../channel/ChannelVisibilityUtils";
import { computeThreadNotificationSetting } from "../threads/ThreadNotificationSettings";
import { isRawMessageMentioned } from "../messages/isMessageMentioned";
import { getRootNavigationRef } from "../main_tabs_v2/RootNavigationRef.native";
import { isChannelFocused } from "../panels/isChannelFocused.native";
import { isolate } from "../bidi/IsolateString";
import { computeChannelName } from "../channel/useChannelName";
import { intl, t } from "../../intl/index.native";
import getDisplayFilename from "../messages/getDisplayFilename";
import NicknameUtils from "../../utils/NicknameUtils";
import isSystemMessage from "../messages/isSystemMessage";
import SystemMessageUtils from "../../utils/SystemMessageUtils";
import Logger from "../debug/Logger";
import isForwardMessage, { isForwardServerMessage } from "../forwarding/isForwardMessage";
import UserUtils from "../../utils/UserUtils";
import { ComponentType } from "../../flow/Server";
import MessageParser from "../messages/MessageParser";
import { getFocusModeEnabled, useFocusModeEnabled } from "./FocusModeUtils";
import { useStateFromStores } from "../../_bundle/Module589";
let renderTitle, getInviteEmbedFormatString;
const shouldNotifyBase = function shouldNotifyBase(currentUser, user, channel, r6 = {}) {
if (user.hasFlag(UserFlags.SPAMMER)) {
return false;
}
if (channel.isManaged()) {
return false;
}
if (isChannelContentGated(channel)) {
return false;
}
const guildId = channel.getGuildId();
let r24 = guildId == null || !LurkingStore.isLurking(guildId);
if (r24) {
const ignoreSameUser = r6.ignoreSameUser;
const r1 = ignoreSameUser ? !ignoreSameUser : user.id === currentUser.id;
let r5 = !r1;
if (!r1) {
const isBlockedOrIgnored = RelationshipStore.isBlockedOrIgnored(user.id);
let r36 = !isBlockedOrIgnored;
if (!isBlockedOrIgnored) {
const ignoreStatus = r6.ignoreStatus;
const r3 = ignoreStatus ? !ignoreStatus : SelfPresenceStore.getStatus() === StatusTypes.DND;
let r4 = !r3;
if (!r3) {
const setting = FocusMode.getSetting();
let r48 = !setting;
if (!setting) {
const ignoreNoMessagesSetting = r6.ignoreNoMessagesSetting;
r48 = !(ignoreNoMessagesSetting ? !ignoreNoMessagesSetting : UserGuildSettingsStore.allowNoMessages(channel));
}
r4 = r48;
}
r36 = r4;
}
r5 = r36;
}
r24 = r5;
}
return r24;
};
renderTitle = function renderTitle(name, channel, a2) {
return `${isolate(name)} (${isolate(computeChannelName(channel, UserStore, RelationshipStore, true))}${a2 != null ? `, ${isolate(computeChannelName(a2, UserStore, RelationshipStore))}` : ""})`;
};
getInviteEmbedFormatString = function getInviteEmbedFormatString({ type }, a1, a2, a3) {
if (ChannelTypes.GUILD_ANNOUNCEMENT !== type && ChannelTypes.GUILD_TEXT !== type) {
if (ChannelTypes.GROUP_DM === type) {
return a2;
}
ChannelTypes.DM;
return a3;
}
return a1;
};
export { shouldNotifyBase };
export function shouldNotify(a0, a1, r5 = true, ignoreStatus = false) {
if (a0.flags != null && _Module1384.hasFlag(a0.flags, MessageFlags.SUPPRESS_NOTIFICATIONS)) {
return false;
}
const channel = ChannelStore.getChannel(a1);
const r11 = a0.type === MessageTypes.THREAD_STARTER_MESSAGE ? ChannelStore.getChannel(channel?.parent_id) : channel;
const currentUser = UserStore.getCurrentUser();
const user = UserStore.getUser(a0.author?.id);
if (r11 != null && currentUser != null && user != null) {
if (r11.type === ChannelTypes.GROUP_DM && a0.type === MessageTypes.RECIPIENT_REMOVE) {
return false;
}
if (RpcNotificationSettingsStore.areSlayerNotificationsSuppressed() && (r11.type === ChannelTypes.DM || r11.linkedLobby != null)) {
return false;
}
if (shouldNotifyBase(currentUser, user, r11, {
ignoreStatus,
ignoreSameUser: MessageTypesSets.SELF_MENTIONABLE_SYSTEM.has(a0.type)
})) {
if (MessageRequestStore.isMessageRequest(a1)) {
return false;
}
if (!r5 && isChannelCurrentlyVisible(r11.id)) {
return false;
}
if (RelationshipStore.isBlockedOrIgnoredForMessage(a0)) {
return false;
}
if (a0.activity_instance !== void 0 && a0.interaction != null && a0.interaction.user.id === currentUser.id) {
return false;
}
if (a0.application_id != null) {
const currentEmbeddedActivity = EmbeddedActivitiesStore.getCurrentEmbeddedActivity();
if (currentEmbeddedActivity?.applicationId === a0.application_id && currentEmbeddedActivity.location.channel_id === a1) {
return false;
}
}
if (THREAD_CHANNEL_TYPES.has(r11.type)) {
if (JoinedThreadsStore.isMuted(r11.id)) {
return false;
}
const r133 = computeThreadNotificationSetting(r11);
return r133 !== ThreadMemberFlags.NO_MESSAGES && (r133 === ThreadMemberFlags.ALL_MESSAGES || isRawMessageMentioned({
rawMessage: a0,
userId: currentUser.id,
suppressEveryone: false,
suppressRoles: false
}));
}
const r98 = GUILD_VOCAL_CHANNEL_TYPES.has(r11.type);
const r99 = r98 ? RTCConnectionStore.getChannelId() === r11.id : !r98;
if (UserGuildSettingsStore.allowAllMessages(r11) && r99) {
return true;
}
return isRawMessageMentioned({
rawMessage: a0,
userId: currentUser.id,
suppressEveryone: UserGuildSettingsStore.isSuppressEveryoneEnabled(r11.getGuildId()),
suppressRoles: UserGuildSettingsStore.isSuppressRolesEnabled(r11.getGuildId())
});
}
return false;
}
return false;
}
export function shouldNotifyForSelectedChannel(a0, a1) {
if (SelectedChannelStore.getChannelId(SelectedGuildStore.getGuildId()) !== a1) {
return false;
}
const channel = ChannelStore.getChannel(a1);
const r24 = a0.type === MessageTypes.THREAD_STARTER_MESSAGE ? ChannelStore.getChannel(channel?.parent_id) : channel;
const currentUser = UserStore.getCurrentUser();
const user = UserStore.getUser(a0.author?.id);
let r35 = r24 != null && currentUser != null && user != null;
if (r35) {
const isManaged = r24.isManaged();
let r38 = !isManaged;
if (!isManaged) {
const hasFlag = user.hasFlag(UserFlags.SPAMMER);
let r6 = !hasFlag;
if (!hasFlag) {
const isBlockedOrIgnoredForMessage = RelationshipStore.isBlockedOrIgnoredForMessage(a0);
let r5 = !isBlockedOrIgnoredForMessage;
if (!isBlockedOrIgnoredForMessage) {
let r4 = user.id !== currentUser.id;
if (r4) {
let r3 = SelfPresenceStore.getStatus() !== StatusTypes.DND;
if (r3) {
const setting = FocusMode.getSetting();
r3 = setting ? !setting : !UserGuildSettingsStore.allowNoMessages(r24);
}
r4 = r3;
}
r5 = r4;
}
r6 = r5;
}
r38 = r6;
}
r35 = r38;
}
return r35;
}
export function shouldNotifyForForumThreadCreation(a0, a1, r10 = true, ignoreStatus = false) {
const currentUser = UserStore.getCurrentUser();
const user = UserStore.getUser(a0.ownerId);
let r19 = a1 != null && currentUser != null && user != null;
if (r19) {
let r24 = !!shouldNotifyBase(currentUser, user, a1, {
ignoreStatus,
ignoreNoMessagesSetting: true
});
if (r24) {
const isGuildOrCategoryOrChannelMuted = UserGuildSettingsStore.isGuildOrCategoryOrChannelMuted(a1.guild_id, a1.id);
let r30 = !isGuildOrCategoryOrChannelMuted;
if (!isGuildOrCategoryOrChannelMuted) {
const r31 = r10 ? !r10 : isChannelCurrentlyVisible(a1.id);
r30 = r31 ? !r31 : UserGuildSettingsStore.getNewForumThreadsCreated(a1);
}
r24 = r30;
}
r19 = r24;
}
return r19;
}
export function shouldNotifyForReaction({ message, channel, reactor, includeSelectedChannel }) {
const currentUser = UserStore.getCurrentUser();
const user = UserStore.getUser(message.author?.id);
return currentUser != null && user != null && (!!shouldNotifyBase(currentUser, user, channel, {
ignoreSameUser: true
}) && ((reactor == null || !RelationshipStore.isBlockedOrIgnored(reactor.id)) && !(includeSelectedChannel ? !includeSelectedChannel : isChannelCurrentlyVisible(channel.id))));
}
export function shouldIncludeSelectedChannel() {
let r1;
L8: {
const isVoicePanelFullscreen = VoicePanelStore.getState().isVoicePanelFullscreen();
r1 = true;
if (!isVoicePanelFullscreen) {
if (EmbeddedActivitiesStore.getConnectedActivityLocation() != null) {
const activityPanelMode = EmbeddedActivitiesStore.getActivityPanelMode();
const PANEL = ActivityPanelModes.PANEL;
r1 = true;
if (activityPanelMode === PANEL) {
break L8;
}
}
const rootNavigationRef = getRootNavigationRef();
r1 = rootNavigationRef == null || !rootNavigationRef.isReady() || !isChannelFocused();
}
}
return r1;
}
export { renderTitle };
export function makeTextChatNotification(a0, a1, a2) {
let r35, body, emoji2, name, title;
L20: {
name = NicknameUtils.getName(a0.getGuildId(), a0.id, a2);
const type = a0.type;
if (ChannelTypes.GUILD_ANNOUNCEMENT !== type && (ChannelTypes.GUILD_TEXT !== type && (ChannelTypes.GUILD_VOICE !== type && (ChannelTypes.ANNOUNCEMENT_THREAD !== type && (ChannelTypes.PUBLIC_THREAD !== type && ChannelTypes.PRIVATE_THREAD !== type))))) {
const GROUP_DM = ChannelTypes.GROUP_DM;
title = name;
if (GROUP_DM !== type) {
break L20;
}
const r48 = a0.isManaged() && a2.bot && name === computeChannelName(a0, UserStore, RelationshipStore);
title = name;
if (r48) {
break L20;
}
title = renderTitle(name, a0);
} else {
const channel = ChannelStore.getChannel(a0.parent_id);
title = a1.type === MessageTypes.THREAD_STARTER_MESSAGE && channel != null ? renderTitle(name, channel, ChannelStore.getChannel(channel.parent_id)) : isSystemMessage(a1) ? GuildStore.getGuild(a0.getGuildId()) != null ? renderTitle(name, a0, channel) : name : renderTitle(name, a0, channel);
}
}
let content2 = a1.content;
if (isSystemMessage(a1)) {
content2 = SystemMessageUtils.stringify(a1, a0);
if (content2 == null) {
new Logger("NotificationTextUtils").warn("SystemMessageUtils.stringify(...) could not convert", {
message: a1
});
throw new Error("failed to stringify system message");
}
}
const r15 = "sticker_items" in a1 ? a1.sticker_items : "stickerItems" in a1 ? a1.stickerItems : a1.stickers;
const r93 = "message_reference" in a1 ? isForwardServerMessage(a1) : isForwardMessage(a1);
L74: {
const r98 = [];
if (r93) {
body = intl.string(t["9ddYKt"]);
emoji2 = r98;
} else {
if (a1.activity != null && a1.application != null) {
body = a1.activity.type === ActivityActionTypes.JOIN ? intl.formatToPlainString(getInviteEmbedFormatString(a0, t.E8CgCh, t.c6KHWJ, t.Fy7rJN), {
user: name,
game: a1.application.name
}) : a1.activity.type === ActivityActionTypes.JOIN_REQUEST ? intl.formatToPlainString(getInviteEmbedFormatString(a0, t["/TD0la"], t["/TD0la"], t["/TD0la"]), {
user: name,
game: a1.application.name
}) : "";
emoji2 = r98;
break L74;
}
if (a1.activity != null && a1.activity.type === ActivityActionTypes.LISTEN) {
body = intl.formatToPlainString(getInviteEmbedFormatString(a0, t.SaDdmN, t.qsODhp, t.WeiMTW), {
user: name
});
emoji2 = r98;
break L74;
}
if (r15 != null && r15.length > 0) {
body = intl.formatToPlainString(t.zY4v1B, {
stickerName: r15[0].name
});
emoji2 = r98;
break L74;
}
if (a1.type === MessageTypes.PREMIUM_REFERRAL) {
body = intl.formatToPlainString(t.lieTqU, {
username: UserUtils.getName(a2)
});
emoji2 = r98;
} else if (a1.poll != null) {
body = intl.formatToPlainString(t.ImizdM, {
question: a1.poll.question.text
});
emoji2 = r98;
} else if (a1.type === MessageTypes.POLL_RESULT) {
const embeds = a1.embeds;
const r166 = embeds == null;
let r167 = void 0;
if (!r166) {
const r168 = embeds[0];
const r169 = r168 == null;
r167 = void 0;
if (!r169) {
const fields = r168.fields;
r167 = fields == null ? void 0 : fields.find((field) => ("name" in field ? field.name : field.rawName) === "poll_question_text");
}
}
body = intl.formatToPlainString(t["9WrecI"], {
question: r167 != null ? "value" in r167 ? r167.value : r167.rawValue : ""
});
emoji2 = r98;
} else {
if (a1.components != null && a1.components.length > 0 && a1.components[0].type === ComponentType.CHECKPOINT_CARD) {
body = intl.string(t.HWnMTQ);
emoji2 = r98;
break L74;
}
const r130 = MessageParser.unparseWithMeta(content2, a0.id, true);
const { content, emoji } = r130;
const length = content2.length;
emoji2 = emoji;
body = content;
if (length !== 0) {
const type2 = a0.type;
const DM = ChannelTypes.DM;
emoji2 = emoji;
body = content;
if (type2 === DM) {
const bot = a2.bot;
emoji2 = emoji;
body = content;
if (!bot) {
const r140 = content2.startsWith("> -# *");
emoji2 = emoji;
body = content;
if (r140) {
const r147 = content.substring(0, 1) + content.substring(4);
let r149 = emoji[Symbol.iterator]();
const next = r149.next;
while (true) {
const r21 = r149 === void 0 ? void 0 : (r35 = next.call(r149)).done ? r149 = void 0 : r35.value;
const r153 = r149;
emoji2 = emoji;
body = r147;
if (r153 === void 0) {
break;
}
try {
r21.position = r21.position - 2;
} catch (r156) {
if (r149 !== void 0 && typeof r149.return === "function") {
try {
r149.return();
} catch {}
}
throw r156;
}
}
}
}
}
}
}
}
}
if (body.length === 0) {
body = (function getContentlessNotificationBody(a0) {
if (a0.embeds !== void 0 && a0.embeds.length > 0) {
const r18 = a0.embeds[0];
const r9 = "description" in r18 ? r18.description : r18.rawDescription;
const r8 = "title" in r18 ? r18.title : r18.rawTitle;
if (r9 != null) {
return r8 != null ? `${r8} ${r9}` : r9;
}
if (r8 != null) {
return r8;
}
if (r18.fields != null && r18.fields.length > 0) {
const r60 = r18.fields[0];
return `${"name" in r60 ? r60.name : r60.rawName} ${"value" in r60 ? r60.value : r60.rawValue}`;
}
}
let flags = a0.flags;
if (flags == null) {
flags = 0;
}
if (_Module1384.hasFlag(flags, MessageFlags.IS_VOICE_MESSAGE)) {
return intl.string(t.slFYgi);
}
if (a0.attachments !== void 0 && a0.attachments.length > 0) {
return intl.formatToPlainString(t["51OkwL"], {
filename: getDisplayFilename(a0.attachments[0])
});
}
return "";
})(a1);
}
return {
icon: a2.getAvatarURL(a0.guild_id, 128),
title,
body,
emoji: emoji2
};
}
export function allowInAppNotifications() {
if (UserRequiredActionStore.hasAction()) {
return false;
}
let r11 = ShowInAppNotifications.getSetting();
const focusModeEnabled = getFocusModeEnabled();
if (r11) {
r11 = !focusModeEnabled;
}
return r11;
}
export function useAllowInAppNotifications() {
const setting = ShowInAppNotifications.useSetting();
const focusModeEnabled = useFocusModeEnabled();
const stateFromStores = useStateFromStores([UserRequiredActionStore], () => UserRequiredActionStore.hasAction());
return (stateFromStores ? !stateFromStores : setting) && !focusModeEnabled;
}
@@ -0,0 +1,81 @@
// Metro module 10310 (f10311).
import UserGuildSettingsStore from "../../stores/UserGuildSettingsStore";
import { UserNotificationSettings } from "../../Constants";
import { ChannelNotificationSettingsFlags, MuteUntilSeconds } from "../user_settings/UserSettingsConstants";
import { intl, t } from "../../intl/index.native";
import SnowflakeUtils from "../../utils/SnowflakeUtils";
import { hasFlag } from "../../_bundle/Module1384";
import { computeIsMuted } from "../../lib/MuteTimers";
import { useStateFromStores } from "../../_bundle/Module589";
let c6890_8 = {
ignoreMute: false,
ignoreUnreadSetting: true,
ignoreNotificationSetting: false
};
export function getMuteTimeOptions() {
return [{
id: "15-minutes",
label: intl.string(t["8ot6gv"]),
value: MuteUntilSeconds.MINUTES_15
}, {
id: "1-hour",
label: intl.string(t.UMWBZr),
value: MuteUntilSeconds.HOURS_1
}, {
id: "3-hours",
label: intl.string(t.QmYWtu),
value: MuteUntilSeconds.HOURS_3
}, {
id: "8-hours",
label: intl.string(t.EpAXPC),
value: MuteUntilSeconds.HOURS_8
}, {
id: "24-hours",
label: intl.string(t["755t4q"]),
value: MuteUntilSeconds.HOURS_24
}, {
id: "forever",
label: intl.string(t.r3LawO),
value: MuteUntilSeconds.ALWAYS
}];
}
export function filterOverrides(a0) {
let r3 = arguments[1];
if (r3 === void 0) {
r3 = c6890_8;
}
let c17859_1 = r3;
return SnowflakeUtils.keys(a0).filter((item) => {
const message_notifications = a0[item].message_notifications;
const NULL = UserNotificationSettings.NULL;
let flags = a0[item].flags;
if (flags == null) {
flags = 0;
}
let r21 = hasFlag(flags, ChannelNotificationSettingsFlags.UNREADS_ALL_MESSAGES);
if (!r21) {
let flags2 = a0[item].flags;
if (flags2 == null) {
flags2 = 0;
}
r21 = hasFlag(flags2, ChannelNotificationSettingsFlags.UNREADS_ONLY_MENTIONS);
}
const ignoreUnreadSetting = c17859_1.ignoreUnreadSetting;
let r30 = ignoreUnreadSetting ? !ignoreUnreadSetting : r21;
if (!r30) {
const ignoreNotificationSetting = c17859_1.ignoreNotificationSetting;
r30 = ignoreNotificationSetting ? !ignoreNotificationSetting : message_notifications !== NULL;
}
if (!r30) {
const ignoreMute = c17859_1.ignoreMute;
r30 = ignoreMute ? !ignoreMute : computeIsMuted(a0[item]);
}
return r30;
});
}
export function useShouldUseNewNotificationSystem() {
return useStateFromStores([UserGuildSettingsStore], () => UserGuildSettingsStore.useNewNotifications);
}
export function shouldShowUseNewNotificationSystem() {
return UserGuildSettingsStore.useNewNotifications;
}
@@ -0,0 +1,31 @@
// Metro module 10250 (f10251).
import AuthenticationStore from "../../stores/AuthenticationStore";
import Module589 from "../../_bundle/Module589";
import Dispatcher from "../../Dispatcher";
let c6839_1 = {};
class RpcNotificationSettingsStore extends Module589.Store {
static displayName = "RpcNotificationSettingsStore";
initialize() {
this.waitFor(AuthenticationStore);
}
areSlayerNotificationsSuppressed() {
for (const key in c6839_1) {
if (c6839_1[key] === AuthenticationStore.getId()) {
return true;
}
}
return false;
}
}
const rpcNotificationSettingsStore = new RpcNotificationSettingsStore(Dispatcher, {
RPC_APP_DISCONNECTED: function handleRpcAppDisconnected(a0) {
delete c6839_1[a0.socketId];
},
SET_RPC_NOTIFICATION_SETTINGS: function handleSetRpcNotificationSettings(a0) {
delete c6839_1[a0.socketId];
if (a0.suppressNotifications) {
c6839_1[a0.socketId] = a0.targetUserId;
}
}
});
export default rpcNotificationSettingsStore;
@@ -0,0 +1,12 @@
// Metro module 14465 (f14466).
import { NotificationSettingsUpdateType } from "../NotificationConstants";
import { AnalyticEvents } from "../../../Constants";
import { EnableFriendGamingActivityNotifications } from "../../user_settings/UserSettings";
import AnalyticsUtils from "../../../utils/AnalyticsUtils";
export function onFriendGamingActivityNotificationSettingsChanged(a0) {
EnableFriendGamingActivityNotifications.updateSetting(a0);
AnalyticsUtils.track(AnalyticEvents.NOTIFICATION_SETTINGS_UPDATED, {
update_type: NotificationSettingsUpdateType.ACCOUNT,
friend_gaming_activity_notifications: a0
});
}
@@ -0,0 +1,28 @@
// Metro module 14462 (f14463).
import { createApexExperiment } from "../../experiments/apex/index";
const apexExperiment = createApexExperiment({
kind: "user",
name: "2026-03-friend-is-online-v3",
defaultConfig: {
showSettingsToggle: false
},
variations: {
1: {
showSettingsToggle: true
},
2: {
showSettingsToggle: true
}
}
});
export default apexExperiment;
export function useFriendOnlineNotificationExperiment(a0) {
return apexExperiment.useConfig({
location: a0
});
}
export function isEligibleForFriendOnlineNotifications(a0) {
return apexExperiment.getConfig({
location: a0
}).showSettingsToggle;
}
@@ -0,0 +1,19 @@
// Metro module 14463 (f14464).
import { NotificationSettingsUpdateType } from "../NotificationConstants";
import { AnalyticEvents } from "../../../Constants";
import { EnableFriendOnlineNotifications, NotifyFriendsOnComeOnline } from "../../user_settings/UserSettings";
import AnalyticsUtils from "../../../utils/AnalyticsUtils";
export function onFriendOnlineNotificationSettingsChanged(a0) {
EnableFriendOnlineNotifications.updateSetting(a0);
AnalyticsUtils.track(AnalyticEvents.NOTIFICATION_SETTINGS_UPDATED, {
update_type: NotificationSettingsUpdateType.ACCOUNT,
friend_online_notifications: a0
});
}
export function onNotifyFriendsOnComeOnlineSettingsChanged(a0) {
NotifyFriendsOnComeOnline.updateSetting(a0);
AnalyticsUtils.track(AnalyticEvents.NOTIFICATION_SETTINGS_UPDATED, {
update_type: NotificationSettingsUpdateType.ACCOUNT,
notify_friends_on_come_online: a0
});
}
@@ -0,0 +1,108 @@
// Metro module 16647 (f16648).
import SelfPresenceStore from "../../../stores/SelfPresenceStore";
import FriendOnlineTimerStore from "./FriendOnlineTimerStore";
import { Endpoints } from "../../../Constants";
import { StatusTypes } from "../../../_bundle/Module505";
import Durations from "../../../utils/Durations";
import { HTTP, HTTPResponseError } from "../../../_bundle/sendRequest";
import SentryUtils_native from "../../../utils/SentryUtils.native";
import Dispatcher from "../../../Dispatcher";
import AutomaticLifecycleManager from "../../../lib/AutomaticLifecycleManager";
import { NotifyFriendsOnComeOnline } from "../../user_settings/UserSettings";
let c11986_8;
let _reportSessionMeaningfullyOnline = function _reportSessionMeaningfullyOnline() {
const r8 = async () => {
let c28482_2;
let c28482_3 = 0;
let c31089_0;
L10: {
try {
c28482_3 = 1;
await HTTP.post({
url: Endpoints.USER_MEANINGFULLY_ONLINE,
rejectWithError: true
});
c28482_3 = 0;
Dispatcher.dispatch({
type: "FRIEND_ONLINE_TIMER_REPORTED",
timestampMs: Date.now()
});
} catch ($e) {
const r26 = $e;
let r7 = r26;
c28482_2 = r26;
if (c28482_3 !== 0) {
while (true) {
try {
const r71 = c28482_2;
c28482_3 = 0;
c31089_0 = r71;
if (c31089_0 instanceof HTTPResponseError && c31089_0.status === 429) {
Dispatcher.dispatch({
type: "FRIEND_ONLINE_TIMER_REPORTED",
timestampMs: Date.now()
});
break L10;
}
SentryUtils_native.captureException(c31089_0, {
tags: {
app_context: "session_timer"
}
});
} catch (r67) {
r7 = r67;
c28482_2 = r67;
if (c28482_3 === 0) {
break;
}
continue;
}
return void 0;
}
}
throw r7;
}
}
};
_reportSessionMeaningfullyOnline = r8;
return r8.apply(this, arguments);
};
c11986_8 = 5 * Durations.Millis.MINUTE;
class FriendOnlineTimerManager extends AutomaticLifecycleManager {
constructor() {
super(...arguments);
const _this = this;
this.timerId = null;
this.actions = {
POST_CONNECTION_OPEN: () => _this.start(),
CONNECTION_RESUMED: () => _this.start(),
CONNECTION_CLOSED: () => _this.clear(),
CONNECTION_INTERRUPTED: () => _this.clear(),
SELF_PRESENCE_STORE_UPDATE: () => _this.start()
};
this.start = () => {
if (NotifyFriendsOnComeOnline.getSetting() && FriendOnlineTimerStore.isCooldownElapsed() && _this.timerId == null && [StatusTypes.ONLINE, StatusTypes.STREAMING].includes(SelfPresenceStore.getStatus())) {
_this.timerId = setTimeout(() => {
_this.timerId = null;
if ([StatusTypes.ONLINE, StatusTypes.STREAMING].includes(SelfPresenceStore.getStatus()) && FriendOnlineTimerStore.isCooldownElapsed()) {
(function reportSessionMeaningfullyOnline() {
return _reportSessionMeaningfullyOnline.apply(this, arguments);
})();
}
}, c11986_8);
}
};
this.clear = () => {
if (_this.timerId != null) {
clearTimeout(_this.timerId);
_this.timerId = null;
}
};
}
_initialize() {}
_terminate() {
this.clear();
}
}
const friendOnlineTimerManager = new FriendOnlineTimerManager();
export default friendOnlineTimerManager;
@@ -0,0 +1,32 @@
// Metro module 16648 (f16649).
import Durations from "../../../utils/Durations";
import Module589 from "../../../_bundle/Module589";
import Dispatcher from "../../../Dispatcher";
const HOUR = Durations.Millis.HOUR;
let c11987_1 = {
lastReportedAtMs: null
};
let c11987_2 = c11987_1;
class FriendOnlineTimerStore extends Module589.PersistedStore {
static displayName = "FriendOnlineTimerStore";
static persistKey = "FriendOnlineTimerStore";
initialize(r2 = c11987_1) {
if (r2 == null) {
r2 = c11987_1;
}
c11987_2 = r2;
}
isCooldownElapsed() {
return c11987_2.lastReportedAtMs == null || Date.now() - c11987_2.lastReportedAtMs >= HOUR;
}
getState() {
return c11987_2;
}
}
const friendOnlineTimerStore = new FriendOnlineTimerStore(Dispatcher, {
FRIEND_ONLINE_TIMER_REPORTED: function setLastReportedAtMs(a0) {
c11987_2.lastReportedAtMs = a0.timestampMs;
return true;
}
});
export default friendOnlineTimerStore;
@@ -0,0 +1,19 @@
// Metro module 16646 (f16647).
import { createApexExperiment } from "../../experiments/apex/index";
const apexExperiment = createApexExperiment({
name: "2025-10-clear-channel-notifications-on-app-foreground-ios",
kind: "user",
defaultConfig: {
enabled: false
},
variations: {
1: {
enabled: true
}
}
});
export function shouldClearChannelNotificationsOnAppForeground(a0) {
return apexExperiment.getConfig({
location: a0.location
}).enabled;
}
@@ -0,0 +1,11 @@
// Metro module 9519 (f9520).
const r8 = {
TOO_MANY: "TOO_MANY",
IRRELEVANT: "IRRELEVANT",
DISLIKE_CONTENT: "DISLIKE_CONTENT",
IRRELEVANT_CHANNEL: "IRRELEVANT_CHANNEL",
IRRELEVANT_USER: "IRRELEVANT_USER",
IRRELEVANT_TOPIC: "IRRELEVANT_TOPIC",
SENSITIVE_OR_OFFENSIVE_TOPIC: "SENSITIVE_OR_OFFENSIVE_TOPIC"
};
export { r8 as NotificationUserFeedbackReasons };
@@ -0,0 +1,55 @@
// Metro module 9518 (f9519).
import { NotificationUserFeedbackReasons } from "./Constants";
import { AnalyticEvents } from "../../../Constants";
import ActionSheetActionCreators from "../../action_sheet/native/ActionSheetActionCreators";
import { intl, t } from "../../../intl/index.native";
import AnalyticsUtils from "../../../utils/AnalyticsUtils";
export function openGuildHighlightNotificationForPush(a0, c17272_1, type, location2, c17272_4) {
const guild_id = a0;
ActionSheetActionCreators.openLazy(import("./GuildHighlightsNotificationsActionSheet"), "GuildHighlightsNotifications", {
guildId: a0,
feedbackSettings: {
reasons: [{
value: NotificationUserFeedbackReasons.TOO_MANY,
label: intl.string(t.pLeQp0)
}, {
value: NotificationUserFeedbackReasons.IRRELEVANT_CHANNEL,
label: intl.string(t.Lu4n25)
}, {
value: NotificationUserFeedbackReasons.IRRELEVANT_USER,
label: intl.string(t.TF6AhF)
}, {
value: NotificationUserFeedbackReasons.IRRELEVANT_TOPIC,
label: intl.string(t["s+8J8f"])
}, {
value: NotificationUserFeedbackReasons.SENSITIVE_OR_OFFENSIVE_TOPIC,
label: intl.string(t.fEUR7Y)
}],
onFeedbackShown: function onFeedbackShown() {
const FEEDBACK_FORM_VIEWED = AnalyticEvents.FEEDBACK_FORM_VIEWED;
AnalyticsUtils.track(FEEDBACK_FORM_VIEWED, {
type,
location: location2,
guild_id,
channel_id: c17272_1.channel_id,
message_id: c17272_1.id,
...c17272_4
});
},
onFeedbackCompleted: function onFeedbackCompleted({ rating, reason }) {
const FEEDBACK_FORM_SUBMITTED = AnalyticEvents.FEEDBACK_FORM_SUBMITTED;
const value = reason?.value;
AnalyticsUtils.track(FEEDBACK_FORM_SUBMITTED, {
type,
location: location2,
rating,
reason: value,
guild_id,
channel_id: c17272_1.channel_id,
message_id: c17272_1.id,
...c17272_4
});
}
}
});
}
@@ -0,0 +1,231 @@
// Metro module 9520 (f9521).
import { useRef, useState, useCallback, useEffect } from "react";
import { View } from "react-native";
import GuildStore from "../../../stores/GuildStore";
import UserGuildSettingsStore from "../../../stores/UserGuildSettingsStore";
import { HelpdeskArticles, HighlightSettings } from "../../../Constants";
import { FeedbackRating } from "../../feedback/Constants";
import { createStyles } from "../../../design/components/Styles/native/createStyles";
import Module712 from "../../../_bundle/Module712";
import GuildIcon, { GuildIconSizes } from "../../guild/native/GuildIcon";
import { Text } from "../../../design/components/Text/native/Text";
import { handleSurveyCleanup } from "../../push_feedback/PushFeedbackActions";
import { useStateFromStoresObject } from "../../../_bundle/defaultAreStatesEqual";
import { intl, t } from "../../../intl/index.native";
import { FeedbackForm } from "../../feedback/native/FeedbackForm";
import useSafeAreaInsets_native from "../../safe_area/useSafeAreaInsets.native";
import { BottomSheet } from "../../../design/components/Sheet/native/BottomSheet.native";
import { BottomSheetScrollView } from "../../../_bundle/Module5245";
import HelpdeskUtils from "../../../utils/HelpdeskUtils";
import ReanimatedRexport from "../../reanimated/ReanimatedRexport";
import { Card } from "../../../design/components/Card/native/Card.native";
import { FormSwitchRow } from "../../../design/void/Form/native/index";
import NotificationSettingsModalActionCreators from "../../../actions/NotificationSettingsModalActionCreators";
import { NotificationLabel } from "../../../utils/NotificationSettingsUtils";
import ActionSheetActionCreators from "../../action_sheet/native/ActionSheetActionCreators";
let useStyles, useStyles2;
const GuildPill = function GuildPill(props) {
const guild = props.guild;
const styles2 = useStyles2();
return <View style={styles2.guildPill}>
<GuildIcon guild={guild} size={GuildIconSizes.SMALL_32} animate />
<Text style={styles2.guildName} variant="heading-md/semibold" color="mobile-text-heading-primary">
{guild?.name}
</Text>
</View>;
};
useStyles = createStyles({
contentContainer: {
padding: 24,
alignItems: "center",
justifyContent: "center"
},
header: {
alignItems: "center",
paddingBottom: 24
},
headerTitle: {
marginBottom: 4
},
centerText: {
textAlign: "center"
},
feedback: {
marginTop: 16,
alignItems: "stretch",
alignSelf: "stretch",
paddingBottom: 16
},
thanks: {
height: 40,
textAlign: "center",
textAlignVertical: "center"
},
settings: {
flex: 1,
backgroundColor: Module712.colors.BACKGROUND_SURFACE_HIGH,
marginVertical: 8,
padding: 0
}
});
useStyles2 = createStyles({
guildPill: {
flexDirection: "row",
padding: 8,
marginBottom: 16,
backgroundColor: Module712.colors.GUILD_NOTIFICATIONS_BOTTOM_SHEET_PILL_BACKGROUND,
alignItems: "center",
justifyContent: "center",
borderRadius: Module712.radii.round,
...Module712.shadows.SHADOW_LOW
},
guildName: {
paddingHorizontal: 8
}
});
export default function SummaryFeedbackActionSheet(props) {
let r105;
const { guildId, feedbackSettings } = props;
const styles = useStyles();
const ref = useRef(null);
let [state3, setState] = useState(void 0);
const state = state3;
const [state2, setState2] = useState(false);
const [state4, setState3] = useState(false);
const callback = useCallback((a0) => {
let r3 = state2;
if (!state2) {
r3 = a0?.rating == null;
}
if (!r3) {
if (feedbackSettings != null) {
const onFeedbackCompleted = feedbackSettings.onFeedbackCompleted;
if (onFeedbackCompleted != null) {
onFeedbackCompleted.call(feedbackSettings, a0);
}
}
handleSurveyCleanup();
setState2(true);
}
}, [state2, feedbackSettings]);
useEffect(() => () => {
callback(state);
}, [state, callback]);
const callback2 = useCallback((a0) => {
setState(a0);
const r5 = a0 == null ? {} : a0;
const { rating, reason } = r5;
if (rating === FeedbackRating.GOOD || reason != null) {
callback(a0);
setState3(false);
} else {
setState3(true);
}
handleSurveyCleanup();
}, [callback]);
const callback3 = useCallback(() => {
const current = ref.current;
if (current != null) {
current.expandActionSheet();
}
setState3(false);
}, []);
const stateFromStoresObject = useStateFromStoresObject([UserGuildSettingsStore, GuildStore], () => ({
guild: GuildStore.getGuild(guildId),
muted: UserGuildSettingsStore.isMuted(guildId),
notifyHighlights: UserGuildSettingsStore.getNotifyHighlights(guildId)
}), [guildId]);
const guild = stateFromStoresObject.guild;
let muted = stateFromStoresObject.muted;
const notifyHighlights = stateFromStoresObject.notifyHighlights;
const r6 = feedbackSettings?.reasons != null;
let r24 = null;
if (r6) {
const r74 = state == null ? {} : state;
const { rating, reason } = r74;
if (rating === FeedbackRating.GOOD || reason != null) {
r105 = <Text style={[styles.centerText, styles.thanks]} variant="heading-md/semibold" color="text-brand">
{intl.string(t.kZbFIO)}
</Text>;
} else {
const props2 = {
ratingsBodyLabel: intl.string(t.Yzl7Or),
reasonsHeaderLabel: intl.string(t.g1q5fr),
reasons: null,
trackOpen: null,
onFeedbackChanged: null
};
let reasons = feedbackSettings?.reasons;
if (reasons == null) {
reasons = [];
}
props2.reasons = reasons;
props2.trackOpen = feedbackSettings != null ? feedbackSettings.onFeedbackShown : () => {};
props2.onFeedbackChanged = callback2;
r105 = <FeedbackForm {...props2} />;
}
r24 = r105;
}
const startHeight = 316 + (r6 ? state2 ? 64 : 148 : 0) + useSafeAreaInsets_native().bottom;
let r131 = !r6;
if (r6) {
const r132 = state == null ? {} : state;
const { rating: rating2, reason: reason2 } = r132;
r131 = rating2 === FeedbackRating.GOOD || reason2 != null;
}
if (!r131) {
r131 = state?.rating == null;
}
const contentHeight = r131 ? startHeight : void 0;
const onLayout = state4 ? callback3 : void 0;
const r192 = [<View style={styles.header}>
<GuildPill guild={guild} />
<Text style={styles.headerTitle} variant="heading-lg/semibold" color="mobile-text-heading-primary">
{intl.string(t.o8Bypv)}
</Text>
<Text style={styles.centerText} variant="text-md/medium" color="text-default">
{intl.format(t.enfuur, {
helpUrl: HelpdeskUtils.getArticleURL(HelpdeskArticles.HIGHLIGHTS_NOTIFICATIONS)
})}
</Text>
</View>, r24 != null && <ReanimatedRexport.View style={styles.feedback}>{r24}</ReanimatedRexport.View>, , ,];
if (state == null) {
state3 = {};
}
const r202 = state3.rating === FeedbackRating.GOOD;
let r203 = !r202;
if (!r202) {
const props3 = {
disabled: muted,
label: intl.string(t.MVi7LQ),
value: null,
onValueChange: null
};
if (!muted) {
muted = notifyHighlights === HighlightSettings.DISABLED;
}
props3.value = muted;
props3.onValueChange = (a0) => {
NotificationSettingsModalActionCreators.updateGuildNotificationSettings(guildId, {
notify_highlights: a0 ? HighlightSettings.DISABLED : HighlightSettings.ENABLED
}, NotificationLabel.highlights(!a0));
};
r203 = <Card style={styles.settings} shadow="low" border="subtle">
<FormSwitchRow {...props3} />
</Card>;
}
r192[2] = r203;
r192[3] = <Text style={styles.centerText} variant="text-sm/medium" color="text-default">
{intl.format(t.F9rfLX, {
notifSettingsHook: () => {
ActionSheetActionCreators.hideActionSheet();
NotificationSettingsModalActionCreators.open(guildId);
}
})}
</Text>;
return <BottomSheet scrollable ref={ref} contentHeight={contentHeight} startHeight={startHeight}>
<BottomSheetScrollView contentContainerStyle={styles.contentContainer} onLayout={onLayout}>
<View>{r192}</View>
</BottomSheetScrollView>
</BottomSheet>;
};
@@ -0,0 +1,26 @@
// Metro module 10270 (f10271).
import { Storage } from "../../../_bundle/Module595";
import { createWithEqualityFn } from "../../../_bundle/identity_700";
import { shallow } from "../../../_bundle/Module3802";
let c6855_2 = "InAppMessageSoundsEnabled";
const withEqualityFn = createWithEqualityFn(() => {
let isEnabled = Storage.get(c6855_2);
if (isEnabled == null) {
isEnabled = true;
}
return {
isEnabled
};
});
export function isInAppMessageSoundsEnabled() {
return withEqualityFn.getState().isEnabled;
}
export function setInAppMessageSoundsEnabled(a0) {
Storage.set(c6855_2, a0);
withEqualityFn.setState({
isEnabled: a0
});
}
export function useInAppMessageSoundsEnabled() {
return withEqualityFn((a0) => a0.isEnabled, shallow);
}
@@ -0,0 +1,318 @@
// Metro module 16645 (f16646).
import { NativeModules } from "react-native";
import GuildReadStateStore from "../../../stores/GuildReadStateStore";
import ReadStateStore from "../../../stores/ReadStateStore";
import { AnalyticEvents } from "../../../Constants";
import Logger from "../../debug/Logger";
import { shouldClearChannelNotificationsOnAppForeground } from "./ClearChannelNotificationsOnAppForegroundExperiment";
import PushNotification from "../../../lib/pushnotification/PushNotification";
import SnowflakeUtils from "../../../utils/SnowflakeUtils";
import AutomaticLifecycleManager from "../../../lib/AutomaticLifecycleManager";
import { isIOS } from "../../../utils/PlatformUtils";
import { removeFile, moveFile, readFile } from "../../../utils/FileManagerUtils.android";
import AnalyticsUtils from "../../../utils/AnalyticsUtils";
function $mk117431($env) {
return function clearStaleNotifications() {
const r2 = $env;
if (shouldClearChannelNotificationsOnAppForeground({
location: "clearStaleNotifications"
})) {
const r16 = c11984_9.filter($mk118578(r2)).map((item) => item.identifier);
if (r16.length > 0) {
PushNotification.removeDeliveredNotifications(r16);
(0, getDeliveredNotifications)();
}
}
};
}
function $mk118578($env) {
return (a0) => {
if (a0.userInfo != null && typeof a0.userInfo === "object") {
if (typeof a0.userInfo.channel_id !== "string") {
return false;
}
if (typeof a0.userInfo.notif_instance_id !== "string") {
return false;
}
let notif_instance_id = a0.userInfo.notif_instance_id;
if (a0.userInfo.type === "MESSAGE_CREATE") {
if (typeof a0.userInfo.message_id !== "string") {
return false;
}
notif_instance_id = a0.userInfo.message_id;
} else {
if (a0.userInfo.type !== "GENERIC_PUSH_NOTIFICATION_SENT") {
return false;
}
if (a0.userInfo.notification_type !== "REACTIONS_PUSH_NOTIFICATION") {
return false;
}
}
if (notif_instance_id != null && typeof notif_instance_id === "string") {
const r30 = ReadStateStore.ackMessageId(a0.userInfo.channel_id);
return r30 != null && !(SnowflakeUtils.compare(r30, notif_instance_id) <= 0);
}
return false;
}
return false;
};
}
function $mk118583($env) {
return (a0) => {
const r6 = JSON.parse(a0);
$env[4].set(r6._local_uuid, r6.app_state);
};
}
let updateAndClearStaleNotifications2, c11984_8, c11984_9, c11984_14;
let env11984 = {};
const getDeliveredNotifications = async function getDeliveredNotifications() {
let c28480_0;
L13: {
c28480_0 = env11984;
if (shouldClearChannelNotificationsOnAppForeground({
location: "getDeliveredNotifications"
})) {
env11984[9] = await PushNotification.getDeliveredNotifications();
break L13;
}
return void 0;
}
};
updateAndClearStaleNotifications2 = async function updateAndClearStaleNotifications() {
let c28481_0 = env11984;
await getDeliveredNotifications();
$mk117431(c28481_0)();
};
c11984_8 = new Logger("NativeNotificationsManager");
c11984_9 = [];
class NativeNotificationsManager extends AutomaticLifecycleManager {
handleAck = ({ channelId }) => {
if (isIOS()) {
PushNotification.setApplicationIconBadgeNumber(GuildReadStateStore.getTotalMentionCount());
}
if (channelId != null) {
const DCDNotificationManager = NativeModules.DCDNotificationManager;
if (DCDNotificationManager != null) {
DCDNotificationManager.clearNotificationsForChannel(channelId);
}
}
};
constructor() {
super(...arguments);
const _this = this;
this.handlePostConnectionOpen = async () => {
let r45;
let c31088_0, c31088_1, app_state, c31088_3, c31088_4, c31088_5;
let c31088_6 = 0;
const r18 = void 0;
const r17 = env11984;
L39: {
L34: {
try {
let env31835;
c31088_4 = r18;
const r28 = env31835 = {
$parent: r17
};
c31088_3 = r28;
env31835[0] = void 0;
env31835[1] = void 0;
env31835[2] = void 0;
env31835[3] = void 0;
env31835[4] = void 0;
env31835[5] = void 0;
env31835[6] = void 0;
env31835[7] = void 0;
env31835[8] = void 0;
if (isIOS()) {
updateAndClearStaleNotifications2();
} else {
_this.handleSetCallNotificationExperiment();
}
c31088_6 = 1;
const moveAndReadData = function moveAndReadData() {
return env31835[10].apply(this, arguments);
};
env31835[9] = moveAndReadData;
env31835[10] = function _moveAndReadData() {
const r9 = async (c32149_0, c32149_1) => {
let r104;
let c32180_0, c32180_1;
L15: {
c32180_0 = c32149_0;
c32180_1 = c32149_1;
await removeFile(env31835[0], c32149_1);
const r19 = await moveFile(env31835[0], c32180_0, c32180_1);
const r76 = null;
if (r19) {
r104 = await readFile(env31835[0], c32180_1, "utf8");
break L15;
}
return r76;
}
return r104;
};
env31835[10] = r9;
return r9.apply(this, arguments);
};
env31835[11] = function normalizeTimestampToMs(a0) {
if (a0 != null) {
return typeof a0 === "number" ? Math.round(1000 * a0) : typeof a0 === "string" ? parseInt(a0, 10) : void 0;
}
};
env31835[0] = isIOS() ? "shared" : "cache";
env31835[1] = "processing_notifications";
env31835[2] = "processing_notification_states";
env31835[3] = await moveAndReadData("notifications_to_track", "processing_notifications");
if (env31835[3] == null) {
c31088_6 = 0;
break L39;
}
env31835[4] = new Map();
if (isIOS()) {
const r309 = await (0, env31835[9])("notification_states_to_track", env31835[2]);
const r334 = c31088_3;
env31835[5] = r309;
if (env31835[5] !== null) {
env31835[5].trim().split("\n").forEach($mk118583(r334));
}
}
env31835[6] = env31835[3].trim().split("\n");
const r136 = env31835[6];
c31088_1 = r136;
const r138 = r136[Symbol.iterator]();
c31088_1 = r138.next;
c31088_0 = r138;
while (true) {
const r140 = c31088_1;
let r141 = c31088_0;
const r142 = r141 === void 0 ? void 0 : (r45 = r140.call(r141)).done ? r141 = void 0 : r45.value;
c31088_0 = r141;
if (r141 === void 0) {
await removeFile(env31835[0], env31835[1]);
if (isIOS()) {
await removeFile(env31835[0], env31835[2]);
}
c31088_6 = 0;
break;
}
c31088_6 = 2;
env31835[7] = r142;
env31835[8] = JSON.parse(env31835[7]);
if (isIOS() && env31835[8]._local_uuid !== void 0) {
const r208 = env31835[8];
const r213 = env31835[4].get(env31835[8]._local_uuid);
app_state = r213;
if (r213 == null) {
app_state = "background";
}
r208.app_state = app_state;
}
const PUSH_NOTIFICATION_RECEIVED = AnalyticEvents.PUSH_NOTIFICATION_RECEIVED;
const r182 = {
notification_received_timestamp: (0, env31835[11])(env31835[8].timestamp),
push_action_type: env31835[8].push_action_type,
notif_instance_id: env31835[8].notif_instance_id,
notif_type_id: env31835[8].notif_type_id,
join_id: env31835[8].join_id,
notif_user_id: env31835[8].notif_user_id,
receiving_user_id: env31835[8].receiving_user_id,
message_id: env31835[8].message_id,
message_type: env31835[8].message_type,
guild_id: env31835[8].guild_id,
channel_id: env31835[8].channel_id,
channel_type: null,
rel_type: null,
mention_type: null,
app_state: null,
os_enabled: null
};
const channel_type = env31835[8].channel_type;
r182.channel_type = channel_type == null ? void 0 : channel_type.toString();
r182.rel_type = env31835[8].rel_type;
r182.mention_type = env31835[8].mention_type;
r182.app_state = env31835[8].app_state;
r182.os_enabled = env31835[8].os_enabled;
AnalyticsUtils.track(PUSH_NOTIFICATION_RECEIVED, r182);
c31088_6 = 1;
}
} catch ($e) {
const r57 = $e;
let r7 = r57;
c31088_5 = r57;
let r58 = c31088_6;
if (r58 !== 0) {
while (true) {
if (r58 === 1) {
try {
const r356 = c31088_5;
c31088_6 = 0;
env31835[12] = r356;
c11984_8.error("Error tracking push notifications", env31835[12]);
break L34;
} catch (r353) {
r7 = r353;
c31088_5 = r353;
r58 = c31088_6;
if (r58 === 0) {
break;
}
}
} else {
try {
const r348 = c31088_5;
c31088_6 = 1;
const r350 = c31088_0;
if (r350 !== void 0 && typeof r350.return === "function") {
try {
r350.return();
} catch {}
}
throw r348;
} catch (r347) {
r7 = r347;
c31088_5 = r347;
r58 = c31088_6;
if (r58 === 0) {
break;
}
}
}
}
}
throw r7;
}
}
return void 0;
}
};
this.handleSetCallNotificationExperiment = () => {
if (!isIOS()) {
const DCDNotificationManager = NativeModules.DCDNotificationManager;
const setShowMissedCallNotifications = DCDNotificationManager.setShowMissedCallNotifications;
if (setShowMissedCallNotifications != null) {
setShowMissedCallNotifications.call(DCDNotificationManager, true);
}
const DCDNotificationManager2 = NativeModules.DCDNotificationManager;
const setShowFullscreenCallUI = DCDNotificationManager2.setShowFullscreenCallUI;
if (setShowFullscreenCallUI != null) {
setShowFullscreenCallUI.call(DCDNotificationManager2, true);
}
}
};
this.updateAndClearStaleNotifications = () => {
updateAndClearStaleNotifications2();
};
this.actions = {
MESSAGE_ACK: this.handleAck,
CHANNEL_SELECT: this.handleAck,
POST_CONNECTION_OPEN: this.handlePostConnectionOpen,
EXPERIMENT_OVERRIDE_BUCKET: this.handleSetCallNotificationExperiment,
EXPERIMENTS_FETCH_SUCCESS: this.handleSetCallNotificationExperiment,
APP_STATE_UPDATE: this.updateAndClearStaleNotifications
};
}
}
c11984_14 = NativeNotificationsManager;
const r42 = new NativeNotificationsManager();
export default r42;
@@ -0,0 +1,21 @@
// Metro module 13512 (f13513).
import { createApexExperiment } from "../../experiments/apex/index";
const apexExperiment = createApexExperiment({
name: "2026-04-declarative-notif-settings",
kind: "user",
defaultConfig: {
enabled: false,
clearDeclarative: false
},
variations: {
1: {
enabled: true,
clearDeclarative: false
},
2: {
enabled: false,
clearDeclarative: true
}
}
});
export { apexExperiment as declarativeNotifSettingsExperiment };
@@ -0,0 +1,202 @@
// Metro module 13513 (f13514).
import { NOTIF_CATEGORIES, NOTIF_SETTINGS, NOTIF_SETTING_MAPPING } from "../NotificationSettingsConstants";
import { intl } from "../../../intl/index.native";
import Module13514 from "../../../_bundle/Module13514";
import { getAssignedNotifSettingsAndMappings } from "../NotificationSettingsUtils";
import SentryUtils_native from "../../../utils/SentryUtils.native";
let c9378_6, formatCategory, formatSetting, buildChannelsAndMapping;
const inferImportanceFromBehavior = function inferImportanceFromBehavior(behavior) {
let MIN;
L11: {
if (!("ringtone" in behavior && behavior.ringtone != null) && behavior.visibility !== "popup") {
if (behavior.visibility === "hidden") {
MIN = c9378_6.MIN;
break L11;
}
if (behavior.sound) {
MIN = c9378_6.DEFAULT;
break L11;
}
MIN = c9378_6.LOW;
} else {
MIN = c9378_6.HIGH;
}
}
return MIN;
};
formatCategory = function formatCategory(a0) {
return {
id: a0.string_id,
name: intl.string(a0.title)
};
};
formatSetting = function formatSetting(item, a1) {
let MIN;
let importance = a1;
const r3 = {
id: item.string_id,
groupId: item.category,
name: intl.string(item.title),
importance: null,
ringtone: null,
badge: null,
vibrate: null
};
if (a1 == null) {
L12: {
const behavior = item.behavior;
if (!("ringtone" in behavior && behavior.ringtone != null) && behavior.visibility !== "popup") {
if (behavior.visibility === "hidden") {
MIN = c9378_6.MIN;
break L12;
}
if (behavior.sound) {
MIN = c9378_6.DEFAULT;
break L12;
}
MIN = c9378_6.LOW;
} else {
MIN = c9378_6.HIGH;
}
}
importance = MIN;
}
r3.importance = importance;
r3.ringtone = "ringtone" in item.behavior ? item.behavior.ringtone : void 0;
r3.badge = item.behavior.badge;
r3.vibrate = item.behavior.vibrate;
return r3;
};
buildChannelsAndMapping = function buildChannelsAndMapping() {
let c20504_0;
const assignedNotifSettingsAndMappings = getAssignedNotifSettingsAndMappings();
const { settings, mappings } = assignedNotifSettingsAndMappings;
const inheritedImportances = (function computeInheritedImportances(a0) {
let r30;
const map = new Map();
const getAndroidNotifChannelStates = Module13514?.getAndroidNotifChannelStates;
if (getAndroidNotifChannelStates == null) {
return map;
}
const map2 = new Map();
let r46 = getAndroidNotifChannelStates()[Symbol.iterator]();
const next = r46.next;
while (true) {
const r49 = r46 === void 0 ? void 0 : (r30 = next.call(r46)).done ? r46 = void 0 : r30.value;
if (r46 === void 0) {
const map3 = new Map();
for (const item2 of NOTIF_SETTINGS) {
map3.set(item2.id, item2);
}
loop12: for (const r76 of a0) {
const { notifType, notifSetting } = r76;
const r81 = NOTIF_SETTING_MAPPING[notifType];
if (r81 != null) {
for (const item of r81) {
if (item === notifSetting) {
continue;
}
const r92 = map3.get(item);
if (r92 == null) {
continue;
}
const r97 = map2.get(r92.string_id);
if (r97 == null) {
continue;
}
if (r97 === inferImportanceFromBehavior(r92.behavior)) {
continue;
}
map.set(notifSetting, r97);
continue loop12;
}
}
}
return map;
} else {
try {
map2.set(r49.channelId, r49.importance);
} catch (r53) {
if (r46 !== void 0 && typeof r46.return === "function") {
try {
r46.return();
} catch {}
}
throw r53;
}
}
}
})(mappings);
const channels = [];
const map = new Map();
c20504_0 = map;
for (const item of settings) {
channels.push(formatSetting(item, inheritedImportances.get(item.id)));
map.set(item.id, item.string_id);
}
return {
mapping: mappings.flatMap((mapping) => {
const notifType = mapping.notifType;
const channel = c20504_0.get(mapping.notifSetting);
return channel == null ? [] : {
type: notifType,
channel
};
}),
channels,
inheritedImportances
};
};
c9378_6 = {
NONE: 0,
0: "NONE",
MIN: 1,
1: "MIN",
LOW: 2,
2: "LOW",
DEFAULT: 3,
3: "DEFAULT",
HIGH: 4,
4: "HIGH"
};
const r34 = {
clear: function clear() {
let r8 = Module13514;
if (r8 == null) {
r8 = {};
}
const { registerAndroidNotifGroupsAndChannels, registerAndroidNotifTypeMappings } = r8;
if (registerAndroidNotifGroupsAndChannels != null) {
registerAndroidNotifGroupsAndChannels([], []);
}
if (registerAndroidNotifTypeMappings != null) {
registerAndroidNotifTypeMappings([]);
}
},
registerDeclarativeNotificationCategories: function registerDeclarativeNotificationCategories() {
let r16 = Module13514;
if (r16 == null) {
r16 = {};
}
const { registerAndroidNotifGroupsAndChannels, registerAndroidNotifTypeMappings } = r16;
if (registerAndroidNotifGroupsAndChannels != null && registerAndroidNotifTypeMappings != null) {
const r10 = buildChannelsAndMapping();
const { channels, mapping, inheritedImportances } = r10;
SentryUtils_native.addBreadcrumb({
message: "Registering declarative notification categories",
data: {
channels: channels.map((channel) => channel.id),
inheritedImportances: Array.from(inheritedImportances.entries()).map((item) => {
const [r7, r24] = item;
return `NotifSettings#${r7} -> ${r24}`;
})
}
});
registerAndroidNotifGroupsAndChannels(NOTIF_CATEGORIES.map(formatCategory), channels);
registerAndroidNotifTypeMappings(mapping);
return true;
}
return false;
}
};
export default r34;
@@ -0,0 +1,42 @@
// Metro module 9541 (f9542).
import { NotificationUserFeedbackReasons } from "./Constants";
import { AnalyticEvents } from "../../../Constants";
import { intl, t } from "../../../intl/index.native";
import AnalyticsUtils from "../../../utils/AnalyticsUtils";
import FeedbackActionSheet from "../../feedback/native/FeedbackActionSheet";
import { handleSurveyCleanup } from "../../push_feedback/PushFeedbackActions";
import ActionSheetActionCreators from "../../action_sheet/native/ActionSheetActionCreators";
const trackOpen = function trackOpen() {
AnalyticsUtils.track(AnalyticEvents.OPEN_POPOUT, {
type: "Notification Feedback Sheet",
source: "Notification End"
});
};
export default function NotificationSurveyActionSheet(props) {
const { notificationType, location: location2, messageId } = props;
const reasons = [{
value: NotificationUserFeedbackReasons.TOO_MANY,
label: intl.string(t.pLeQp0)
}, {
value: NotificationUserFeedbackReasons.IRRELEVANT,
label: intl.string(t.tuwPcC)
}, {
value: NotificationUserFeedbackReasons.DISLIKE_CONTENT,
label: intl.string(t.glUMhg)
}];
return <FeedbackActionSheet headerLabel={intl.string(t.wGioO1)} showHeaderCloseButton hideDontShowAgainCheckbox ratingsBodyLabel={intl.string(t.Yzl7Or)} reasonsHeaderLabel={intl.string(t.g1q5fr)} reasons={reasons} trackOpen={trackOpen} trackReport={function trackReport({ rating, reason }) {
if (rating != null) {
AnalyticsUtils.track(AnalyticEvents.NOTIFICATION_REPORT_SUBMITTED, {
reason: reason != null ? reason.value : null,
rating,
notification_type: notificationType,
location: location2,
message_id: messageId
});
handleSurveyCleanup();
ActionSheetActionCreators.openLazy(import("./NotificationSurveyResponseActionSheet"), "UserFeedbackSurvey", {
header: intl.string(t.wGioO1)
});
}
}} />;
};
@@ -0,0 +1,57 @@
// Metro module 9544 (f9545).
import { Image as Image2, View } from "react-native";
import { HelpdeskArticles, Fonts } from "../../../Constants";
import { createStyles } from "../../../design/components/Styles/native/createStyles";
import TextStyles from "../../rebrand/native/TextStyles";
import Module712 from "../../../_bundle/Module712";
import ActionSheetActionCreators from "../../action_sheet/native/ActionSheetActionCreators";
import { BottomSheet } from "../../../design/components/Sheet/native/BottomSheet.native";
import { BottomSheetTitleHeader } from "../../../design/components/Sheet/native/BottomSheetTitleHeader.native";
import { ActionSheetCloseButton } from "../../../design/components/Sheet/native/ActionSheetCloseButton.native";
import Module9545 from "../../../_bundle/Module9545";
import { Text } from "../../../design/components/Text/native/Text";
import { intl, t } from "../../../intl/index.native";
import HelpdeskUtils from "../../../utils/HelpdeskUtils";
let useStyles;
const onClose = function onClose() {
ActionSheetActionCreators.hideActionSheet();
};
useStyles = createStyles({
title: {
...TextStyles(Fonts.DISPLAY_EXTRABOLD, Module712.colors.INTERACTIVE_TEXT_ACTIVE, 16),
marginTop: 8,
marginBottom: 8
},
subtitle: {
color: Module712.colors.INTERACTIVE_TEXT_ACTIVE,
textAlign: "center",
width: 343
},
view: {
paddingTop: 50,
paddingBottom: 100,
alignItems: "center"
},
rating: {
width: 116,
height: 93
}
});
export default function NotificationSurveyResponseActionSheet(props) {
const header = props.header;
const styles = useStyles();
return <BottomSheet>
{header != null && <BottomSheetTitleHeader title={header} trailing={<ActionSheetCloseButton onPress={onClose} />} />}
<View style={styles.view}>
<Image2 style={styles.rating} source={Module9545} />
<Text style={styles.title} variant="heading-md/bold">
{intl.string(t["d9+vQ8"])}
</Text>
<Text style={styles.subtitle} variant="text-md/normal">
{intl.format(t.WxD5QY, {
helpUrl: HelpdeskUtils.getArticleURL(HelpdeskArticles.HIGHLIGHTS_NOTIFICATIONS)
})}
</Text>
</View>
</BottomSheet>;
};
@@ -0,0 +1,191 @@
// Metro module 13508 (f13509).
import { NativeModules } from "react-native";
import ApexExperimentStore from "../../experiments/apex/ApexExperimentStore";
import MultiAccountStore from "../../multi_account/MultiAccountStore";
import MultiAccountSwitchStore from "../../multi_account/MultiAccountSwitchStore";
import AuthenticationStore from "../../../stores/AuthenticationStore";
import { NOTIF_SETTINGS } from "../NotificationSettingsConstants";
import { AnalyticEvents } from "../../../Constants";
import LifecycleManager from "../../../lib/LifecycleManager";
import Dispatcher from "../../../Dispatcher";
import PushNotification from "../../../lib/pushnotification/PushNotification";
import { declarativeNotifSettingsExperiment } from "./NotifSettingsExperiments";
import NotifSettingsUtils_android from "./NotifSettingsUtils.android";
import SentryUtils_native from "../../../utils/SentryUtils.native";
import { intl, t } from "../../../intl/index.native";
import NotificationSettings_messages from "../NotificationSettings.messages";
import { isAndroid } from "../../../utils/PlatformUtils";
import Module13514 from "../../../_bundle/Module13514";
import AnalyticsUtils from "../../../utils/AnalyticsUtils";
import PushNotificationActionCreators from "../../../actions/native/PushNotificationActionCreators";
class NotificationTokenManager extends LifecycleManager {
_experimentUnsubscribe = null;
token = null;
hasRegisterEventListener = false;
hasTrackedDisabledAndroidNotifChannels = false;
postConnectionOpenTimeoutID = null;
_handleExperimentsUpdated = () => this.registerNotificationCategories();
handleToken = (a0) => {
this.token = a0;
if (this.canSync) {
this.registerToken();
}
};
registerToken = () => {
if (this.token != null) {
NativeModules.DCDNotificationCategoryUtils.registerNotificationReplyCategories(intl.string(t.TBA5Xg), intl.string(t.TXNS7S), intl.string(t.TBA5Xg), () => {});
if (NativeModules.PushNotificationAndroid) {
NativeModules.PushNotificationAndroid.onRegisterNotificationToken();
}
PushNotificationActionCreators.registerDevice(this.token);
}
};
handleSyncNoMultiAccountOnLoginSuccess = () => {
this.handleSyncNoMultiAccount();
};
handleSyncNoMultiAccountOnRegisterSuccess = () => {
this.postConnectionOpenTimeoutID = setTimeout(this.handleSyncNoMultiAccountOnPostConnectionOpen, 5000);
};
handleSyncNoMultiAccountOnPostConnectionOpen = () => {
if (this.postConnectionOpenTimeoutID != null) {
clearTimeout(this.postConnectionOpenTimeoutID);
this.postConnectionOpenTimeoutID = null;
this.handleSyncNoMultiAccount();
}
};
handleSyncNoMultiAccount = () => {
if (this.canSync && !MultiAccountStore.canUseMultiAccountNotifications) {
this.registerToken();
}
};
handleSyncWithMultiAccount = () => {
if (this.canSync && MultiAccountStore.canUseMultiAccountNotifications) {
this.registerToken();
}
};
_initialize() {
if (this.token != null) {
this.handleToken(this.token);
}
ApexExperimentStore.addChangeListener(this._handleExperimentsUpdated);
this._experimentUnsubscribe = () => {
ApexExperimentStore.removeChangeListener(this._handleExperimentsUpdated);
};
Dispatcher.subscribe("LOGIN_SUCCESS", this.handleSyncNoMultiAccountOnLoginSuccess);
Dispatcher.subscribe("REGISTER_SUCCESS", this.handleSyncNoMultiAccountOnRegisterSuccess);
Dispatcher.subscribe("POST_CONNECTION_OPEN", this.handleSyncNoMultiAccountOnPostConnectionOpen);
Dispatcher.subscribe("POST_CONNECTION_OPEN", this.handleSyncWithMultiAccount);
Dispatcher.subscribe("MULTI_ACCOUNT_REMOVE_ACCOUNT", this.handleSyncWithMultiAccount);
}
_terminate() {
Dispatcher.unsubscribe("LOGIN_SUCCESS", this.handleSyncNoMultiAccountOnLoginSuccess);
Dispatcher.unsubscribe("REGISTER_SUCCESS", this.handleSyncNoMultiAccountOnRegisterSuccess);
Dispatcher.unsubscribe("POST_CONNECTION_OPEN", this.handleSyncNoMultiAccountOnPostConnectionOpen);
Dispatcher.unsubscribe("POST_CONNECTION_OPEN", this.handleSyncWithMultiAccount);
Dispatcher.unsubscribe("MULTI_ACCOUNT_REMOVE_ACCOUNT", this.handleSyncWithMultiAccount);
if (this._experimentUnsubscribe != null) {
this._experimentUnsubscribe();
this._experimentUnsubscribe = null;
}
}
registerListener() {
if (this.hasRegisterEventListener) {
throw new Error("Device token listener already registered.");
}
this.hasRegisterEventListener = true;
PushNotification.addRegisterEventListener(this.handleToken);
}
registerNotificationCategories() {
const config = declarativeNotifSettingsExperiment.getConfig({
location: "registerNotificationCategories"
});
let r12 = false;
try {
if (config.enabled) {
r12 = NotifSettingsUtils_android.registerDeclarativeNotificationCategories();
}
} catch ($e) {
SentryUtils_native.captureException($e);
}
if (!r12) {
try {
if (config.clearDeclarative) {
SentryUtils_native.addBreadcrumb({
message: "Clearing declarative notification categories"
});
NotifSettingsUtils_android.clear();
}
} catch ($e) {
SentryUtils_native.captureException($e);
}
this.registerLegacyNotificationCategories();
}
this.trackDisabledAndroidNotifChannels();
}
registerLegacyNotificationCategories() {
const registerNotificationCategories2 = NativeModules.DCDNotificationCategoryUtils.registerNotificationCategories;
const registerNotificationCategoriesAndGroups = NativeModules.DCDNotificationCategoryUtils.registerNotificationCategoriesAndGroups;
if (registerNotificationCategoriesAndGroups != null) {
registerNotificationCategoriesAndGroups({
calls: intl.string(NotificationSettings_messages["IUH/Oe"]),
mediaConnections: intl.string(NotificationSettings_messages.VeBD1N),
messages: intl.string(NotificationSettings_messages["4qWUAO"]),
directMessages: intl.string(NotificationSettings_messages.NGdNZb),
friendRequests: intl.string(NotificationSettings_messages.NxgGZA),
polls: intl.string(NotificationSettings_messages.MOjygY),
social: intl.string(NotificationSettings_messages["UzRF+8"]),
stageLive: intl.string(NotificationSettings_messages["4n388K"]),
guildEventLive: intl.string(NotificationSettings_messages["40TIqW"]),
guildHighlights: intl.string(t.p5jg9S),
forumThreadCreated: intl.string(NotificationSettings_messages.HibKoy),
systemMessages: intl.string(NotificationSettings_messages.zJlwvV),
other: intl.string(NotificationSettings_messages.kIrLfg),
default: intl.string(NotificationSettings_messages["T+79Eo"]),
reactions: intl.string(t.gHp0C4)
}, {
realtime: intl.string(NotificationSettings_messages.S5cB9e),
social: intl.string(NotificationSettings_messages["UzRF+8"]),
server: intl.string(NotificationSettings_messages.zRKbpz),
other: intl.string(NotificationSettings_messages.q5M7HV)
});
} else if (registerNotificationCategories2 != null) {
registerNotificationCategories2({
calls: intl.string(t.JJogjm),
mediaConnections: intl.string(t.K3lovD),
messages: intl.string(t.OIgYlQ),
directMessages: intl.string(t.YUU0RF),
social: intl.string(t.TdEu5X),
gameDetection: intl.string(t["A/4saf"]),
stageLive: intl.string(t.qGRagm),
guildEventLive: intl.string(t.MfGr0a),
guildHighlights: intl.string(t.p5jg9S),
forumThreadCreated: intl.string(t.dl57ho),
other: intl.string(t.BcZTKu),
otherHighPriority: intl.string(t.bcv3rp)
});
}
}
trackDisabledAndroidNotifChannels() {
if (!this.hasTrackedDisabledAndroidNotifChannels) {
this.hasTrackedDisabledAndroidNotifChannels = true;
if (isAndroid()) {
const getAndroidNotifChannelStates = Module13514?.getAndroidNotifChannelStates;
if (getAndroidNotifChannelStates != null) {
const r8 = getAndroidNotifChannelStates();
let c20503_0 = new Set(NOTIF_SETTINGS.map((item) => item.string_id));
AnalyticsUtils.track(AnalyticEvents.ANDROID_NOTIFICATION_CHANNELS_SYNCED, {
disabled_channels: r8.filter((item) => item.importance === 0 && c20503_0.has(item.channelId)).map((item) => item.channelId)
});
}
}
}
}
getToken() {
return this.token;
}
get canSync() {
return this.isInitialized && AuthenticationStore.isAuthenticated() && !MultiAccountSwitchStore.getIsSwitchingAccount();
}
}
const notificationTokenManager = new NotificationTokenManager();
export default notificationTokenManager;
@@ -0,0 +1,17 @@
// Metro module 10269 (f10270).
import NotificationSettingsStore from "../../../stores/NotificationSettingsStore";
import { isInAppMessageSoundsEnabled } from "./InAppMessageSoundsStore";
import { InAppNotificationTypes } from "../../../Constants";
import { isMetaQuest } from "../../device/MetaQuestUtils.android";
import { playSound } from "../../sound_playback/SoundUtils";
let c6854_5 = "message1";
let c6854_6 = 0;
export function playInAppMessageSound(a0) {
if (a0.type === InAppNotificationTypes.MESSAGE && isMetaQuest() && isInAppMessageSoundsEnabled() && !NotificationSettingsStore.isSoundDisabled(c6854_5)) {
const r22 = Date.now();
if (!(r22 - c6854_6 < 1000)) {
c6854_6 = r22;
playSound(c6854_5, 0.4);
}
}
}
@@ -0,0 +1,31 @@
// Metro module 14467 (f14468).
import { createApexExperiment } from "../../experiments/apex/index";
const apexExperiment = createApexExperiment({
kind: "user",
name: "2026-01-profile-updates-notification",
defaultConfig: {
showSettingsToggle: false
},
variations: {
0: {
showSettingsToggle: false
},
1: {
showSettingsToggle: true
},
2: {
showSettingsToggle: true
}
}
});
export default apexExperiment;
export function useProfileUpdatesNotificationExperiment(a0) {
return apexExperiment.useConfig({
location: a0
});
}
export function isEligibleForProfileUpdatesNotificationsToggle(a0) {
return apexExperiment.getConfig({
location: a0
}).showSettingsToggle;
}
@@ -0,0 +1,12 @@
// Metro module 14468 (f14469).
import { NotificationSettingsUpdateType } from "../NotificationConstants";
import { AnalyticEvents } from "../../../Constants";
import { EnableProfileUpdatesNotifications } from "../../user_settings/UserSettings";
import AnalyticsUtils from "../../../utils/AnalyticsUtils";
export function onProfileUpdatesNotificationSettingsChanged(a0) {
EnableProfileUpdatesNotifications.updateSetting(a0);
AnalyticsUtils.track(AnalyticEvents.NOTIFICATION_SETTINGS_UPDATED, {
update_type: NotificationSettingsUpdateType.ACCOUNT,
profile_updates_notifications: a0
});
}
@@ -0,0 +1,132 @@
// Metro module 2389 (f2390).
import { loadJsonAsset } from "../../../asset_json/native/AssetJsonUtils";
import * as _Module2390 from "../../../../_bundle/Module2390";
import * as _Module2391 from "../../../../_bundle/Module2391";
import * as _Module2392 from "../../../../_bundle/Module2392";
import * as _Module2393 from "../../../../_bundle/Module2393";
import * as _Module2394 from "../../../../_bundle/Module2394";
import * as _Module2395 from "../../../../_bundle/Module2395";
import * as _Module2396 from "../../../../_bundle/Module2396";
import * as _Module2397 from "../../../../_bundle/Module2397";
import * as _Module2398 from "../../../../_bundle/Module2398";
import * as _Module2399 from "../../../../_bundle/Module2399";
import * as _Module2400 from "../../../../_bundle/Module2400";
import * as _Module2401 from "../../../../_bundle/Module2401";
import * as _Module2402 from "../../../../_bundle/Module2402";
import * as _Module2403 from "../../../../_bundle/Module2403";
import * as _Module2404 from "../../../../_bundle/Module2404";
import * as _Module2405 from "../../../../_bundle/Module2405";
import * as _Module2406 from "../../../../_bundle/Module2406";
import * as _Module2407 from "../../../../_bundle/Module2407";
import * as _Module2408 from "../../../../_bundle/Module2408";
import * as _Module2409 from "../../../../_bundle/Module2409";
import * as _Module2410 from "../../../../_bundle/Module2410";
import * as _Module2411 from "../../../../_bundle/Module2411";
import * as _Module2412 from "../../../../_bundle/Module2412";
import * as _Module2413 from "../../../../_bundle/Module2413";
import * as _Module2414 from "../../../../_bundle/Module2414";
import * as _Module2415 from "../../../../_bundle/Module2415";
import * as _Module2416 from "../../../../_bundle/Module2416";
import * as _Module2417 from "../../../../_bundle/Module2417";
import * as _Module2418 from "../../../../_bundle/Module2418";
import * as _Module2419 from "../../../../_bundle/Module2419";
import * as _Module2420 from "../../../../_bundle/Module2420";
import { createLoader, makeMessagesProxy } from "../../../../_bundle/Module1274";
const loader = createLoader({
bg: () => loadJsonAsset(_Module2390).then((result) => ({
default: result
})),
cs: () => loadJsonAsset(_Module2391).then((result) => ({
default: result
})),
da: () => loadJsonAsset(_Module2392).then((result) => ({
default: result
})),
de: () => loadJsonAsset(_Module2393).then((result) => ({
default: result
})),
el: () => loadJsonAsset(_Module2394).then((result) => ({
default: result
})),
"en-GB": () => loadJsonAsset(_Module2395).then((result) => ({
default: result
})),
"es-419": () => loadJsonAsset(_Module2396).then((result) => ({
default: result
})),
"es-ES": () => loadJsonAsset(_Module2397).then((result) => ({
default: result
})),
fi: () => loadJsonAsset(_Module2398).then((result) => ({
default: result
})),
fr: () => loadJsonAsset(_Module2399).then((result) => ({
default: result
})),
hi: () => loadJsonAsset(_Module2400).then((result) => ({
default: result
})),
hr: () => loadJsonAsset(_Module2401).then((result) => ({
default: result
})),
hu: () => loadJsonAsset(_Module2402).then((result) => ({
default: result
})),
it: () => loadJsonAsset(_Module2403).then((result) => ({
default: result
})),
ja: () => loadJsonAsset(_Module2404).then((result) => ({
default: result
})),
ko: () => loadJsonAsset(_Module2405).then((result) => ({
default: result
})),
lt: () => loadJsonAsset(_Module2406).then((result) => ({
default: result
})),
nl: () => loadJsonAsset(_Module2407).then((result) => ({
default: result
})),
no: () => loadJsonAsset(_Module2408).then((result) => ({
default: result
})),
pl: () => loadJsonAsset(_Module2409).then((result) => ({
default: result
})),
"pt-BR": () => loadJsonAsset(_Module2410).then((result) => ({
default: result
})),
ro: () => loadJsonAsset(_Module2411).then((result) => ({
default: result
})),
ru: () => loadJsonAsset(_Module2412).then((result) => ({
default: result
})),
"sv-SE": () => loadJsonAsset(_Module2413).then((result) => ({
default: result
})),
th: () => loadJsonAsset(_Module2414).then((result) => ({
default: result
})),
tr: () => loadJsonAsset(_Module2415).then((result) => ({
default: result
})),
uk: () => loadJsonAsset(_Module2416).then((result) => ({
default: result
})),
vi: () => loadJsonAsset(_Module2417).then((result) => ({
default: result
})),
"zh-CN": () => loadJsonAsset(_Module2418).then((result) => ({
default: result
})),
"zh-TW": () => loadJsonAsset(_Module2419).then((result) => ({
default: result
})),
"en-US": () => loadJsonAsset(_Module2420).then((result) => ({
default: result
}))
}, "en-US");
const r51 = makeMessagesProxy(loader);
export default r51;
export { loader as messagesLoader };
@@ -0,0 +1,12 @@
// Metro module 14704 (f14705).
import { NotificationSettingsUpdateType } from "../../NotificationConstants";
import { AnalyticEvents } from "../../../../Constants";
import { NotifyFriendsOnProfileUpdate } from "../../../user_settings/UserSettings";
import AnalyticsUtils from "../../../../utils/AnalyticsUtils";
export function onNotifyFriendsOnProfileUpdateSettingsChanged(a0) {
NotifyFriendsOnProfileUpdate.updateSetting(a0);
AnalyticsUtils.track(AnalyticEvents.NOTIFICATION_SETTINGS_UPDATED, {
update_type: NotificationSettingsUpdateType.ACCOUNT,
notify_friends_on_profile_update: a0
});
}
@@ -0,0 +1,12 @@
// Metro module 14470 (f14471).
import { NotificationSettingsUpdateType } from "../NotificationConstants";
import { AnalyticEvents } from "../../../Constants";
import { EnableServerTrendingNotifications } from "../../user_settings/UserSettings";
import AnalyticsUtils from "../../../utils/AnalyticsUtils";
export function onServerTrendingNotificationSettingsChanged(a0) {
EnableServerTrendingNotifications.updateSetting(a0);
AnalyticsUtils.track(AnalyticEvents.NOTIFICATION_SETTINGS_UPDATED, {
update_type: NotificationSettingsUpdateType.ACCOUNT,
server_trending_notifications: a0
});
}
@@ -0,0 +1,92 @@
// Metro module 11693 (f11694).
import { View } from "react-native";
import { createStyles } from "../../../../design/components/Styles/native/createStyles";
import Module712 from "../../../../_bundle/Module712";
import { BottomSheet } from "../../../../design/components/Sheet/native/BottomSheet.native";
import ChatInputActionButton from "../../../chat_input/native/action_buttons/ChatInputActionButton";
import { BellIcon } from "../../../../design/components/Icon/native/redesign/generated/BellIcon";
import { intl, t } from "../../../../intl/index.native";
import { Text } from "../../../../design/components/Text/native/Text";
import { Button } from "../../../../design/components/Button/native/Button.native";
import NotificationSettingsModalActionCreators from "../../../../actions/NotificationSettingsModalActionCreators";
import { NotificationLabels } from "../../../../utils/NotificationSettingsUtils";
import ActionSheetActionCreators from "../../../action_sheet/native/ActionSheetActionCreators";
import ToastActionCreators from "../../../toast/native/ToastActionCreators";
import { Icon } from "../../../../design/void/native";
import Module7732 from "../../../../_bundle/Module7732";
const useStyles = createStyles({
sheet: {
backgroundColor: Module712.colors.BACKGROUND_BASE_LOWEST
},
iconContainer: {
alignItems: "center",
marginBottom: 8
},
iconBackground: {
width: 48,
height: 48
},
content: {
padding: 16
},
headerText: {
textAlign: "center",
marginBottom: 8,
paddingHorizontal: 16
},
infoText: {
textAlign: "center",
marginBottom: 16,
paddingHorizontal: 16
},
dismissButtonContainer: {
marginTop: 8
},
mutedNotificationContainer: {
borderRadius: Module712.radii.round,
backgroundColor: Module712.colors.BACKGROUND_FEEDBACK_NOTIFICATION,
height: 24,
width: 24,
padding: 4,
alignContent: "center"
},
mutedNotification: {
width: 16,
height: 16
}
});
export default function MuteAppDMActionSheet(props) {
const styles = useStyles();
const channel = props.channel;
return <BottomSheet startExpanded backgroundStyles={styles.sheet}>
<View style={styles.content}>
<View style={styles.iconContainer}>
<ChatInputActionButton style={styles.iconBackground} IconComponent={BellIcon} active accessibilityLabel={intl.string(t.uAmAiL)} />
</View>
<Text variant="heading-lg/bold" color="mobile-text-heading-primary" style={styles.headerText}>
{intl.string(t.uAmAiL)}
</Text>
<Text variant="text-md/normal" color="text-default" style={styles.infoText}>
{intl.string(t.mscFJU)}
</Text>
<Button variant="destructive" text={intl.string(t.uAmAiL)} onPress={() => {
NotificationSettingsModalActionCreators.updateChannelOverrideSettings(null, channel.id, {
muted: true
}, NotificationLabels.Muted);
ActionSheetActionCreators.hideActionSheet();
ToastActionCreators.open({
key: "NOTIFICATIONS_MUTED",
content: intl.string(t.EgGpkx),
icon: () => <View style={styles.mutedNotificationContainer}>
<Icon source={Module7732} color={Module712.unsafe_rawColors.WHITE} style={styles.mutedNotification} />
</View>
});
}} />
<View style={styles.dismissButtonContainer}>
<Button variant="secondary" text={intl.string(t.WAI6xu)} onPress={() => {
ActionSheetActionCreators.hideActionSheet();
}} />
</View>
</View>
</BottomSheet>;
};
@@ -0,0 +1,73 @@
// Metro module 10311 (f10312).
import { useLayoutEffect, useCallback } from "react";
import { View } from "react-native";
import UserGuildSettingsStore from "../../../../stores/UserGuildSettingsStore";
import { createStyles } from "../../../../design/components/Styles/native/createStyles";
import Module712 from "../../../../_bundle/Module712";
import { useChannelPresetInheritance, updateChannelToGuildDefault } from "../utils/notficationSettingsChannelFlagUtils";
import { intl, t } from "../../../../intl/index.native";
import useChannelName from "../../../channel/useChannelName";
import { useNavigation } from "../../../../design/components/Navigator/native/useNavigation.native";
import { NavigatorHeader, getHeaderBackButton } from "../../../../design/components/Navigator/native/NavigatorHeader.native";
import NotificationSettingsModalActionCreators from "../../../../actions/NotificationSettingsModalActionCreators";
import { NotificationLabels } from "../../../../utils/NotificationSettingsUtils";
import { useStateFromStoresObject } from "../../../../_bundle/Module589";
import { Form } from "../../../../design/void/Form/native/index";
import { NotificationSettingsMuteBanner, getMuteBannerSubtitleFromConfig } from "./NotificationSettingsMuteBanner";
import { NotificationSettingsChannelPresets } from "./NotificationSettingsPresets";
import { NotificationSettingsChannelMessageNotification } from "./NotificationSettingsMessageNotification";
import { NotificationSettingsChannelMessageUnread } from "./NotificationSettingsMessageUnread";
import { NotificationSettingsChannelPost } from "./NotificationSettingsChannelPost";
import { Button } from "../../../../design/components/Button/native/Button.native";
const useStyles = createStyles({
screenContainer: {
flex: 1,
backgroundColor: Module712.colors.BACKGROUND_BASE_LOW,
padding: 16
}
});
export default function NotificationSettingsChannel(props) {
let c17860_0 = props;
const channelPresetInheritance = useChannelPresetInheritance(props.channel);
const title = intl.string(t.h850Ss);
const subtitle = useChannelName(props.channel);
const navigation = useNavigation();
const styles = useStyles();
useLayoutEffect(() => {
navigation.setOptions({
title: `${title} (${subtitle})`,
headerTitle: () => <NavigatorHeader title={title} subtitle={subtitle} />
});
if (c17860_0.inGuildContext) {
navigation.setOptions({
headerLeft: getHeaderBackButton(() => navigation.popToTop())
});
}
});
const callback2 = useCallback(() => updateChannelToGuildDefault(c17860_0.channel.guild_id, c17860_0.channel.id), [props.channel]);
const callback = useCallback(() => {
NotificationSettingsModalActionCreators.updateChannelOverrideSettings(c17860_0.channel.guild_id, c17860_0.channel.id, {
muted: false
}, NotificationLabels.Unmuted);
}, [props.channel]);
const stateFromStoresObject = useStateFromStoresObject([UserGuildSettingsStore], () => ({
config: UserGuildSettingsStore.getChannelMuteConfig(c17860_0.channel.guild_id, c17860_0.channel.id),
muted: UserGuildSettingsStore.isChannelMuted(c17860_0.channel.guild_id, c17860_0.channel.id)
}));
const r79 = [stateFromStoresObject.muted && <NotificationSettingsMuteBanner style={{
marginBottom: 16
}} title={intl.string(t["6MCxAy"])} subtitle={getMuteBannerSubtitleFromConfig(stateFromStoresObject.config)} onPressUnmute={callback} />, <NotificationSettingsChannelPresets channel={props.channel} />, <NotificationSettingsChannelMessageNotification style={{
marginTop: 24
}} channel={props.channel} />, <NotificationSettingsChannelMessageUnread style={{
marginTop: 24
}} channel={props.channel} />, props.channel.isForumLikeChannel() && <NotificationSettingsChannelPost style={{
marginTop: 24
}} channel={props.channel} />, ,];
const inherited = channelPresetInheritance.inherited;
r79[5] = inherited ? !inherited : <View style={{
marginTop: 24
}}>
<Button variant="secondary" onPress={callback2} text={intl.string(t["3PBFN6"])} />
</View>;
return <Form style={styles.screenContainer}>{r79}</Form>;
};
@@ -0,0 +1,44 @@
// Metro module 10332 (f10333).
import { View } from "react-native";
import UserGuildSettingsStore from "../../../../stores/UserGuildSettingsStore";
import { useStateFromStoresObject } from "../../../../_bundle/Module589";
import { TableRowGroup } from "../../../../design/components/TableRow/native/TableRowGroup.native";
import { intl, t } from "../../../../intl/index.native";
import { TableCheckboxRow } from "../../../../design/components/TableRow/native/TableCheckboxRow.native";
import NotificationSettingsModalActionCreators from "../../../../actions/NotificationSettingsModalActionCreators";
export function NotificationSettingsChannelPost(props) {
let newForumThreadsCreated;
let c17879_0 = props;
const channel = props.channel;
const { guild_id, id } = channel;
const stateFromStoresObject = useStateFromStoresObject([UserGuildSettingsStore], () => ({
muted: UserGuildSettingsStore.isChannelMuted(guild_id, id),
guildMuted: UserGuildSettingsStore.isMuted(guild_id),
newForumThreadsCreated: UserGuildSettingsStore.getNewForumThreadsCreated(c17879_0.channel)
}));
let muted = stateFromStoresObject.muted;
const guildMuted = stateFromStoresObject.guildMuted;
newForumThreadsCreated = stateFromStoresObject.newForumThreadsCreated;
const props2 = {
title: intl.string(t.bK11jO),
hasIcons: false,
children: null
};
const props3 = {
label: intl.string(t.Rkgjph),
checked: newForumThreadsCreated,
disabled: null,
onPress: null
};
if (!muted) {
muted = guildMuted;
}
props3.disabled = muted;
props3.onPress = () => {
NotificationSettingsModalActionCreators.setForumThreadsCreated(c17879_0.channel, !newForumThreadsCreated);
};
props2.children = <TableCheckboxRow {...props3} />;
return <View style={props.style}>
<TableRowGroup {...props2} />
</View>;
}
@@ -0,0 +1,81 @@
// Metro module 10319 (f10320).
import { View } from "react-native";
import { createStyles } from "../../../../design/components/Styles/native/createStyles";
import Module712 from "../../../../_bundle/Module712";
import { getPushNotificationSelectOptions } from "../utils/notificationSettingsPresetOptionUtils";
import { Text } from "../../../../design/components/Text/native/Text";
import { intl, t } from "../../../../intl/index.native";
import { PressableOpacity } from "../../../../design/void/Pressables/native/Pressables";
import NotificationSettingsMockMessage from "./NotificationSettingsMockMessage";
import { useGuildPresetSettings } from "../utils/notificationSettingsGuildFlagUtils";
import ActionSheetActionCreators from "../../../action_sheet/native/ActionSheetActionCreators";
import { useChannelPresetSettings } from "../utils/notficationSettingsChannelFlagUtils";
let useStyles;
const NotificationSettingsMessageNotification = function NotificationSettingsMessageNotification(props) {
let c17867_0 = props;
const styles = useStyles();
const r18 = getPushNotificationSelectOptions().find((item) => item.value === c17867_0.setting);
const r65 = [<View style={styles.header}>
<Text variant="text-sm/semibold" color="text-default" style={styles.headerTitle}>
{intl.string(t["1m22ZB"])}
</Text>
<Text variant="text-xs/semibold" color="text-default">
{props.context === "guild" ? intl.string(t["4bP2ZZ"]) : intl.string(t["R1j5+4"])}
</Text>
</View>, ,];
const r79 = [<NotificationSettingsMockMessage notificationSetting={props.setting} />, , ,];
let r85 = r18?.label;
if (r85 == null) {
r85 = "unset";
}
r79[1] = <Text variant="text-sm/medium" style={styles.label}>{r85}</Text>;
r79[2] = <PressableOpacity onPress={props.onCustomize}>
<Text variant="text-sm/semibold" style={styles.cta} color="text-brand">
{intl.string(t.yxiV9W)}
</Text>
</PressableOpacity>;
r65[1] = <PressableOpacity onPress={props.onCustomize} activeOpacity={0.6}>
<View style={styles.card}>{r79}</View>
</PressableOpacity>;
return <View style={props.style}>{r65}</View>;
};
useStyles = createStyles({
card: {
backgroundColor: Module712.colors.BACKGROUND_BASE_LOWEST,
borderColor: Module712.colors.BACKGROUND_MOD_SUBTLE,
borderRadius: 20,
borderWidth: 1,
padding: 14
},
cta: {
textAlign: "center",
marginTop: 4
},
label: {
textAlign: "center",
marginTop: 8
},
header: {
marginBottom: 8
},
headerTitle: {
marginBottom: 4
}
});
export default NotificationSettingsMessageNotification;
export function NotificationSettingsGuildMessageNotification(props) {
let c17868_0 = props;
return <NotificationSettingsMessageNotification context="guild" style={props.style} setting={useGuildPresetSettings(props.guildId).notification} onCustomize={() => {
ActionSheetActionCreators.openLazy(import("./NotificationSettingsMessageNotificationGuildActionSheet"), "MessageNotificationGuildActionSheet", {
guildId: c17868_0.guildId
});
}} />;
}
export function NotificationSettingsChannelMessageNotification(props) {
let c17869_0 = props;
return <NotificationSettingsMessageNotification context="channel" style={props.style} setting={useChannelPresetSettings(props.channel).notification} onCustomize={() => {
ActionSheetActionCreators.openLazy(import("./NotificationSettingsMessageNotificationChannelActionSheet"), "MessageNotificationChannelActionSheet", {
channel: c17869_0.channel
});
}} />;
}
@@ -0,0 +1,49 @@
// Metro module 10324 (f10325).
import { View } from "react-native";
import { UserNotificationSettings } from "../../../../Constants";
import { createStyles } from "../../../../design/components/Styles/native/createStyles";
import Module712 from "../../../../_bundle/Module712";
import { BottomSheet } from "../../../../design/components/Sheet/native/BottomSheet.native";
import NotificationSettingsMockMessage from "./NotificationSettingsMockMessage";
import { Text } from "../../../../design/components/Text/native/Text";
import { intl, t } from "../../../../intl/index.native";
import { TableRadioGroup } from "../../../../design/components/TableRow/native/TableRadioGroup.native";
import { TableRadioRow } from "../../../../design/components/TableRow/native/TableRadioRow.native";
const useStyles = createStyles({
sheet: {
backgroundColor: Module712.colors.BACKGROUND_BASE_LOWEST
},
header: {
padding: 24,
paddingTop: 0
},
content: {
backgroundColor: Module712.colors.BACKGROUND_BASE_LOWER,
padding: 16
},
form: {
marginTop: 8,
marginBottom: 16
}
});
export default function NotificationSettingsMessageNotificationActionSheet(props) {
const styles = useStyles();
return <BottomSheet startExpanded backgroundStyles={styles.sheet}>
<View style={styles.header}>
<NotificationSettingsMockMessage notificationSetting={props.value} />
</View>
<View style={styles.content}>
<Text variant="text-sm/semibold">
{intl.string(t["1m22ZB"])}
</Text>
<Text variant="text-xs/medium" color="text-muted" />
<View style={styles.form}>
<TableRadioGroup defaultValue={props.value} onChange={props.onChange} hasIcons={false}>
<TableRadioRow label={intl.string(t["HVah/3"])} value={UserNotificationSettings.ALL_MESSAGES} subLabel={props.allMessagesSubLabel} />
<TableRadioRow label={intl.string(t["tu+ZWJ"])} value={UserNotificationSettings.ONLY_MENTIONS} />
<TableRadioRow label={intl.string(t.X4wWUi)} value={UserNotificationSettings.NO_MESSAGES} />
</TableRadioGroup>
</View>
</View>
</BottomSheet>;
};
@@ -0,0 +1,25 @@
// Metro module 10325 (f10326).
import UserGuildSettingsStore from "../../../../stores/UserGuildSettingsStore";
import { UserNotificationSettings } from "../../../../Constants";
import { UnreadSetting } from "../../../read_states/ReadStateConstants";
import { ChannelNotificationSettingsFlags } from "../../../user_settings/UserSettingsConstants";
import { useChannelPresetSettings } from "../utils/notficationSettingsChannelFlagUtils";
import NotificationSettingsMessageNotificationActionSheet from "./NotificationSettingsMessageNotificationActionSheet";
import { intl, t } from "../../../../intl/index.native";
import { withChannelUnreadFlags } from "../utils/notificationSettingsFlagUtils";
import NotificationSettingsModalActionCreators from "../../../../actions/NotificationSettingsModalActionCreators";
import { NotificationLabel } from "../../../../utils/NotificationSettingsUtils";
export default function NotificationSettingsMessageNotificationChannelActionSheet(props) {
let c17872_0 = props;
const channelPresetSettings = useChannelPresetSettings(props.channel);
const { unread, notification } = channelPresetSettings;
return <NotificationSettingsMessageNotificationActionSheet context="channel" value={notification} allMessagesSubLabel={notification !== UserNotificationSettings.ALL_MESSAGES ? unread !== UnreadSetting.ALL_MESSAGES ? intl.string(t.eP8yWU) : void 0 : void 0} onChange={(event) => {
const r7 = {
message_notifications: event
};
if (event === UserNotificationSettings.ALL_MESSAGES && unread !== UnreadSetting.ALL_MESSAGES) {
r7.flags = withChannelUnreadFlags(UserGuildSettingsStore.getChannelIdFlags(c17872_0.channel.guild_id, c17872_0.channel.id), ChannelNotificationSettingsFlags.UNREADS_ALL_MESSAGES);
}
NotificationSettingsModalActionCreators.updateChannelOverrideSettings(c17872_0.channel.guild_id, c17872_0.channel.id, r7, NotificationLabel.notifications(event));
}} />;
};
@@ -0,0 +1,25 @@
// Metro module 10323 (f10324).
import UserGuildSettingsStore from "../../../../stores/UserGuildSettingsStore";
import { UserNotificationSettings } from "../../../../Constants";
import { UnreadSetting } from "../../../read_states/ReadStateConstants";
import { GuildNotificationSettingsFlags } from "../../../user_settings/UserSettingsConstants";
import { useGuildPresetSettings } from "../utils/notificationSettingsGuildFlagUtils";
import NotificationSettingsMessageNotificationActionSheet from "./NotificationSettingsMessageNotificationActionSheet";
import { intl, t } from "../../../../intl/index.native";
import { withGuildUnreadFlags } from "../utils/notificationSettingsFlagUtils";
import NotificationSettingsModalActionCreators from "../../../../actions/NotificationSettingsModalActionCreators";
import { NotificationLabel } from "../../../../utils/NotificationSettingsUtils";
export default function NotificationSettingsMessageNotificationGuildActionSheet(props) {
let c17871_0 = props;
const guildPresetSettings = useGuildPresetSettings(props.guildId);
const { unread, notification } = guildPresetSettings;
return <NotificationSettingsMessageNotificationActionSheet context="guild" value={notification} allMessagesSubLabel={notification !== UserNotificationSettings.ALL_MESSAGES ? unread !== UnreadSetting.ALL_MESSAGES ? intl.string(t.eP8yWU) : void 0 : void 0} onChange={(event) => {
const r6 = {
message_notifications: event
};
if (event === UserNotificationSettings.ALL_MESSAGES && unread !== UnreadSetting.ALL_MESSAGES) {
r6.flags = withGuildUnreadFlags(UserGuildSettingsStore.getGuildFlags(c17871_0.guildId), GuildNotificationSettingsFlags.UNREADS_ALL_MESSAGES);
}
NotificationSettingsModalActionCreators.updateGuildNotificationSettings(c17871_0.guildId, r6, NotificationLabel.notifications(event));
}} />;
};
@@ -0,0 +1,81 @@
// Metro module 10326 (f10327).
import { View } from "react-native";
import { createStyles } from "../../../../design/components/Styles/native/createStyles";
import Module712 from "../../../../_bundle/Module712";
import { getUnreadSelectOptions } from "../utils/notificationSettingsPresetOptionUtils";
import { Text } from "../../../../design/components/Text/native/Text";
import { intl, t } from "../../../../intl/index.native";
import { PressableOpacity } from "../../../../design/void/Pressables/native/Pressables";
import NotificationSettingsMockChannels from "./NotificationSettingsMockChannels";
import { useGuildPresetSettings } from "../utils/notificationSettingsGuildFlagUtils";
import ActionSheetActionCreators from "../../../action_sheet/native/ActionSheetActionCreators";
import { useChannelPresetSettings } from "../utils/notficationSettingsChannelFlagUtils";
let useStyles;
const NotificationSettingsMessageUnread = function NotificationSettingsMessageUnread(props) {
let c17873_0 = props;
const styles = useStyles();
const r18 = getUnreadSelectOptions().find((item) => item.value === c17873_0.setting);
const r55 = [<View style={styles.header}>
<Text variant="text-sm/semibold" color="text-default" style={styles.headerTitle}>
{intl.string(t.Tqd1Af)}
</Text>
<Text variant="text-xs/semibold" color="text-default">
{intl.string(t.RpQgm5)}
</Text>
</View>, ,];
const r69 = [<NotificationSettingsMockChannels unreadSetting={props.setting} />, , ,];
let r75 = r18?.label;
if (r75 == null) {
r75 = "unset";
}
r69[1] = <Text variant="text-sm/medium" style={styles.label}>{r75}</Text>;
r69[2] = <PressableOpacity onPress={props.onCustomize}>
<Text variant="text-sm/semibold" style={styles.cta} color="text-brand">
{intl.string(t.yxiV9W)}
{" "}
</Text>
</PressableOpacity>;
r55[1] = <PressableOpacity onPress={props.onCustomize} activeOpacity={0.6}>
<View style={styles.card}>{r69}</View>
</PressableOpacity>;
return <View style={props.style}>{r55}</View>;
};
useStyles = createStyles({
card: {
backgroundColor: Module712.colors.BACKGROUND_BASE_LOWEST,
borderColor: Module712.colors.BACKGROUND_MOD_SUBTLE,
borderRadius: 20,
borderWidth: 1,
padding: 14
},
cta: {
marginTop: 4,
textAlign: "center"
},
label: {
marginTop: 8,
textAlign: "center"
},
header: {
marginBottom: 8
},
headerTitle: {
marginBottom: 4
}
});
export function NotificationSettingsGuildMessageUnread(props) {
let c17874_0 = props;
return <NotificationSettingsMessageUnread style={props.style} setting={useGuildPresetSettings(props.guildId).unread} onCustomize={() => {
ActionSheetActionCreators.openLazy(import("./NotificationSettingsMessageUnreadGuildActionSheet"), "MessageUnreadActionSheet", {
guildId: c17874_0.guildId
});
}} />;
}
export function NotificationSettingsChannelMessageUnread(props) {
let c17875_0 = props;
return <NotificationSettingsMessageUnread style={props.style} setting={useChannelPresetSettings(props.channel).unread} onCustomize={() => {
ActionSheetActionCreators.openLazy(import("./NotificationSettingsMessageUnreadChannelActionSheet"), "MessageUnreadActionSheet", {
channel: c17875_0.channel
});
}} />;
}
@@ -0,0 +1,50 @@
// Metro module 10330 (f10331).
import { View } from "react-native";
import { UnreadSetting } from "../../../read_states/ReadStateConstants";
import { createStyles } from "../../../../design/components/Styles/native/createStyles";
import Module712 from "../../../../_bundle/Module712";
import { BottomSheet } from "../../../../design/components/Sheet/native/BottomSheet.native";
import NotificationSettingsMockChannels from "./NotificationSettingsMockChannels";
import { Text } from "../../../../design/components/Text/native/Text";
import { intl, t } from "../../../../intl/index.native";
import { TableRadioGroup } from "../../../../design/components/TableRow/native/TableRadioGroup.native";
import { TableRadioRow } from "../../../../design/components/TableRow/native/TableRadioRow.native";
const useStyles = createStyles({
sheet: {
backgroundColor: Module712.colors.BACKGROUND_BASE_LOWEST
},
header: {
padding: 24,
paddingTop: 0
},
content: {
backgroundColor: Module712.colors.BACKGROUND_BASE_LOWER,
padding: 16
},
form: {
marginTop: 8,
marginBottom: 16
}
});
export default function NotificationSettingsMessageUnreadActionSheet(props) {
const styles = useStyles();
return <BottomSheet startExpanded backgroundStyles={styles.sheet}>
<View style={styles.header}>
<NotificationSettingsMockChannels unreadSetting={props.value} />
</View>
<View style={styles.content}>
<Text variant="text-sm/semibold">
{intl.string(t.Tqd1Af)}
</Text>
<Text variant="text-xs/medium" color="text-muted">
{intl.string(t.RpQgm5)}
</Text>
<View style={styles.form}>
<TableRadioGroup defaultValue={props.value} onChange={props.onChange} hasIcons={false}>
<TableRadioRow label={intl.string(t["HVah/3"])} value={UnreadSetting.ALL_MESSAGES} />
<TableRadioRow subLabel={props.disabledMentionOnlyWithReason} disabled={props.disabledMentionOnlyWithReason != null} label={intl.string(t["tu+ZWJ"])} value={UnreadSetting.ONLY_MENTIONS} />
</TableRadioGroup>
</View>
</View>
</BottomSheet>;
};
@@ -0,0 +1,20 @@
// Metro module 10331 (f10332).
import UserGuildSettingsStore from "../../../../stores/UserGuildSettingsStore";
import { UserNotificationSettings } from "../../../../Constants";
import { UnreadSetting } from "../../../read_states/ReadStateConstants";
import { ChannelNotificationSettingsFlags } from "../../../user_settings/UserSettingsConstants";
import { useChannelPresetSettings } from "../utils/notficationSettingsChannelFlagUtils";
import NotificationSettingsMessageUnreadActionSheet from "./NotificationSettingsMessageUnreadActionSheet";
import { intl, t } from "../../../../intl/index.native";
import NotificationSettingsModalActionCreators from "../../../../actions/NotificationSettingsModalActionCreators";
import { withChannelUnreadFlags } from "../utils/notificationSettingsFlagUtils";
import { NotificationLabel } from "../../../../utils/NotificationSettingsUtils";
export default function NotificationSettingsMessageUnreadChannelActionSheet(props) {
let c17878_0 = props;
const channelPresetSettings = useChannelPresetSettings(props.channel);
return <NotificationSettingsMessageUnreadActionSheet value={channelPresetSettings.unread} disabledMentionOnlyWithReason={channelPresetSettings.notification === UserNotificationSettings.ALL_MESSAGES ? intl.string(t.eP8yWU) : void 0} onChange={(event) => {
NotificationSettingsModalActionCreators.updateChannelOverrideSettings(c17878_0.channel.guild_id, c17878_0.channel.id, {
flags: withChannelUnreadFlags(UserGuildSettingsStore.getChannelIdFlags(c17878_0.channel.guild_id, c17878_0.channel.id), event === UnreadSetting.ALL_MESSAGES ? ChannelNotificationSettingsFlags.UNREADS_ALL_MESSAGES : ChannelNotificationSettingsFlags.UNREADS_ONLY_MENTIONS)
}, NotificationLabel.unreads(event));
}} />;
};
@@ -0,0 +1,21 @@
// Metro module 10329 (f10330).
import UserGuildSettingsStore from "../../../../stores/UserGuildSettingsStore";
import { UserNotificationSettings } from "../../../../Constants";
import { UnreadSetting } from "../../../read_states/ReadStateConstants";
import { GuildNotificationSettingsFlags } from "../../../user_settings/UserSettingsConstants";
import { useGuildPresetSettings } from "../utils/notificationSettingsGuildFlagUtils";
import NotificationSettingsMessageUnreadActionSheet from "./NotificationSettingsMessageUnreadActionSheet";
import { intl, t } from "../../../../intl/index.native";
import NotificationSettingsModalActionCreators from "../../../../actions/NotificationSettingsModalActionCreators";
import { withGuildUnreadFlags } from "../utils/notificationSettingsFlagUtils";
import { NotificationLabel } from "../../../../utils/NotificationSettingsUtils";
export default function NotificationSettingsMessageUnreadGuildActionSheet(props) {
let c17877_0 = props;
const guildPresetSettings = useGuildPresetSettings(props.guildId);
const unread = guildPresetSettings.unread;
return <NotificationSettingsMessageUnreadActionSheet disabledMentionOnlyWithReason={guildPresetSettings.notification === UserNotificationSettings.ALL_MESSAGES ? intl.string(t.eP8yWU) : void 0} value={unread} onChange={(event) => {
NotificationSettingsModalActionCreators.updateGuildNotificationSettings(c17877_0.guildId, {
flags: withGuildUnreadFlags(UserGuildSettingsStore.getGuildFlags(c17877_0.guildId), event === UnreadSetting.ALL_MESSAGES ? GuildNotificationSettingsFlags.UNREADS_ALL_MESSAGES : GuildNotificationSettingsFlags.UNREADS_ONLY_MENTIONS)
}, NotificationLabel.unreads(event));
}} />;
};
@@ -0,0 +1,67 @@
// Metro module 10327 (f10328).
import { View } from "react-native";
import { UnreadSetting } from "../../../read_states/ReadStateConstants";
import { createStyles } from "../../../../design/components/Styles/native/createStyles";
import Module712 from "../../../../_bundle/Module712";
import { intl, t } from "../../../../intl/index.native";
import StaticChannelIndicator from "../../../channel_list_v2/native/components/StaticChannelIndicator";
import { TextIcon } from "../../../../design/components/Icon/native/redesign/generated/TextIcon";
import { Text } from "../../../../design/components/Text/native/Text";
import { Badge } from "../../../../design/void/native";
const useStyles = createStyles({
card: {
backgroundColor: Module712.colors.BACKGROUND_SURFACE_HIGH,
overflow: "hidden",
borderRadius: 10,
paddingVertical: 8
},
channel: {
display: "flex",
flexDirection: "row",
alignItems: "center",
paddingVertical: 4,
justifyContent: "space-between",
paddingRight: 12
},
channelName: {
display: "flex",
flexDirection: "row",
alignItems: "center"
}
});
export default function NotificationSettingsMockChannels(props) {
const styles = useStyles();
const r20 = [{
badged: true,
unread: true,
resolvedUnreadSetting: UnreadSetting.ALL_MESSAGES,
name: intl.string(t.EjLobP)
}, {
badged: false,
unread: true,
resolvedUnreadSetting: UnreadSetting.ONLY_MENTIONS,
name: intl.string(t.Wgpwpp)
}, {
badged: false,
unread: false,
resolvedUnreadSetting: UnreadSetting.ONLY_MENTIONS,
name: intl.string(t.g9VImh)
}];
if (props.unreadSetting === UnreadSetting.ALL_MESSAGES) {
r20[1].resolvedUnreadSetting = UnreadSetting.ALL_MESSAGES;
}
return <View style={styles.card}>
{r20.map((item) => <View key={item.name} style={styles.channel}>
<View style={styles.channelName}>
<StaticChannelIndicator unread={item.unread} resolvedUnreadSetting={item.resolvedUnreadSetting} />
<TextIcon style={{
marginLeft: 12
}} size="xs" color={item.resolvedUnreadSetting === UnreadSetting.ONLY_MENTIONS ? "text-muted" : void 0} />
<Text style={{
marginLeft: 4
}} variant="text-sm/semibold" color={item.resolvedUnreadSetting === UnreadSetting.ONLY_MENTIONS ? "text-muted" : void 0}>{item.name}</Text>
</View>
<Badge value={item.badged ? 1 : 0} />
</View>)}
</View>;
};
@@ -0,0 +1,93 @@
// Metro module 10321 (f10322).
import { useEffect } from "react";
import { View } from "react-native";
import UserStore from "../../../../stores/UserStore";
import { UserNotificationSettings } from "../../../../Constants";
import { createStyles } from "../../../../design/components/Styles/native/createStyles";
import Module712 from "../../../../_bundle/Module712";
import { useStateFromStores } from "../../../../_bundle/Module589";
import UserUtils from "../../../../utils/UserUtils";
import ReanimatedRexport, { useSharedValue, useAnimatedStyle } from "../../../reanimated/ReanimatedRexport";
import * as _timing from "../../../../design/animation/reanimated/timing/timing";
import * as _timingPresets from "../../../../design/animation/reanimated/timing/timingPresets";
import { Text } from "../../../../design/components/Text/native/Text";
import { intl, t } from "../../../../intl/index.native";
import { Avatar, AvatarSizes } from "../../../../design/void/native";
import Module10322 from "../../../../_bundle/Module10322";
const useStyles = createStyles({
card: {
backgroundColor: Module712.colors.BACKGROUND_SURFACE_HIGH,
overflow: "hidden",
borderRadius: 10,
padding: 16
},
cardContent: {
display: "flex",
flexDirection: "row"
},
cardMessage: {
marginLeft: 12,
maxWidth: 240
},
overlay: {
position: "absolute",
top: 0,
left: 0,
right: 0,
bottom: 0,
backgroundColor: Module712.colors.BACKGROUND_BASE_LOWEST
}
});
const __initData = {
code: "function NotificationSettingsMockMessageTsx1(){const{withTiming,opacity,timingStandard}=this.__closure;return{opacity:withTiming(opacity.get(),timingStandard)};}"
};
export default function NotificationSettingsMockMessage(props) {
const styles = useStyles();
let r20 = UserUtils.getName(useStateFromStores([UserStore], () => UserStore.getCurrentUser()));
if (r20 == null) {
r20 = "Roka";
}
const r33 = props.notificationSetting === UserNotificationSettings.NO_MESSAGES;
let c17870_0 = r33;
const sharedValue = useSharedValue(r33 ? 0.8 : 0);
const h = () => ({
opacity: _timing.withTiming(sharedValue.get(), _timingPresets.timingStandard)
});
h.__closure = {
withTiming: _timing.withTiming,
opacity: sharedValue,
timingStandard: _timingPresets.timingStandard
};
h.__workletHash = 6531430956793;
h.__initData = __initData;
const animatedStyle = useAnimatedStyle(h);
const r73 = props.notificationSetting === UserNotificationSettings.ALL_MESSAGES ? <Text variant="text-sm/medium" color="text-default">
{intl.string(t.WYyzI5)}
</Text> : <View>
<Text variant="text-sm/medium" color="text-default">
<Text variant="text-sm/normal" color="text-link">
@
{r20}
{" "}
</Text>
{intl.string(t.WYyzI5)}
</Text>
</View>;
useEffect(() => {
sharedValue.set(c17870_0 ? 0.8 : 0);
}, [sharedValue, r33]);
return <View style={styles.card}>
<View style={styles.cardContent}>
<View>
<Avatar source={Module10322} size={AvatarSizes.LARGE_48} />
</View>
<View style={styles.cardMessage}>
<Text variant="text-sm/semibold">
{intl.string(t.qSq0tD)}
</Text>
{r73}
</View>
</View>
<ReanimatedRexport.View style={[animatedStyle, styles.overlay]} />
</View>;
};
@@ -0,0 +1,40 @@
// Metro module 10314 (f10315).
import { View } from "react-native";
import { createStyles } from "../../../../design/components/Styles/native/createStyles";
import Module712 from "../../../../_bundle/Module712";
import { Text } from "../../../../design/components/Text/native/Text";
import { Button } from "../../../../design/components/Button/native/Button.native";
import { intl, t } from "../../../../intl/index.native";
const useStyles = createStyles({
card: {
padding: 16,
display: "flex",
flexDirection: "row",
alignItems: "center",
justifyContent: "space-between",
borderRadius: Module712.radii.lg + 8,
backgroundColor: Module712.colors.BACKGROUND_BRAND
}
});
export function NotificationSettingsMuteBanner(props) {
return <View style={[props.style, useStyles().card]}>
<View style={{
flex: 1,
marginRight: 8
}}>
<Text variant="text-md/semibold" color="text-overlay-light">{props.title}</Text>
<Text variant="text-xs/medium" color="text-overlay-light">{props.subtitle}</Text>
</View>
<Button text={intl.string(t.YqAjXy)} onPress={props.onPressUnmute} variant="primary-overlay" />
</View>;
}
export function getMuteBannerSubtitleFromConfig(a0) {
return a0?.end_time == null ? intl.string(t["tFqP/P"]) : intl.formatToPlainString(t.C7m4oh, {
endTime: new Date(a0.end_time).toLocaleString(intl.currentLocale, {
month: "numeric",
day: "numeric",
hour: "numeric",
minute: "2-digit"
})
});
}
@@ -0,0 +1,95 @@
// Metro module 10315 (f10316).
import { useEffect } from "react";
import { View } from "react-native";
import { intl, t } from "../../../../intl/index.native";
import { Presets } from "../utils/notificationSettingsPresetUtils";
import { CircleCheckIcon } from "../../../../design/components/Icon/native/redesign/generated/CircleCheckIcon";
import { MagicWandIcon } from "../../../../design/components/Icon/native/redesign/generated/MagicWandIcon";
import { BellSlashIcon } from "../../../../design/components/Icon/native/redesign/generated/BellSlashIcon";
import { createStyles } from "../../../../design/components/Styles/native/createStyles";
import Module712 from "../../../../_bundle/Module712";
import { useSegmentedControlState } from "../../../../design/components/SegmentedControl/native/SegmentedControlState.native";
import { Text } from "../../../../design/components/Text/native/Text";
import { Button } from "../../../../design/components/Button/native/Button.native";
import { SegmentedControl } from "../../../../design/components/SegmentedControl/native/SegmentedControl.native";
import { useGuildPresetSettings, updateGuildPreset } from "../utils/notificationSettingsGuildFlagUtils";
import { useChannelPresetSettings, updateChannelPreset } from "../utils/notficationSettingsChannelFlagUtils";
let useStyles;
const NotificationSettingsPresets = function NotificationSettingsPresets(props) {
let c17863_0 = props;
const styles = useStyles();
const defaultIndex = props.preset !== Presets.ALL_MESSAGES ? props.preset !== Presets.MENTIONS ? props.preset === Presets.NOTHING ? 2 : void 0 : 1 : 0;
let c17863_1 = defaultIndex;
const segmentedControlState = useSegmentedControlState({
pageWidth: 0,
onSetActiveIndex: function onSetActiveIndex(a0) {
if (a0 === 0 && c17863_0.preset !== Presets.ALL_MESSAGES) {
c17863_0.updatePreset(Presets.ALL_MESSAGES);
}
if (a0 === 1 && c17863_0.preset !== Presets.MENTIONS) {
c17863_0.updatePreset(Presets.MENTIONS);
}
if (a0 === 2 && c17863_0.preset !== Presets.NOTHING) {
c17863_0.updatePreset(Presets.NOTHING);
}
},
items: [{
label: intl.string(t.hZrr6k),
id: Presets.ALL_MESSAGES,
icon: <CircleCheckIcon />,
page: null
}, {
label: intl.string(t.y59NJm),
id: Presets.MENTIONS,
icon: <MagicWandIcon />,
page: null
}, {
label: intl.string(t["pGn/bJ"]),
id: Presets.NOTHING,
icon: <BellSlashIcon />,
page: null
}],
defaultIndex
});
useEffect(() => {
if (!(c17863_1 == null || c17863_1 >= 3)) {
segmentedControlState.setActiveIndex(c17863_1);
}
}, [defaultIndex, segmentedControlState]);
return props.preset === Presets.CUSTOM ? <View style={styles.customContainer}>
<View style={{
flex: 1,
marginRight: 8
}}>
<Text variant="text-sm/semibold">
{intl.string(t["32yow9"])}
</Text>
<Text variant="text-xs/medium">
{intl.string(t.l3doVX)}
</Text>
</View>
<Button variant="secondary" text={intl.string(t["ztO+l+"])} onPress={() => {
c17863_0.updatePreset(Presets.MENTIONS);
}} />
</View> : <SegmentedControl variant="experimental_Large" state={segmentedControlState} />;
};
useStyles = createStyles({
customContainer: {
padding: 16,
minHeight: 82,
display: "flex",
flexDirection: "row",
alignItems: "center",
justifyContent: "center",
borderRadius: Module712.radii.lg + 8,
backgroundColor: Module712.colors.REDESIGN_INPUT_CONTROL_ACTIVE_BG
}
});
export function NotificationSettingsGuildPresets(props) {
let c17864_0 = props;
return <NotificationSettingsPresets preset={useGuildPresetSettings(props.guildId).preset} updatePreset={(a0) => updateGuildPreset(c17864_0.guildId, a0)} />;
}
export function NotificationSettingsChannelPresets(props) {
let c17865_0 = props;
return <NotificationSettingsPresets preset={useChannelPresetSettings(props.channel).preset} updatePreset={(a0) => updateChannelPreset(c17865_0.channel.guild_id, c17865_0.channel.id, a0)} />;
}
@@ -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);
}
@@ -0,0 +1,10 @@
// Metro module 10460 (f10461).
import useTrackImpression from "../../app_analytics/useTrackImpression";
import { ImpressionTypes, ImpressionNames } from "../../../_bundle/Module503";
export default function UnreadSettingNoticeImpressionTracking(a0) {
useTrackImpression({
type: ImpressionTypes.VIEW,
name: ImpressionNames.NOTIFICATION_SETTING_UNREAD_NUDGE
}, void 0, [a0.id]);
return null;
};
@@ -0,0 +1,271 @@
// Metro module 10456 (f10457).
import AuthenticationStore from "../../../stores/AuthenticationStore";
import ChannelStore from "../../../stores/ChannelStore";
import GuildStore from "../../../stores/GuildStore";
import SelectedChannelStore from "../../../stores/SelectedChannelStore";
import UserGuildSettingsStore from "../../../stores/UserGuildSettingsStore";
import { UserNotificationSettings } from "../../../Constants";
import { UnreadSetting } from "../../read_states/ReadStateConstants";
import { ChannelNotificationSettingsFlags } from "../../user_settings/UserSettingsConstants";
import Durations from "../../../utils/Durations";
import SnowflakeUtils from "../../../utils/SnowflakeUtils";
import { hasAnyFlag } from "../../../_bundle/Module1384";
import Module589 from "../../../_bundle/Module589";
import { updateChannelUnreadSetting } from "../settings/utils/notficationSettingsChannelFlagUtils";
import Dispatcher from "../../../Dispatcher";
let c7004_11, c7004_12, WEEK, c7004_14, c7004_15, channelId, c7004_17, c7004_18, shouldTrackChannel, c7004_21, $mk84699 = function() {
return () => {
let r11;
L7: {
const r2 = channelId == null;
r11 = false;
if (!r2) {
const shouldTrackChannel2 = shouldTrackChannel(channelId);
r11 = false;
if (shouldTrackChannel2) {
if (!(channelId in c7004_14.channels)) {
c7004_14.channels[channelId] = {
lastActionTime: 0,
viewDuration: 0,
numSends: 0
};
}
const r19 = c7004_14.channels[channelId];
if (r19.lastActionTime > Date.now() - Durations.Millis.DAY) {
const r33 = r19.viewDuration > c7004_12;
r11 = false;
if (r33) {
break L7;
}
}
const lastActionTime = Date.now();
r19.lastActionTime = lastActionTime;
r19.viewDuration = r19.viewDuration + (lastActionTime - c7004_17);
c7004_17 = lastActionTime;
r11 = true;
}
}
}
if (r11) {
c7004_21.emitChange();
}
};
};
const startInterval = function startInterval() {
if (c7004_18 !== 0) {
clearInterval(c7004_18);
c7004_18 = 0;
}
if (UserGuildSettingsStore.useNewNotifications) {
const r12 = setInterval;
const r20 = 15 * Durations.Millis.SECOND;
c7004_18 = r12($mk84699(), r20);
}
return false;
};
shouldTrackChannel = function shouldTrackChannel(channelId) {
if (UserGuildSettingsStore.useNewNotifications) {
if (c7004_15.has(channelId)) {
return false;
}
const basicChannel = ChannelStore.getBasicChannel(channelId);
if (basicChannel != null && basicChannel.guild_id != null) {
if (UserGuildSettingsStore.isGuildOrCategoryOrChannelMuted(basicChannel.guild_id, basicChannel.id)) {
return false;
}
const { guild_id, id } = basicChannel;
const r2 = id == null;
let r1 = false;
if (!r2) {
const r29 = UserGuildSettingsStore.getChannelOverrides(guild_id)[id];
r1 = r29 != null && (r29.message_notifications != null && r29.message_notifications !== UserNotificationSettings.NULL || !(r29.flags == null || !hasAnyFlag(r29.flags, ChannelNotificationSettingsFlags.UNREADS_ALL_MESSAGES | ChannelNotificationSettingsFlags.UNREADS_ONLY_MENTIONS)));
}
if (r1) {
return false;
}
const { guild_id: guild_id2, parent_id } = basicChannel;
const r47 = parent_id == null;
let r48 = false;
if (!r47) {
const r51 = UserGuildSettingsStore.getChannelOverrides(guild_id2)[parent_id];
r48 = r51 != null && (r51.message_notifications != null && r51.message_notifications !== UserNotificationSettings.NULL || !(r51.flags == null || !hasAnyFlag(r51.flags, ChannelNotificationSettingsFlags.UNREADS_ALL_MESSAGES | ChannelNotificationSettingsFlags.UNREADS_ONLY_MENTIONS)));
}
if (r48) {
return false;
}
const r73 = UserGuildSettingsStore.resolveUnreadSetting(basicChannel);
return UserGuildSettingsStore.getChannelUnreadSetting(basicChannel.guild_id, basicChannel.id) === UnreadSetting.UNSET && r73 !== UnreadSetting.ALL_MESSAGES;
}
return false;
}
return false;
};
c7004_11 = [{
timeSinceJoin: 1 * Durations.Millis.HOUR,
sends: 1,
viewTime: 1 * Durations.Millis.MINUTE
}, {
timeSinceJoin: 1 * Durations.Millis.DAY,
sends: 2,
viewTime: 2 * Durations.Millis.MINUTE
}, {
timeSinceJoin: 1 * Durations.Millis.WEEK,
sends: 5,
viewTime: 5 * Durations.Millis.MINUTE
}, {
timeSinceJoin: 1 * Durations.Millis.DAYS_30,
sends: 10,
viewTime: 30 * Durations.Millis.MINUTE
}];
c7004_12 = 5 * c7004_11[c7004_11.length - 1].viewTime;
WEEK = Durations.Millis.WEEK;
c7004_14 = {
channels: {}
};
c7004_15 = new Set();
channelId = null;
c7004_17 = 0;
c7004_18 = 0;
class UnreadSettingNoticeStore2Class extends Module589.PersistedStore {
static displayName = "UnreadSettingNoticeStore2";
static persistKey = "UnreadSettingNoticeStore2";
initialize(a0) {
if (a0 != null) {
c7004_14.channels = a0.channels;
}
this.syncWith([UserGuildSettingsStore], startInterval);
this.waitFor(AuthenticationStore, ChannelStore, GuildStore, SelectedChannelStore, UserGuildSettingsStore);
}
getState() {
return c7004_14;
}
getLastActionTime(a0) {
let r8 = c7004_14.channels[a0]?.lastActionTime;
if (r8 == null) {
r8 = 0;
}
return r8;
}
maybeAutoUpgradeChannel(a0) {
if (shouldTrackChannel(a0)) {
const basicChannel = ChannelStore.getBasicChannel(a0);
let r12 = basicChannel != null && basicChannel.guild_id != null;
if (r12) {
let r17 = !!(function isChannelNewEnough(a0) {
let r8 = GuildStore.getGuild(a0.guild_id)?.joinedAt;
if (r8 == null) {
r8 = new Date();
}
const r43 = Math.min(SnowflakeUtils.age(a0.id), Date.now() - r8.getTime());
const r47 = c7004_14.channels[a0.id];
if (r47 == null) {
return false;
}
if (r47.lastActionTime < Date.now() - WEEK) {
return false;
}
for (const item of c7004_11) {
if (!(r43 < item.timeSinceJoin)) {
continue;
}
if (!(r47.numSends >= item.sends) && !(r47.viewDuration >= item.viewTime)) {
continue;
}
return true;
}
return false;
})(basicChannel);
if (r17) {
delete c7004_14.channels[a0];
c7004_15.add(a0);
updateChannelUnreadSetting(basicChannel.guild_id, basicChannel.id, UnreadSetting.ALL_MESSAGES);
r17 = true;
}
r12 = r17;
}
return r12;
}
return false;
}
}
c7004_21 = new UnreadSettingNoticeStore2Class(Dispatcher, {
CHANNEL_SELECT: function handleChannelSelect() {
let r11;
L7: {
const r2 = channelId == null;
r11 = false;
if (!r2) {
const shouldTrackChannel2 = shouldTrackChannel(channelId);
r11 = false;
if (shouldTrackChannel2) {
if (!(channelId in c7004_14.channels)) {
c7004_14.channels[channelId] = {
lastActionTime: 0,
viewDuration: 0,
numSends: 0
};
}
const r19 = c7004_14.channels[channelId];
if (r19.lastActionTime > Date.now() - Durations.Millis.DAY) {
const r33 = r19.viewDuration > c7004_12;
r11 = false;
if (r33) {
break L7;
}
}
const lastActionTime = Date.now();
r19.lastActionTime = lastActionTime;
r19.viewDuration = r19.viewDuration + (lastActionTime - c7004_17);
c7004_17 = lastActionTime;
r11 = true;
}
}
}
channelId = SelectedChannelStore.getChannelId();
c7004_17 = Date.now();
return r11;
},
CONNECTION_OPEN: function handleConnectionOpen() {
channelId = SelectedChannelStore.getChannelId();
c7004_17 = Date.now();
if (c7004_18 !== 0) {
clearInterval(c7004_18);
c7004_18 = 0;
}
if (UserGuildSettingsStore.useNewNotifications) {
const r17 = setInterval;
const r25 = 15 * Durations.Millis.SECOND;
c7004_18 = r17($mk84699(), r25);
}
let c17968_0 = Date.now() - WEEK;
SnowflakeUtils.forEach(c7004_14.channels, (a0, a1) => {
if (a0.lastActionTime < c17968_0) {
delete c7004_14.channels[a1];
}
});
},
MESSAGE_CREATE: function handleMessageCreate(a0) {
if (!a0.optimistic && !a0.isPushNotification) {
if (a0.message.author?.id !== AuthenticationStore.getId()) {
return false;
}
if (shouldTrackChannel(a0.channelId)) {
const channelId2 = a0.channelId;
if (!(channelId2 in c7004_14.channels)) {
c7004_14.channels[channelId2] = {
lastActionTime: 0,
viewDuration: 0,
numSends: 0
};
}
const r25 = c7004_14.channels[channelId2];
r25.lastActionTime = Date.now();
r25.numSends = r25.numSends + 1;
return void 0;
}
return false;
}
return false;
}
});
export default c7004_21;
@@ -0,0 +1,58 @@
// Metro module 10459 (f10460).
import { View } from "react-native";
import { ChannelNotificationSettingsFlags } from "../../../user_settings/UserSettingsConstants";
import { createStyles } from "../../../../design/components/Styles/native/createStyles";
import Module712 from "../../../../_bundle/Module712";
import UnreadSettingNoticeImpressionTracking from "../UnreadSettingNoticeImpressionTracking";
import { Text } from "../../../../design/components/Text/native/Text";
import { intl, t } from "../../../../intl/index.native";
import { PressableOpacity } from "../../../../design/void/Pressables/native/Pressables";
import updateChannelUnreadSettings from "../utils/updateChannelUnreadSettings";
const useStyles = createStyles({
content: {
display: "flex",
flexDirection: "row",
paddingVertical: Module712.space.PX_12,
paddingHorizontal: Module712.space.PX_16,
borderBottomWidth: 1,
borderBottomColor: Module712.colors.BORDER_SUBTLE,
backgroundColor: Module712.colors.BACKGROUND_BASE_LOW,
...Module712.shadows.SHADOW_LOW
},
informations: {
flex: 1
},
actions: {
display: "flex",
flexDirection: "row",
alignItems: "center",
marginLeft: 16
},
inlineTextWithIcon: {
display: "flex",
flexDirection: "row",
alignItems: "center"
}
});
export default function UnreadSettingNoticeConnected(props) {
let c17972_0 = props;
const styles = useStyles();
return <View style={styles.content}>
<UnreadSettingNoticeImpressionTracking id={props.channel.id} />
<View style={styles.informations}>
<Text variant="text-md/semibold">
{intl.string(t.i4xQ5o)}
</Text>
</View>
<View style={styles.actions}>
<PressableOpacity accessibilityRole="button" style={styles.inlineTextWithIcon} onPress={() => {
updateChannelUnreadSettings(c17972_0.channel.guild_id, c17972_0.channel.id, ChannelNotificationSettingsFlags.UNREADS_ONLY_MENTIONS);
c17972_0.clearUnreadsNotice();
}}>
<Text variant="text-xs/medium" color="text-link">
{intl.string(t.KyUKhT)}
</Text>
</PressableOpacity>
</View>
</View>;
};
@@ -0,0 +1,15 @@
// Metro module 10461 (f10462).
import UserGuildSettingsStore from "../../../../stores/UserGuildSettingsStore";
import { AnalyticsObjects } from "../../../../Constants";
import { UnreadSetting } from "../../../read_states/ReadStateConstants";
import { ChannelNotificationSettingsFlags } from "../../../user_settings/UserSettingsConstants";
import NotificationSettingsModalActionCreators from "../../../../actions/NotificationSettingsModalActionCreators";
import { withChannelUnreadFlags } from "../../settings/utils/notificationSettingsFlagUtils";
import { NotificationLabel } from "../../../../utils/NotificationSettingsUtils";
export default function updateChannelUnreadSettings(a0, a1, a2) {
NotificationSettingsModalActionCreators.updateChannelOverrideSettings(a0, a1, {
flags: withChannelUnreadFlags(UserGuildSettingsStore.getChannelIdFlags(a0, a1), a2)
}, NotificationLabel.unreads(a2 === ChannelNotificationSettingsFlags.UNREADS_ALL_MESSAGES ? UnreadSetting.ALL_MESSAGES : UnreadSetting.ONLY_MENTIONS), {
object: AnalyticsObjects.NOTIFICATION_SETTING_UNREAD_NOTICE
});
};
@@ -0,0 +1,22 @@
// Metro module 10455 (f10456).
import { useState, useEffect, useCallback } from "react";
import { CHANNEL_ELIGIBLE_FOR_UNREAD_SETTING } from "../../../../records/ChannelRecord";
import { useShouldUseNewNotificationSystem } from "../../NotificationUtils";
import { useStateFromStores } from "../../../../_bundle/Module589";
import UnreadSettingNoticeStore2 from "../UnreadSettingNoticeStore2";
export default function useUnreadSettingNotice(a0) {
const shouldUseNewNotificationSystem = useShouldUseNewNotificationSystem("useShouldRenderBanner");
const [state, setState] = useState("");
useEffect(() => {
setState("");
}, [a0.id]);
useEffect(() => {
if (CHANNEL_ELIGIBLE_FOR_UNREAD_SETTING.has(a0.type) && state !== a0.id && shouldUseNewNotificationSystem && UnreadSettingNoticeStore2.maybeAutoUpgradeChannel(a0.id)) {
setState(a0.id);
}
}, [state, shouldUseNewNotificationSystem, useStateFromStores([UnreadSettingNoticeStore2], () => UnreadSettingNoticeStore2.getLastActionTime(a0.id)), a0]);
return {
showUnreadsNotice: state === a0.id,
clearUnreadsNotice: useCallback(() => setState(""), [])
};
};
@@ -0,0 +1,12 @@
// Metro module 14475 (f14476).
import { NotificationSettingsUpdateType } from "../NotificationConstants";
import { AnalyticEvents } from "../../../Constants";
import { EnableSummaryReminderNotifications } from "../../user_settings/UserSettings";
import AnalyticsUtils from "../../../utils/AnalyticsUtils";
export function onSummaryReminderNotificationSettingsChanged(a0) {
EnableSummaryReminderNotifications.updateSetting(a0);
AnalyticsUtils.track(AnalyticEvents.NOTIFICATION_SETTINGS_UPDATED, {
update_type: NotificationSettingsUpdateType.ACCOUNT,
summary_reminder_notifications: a0
});
}
@@ -0,0 +1,31 @@
// Metro module 14472 (f14473).
import { createApexExperiment } from "../../experiments/apex/index";
const apexExperiment = createApexExperiment({
kind: "user",
name: "2026-04-upcoming-server-event",
defaultConfig: {
showSettingsToggle: false
},
variations: {
1: {
showSettingsToggle: true
},
2: {
showSettingsToggle: true
},
3: {
showSettingsToggle: true
}
}
});
export default apexExperiment;
export function useUpcomingServerEventExperiment(a0) {
return apexExperiment.useConfig({
location: a0
});
}
export function isEligibleForUpcomingServerEventNotifications(a0) {
return apexExperiment.getConfig({
location: a0
}).showSettingsToggle;
}
@@ -0,0 +1,12 @@
// Metro module 14473 (f14474).
import { NotificationSettingsUpdateType } from "../NotificationConstants";
import { AnalyticEvents } from "../../../Constants";
import { EnableUpcomingServerEventNotifications } from "../../user_settings/UserSettings";
import AnalyticsUtils from "../../../utils/AnalyticsUtils";
export function onUpcomingServerEventNotificationSettingsChanged(a0) {
EnableUpcomingServerEventNotifications.updateSetting(a0);
AnalyticsUtils.track(AnalyticEvents.NOTIFICATION_SETTINGS_UPDATED, {
update_type: NotificationSettingsUpdateType.ACCOUNT,
upcoming_server_event_notifications: a0
});
}