Files
2026-07-28 01:06:53 +03:00

1299 lines
79 KiB
TypeScript

/* Metro module 10905; source: stores/native/InAppNotificationStore.tsx; dependencies: [15, 17, 18, 6, 7, 1378, 4606, 10906, 6611, 5116, 1348, 1379, 1867, 10907, 4605, 1934, 1373, 1878, 661, 8277, 8275, 3738, 22, 10908, 10910, 5087, 5216, 10911, 10684, 4625, 10919, 672, 10920, 10921, 10915, 10923, 10927, 4246, 10928, 3829, 1314, 10929, 5188, 10930, 4863, 21, 566, 694, 2] */
import ClassCallCheck from '../../by-id/module-00006-ClassCallCheck.js'; /* Metro dependency 6 */
import CreateClass from '../../by-id/module-00007-CreateClass.js'; /* Metro dependency 7 */
import PossibleConstructorReturn from '../../by-id/module-00015-PossibleConstructorReturn.js'; /* Metro dependency 15 */
import Module00017 from '../../by-id/module-00017.js'; /* Metro dependency 17 */
import Inherits from '../../by-id/module-00018-Inherits.js'; /* Metro dependency 18 */
import Flux from '../../external/discord_common/js/packages/flux/index.tsx'; /* Metro dependency 566 */
import UserSettingsProtoStore from '../../modules/user_settings/UserSettingsProtoStore.tsx'; /* Metro dependency 1348 */
import UserRequiredActionStore from '../UserRequiredActionStore.tsx'; /* Metro dependency 1373 */
import EmbeddedActivitiesStore from '../../modules/activities/EmbeddedActivitiesStore.tsx'; /* Metro dependency 1378 */
import ChannelStore from '../ChannelStore.tsx'; /* Metro dependency 1379 */
import GuildStore from '../GuildStore.tsx'; /* Metro dependency 1867 */
import UserStore from '../UserStore.tsx'; /* Metro dependency 1878 */
import SelectedChannelStore from '../SelectedChannelStore.tsx'; /* Metro dependency 1934 */
import ReadStateStore from '../ReadStateStore.tsx'; /* Metro dependency 4605 */
import ChannelRTCStore from '../../modules/calls/ChannelRTCStore.tsx'; /* Metro dependency 4606 */
import AppAnalyticsUtils from '../../modules/app_analytics/AppAnalyticsUtils.tsx'; /* Metro dependency 4863 */
import FamilyCenterStore from '../../modules/parent_tools/FamilyCenterStore.tsx'; /* Metro dependency 5116 */
import GuildIncidentsStore from '../../modules/guild_antiraid/GuildIncidentsStore.tsx'; /* Metro dependency 10906 */
import NotificationSettingsStore from '../NotificationSettingsStore.tsx'; /* Metro dependency 10907 */
import InAppNotificationActionCreators from '../../actions/native/InAppNotificationActionCreators.tsx'; /* Metro dependency 10920 */
import ForLaterExperiment from '../../modules/saved_messages/ForLaterExperiment.tsx'; /* Metro dependency 10929 */
import * as FileImportTrackerModule from '../../by-id/module-00002-FileImportTracker.js'; /* Metro dependency 2 */
import * as ConstantsModule from '../../Constants.tsx'; /* Metro dependency 661 */
import * as Preloaded_user_settingsModule from '../../external/discord_common/js/packages/protos/discord_protos/discord_users/v1/preloaded_user_settings.tsx'; /* Metro dependency 1314 */
import * as FamilyCenterV3ExperimentModule from '../../modules/parent_tools/FamilyCenterV3Experiment.tsx'; /* Metro dependency 5188 */
import * as LastMentionTimestampStoreModule from '../../modules/notifications/LastMentionTimestampStore.tsx'; /* Metro dependency 6611 */
import * as GuildAntiRaidUtilsModule from '../../modules/guild_antiraid/GuildAntiRaidUtils.tsx'; /* Metro dependency 8275 */
import * as GuildAntiRaidTypesModule from '../../modules/guild_antiraid/GuildAntiRaidTypes.tsx'; /* Metro dependency 8277 */
import * as RestrictedScheduleNotificationUtilsModule from '../../modules/parent_tools/RestrictedScheduleNotificationUtils.tsx'; /* Metro dependency 10908 */
import * as MessageUtilsModule from '../../modules/messages/MessageUtils.tsx'; /* Metro dependency 10910 */
import * as NotificationTextUtilsModule from '../../modules/notifications/NotificationTextUtils.tsx'; /* Metro dependency 10911 */
import * as InAppNotificationUtilsModule from '../../modules/in_app_notifications/InAppNotificationUtils.tsx'; /* Metro dependency 10921 */
import * as PlayInAppMessageSoundModule from '../../modules/notifications/native/playInAppMessageSound.tsx'; /* Metro dependency 10930 */
function _fun83470(global, require, importDefault, importAll, module, exports, dependencyMap) { // fn#83470, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:11091:6, offset: 0x01f1bf38, size: 923 bytes, params: 8, frame: 21
const env0_0 = require;
const _arrayLikeToArray_83476 = function(a0, a1) {
var r0;
var r1;
var r2;
var value3;
var length;
var value5;
var value = undefined;
var value2 = value == null;
reducibleJoin2: while (true) {
if (value2) {
r0 = value2;
break reducibleJoin2;
}
value3 = value > a0.length;
r0 = value3;
break reducibleJoin2;
}
reducibleJoin4: while (true) {
if (r0) {
length = a0.length;
r1 = length;
break reducibleJoin4;
}
r1 = value;
break reducibleJoin4;
}
value = (0, global.Array)(r1);
var value4 = 0;
if (value4 < r1) {
r2 = value4;
reducibleLoop5: while (true) {
value[r2] = a0[r2];
value5 = typeof r2 === 'bigint' ? r2 + 1n : +r2 + 1;
if (value5 < r1) {
r2 = value5;
continue reducibleLoop5;
}
break reducibleLoop5;
}
}
return value;
};
const GUILD_UPDATE_834772 = GUILD_UPDATE_83477;
const ENQUEUE_IN_APP_NOTIFICATION2 = ENQUEUE_IN_APP_NOTIFICATION;
const Object = global.Object;
Object.defineProperty(exports, '__esModule', {value: true});
let value = FamilyCenterStore;
let value5 = new _fun83484()();
const value9 = new _fun83489()();
const env0_28 = value.isCurrentUserInRestrictedHours();
let env0_30 = (RestrictedScheduleNotificationUtilsModule).EMPTY_SCHEDULE_SNAPSHOT;
const Store = (Flux).Store;
_fun83495(Store).displayName = 'InAppNotificationStore';
value = new value(importDefault(694) /* metro dependency 694: Dispatcher */, {POST_CONNECTION_OPEN: function() {
env0_29 = true;
env0_30 = require(dependencyMap[23]).toScheduleSnapshot(getCurrentRestrictedSchedule());
GUILD_UPDATE_83477();
}, LOGOUT: LOGOUT_83500, GUILD_UPDATE: GUILD_UPDATE_834772, MESSAGE_CREATE: MESSAGE_CREATE_83502,
MESSAGE_ACK: MESSAGE_ACK_83504, REACTION_NOTIFICATION_SENT: REACTION_NOTIFICATION_SENT,
MESSAGE_REMINDER_DUE: MESSAGE_REMINDER_DUE, RESTRICTED_HOURS_WARNING: RESTRICTED_HOURS_WARNING,
RESTRICTED_HOURS_STATE_CHANGE: RESTRICTED_HOURS_STATE_CHANGE, THREAD_CREATE: THREAD_CREATE_83515,
CLEAR_IN_APP_NOTIFICATION: function() {
env0_26 = null;
showNextNotification();
}, ENQUEUE_IN_APP_NOTIFICATION: ENQUEUE_IN_APP_NOTIFICATION2, CHANNEL_SELECT: CHANNEL_SELECT_83518,
CHANNEL_RTC_UPDATE_CHAT_OPEN: CHANNEL_RTC_UPDATE_CHAT_OPEN_83520,
USER_SETTINGS_PROTO_UPDATE: USER_SETTINGS_PROTO_UPDATE_83522, CURRENT_USER_UPDATE: CURRENT_USER_UPDATE_83524});
(FileImportTrackerModule).fileFinishedImporting('stores/native/InAppNotificationStore.tsx');
exports.default = value;
function _isNativeReflectConstruct_83471() { // fn#83471, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:11091:420, offset: 0x01f1c2d3, size: 98 bytes, params: 1, frame: 18
var Boolean;
var prototype;
var valueOf;
var call;
var Reflect;
var construct;
var closure;
var value;
var error;
try {
Boolean = global.Boolean;
prototype = Boolean.prototype;
valueOf = prototype.valueOf;
call = valueOf.call;
Reflect = global.Reflect;
construct = Reflect.construct;
Boolean = global.Boolean;
closure = function() {
};
value = Reflect.apply(construct, Reflect, [Boolean, [], closure]);
value = Reflect.apply(call, valueOf, [value]);
var result = !value;
} catch (error) {
}
return (_isNativeReflectConstruct_83471_isNativeReflectConstruct = function() {
return !!result;
})();
}
function _createForOfIteratorHelperLoose_83474(a0, a1) { // fn#83474, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:11091:613, offset: 0x01f1c335, size: 372 bytes, params: 3, frame: 20
var r6;
var r9;
var r5;
var value3;
var regexp;
const env0_0 = a0;
const Symbol = global.Symbol;
let value = typeof Symbol !== 'undefined';
let r1 = value && a0[global.Symbol.iterator];
r1 = !r1 ? a0['@@iterator'] : r1;
if (r1) {
value = r1.call(a0);
return value.next.bind(value);
}
const Array = global.Array;
if (Array.isArray(a0)) {
if (r1) {
}
return _fun83475;
}
value = undefined;
if (a0) {
if (typeof a0 === 'string') {
value = _arrayLikeToArray_83476(a0, value);
r5 = value;
} else {
value3 = ({}).toString.call(a0).slice(8, -1);
r6 = value3 === 'Object' && a0.constructor;
r9 = r6 ? a0.constructor.name : value3;
if (r9 === 'Map') {
r6 = global.Array.from(a0);
} else if (r9 === 'Set') {
r6 = global.Array.from(a0);
} else if (r9 === 'Arguments') {
value = _arrayLikeToArray_83476(a0, value);
r6 = value;
} else {
regexp = RegExp('^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$', '');
if (regexp.test(r9)) {
value = _arrayLikeToArray_83476(a0, value);
r6 = value;
} else {
r6 = value;
}
}
r5 = r6;
}
} else {
r5 = value;
}
if (r5) {
if (r5) {
}
return _fun83475;
}
const TypeError = global.TypeError;
throw new TypeError('Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.');
function _fun83475() { // fn#83475, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:11091:1184, offset: 0x00c39d73, size: 69 bytes, params: 1, frame: 5
return env0_1 >= env0_0.length ? {done: true} : {done: false,
value: env0_0[typeof env0_1 === 'bigint' ? env0_1 : +env0_1]};
}
}
function GUILD_UPDATE_83477() { // fn#83477, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:11091:3042, offset: 0x01f1c4a9, size: 392 bytes, params: 1, frame: 22
var r2;
var r1;
var r0;
var shouldShowRaidInAppNotification2;
var show;
var guildId;
var guild;
var channel;
var value5;
var value7;
var value8;
var object2;
const value2 = undefined;
if (NotificationTextUtilsModule.allowInAppNotifications()) {
shouldShowRaidInAppNotification2 = (require(10923) /* metro dependency 10923: GuildAntiRaidHooks */).shouldShowRaidInAppNotification();
show = shouldShowRaidInAppNotification2.show;
guildId = shouldShowRaidInAppNotification2.guildId;
if (show) {
if (guildId == null) {
return false;
}
guild = GuildStore.getGuild(guildId);
if (guild == null) {
return false;
}
channel = ChannelStore.getChannel((importDefault(10927) /* metro dependency 10927: getGuildSafetyAlertsChannelId */)(guild));
value5 = channel != null;
if (value5) {
value7 = SelectedChannelStore.getChannelId() !== channel.id;
if (value7) {
value8 = env0_25.wasRecentlyDismissed({guild: guild, channel: channel});
if (value8) {
r2 = !value8;
} else {
object2 = {};
object2.type = InAppNotificationTypes.ALERT;
object2.key = guildId;
object2.duration = 30 * (importDefault(672) /* metro dependency 672: Durations */).Millis.SECOND;
object2.onDismiss = onDismiss_83478;
object2.channel = channel;
object2.guild = guild;
object2.inAppNotificationId = (require(10921) /* metro dependency 10921: InAppNotificationUtils */).generateInAppNotificationId();
ENQUEUE_IN_APP_NOTIFICATION({notification: object2});
r2 = value2;
}
r1 = r2;
} else {
r1 = value7;
}
r0 = r1;
} else {
r0 = value5;
}
return r0;
}
}
return false;
function GUILD_UPDATE_83477OnDismiss() { // fn#83478, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:11091:3487, owner: GUILD_UPDATE_83477.onDismiss, offset: 0x01f1c631, size: 73 bytes, params: 1, frame: 14
(InAppNotificationActionCreators).clearNotification();
env1_25.dismissNotification({guild: env0_0, channel: env0_1});
}
}
function getCurrentRestrictedSchedule() { // fn#83479, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:11091:3648, offset: 0x01f1c67a, size: 66 bytes, params: 1, frame: 12
const currentUser = UserStore.getCurrentUser();
const value2 = null;
const restrictedSchedule = value2 == currentUser ? undefined : currentUser.restrictedSchedule;
return value2 == restrictedSchedule || restrictedSchedule.rules.length === 0 ? value2 : restrictedSchedule;
}
function ENQUEUE_IN_APP_NOTIFICATION({notification}) { // fn#83480, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:11091:3795, offset: 0x01f1c6bc, size: 223 bytes, params: 2, frame: 22
if (env0_28) {
trackDismissed(notification, 'restricted_hours');
return false;
}
const {guildId, channelId,
messageId} = (InAppNotificationUtilsModule).extractGuildAndChannelAndMessageIdFromNotification(notification);
const defaultImport = AppAnalyticsUtils;
const trackWithMetadata = defaultImport.trackWithMetadata;
const IN_APP_NOTIFICATION_CREATED = AnalyticEvents.IN_APP_NOTIFICATION_CREATED;
Reflect.apply(trackWithMetadata, defaultImport, [IN_APP_NOTIFICATION_CREATED, {type: notification.type,
guild_id: guildId, channel_id: channelId, in_app_notification_id: notification.inAppNotificationId,
message_id: messageId}]);
env0_27.enqueue(notification);
(PlayInAppMessageSoundModule).playInAppMessageSound(notification);
if (env0_26 == null) {
showNextNotification();
}
}
function trackDismissed(a0, a1) { // fn#83481, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:11091:4274, offset: 0x01f1c79b, size: 137 bytes, params: 3, frame: 19
const {guildId, channelId,
messageId} = (InAppNotificationUtilsModule).extractGuildAndChannelAndMessageIdFromNotification(a0);
const defaultImport = AppAnalyticsUtils;
const trackWithMetadata = defaultImport.trackWithMetadata;
const IN_APP_NOTIFICATION_DISMISSED = AnalyticEvents.IN_APP_NOTIFICATION_DISMISSED;
Reflect.apply(trackWithMetadata, defaultImport, [IN_APP_NOTIFICATION_DISMISSED, {type: a0.type, guild_id: guildId,
channel_id: channelId, message_id: messageId, dismiss_reason: a1,
in_app_notification_id: a0.inAppNotificationId}]);
}
function showNextNotification() { // fn#83482, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:11091:4586, offset: 0x01f1c824, size: 27 bytes, params: 1, frame: 10
env0_26 = env0_27.tryDrain();
}
function rejectNotifications(a0) { // fn#83483, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:11091:4633, offset: 0x01f1c83f, size: 85 bytes, params: 2, frame: 13
env0_27.removeAll(a0);
if (env0_26 == null) {
if (env0_26 != null) {
return false;
}
showNextNotification();
} else {
if (a0(env0_26)) {
env0_26 = null;
showNextNotification();
return true;
}
if (env0_26 != null) {
return false;
}
showNextNotification();
}
return true;
}
function _fun83484() { // fn#83484, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:11091:1533, offset: 0x01f1c894, size: 111 bytes, params: 1, frame: 15
return CreateClass(AlertDismissalHandler, [{key: 'key', value: function({guild, channel}) {
guild = guild.id;
return guild + channel.id;
}}, {key: 'dismissNotification', value: value_83487}, {key: 'wasRecentlyDismissed', value: value_83488}]);
function AlertDismissalHandler() { // fn#83485, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:11091:1554, offset: 0x01f1c903, size: 172 bytes, params: 1, frame: 19
const value = environment.__proto__;
env1_6(this, AlertDismissalHandler);
const object = {};
const GuildIncidentAlertTypes = (GuildAntiRaidTypesModule).GuildIncidentAlertTypes;
const JOIN_RAID = GuildIncidentAlertTypes.JOIN_RAID;
let Map = global.Map;
object[JOIN_RAID] = new Map();
const DM_RAID = GuildIncidentAlertTypes.DM_RAID;
Map = global.Map;
object[DM_RAID] = new Map();
this.dissmissedAlertsMap = object;
this.threshold = {'amount': 1, 'unitOfTime': 'hour'};
}
function value_83487({guild, channel}) { // fn#83487, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:11091:1896, offset: 0x01f1c9cc, size: 145 bytes, params: 2, frame: 19
const getIncidentAlertType = GuildAntiRaidUtilsModule.getIncidentAlertType;
const guildIncidentsStoreBinding = GuildIncidentsStore;
const getGuildIncident = guildIncidentsStoreBinding.getGuildIncident;
const value2 = Reflect.apply(getIncidentAlertType, GuildAntiRaidUtilsModule, [Reflect.apply(getGuildIncident,
guildIncidentsStoreBinding, [guild.id])]);
if (value2 != null) {
this.dissmissedAlertsMap[value2].set(this.key({guild: guild, channel: channel}),
(importDefault(3738) /* metro dependency 3738 */)());
}
}
function value_83488({guild, channel}) { // fn#83488, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:11091:2120, offset: 0x01f1ca5d, size: 212 bytes, params: 2, frame: 19
var r0;
var diff;
var value6;
var threshold;
let value = environment.__proto__;
const getIncidentAlertType = GuildAntiRaidUtilsModule.getIncidentAlertType;
const guildIncidentsStoreBinding = GuildIncidentsStore;
const getGuildIncident = guildIncidentsStoreBinding.getGuildIncident;
const value2 = Reflect.apply(getIncidentAlertType, GuildAntiRaidUtilsModule, [Reflect.apply(getGuildIncident,
guildIncidentsStoreBinding, [guild.id])]);
if (value2 == null) {
return false;
}
const value4 = this.dissmissedAlertsMap[value2].get(this.key({guild: guild, channel: channel}));
const value5 = value4 !== undefined;
if (value5) {
value = (importDefault(3738) /* metro dependency 3738 */)();
diff = value.diff;
value6 = (importDefault(3738) /* metro dependency 3738 */)(value4);
threshold = this.threshold;
value = Reflect.apply(diff, value, [value6, threshold.unitOfTime]);
threshold = this.threshold;
value = value < threshold.amount;
r0 = value;
} else {
r0 = value5;
}
return r0;
}
}
function _fun83489() { // fn#83489, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:11091:2423, offset: 0x01f1cb31, size: 138 bytes, params: 1, frame: 15
return CreateClass(NotificationQueue, [{key: 'enqueue', value: value_83491}, {key: 'tryDrain', value: function() {
return this.queue.shift();
}}, {key: 'isFull', value: function() {
return this.queue.length >= 2;
}}, {key: 'removeAll', value: function(a0) {
var r2;
var value4;
var value2 = _createForOfIteratorHelperLoose_83474(importDefault(dependencyMap[22]).remove(this.queue, a0));
var value3 = value2();
if (!value3.done) {
for (r2 = value3; true; r2 = value4) {
trackDismissed(r2.value, 'rejected_from_queue');
value4 = value2();
if (value4.done) {
break;
}
}
}
}}]);
function NotificationQueue() { // fn#83490, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:11091:2444, offset: 0x01f1cbbb, size: 37 bytes, params: 1, frame: 13
env1_6(this, NotificationQueue);
this.queue = [];
}
function value_83491(a0) { // fn#83491, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:11091:2537, offset: 0x01f1cbe0, size: 84 bytes, params: 2, frame: 14
var value;
var value2;
if (this.isFull()) {
value = this.queue.shift();
if (value != null) {
value2 = environment.__proto__;
trackDismissed(value, 'evicted_from_queue');
}
}
this.queue.push(a0);
}
}
function _fun83495(a0) { // fn#83495, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:11091:4790, offset: 0x01f1cccc, size: 99 bytes, params: 2, frame: 16
const InAppNotificationStore2 = InAppNotificationStore;
Inherits(InAppNotificationStore2, a0);
return CreateClass(InAppNotificationStore2, [{key: 'initialize', value: function() {
var channelRTCStoreBinding = ChannelRTCStore;
var channelStoreBinding = ChannelStore;
var embeddedActivitiesStoreBinding = EmbeddedActivitiesStore;
var familyCenterStoreBinding = familyCenterStore;
var guildIncidentsStoreBinding = GuildIncidentsStore;
this.waitFor(channelRTCStoreBinding, channelStoreBinding, embeddedActivitiesStoreBinding,
familyCenterStoreBinding,
guildIncidentsStoreBinding, GuildStore, NotificationSettingsStore, ReadStateStore, SelectedChannelStore,
UserRequiredActionStore, UserSettingsProtoStore, UserStore);
this.syncWith([guildIncidentsStoreBinding], GUILD_UPDATE_83477);
}}, {key: 'getCurrentNotification', value: value_83498}]);
function InAppNotificationStore() { // fn#83496, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:11091:4802, offset: 0x01f1cd2f, size: 113 bytes, params: 1, frame: 20
const value = environment.__proto__;
env1_6(this, InAppNotificationStore);
const value3 = env1_4(InAppNotificationStore);
return env1_3(this, _isNativeReflectConstruct_83471() ? global.Reflect.construct(value3, arguments,
env1_4(this).constructor) : value3.apply(this, arguments));
}
function value_83498() { // fn#83498, offset: 0x00df3adf, size: 9 bytes, params: 1, frame: 1
return env1_26;
}
}
function LOGOUT_83500() { // fn#83500, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:11091:5511, offset: 0x01f1ce42, size: 73 bytes, params: 1, frame: 12
env0_30 = (require(10908) /* metro dependency 10908: RestrictedScheduleNotificationUtils */).EMPTY_SCHEDULE_SNAPSHOT;
env0_27.removeAll(function() {
return true;
});
}
function MESSAGE_CREATE_83502({message, optimistic}) { // fn#83502, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:11091:5653, offset: 0x01f1ce8b, size: 643 bytes, params: 2, frame: 20
var moduleValue2;
var SELF_MENTIONABLE_SYSTEM;
var moduleValue3;
var defaultImport;
var channelRTCStoreBinding;
var shouldIncludeSelectedChannel2;
var moduleValue5;
var channelStoreBinding;
var channel;
var messageRecord;
var moduleValue7;
var object2;
var guildStoreBinding;
var id;
var readStateStoreBinding;
var getMentionCount;
const channel_id = message.channel_id;
if (MessageUtilsModule.canViewPotentiallyNSFWChannel(channel_id)) {
moduleValue2 = require(5087) /* metro dependency 5087: SpoilerChannelUtils */;
if (moduleValue2.shouldShowSpoilerGateForChannelId(channel_id)) {
return false;
}
if ((importDefault(5216) /* metro dependency 5216: isSystemMessage */)(message)) {
SELF_MENTIONABLE_SYSTEM = MessageTypesSets.SELF_MENTIONABLE_SYSTEM;
if (SELF_MENTIONABLE_SYSTEM.has(message.type)) {
if (optimistic) {
return false;
}
moduleValue3 = require(10911) /* metro dependency 10911: NotificationTextUtils */;
if (moduleValue3.allowInAppNotifications()) {
defaultImport = importDefault(10684) /* metro dependency 10684: ExternalPipAndroid */;
if (defaultImport.isEnabled()) {
return false;
}
channelRTCStoreBinding = ChannelRTCStore;
if (channelRTCStoreBinding.getChatOpen(channel_id)) {
return false;
}
shouldIncludeSelectedChannel2 = (require(10911) /* metro dependency 10911: NotificationTextUtils */).shouldIncludeSelectedChannel();
moduleValue5 = require(10911) /* metro dependency 10911: NotificationTextUtils */;
if (moduleValue5.shouldNotify(message, channel_id, shouldIncludeSelectedChannel2)) {
channel = ChannelStore.getChannel(channel_id);
if (channel == null) {
return false;
}
messageRecord = (require(4625) /* metro dependency 4625: MessageRecordUtils */).createMessageRecord(message);
moduleValue7 = require(10919) /* metro dependency 10919: useFormattedMessagePreview */;
if (moduleValue7.isMessageContentPreviewable(messageRecord)) {
trackMessageNotificationTimestamps(message, channel.guild_id);
object2 = {};
object2.type = InAppNotificationTypes.MESSAGE;
guildStoreBinding = GuildStore;
object2.guild = guildStoreBinding.getGuild(channel.getGuildId());
object2.channel = channel;
object2.message = messageRecord;
id = messageRecord.id;
object2.key = id;
object2.duration = 5 * (importDefault(672) /* metro dependency 672: Durations */).Millis.SECOND;
object2.onDismiss = onDismiss_83503;
channelStoreBinding = ChannelStore;
object2.parentChannel = channelStoreBinding.getChannel(channel.parent_id);
object2.inAppNotificationId = (require(10921) /* metro dependency 10921: InAppNotificationUtils */).generateInAppNotificationId();
readStateStoreBinding = ReadStateStore;
getMentionCount = readStateStoreBinding.getMentionCount;
id = channel.id;
object2.mentionCount = Reflect.apply(getMentionCount, readStateStoreBinding, [id]);
ENQUEUE_IN_APP_NOTIFICATION({notification: object2});
return undefined;
}
return false;
}
return false;
}
return false;
}
return false;
}
if (optimistic) {
return false;
}
moduleValue3 = require(10911) /* metro dependency 10911: NotificationTextUtils */;
if (moduleValue3.allowInAppNotifications()) {
defaultImport = importDefault(10684) /* metro dependency 10684: ExternalPipAndroid */;
if (defaultImport.isEnabled()) {
return false;
}
channelRTCStoreBinding = ChannelRTCStore;
if (channelRTCStoreBinding.getChatOpen(channel_id)) {
return false;
}
shouldIncludeSelectedChannel2 = (require(10911) /* metro dependency 10911: NotificationTextUtils */).shouldIncludeSelectedChannel();
moduleValue5 = require(10911) /* metro dependency 10911: NotificationTextUtils */;
if (moduleValue5.shouldNotify(message, channel_id, shouldIncludeSelectedChannel2)) {
channel = ChannelStore.getChannel(channel_id);
if (channel == null) {
return false;
}
messageRecord = (require(4625) /* metro dependency 4625: MessageRecordUtils */).createMessageRecord(message);
moduleValue7 = require(10919) /* metro dependency 10919: useFormattedMessagePreview */;
if (moduleValue7.isMessageContentPreviewable(messageRecord)) {
trackMessageNotificationTimestamps(message, channel.guild_id);
object2 = {};
object2.type = InAppNotificationTypes.MESSAGE;
guildStoreBinding = GuildStore;
object2.guild = guildStoreBinding.getGuild(channel.getGuildId());
object2.channel = channel;
object2.message = messageRecord;
id = messageRecord.id;
object2.key = id;
object2.duration = 5 * (importDefault(672) /* metro dependency 672: Durations */).Millis.SECOND;
object2.onDismiss = onDismiss_83503;
channelStoreBinding = ChannelStore;
object2.parentChannel = channelStoreBinding.getChannel(channel.parent_id);
object2.inAppNotificationId = (require(10921) /* metro dependency 10921: InAppNotificationUtils */).generateInAppNotificationId();
readStateStoreBinding = ReadStateStore;
getMentionCount = readStateStoreBinding.getMentionCount;
id = channel.id;
object2.mentionCount = Reflect.apply(getMentionCount, readStateStoreBinding, [id]);
ENQUEUE_IN_APP_NOTIFICATION({notification: object2});
return undefined;
}
return false;
}
return false;
}
}
return false;
function MESSAGE_CREATE_83502OnDismiss() { // fn#83503, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:11091:6403, owner: MESSAGE_CREATE_83502.onDismiss, offset: 0x01f1d10e, size: 37 bytes, params: 1, frame: 11
const value = environment.__proto__;
(InAppNotificationActionCreators).clearNotification();
}
}
function MESSAGE_ACK_83504({channelId, messageId}) { // fn#83504, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:11091:6591, offset: 0x01f1d133, size: 95 bytes, params: 2, frame: 15
const MESSAGE_ACK_83504Predicate2 = MESSAGE_ACK_83504Predicate;
if (env0_26 != null && MESSAGE_ACK_83504Predicate2(env0_26)) {
trackDismissed(env0_26, 'message_acked');
}
return rejectNotifications(MESSAGE_ACK_83504Predicate2);
function MESSAGE_ACK_83504Predicate(a0) { // fn#83505, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:11091:6658, owner: MESSAGE_ACK_83504.predicate, offset: 0x01f1d192, size: 111 bytes, params: 2, frame: 14
const type = a0.type;
let value = environment.__proto__;
const MESSAGE = InAppNotificationTypes.MESSAGE;
let r0 = type === MESSAGE && a0.channel.id === channelId;
if (r0) {
value = importDefault(21) /* metro dependency 21: SnowflakeUtils */;
value = value.compare(a0.message.id, messageId);
value = value <= 0;
r0 = value;
}
return r0;
}
}
function REACTION_NOTIFICATION_SENT({message, route, emoji, reactorUserId}) { // fn#83506, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:11091:6858, offset: 0x01f1d201, size: 942 bytes, params: 2, frame: 26
var r1;
var id;
var id2;
var type;
var r7;
var channelId;
var guildId;
var channelStoreBinding;
var channel;
var currentUser;
var author;
const ReactionNotifications = (require(3829) /* metro dependency 3829: UserSettings */).ReactionNotifications;
const ReactionNotificationType = (Preloaded_user_settingsModule).ReactionNotificationType;
var defaultImport;
var EnableGdmAllReactionNotifications;
var moduleValue3;
var isReactionMilestoneNotification;
var guild;
var user;
var shouldIncludeSelectedChannel2;
var moduleValue5;
var messageRecord;
var moduleValue7;
var object2;
if (message != null) {
var reactions = message.reactions;
if (reactions == null) {
return false;
}
if (emoji == null) {
return false;
}
var value;
var value2 = undefined;
var moduleValue = require(10911) /* metro dependency 10911: NotificationTextUtils */;
if (moduleValue.allowInAppNotifications()) {
r1 = (require(4246) /* metro dependency 4246: LinkUtils */).tryParseChannelPath(route) ?? ({'channelId': null,
'guildId': null});
channelId = r1.channelId;
guildId = r1.guildId;
if (channelId == null) {
return false;
}
if (guildId == null) {
return false;
}
channel = ChannelStore.getChannel(channelId);
if (channel == null) {
return false;
}
currentUser = UserStore.getCurrentUser();
author = message.author;
id = author == null ? value2 : author.id;
id2 = currentUser == null ? value2 : currentUser.id;
type = channel.type;
if (type !== ChannelTypes.GROUP_DM) {
if (ReactionNotifications.getSetting() !== ReactionNotificationType.NOTIFICATIONS_DISABLED) {
type = channel == null ? value2 : channel.type;
r1 = type != null && channel.type === ChannelTypes.GUILD_ANNOUNCEMENT;
moduleValue3 = require(10921) /* metro dependency 10921: InAppNotificationUtils */;
isReactionMilestoneNotification = moduleValue3.isReactionMilestoneNotification;
reactions = message.reactions;
type = channel == null ? value2 : channel.type;
r1 = !r1 ? Reflect.apply(isReactionMilestoneNotification, moduleValue3, [reactions, type]) : r1;
guild = GuildStore.getGuild(guildId);
user = UserStore.getUser(reactorUserId);
if (user != null) {
shouldIncludeSelectedChannel2 = (require(10911) /* metro dependency 10911: NotificationTextUtils */).shouldIncludeSelectedChannel();
moduleValue5 = require(10911) /* metro dependency 10911: NotificationTextUtils */;
if (moduleValue5.shouldNotifyForReaction({message: message, channel: channel, reactor: user,
includeSelectedChannel: shouldIncludeSelectedChannel2})) {
messageRecord = (require(4625) /* metro dependency 4625: MessageRecordUtils */).createMessageRecord(message);
moduleValue7 = require(10919) /* metro dependency 10919: useFormattedMessagePreview */;
if (moduleValue7.isMessageContentPreviewable(messageRecord)) {
r7 = message.reactions.find(_fun83507) ?? value2;
if (r7 != null) {
object2 = {};
object2.type = InAppNotificationTypes.REACTION;
object2.key = channelId;
object2.duration = 5 * (importDefault(672) /* metro dependency 672: Durations */).Millis.SECOND;
object2.onDismiss = onDismiss_83508;
object2.channel = channel;
object2.guild = guild;
object2.user = user;
object2.message = messageRecord;
channelStoreBinding = ChannelStore;
object2.parentChannel = channelStoreBinding.getChannel(channel.parent_id);
object2.reaction = r7;
object2.inAppNotificationId = (require(10921) /* metro dependency 10921: InAppNotificationUtils */).generateInAppNotificationId();
ENQUEUE_IN_APP_NOTIFICATION({notification: object2});
return value2;
}
if (r1) {
object2 = {};
object2.type = InAppNotificationTypes.REACTION;
object2.key = channelId;
object2.duration = 5 * (importDefault(672) /* metro dependency 672: Durations */).Millis.SECOND;
object2.onDismiss = onDismiss_83508;
object2.channel = channel;
object2.guild = guild;
object2.user = user;
object2.message = messageRecord;
channelStoreBinding = ChannelStore;
object2.parentChannel = channelStoreBinding.getChannel(channel.parent_id);
object2.reaction = r7;
object2.inAppNotificationId = (require(10921) /* metro dependency 10921: InAppNotificationUtils */).generateInAppNotificationId();
ENQUEUE_IN_APP_NOTIFICATION({notification: object2});
return value2;
}
return false;
}
return false;
}
return false;
}
if (r1) {
shouldIncludeSelectedChannel2 = (require(10911) /* metro dependency 10911: NotificationTextUtils */).shouldIncludeSelectedChannel();
moduleValue5 = require(10911) /* metro dependency 10911: NotificationTextUtils */;
if (moduleValue5.shouldNotifyForReaction({message: message, channel: channel, reactor: user,
includeSelectedChannel: shouldIncludeSelectedChannel2})) {
messageRecord = (require(4625) /* metro dependency 4625: MessageRecordUtils */).createMessageRecord(message);
moduleValue7 = require(10919) /* metro dependency 10919: useFormattedMessagePreview */;
if (moduleValue7.isMessageContentPreviewable(messageRecord)) {
r7 = message.reactions.find(_fun83507) ?? value2;
if (r7 != null) {
object2 = {};
object2.type = InAppNotificationTypes.REACTION;
object2.key = channelId;
object2.duration = 5 * (importDefault(672) /* metro dependency 672: Durations */).Millis.SECOND;
object2.onDismiss = onDismiss_83508;
object2.channel = channel;
object2.guild = guild;
object2.user = user;
object2.message = messageRecord;
channelStoreBinding = ChannelStore;
object2.parentChannel = channelStoreBinding.getChannel(channel.parent_id);
object2.reaction = r7;
object2.inAppNotificationId = (require(10921) /* metro dependency 10921: InAppNotificationUtils */).generateInAppNotificationId();
ENQUEUE_IN_APP_NOTIFICATION({notification: object2});
return value2;
}
if (r1) {
object2 = {};
object2.type = InAppNotificationTypes.REACTION;
object2.key = channelId;
object2.duration = 5 * (importDefault(672) /* metro dependency 672: Durations */).Millis.SECOND;
object2.onDismiss = onDismiss_83508;
object2.channel = channel;
object2.guild = guild;
object2.user = user;
object2.message = messageRecord;
channelStoreBinding = ChannelStore;
object2.parentChannel = channelStoreBinding.getChannel(channel.parent_id);
object2.reaction = r7;
object2.inAppNotificationId = (require(10921) /* metro dependency 10921: InAppNotificationUtils */).generateInAppNotificationId();
ENQUEUE_IN_APP_NOTIFICATION({notification: object2});
return value2;
}
return false;
}
return false;
}
return false;
}
return false;
}
return false;
}
if (id !== id2) {
defaultImport = importDefault(10928) /* metro dependency 10928: GdmAllReactionNotificationsExperiment */;
if (defaultImport.getConfig({location: 'handleReactionAdd'}).showSettingsToggle) {
EnableGdmAllReactionNotifications = (require(3829) /* metro dependency 3829: UserSettings */).EnableGdmAllReactionNotifications;
if (EnableGdmAllReactionNotifications.getSetting()) {
type = channel == null ? value2 : channel.type;
r1 = type != null && channel.type === ChannelTypes.GUILD_ANNOUNCEMENT;
moduleValue3 = require(10921) /* metro dependency 10921: InAppNotificationUtils */;
isReactionMilestoneNotification = moduleValue3.isReactionMilestoneNotification;
reactions = message.reactions;
type = channel == null ? value2 : channel.type;
r1 = !r1 ? Reflect.apply(isReactionMilestoneNotification, moduleValue3, [reactions, type]) : r1;
guild = GuildStore.getGuild(guildId);
user = UserStore.getUser(reactorUserId);
if (user != null) {
shouldIncludeSelectedChannel2 = (require(10911) /* metro dependency 10911: NotificationTextUtils */).shouldIncludeSelectedChannel();
moduleValue5 = require(10911) /* metro dependency 10911: NotificationTextUtils */;
if (moduleValue5.shouldNotifyForReaction({message: message, channel: channel, reactor: user,
includeSelectedChannel: shouldIncludeSelectedChannel2})) {
messageRecord = (require(4625) /* metro dependency 4625: MessageRecordUtils */).createMessageRecord(message);
moduleValue7 = require(10919) /* metro dependency 10919: useFormattedMessagePreview */;
if (moduleValue7.isMessageContentPreviewable(messageRecord)) {
r7 = message.reactions.find(_fun83507) ?? value2;
if (r7 != null) {
object2 = {};
object2.type = InAppNotificationTypes.REACTION;
object2.key = channelId;
object2.duration = 5 * (importDefault(672) /* metro dependency 672: Durations */).Millis.SECOND;
object2.onDismiss = onDismiss_83508;
object2.channel = channel;
object2.guild = guild;
object2.user = user;
object2.message = messageRecord;
channelStoreBinding = ChannelStore;
object2.parentChannel = channelStoreBinding.getChannel(channel.parent_id);
object2.reaction = r7;
object2.inAppNotificationId = (require(10921) /* metro dependency 10921: InAppNotificationUtils */).generateInAppNotificationId();
ENQUEUE_IN_APP_NOTIFICATION({notification: object2});
return value2;
}
if (r1) {
object2 = {};
object2.type = InAppNotificationTypes.REACTION;
object2.key = channelId;
object2.duration = 5 * (importDefault(672) /* metro dependency 672: Durations */).Millis.SECOND;
object2.onDismiss = onDismiss_83508;
object2.channel = channel;
object2.guild = guild;
object2.user = user;
object2.message = messageRecord;
channelStoreBinding = ChannelStore;
object2.parentChannel = channelStoreBinding.getChannel(channel.parent_id);
object2.reaction = r7;
object2.inAppNotificationId = (require(10921) /* metro dependency 10921: InAppNotificationUtils */).generateInAppNotificationId();
ENQUEUE_IN_APP_NOTIFICATION({notification: object2});
return value2;
}
return false;
}
return false;
}
return false;
}
if (r1) {
shouldIncludeSelectedChannel2 = (require(10911) /* metro dependency 10911: NotificationTextUtils */).shouldIncludeSelectedChannel();
moduleValue5 = require(10911) /* metro dependency 10911: NotificationTextUtils */;
if (moduleValue5.shouldNotifyForReaction({message: message, channel: channel, reactor: user,
includeSelectedChannel: shouldIncludeSelectedChannel2})) {
messageRecord = (require(4625) /* metro dependency 4625: MessageRecordUtils */).createMessageRecord(message);
moduleValue7 = require(10919) /* metro dependency 10919: useFormattedMessagePreview */;
if (moduleValue7.isMessageContentPreviewable(messageRecord)) {
r7 = message.reactions.find(_fun83507) ?? value2;
if (r7 != null) {
object2 = {};
object2.type = InAppNotificationTypes.REACTION;
object2.key = channelId;
object2.duration = 5 * (importDefault(672) /* metro dependency 672: Durations */).Millis.SECOND;
object2.onDismiss = onDismiss_83508;
object2.channel = channel;
object2.guild = guild;
object2.user = user;
object2.message = messageRecord;
channelStoreBinding = ChannelStore;
object2.parentChannel = channelStoreBinding.getChannel(channel.parent_id);
object2.reaction = r7;
object2.inAppNotificationId = (require(10921) /* metro dependency 10921: InAppNotificationUtils */).generateInAppNotificationId();
ENQUEUE_IN_APP_NOTIFICATION({notification: object2});
return value2;
}
if (r1) {
object2 = {};
object2.type = InAppNotificationTypes.REACTION;
object2.key = channelId;
object2.duration = 5 * (importDefault(672) /* metro dependency 672: Durations */).Millis.SECOND;
object2.onDismiss = onDismiss_83508;
object2.channel = channel;
object2.guild = guild;
object2.user = user;
object2.message = messageRecord;
channelStoreBinding = ChannelStore;
object2.parentChannel = channelStoreBinding.getChannel(channel.parent_id);
object2.reaction = r7;
object2.inAppNotificationId = (require(10921) /* metro dependency 10921: InAppNotificationUtils */).generateInAppNotificationId();
ENQUEUE_IN_APP_NOTIFICATION({notification: object2});
return value2;
}
return false;
}
return false;
}
return false;
}
return false;
}
return false;
}
return false;
}
if (ReactionNotifications.getSetting() !== ReactionNotificationType.NOTIFICATIONS_DISABLED) {
type = channel == null ? value2 : channel.type;
r1 = type != null && channel.type === ChannelTypes.GUILD_ANNOUNCEMENT;
moduleValue3 = require(10921) /* metro dependency 10921: InAppNotificationUtils */;
isReactionMilestoneNotification = moduleValue3.isReactionMilestoneNotification;
reactions = message.reactions;
type = channel == null ? value2 : channel.type;
r1 = !r1 ? Reflect.apply(isReactionMilestoneNotification, moduleValue3, [reactions, type]) : r1;
guild = GuildStore.getGuild(guildId);
user = UserStore.getUser(reactorUserId);
if (user != null) {
shouldIncludeSelectedChannel2 = (require(10911) /* metro dependency 10911: NotificationTextUtils */).shouldIncludeSelectedChannel();
moduleValue5 = require(10911) /* metro dependency 10911: NotificationTextUtils */;
if (moduleValue5.shouldNotifyForReaction({message: message, channel: channel, reactor: user,
includeSelectedChannel: shouldIncludeSelectedChannel2})) {
messageRecord = (require(4625) /* metro dependency 4625: MessageRecordUtils */).createMessageRecord(message);
moduleValue7 = require(10919) /* metro dependency 10919: useFormattedMessagePreview */;
if (moduleValue7.isMessageContentPreviewable(messageRecord)) {
r7 = message.reactions.find(_fun83507) ?? value2;
if (r7 != null) {
object2 = {};
object2.type = InAppNotificationTypes.REACTION;
object2.key = channelId;
object2.duration = 5 * (importDefault(672) /* metro dependency 672: Durations */).Millis.SECOND;
object2.onDismiss = onDismiss_83508;
object2.channel = channel;
object2.guild = guild;
object2.user = user;
object2.message = messageRecord;
channelStoreBinding = ChannelStore;
object2.parentChannel = channelStoreBinding.getChannel(channel.parent_id);
object2.reaction = r7;
object2.inAppNotificationId = (require(10921) /* metro dependency 10921: InAppNotificationUtils */).generateInAppNotificationId();
ENQUEUE_IN_APP_NOTIFICATION({notification: object2});
return value2;
}
if (r1) {
object2 = {};
object2.type = InAppNotificationTypes.REACTION;
object2.key = channelId;
object2.duration = 5 * (importDefault(672) /* metro dependency 672: Durations */).Millis.SECOND;
object2.onDismiss = onDismiss_83508;
object2.channel = channel;
object2.guild = guild;
object2.user = user;
object2.message = messageRecord;
channelStoreBinding = ChannelStore;
object2.parentChannel = channelStoreBinding.getChannel(channel.parent_id);
object2.reaction = r7;
object2.inAppNotificationId = (require(10921) /* metro dependency 10921: InAppNotificationUtils */).generateInAppNotificationId();
ENQUEUE_IN_APP_NOTIFICATION({notification: object2});
return value2;
}
return false;
}
return false;
}
return false;
}
if (r1) {
shouldIncludeSelectedChannel2 = (require(10911) /* metro dependency 10911: NotificationTextUtils */).shouldIncludeSelectedChannel();
moduleValue5 = require(10911) /* metro dependency 10911: NotificationTextUtils */;
if (moduleValue5.shouldNotifyForReaction({message: message, channel: channel, reactor: user,
includeSelectedChannel: shouldIncludeSelectedChannel2})) {
messageRecord = (require(4625) /* metro dependency 4625: MessageRecordUtils */).createMessageRecord(message);
moduleValue7 = require(10919) /* metro dependency 10919: useFormattedMessagePreview */;
if (moduleValue7.isMessageContentPreviewable(messageRecord)) {
r7 = message.reactions.find(_fun83507) ?? value2;
if (r7 != null) {
object2 = {};
object2.type = InAppNotificationTypes.REACTION;
object2.key = channelId;
object2.duration = 5 * (importDefault(672) /* metro dependency 672: Durations */).Millis.SECOND;
object2.onDismiss = onDismiss_83508;
object2.channel = channel;
object2.guild = guild;
object2.user = user;
object2.message = messageRecord;
channelStoreBinding = ChannelStore;
object2.parentChannel = channelStoreBinding.getChannel(channel.parent_id);
object2.reaction = r7;
object2.inAppNotificationId = (require(10921) /* metro dependency 10921: InAppNotificationUtils */).generateInAppNotificationId();
ENQUEUE_IN_APP_NOTIFICATION({notification: object2});
return value2;
}
if (r1) {
object2 = {};
object2.type = InAppNotificationTypes.REACTION;
object2.key = channelId;
object2.duration = 5 * (importDefault(672) /* metro dependency 672: Durations */).Millis.SECOND;
object2.onDismiss = onDismiss_83508;
object2.channel = channel;
object2.guild = guild;
object2.user = user;
object2.message = messageRecord;
channelStoreBinding = ChannelStore;
object2.parentChannel = channelStoreBinding.getChannel(channel.parent_id);
object2.reaction = r7;
object2.inAppNotificationId = (require(10921) /* metro dependency 10921: InAppNotificationUtils */).generateInAppNotificationId();
ENQUEUE_IN_APP_NOTIFICATION({notification: object2});
return value2;
}
return false;
}
return false;
}
return false;
}
return false;
}
return false;
}
}
return false;
function _fun83507(a0) { // fn#83507, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:11091:8087, offset: 0x01f1d5af, size: 77 bytes, params: 2, frame: 5
let r0 = a0.emoji.id === emoji.id && emoji.id != null;
r0 = !r0 ? a0.emoji.name === emoji.name : r0;
return r0;
}
function REACTION_NOTIFICATION_SENTOnDismiss() { // fn#83508, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:11091:8285, owner: REACTION_NOTIFICATION_SENT.onDismiss, offset: 0x01f1d10e, size: 37 bytes, params: 1, frame: 11
const value = environment.__proto__;
(InAppNotificationActionCreators).clearNotification();
}
}
function MESSAGE_REMINDER_DUE({savedMessage}) { // fn#83509, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:11091:8491, offset: 0x01f1d5fc, size: 315 bytes, params: 2, frame: 20
var channelStoreBinding;
var getChannel;
var saveData;
var channelId;
var value2;
var value3;
var object2;
const defaultImport = ForLaterExperiment;
const getConfig = defaultImport.getConfig;
if (Reflect.apply(getConfig, defaultImport, [{location: 'inAppNotificationStore'}]).enabled) {
if (savedMessage.message != null) {
channelStoreBinding = ChannelStore;
getChannel = channelStoreBinding.getChannel;
saveData = savedMessage.saveData;
channelId = saveData.channelId;
value2 = Reflect.apply(getChannel, channelStoreBinding, [channelId]);
if (value2 != null) {
saveData = savedMessage.saveData;
channelId = saveData.channelId;
saveData = savedMessage.saveData;
value3 = '' + channelId + '-' + saveData.messageId;
object2 = {};
object2.type = InAppNotificationTypes.MESSAGE_REMINDER;
object2.key = value3;
object2.duration = 10 * (importDefault(672) /* metro dependency 672: Durations */).Millis.SECOND;
object2.onDismiss = onDismiss_83510;
object2.channel = value2;
object2.author = savedMessage.message.author;
object2.savedMessage = savedMessage;
object2.inAppNotificationId = (require(10921) /* metro dependency 10921: InAppNotificationUtils */).generateInAppNotificationId();
ENQUEUE_IN_APP_NOTIFICATION({notification: object2});
}
}
}
function MESSAGE_REMINDER_DUEOnDismiss() { // fn#83510, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:11091:8853, owner: MESSAGE_REMINDER_DUE.onDismiss, offset: 0x01f1d10e, size: 37 bytes, params: 1, frame: 11
const value = environment.__proto__;
(InAppNotificationActionCreators).clearNotification();
}
}
function RESTRICTED_HOURS_WARNING({title, subtitle}) { // fn#83511, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:11091:9028, offset: 0x01f1d737, size: 242 bytes, params: 2, frame: 20
var r1;
var r0;
var screenDowntimeReminder;
var object2;
const isFamilyCenterV3Enabled = (FamilyCenterV3ExperimentModule).getIsFamilyCenterV3Enabled({location: 'InAppNotificationStore'});
if (isFamilyCenterV3Enabled) {
screenDowntimeReminder = NotificationSettingsStore.screenDowntimeReminder;
if (screenDowntimeReminder) {
object2 = {};
object2.type = InAppNotificationTypes.RESTRICTED_HOURS_WARNING;
object2.key = 'restricted-hours-warning';
object2.duration = 10 * (importDefault(672) /* metro dependency 672: Durations */).Millis.SECOND;
object2.onDismiss = onDismiss_83512;
object2.title = title;
object2.subtitle = subtitle;
object2.inAppNotificationId = (require(10921) /* metro dependency 10921: InAppNotificationUtils */).generateInAppNotificationId();
ENQUEUE_IN_APP_NOTIFICATION({notification: object2});
r1 = undefined;
} else {
r1 = !!screenDowntimeReminder;
}
r0 = r1;
} else {
r0 = !!isFamilyCenterV3Enabled;
}
return r0;
function RESTRICTED_HOURS_WARNINGOnDismiss() { // fn#83512, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:11091:9354, owner: RESTRICTED_HOURS_WARNING.onDismiss, offset: 0x01f1d10e, size: 37 bytes, params: 1, frame: 11
const value = environment.__proto__;
(InAppNotificationActionCreators).clearNotification();
}
}
function RESTRICTED_HOURS_STATE_CHANGE({isInRestrictedHours}) { // fn#83513, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:11091:9503, offset: 0x01f1d829, size: 77 bytes, params: 2, frame: 14
if (isInRestrictedHours) {
if (env0_26 != null) {
trackDismissed(env0_26, 'restricted_hours');
}
rejectNotifications(function() {
return true;
});
return undefined;
}
return false;
}
function THREAD_CREATE_83515({channel, isNewlyCreated}) { // fn#83515, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:11091:9680, offset: 0x01f1d876, size: 383 bytes, params: 2, frame: 20
var moduleValue;
var moduleValue2;
var shouldNotifyForForumThreadCreation;
var moduleValue3;
var userStoreBinding;
var value3;
var guildStoreBinding;
var value4;
var object2;
const channel2 = ChannelStore.getChannel(channel.parent_id);
if (channel2 != null) {
if (channel2.isForumLikeChannel()) {
if (isNewlyCreated) {
moduleValue = require(10911) /* metro dependency 10911: NotificationTextUtils */;
if (moduleValue.allowInAppNotifications()) {
moduleValue2 = require(10911) /* metro dependency 10911: NotificationTextUtils */;
shouldNotifyForForumThreadCreation = moduleValue2.shouldNotifyForForumThreadCreation;
moduleValue3 = require(10915) /* metro dependency 10915: isChannelFocusedNative */;
if (Reflect.apply(shouldNotifyForForumThreadCreation, moduleValue2, [channel, channel2,
!moduleValue3.isChannelFocused()])) {
userStoreBinding = UserStore;
value3 = userStoreBinding.getUser(channel.ownerId);
if (value3 == null) {
return false;
}
guildStoreBinding = GuildStore;
value4 = guildStoreBinding.getGuild(channel2.guild_id);
if (value4 == null) {
return false;
}
object2 = {};
object2.type = InAppNotificationTypes.FORUM_THREAD_CREATED;
object2.thread = channel;
object2.threadCreator = value3;
object2.parentChannel = channel2;
object2.guild = value4;
object2.key = channel.id;
object2.duration = 5 * (importDefault(672) /* metro dependency 672: Durations */).Millis.SECOND;
object2.onDismiss = onDismiss_83516;
object2.inAppNotificationId = (require(10921) /* metro dependency 10921: InAppNotificationUtils */).generateInAppNotificationId();
ENQUEUE_IN_APP_NOTIFICATION({notification: object2});
return undefined;
}
return false;
}
return false;
}
return false;
}
}
return false;
function THREAD_CREATE_83515OnDismiss() { // fn#83516, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:11091:10228, owner: THREAD_CREATE_83515.onDismiss, offset: 0x01f1d10e, size: 37 bytes, params: 1, frame: 11
const value = environment.__proto__;
(InAppNotificationActionCreators).clearNotification();
}
}
function CHANNEL_SELECT_83518({channelId}) { // fn#83518, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:11091:10493, offset: 0x01f1da0a, size: 86 bytes, params: 2, frame: 15
const CHANNEL_SELECT_83518Predicate2 = CHANNEL_SELECT_83518Predicate;
if (env0_26 != null && CHANNEL_SELECT_83518Predicate2(env0_26)) {
trackDismissed(env0_26, 'notification_clicked');
}
return rejectNotifications(CHANNEL_SELECT_83518Predicate2);
function CHANNEL_SELECT_83518Predicate(a0) { // fn#83519, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:11091:10551, owner: CHANNEL_SELECT_83518.predicate, offset: 0x01f1da60, size: 144 bytes, params: 2, frame: 6
const type = a0.type;
const value = environment.__proto__;
const MESSAGE = InAppNotificationTypes.MESSAGE;
let r0 = type === MESSAGE && a0.channel.id === channelId;
r0 = !r0 ? a0.type === InAppNotificationTypes.MESSAGE_FAILED_TO_SEND && a0.channelId === channelId : r0;
r0 = !r0 ? a0.type === InAppNotificationTypes.ALERT && a0.channel.id === channelId : r0;
return r0;
}
}
function CHANNEL_RTC_UPDATE_CHAT_OPEN_83520({channelId, chatOpen}) { // fn#83520, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:11091:10811, offset: 0x01f1daf0, size: 96 bytes, params: 2, frame: 15
const CHANNEL_RTC_UPDATE_CHAT_OPEN_83520Predicate2 = CHANNEL_RTC_UPDATE_CHAT_OPEN_83520Predicate;
if (env0_26 != null && CHANNEL_RTC_UPDATE_CHAT_OPEN_83520Predicate2(env0_26)) {
trackDismissed(env0_26, 'notification_clicked');
}
return rejectNotifications(CHANNEL_RTC_UPDATE_CHAT_OPEN_83520Predicate2);
function CHANNEL_RTC_UPDATE_CHAT_OPEN_83520Predicate(a0) { // fn#83521, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:11091:10880, owner: CHANNEL_RTC_UPDATE_CHAT_OPEN_83520.predicate, offset: 0x01f1db50, size: 61 bytes, params: 2, frame: 3
const type = a0.type;
const value = environment.__proto__;
const MESSAGE = InAppNotificationTypes.MESSAGE;
return type === MESSAGE && a0.channel.id === channelId && chatOpen;
}
}
function USER_SETTINGS_PROTO_UPDATE_83522() { // fn#83522, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:11091:11053, offset: 0x01f1db8d, size: 103 bytes, params: 1, frame: 16
var r0;
const value2 = (NotificationTextUtilsModule).allowInAppNotifications();
if (value2) {
r0 = !value2;
} else {
if (env0_26 != null) {
trackDismissed(env0_26, 'settings_updated');
}
env0_27.removeAll(function() {
return true;
});
r0 = true;
}
return r0;
}
function CURRENT_USER_UPDATE_83524() { // fn#83524, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:11091:11236, offset: 0x01f1dbf4, size: 429 bytes, params: 1, frame: 21
var r1;
var moduleValue;
var moduleValue2;
var value3;
var object2;
var moduleValue5;
var restrictedScheduleNotificationKey;
var kind;
var getRestrictedScheduleNotificationTitle;
var value;
if (env0_29) {
moduleValue = require(5188) /* metro dependency 5188: FamilyCenterV3Experiment */;
if (moduleValue.getIsFamilyCenterV3Enabled({location: 'InAppNotificationStore'})) {
moduleValue2 = require(10908) /* metro dependency 10908: RestrictedScheduleNotificationUtils */;
value3 = (require(10908) /* metro dependency 10908: RestrictedScheduleNotificationUtils */).diffSchedules(EMPTY_SCHEDULE_SNAPSHOT,
moduleValue2.toScheduleSnapshot(getCurrentRestrictedSchedule()));
r1 = value3 != null && (require(3829) /* metro dependency 3829: UserSettings */).EnableScreenDowntimeScheduleNotifications.getSetting();
r1 = r1 && (require(10911) /* metro dependency 10911: NotificationTextUtils */).allowInAppNotifications();
if (r1) {
object2 = {};
object2.type = InAppNotificationTypes.RESTRICTED_SCHEDULE_UPDATED;
moduleValue5 = require(10908) /* metro dependency 10908: RestrictedScheduleNotificationUtils */;
restrictedScheduleNotificationKey = moduleValue5.restrictedScheduleNotificationKey;
kind = value3.kind;
object2.key = Reflect.apply(restrictedScheduleNotificationKey, moduleValue5, [kind]);
object2.duration = 7 * (importDefault(672) /* metro dependency 672: Durations */).Millis.SECOND;
object2.onDismiss = onDismiss_83525;
value = require(10908) /* metro dependency 10908: RestrictedScheduleNotificationUtils */;
getRestrictedScheduleNotificationTitle = value.getRestrictedScheduleNotificationTitle;
kind = value3.kind;
object2.title = Reflect.apply(getRestrictedScheduleNotificationTitle, value, [kind]);
value = require(10908) /* metro dependency 10908: RestrictedScheduleNotificationUtils */;
object2.subtitle = value.getRestrictedScheduleNotificationSubtitle(value3.rule);
value = require(10921) /* metro dependency 10921: InAppNotificationUtils */;
object2.inAppNotificationId = value.generateInAppNotificationId();
ENQUEUE_IN_APP_NOTIFICATION({notification: object2});
}
return undefined;
}
}
return false;
function CURRENT_USER_UPDATE_83524OnDismiss() { // fn#83525, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:11091:11771, owner: CURRENT_USER_UPDATE_83524.onDismiss, offset: 0x01f1d10e, size: 37 bytes, params: 1, frame: 11
const value = environment.__proto__;
(InAppNotificationActionCreators).clearNotification();
}
}
}
global.__d(_fun83470, 10905, [15, 17, 18, 6, 7, 1378, 4606, 10906, 6611, 5116, 1348, 1379, 1867, 10907, 4605, 1934,
1373, 1878, 661, 8277, 8275, 3738, 22, 10908, 10910, 5087, 5216, 10911, 10684, 4625, 10919, 672, 10920, 10921,
10915, 10923, 10927, 4246, 10928, 3829, 1314, 10929, 5188, 10930, 4863, 21, 566, 694,
2]) /* metro module 10905, dependencies: [15, 17, 18, 6, 7, 1378, 4606, 10906, 6611, 5116, 1348, 1379, 1867, 10907, 4605, 1934, 1373, 1878, 661, 8277, 8275, 3738, 22, 10908, 10910, 5087, 5216, 10911, 10684, 4625, 10919, 672, 10920, 10921, 10915, 10923, 10927, 4246, 10928, 3829, 1314, 10929, 5188, 10930, 4863, 21, 566, 694, 2] */;