Files
discord-decomp/sources/modules/nuf/native/NotificationPermissionManager.tsx
2026-07-28 01:06:53 +03:00

563 lines
32 KiB
TypeScript

/* Metro module 15801; source: modules/nuf/native/NotificationPermissionManager.tsx; dependencies: [6, 7, 15, 17, 18, 5, 27, 3786, 1226, 1379, 4864, 11872, 11873, 661, 4661, 4080, 15802, 1962, 480, 3738, 11875, 10911, 683, 477, 14889, 676, 4860, 2] */
import Module00005 from '../../../by-id/module-00005.js'; /* Metro dependency 5 */
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 AuthenticationStore from '../../../stores/AuthenticationStore.tsx'; /* Metro dependency 1226 */
import ChannelStore from '../../../stores/ChannelStore.tsx'; /* Metro dependency 1379 */
import JoinedThreadsStore from '../../threads/JoinedThreadsStore.tsx'; /* Metro dependency 3786 */
import UserGuildSettingsStore from '../../../stores/UserGuildSettingsStore.tsx'; /* Metro dependency 4864 */
import PushNotificationPermissionStore from '../../../stores/native/PushNotificationPermissionStore.tsx'; /* Metro dependency 11872 */
import * as FileImportTrackerModule from '../../../by-id/module-00002-FileImportTracker.js'; /* Metro dependency 2 */
import * as ReactNativeModule from '../../../by-id/module-00027-ReactNative.js'; /* Metro dependency 27 */
import * as NativePermissionConstantsModule from '../../native_permissions/NativePermissionConstants.tsx'; /* Metro dependency 4661 */
import * as PushNotificationPermissionStoreModule from '../../../stores/native/PushNotificationPermissionStore.tsx'; /* Metro dependency 11872 */
import * as NotificationPermissionConstantsModule from './components/notification/NotificationPermissionConstants.tsx'; /* Metro dependency 11873 */
function _fun121398(global, require, importDefault, importAll, module, exports, dependencyMap) { // fn#121398, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:16009:6, offset: 0x025474bb, size: 585 bytes, params: 8, frame: 19
const env0_0 = require;
const shouldShowPrompt = function() {
return _shouldShowPrompt.apply(this, arguments);
};
const shouldShowReactivationPrompt = function() {
return _shouldShowReactivationPrompt.apply(this, arguments);
};
const _logNotificationPermissionStatus = function() {
return _logNotificationPermissionStatus2.apply(this, arguments);
};
const Object = global.Object;
Object.defineProperty(exports, '__esModule', {value: true});
const PermissionPromptType = (PushNotificationPermissionStoreModule).PermissionPromptType;
let value = NotificationPermissionConstantsModule;
const env0_16 = value.NOTIFICATION_REACTIVATION_ACTIONSHEET_KEY;
const env0_17 = value.EventActionLocation;
value = require(661) /* metro dependency 661: Constants */;
const env0_18 = value.RelationshipTypes;
const env0_19 = value.GuildFeatures;
const env0_20 = value.AnalyticEvents;
const FRIEND_REQUEST_SENT = PermissionPromptType.FRIEND_REQUEST_SENT;
items2 = [FRIEND_REQUEST_SENT];
const INVITE_ACCEPTED = PermissionPromptType.INVITE_ACCEPTED;
items2[1] = INVITE_ACCEPTED;
value = importDefault(4860) /* metro dependency 4860: AutomaticLifecycleManager */;
value = _fun121417(value);
value = new value();
(FileImportTrackerModule).fileFinishedImporting('modules/nuf/native/NotificationPermissionManager.tsx');
exports.default = value;
function _isNativeReflectConstruct_121399() { // fn#121399, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:16009:460, offset: 0x02547704, 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_121399_isNativeReflectConstruct = function() {
return !!result;
})();
}
function haveNotSeenPromptSince(a0, a1) { // fn#121402, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:16009:701, offset: 0x02547766, size: 112 bytes, params: 3, frame: 16
var r1;
var r0;
var value;
const pushNotificationPermissionStoreBinding = PushNotificationPermissionStore;
const getState = pushNotificationPermissionStoreBinding.getState;
const property = Reflect.apply(getState, pushNotificationPermissionStoreBinding, []).promptLastSeen[a0];
const value2 = property == null;
if (value2) {
r0 = value2;
} else {
if (env0_22.includes(a0)) {
value = (importDefault(3738) /* metro dependency 3738 */)();
value = value.diff(property, 'days');
value = value >= 1;
r1 = value;
} else {
r1 = undefined;
}
r0 = r1;
}
return r0;
}
function _shouldShowPrompt() { // fn#121404, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:16009:918, offset: 0x025477d6, size: 50 bytes, params: 1, frame: 14
return Module00005(_fun121406).apply(this, arguments);
function* _fun121406(a0) { // fn#121406, original name: ?anon_0_, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:16009:975, offset: 0x02547813, size: 101 bytes, params: 2, frame: 16
if (false) {
return undefined;
}
value = environment.__proto__.__proto__;
const NativePermissionManager = env2_9.NativePermissionManager;
const getNotificationAuthorizationStatus = NativePermissionManager.getNotificationAuthorizationStatus;
yield Reflect.apply(getNotificationAuthorizationStatus, NativePermissionManager, []);
const value3 = undefined;
if (false) {
return value3;
}
const UNDETERMINED = env2_21.UNDETERMINED;
return (value3 === UNDETERMINED || value3 === env2_21.PROVISIONAL) && env2_25(a0, 1);
}
}
function _shouldShowReactivationPrompt() { // fn#121408, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:16009:1263, offset: 0x02547878, size: 50 bytes, params: 1, frame: 14
return Module00005(_fun121410).apply(this, arguments);
function* _fun121410(a0) { // fn#121410, original name: ?anon_0_, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:16009:1344, offset: 0x025478b5, size: 84 bytes, params: 2, frame: 16
if (false) {
return undefined;
}
value = environment.__proto__.__proto__;
const NativePermissionManager = env2_9.NativePermissionManager;
const getNotificationAuthorizationStatus = NativePermissionManager.getNotificationAuthorizationStatus;
yield Reflect.apply(getNotificationAuthorizationStatus, NativePermissionManager, []);
const value3 = undefined;
if (false) {
return value3;
}
const DENIED = env2_21.DENIED;
return value3 === DENIED && env2_25(a0, 1);
}
}
function showPrompt(a0, a1, a2) { // fn#121411, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:16009:1511, offset: 0x02547909, size: 80 bytes, params: 4, frame: 14
const env0_0 = a0;
const env0_1 = a1;
if (env0_23 != null) {
global.clearTimeout(env0_23);
}
env0_23 = global.setTimeout(_fun121412, a2);
function _fun121412() { // fn#121412, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:16009:1577, offset: 0x02547959, size: 159 bytes, params: 1, frame: 20
require(dependencyMap[20]).setPushPermissionReactivationSeen(env0_0);
const defaultImport = importDefault(dependencyMap[15]);
const openLazy = defaultImport.openLazy;
const value3 = require(dependencyMap[17])(dependencyMap[16], dependencyMap.paths);
const ImpressionNames = require(dependencyMap[18]).ImpressionNames;
const PUSH_NOTIFICATION_REACTIVATION_PROMPT = ImpressionNames.PUSH_NOTIFICATION_REACTIVATION_PROMPT;
Reflect.apply(openLazy, defaultImport, [value3, NOTIFICATION_REACTIVATION_ACTIONSHEET_KEY,
{impressionName: PUSH_NOTIFICATION_REACTIVATION_PROMPT, impressionProperties: {action_location: require},
location: require}]);
}
}
function _logNotificationPermissionStatus2() { // fn#121414, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:16009:1966, offset: 0x025479f8, size: 50 bytes, params: 1, frame: 14
return Module00005(_fun121416).apply(this, arguments);
function* _fun121416() { // fn#121416, original name: ?anon_0_, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:16009:2055, offset: 0x02547a35, size: 190 bytes, params: 1, frame: 20
if (true) {
value = environment.__proto__.__proto__;
var NativePermissionManager = env2_9.NativePermissionManager;
var getNotificationAuthorizationStatus = NativePermissionManager.getNotificationAuthorizationStatus;
yield Reflect.apply(getNotificationAuthorizationStatus, NativePermissionManager, []);
var value3 = undefined;
if (false) {
return value3;
}
var binding = env2_0;
var binding2 = env2_2;
var value6 = binding(binding2[21]).allowInAppNotifications();
var value7 = env2_1(binding2[22]);
var track = value7.track;
var NOTIFICATION_PERMISSION_STATUS = env2_20.NOTIFICATION_PERMISSION_STATUS;
var object = {};
var AUTHORIZED = env2_21.AUTHORIZED;
object.os_enabled = value3 === AUTHORIZED;
object.foreground_app_enabled = value6;
object.background_app_enabled = value6;
value = binding(binding2[23]);
value = value.isIOS();
object.notification_authorization_status = value ? value3 : null;
Reflect.apply(track, value7, [NOTIFICATION_PERMISSION_STATUS, object]);
}
}
}
function _fun121417(a0) { // fn#121417, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:16009:2398, offset: 0x02547af3, size: 101 bytes, params: 2, frame: 16
const NotificationPermissionManager2 = NotificationPermissionManager;
Inherits(NotificationPermissionManager2, a0);
return CreateClass(NotificationPermissionManager2, [{key: 'handleMessageCreateForNudge', value: value_121445},
{key: 'handleReactionAddForNudge', value: value_121446}]);
function NotificationPermissionManager(a0) { // fn#121418, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:16009:2410, offset: 0x02547b58, size: 332 bytes, params: 2, frame: 21
var r0;
var Reflect;
let value = copyRestArgs(0, undefined);
let binding = env1_3;
binding(this, NotificationPermissionManager);
const items2 = [];
arraySpread(items2, value, 0, items2);
value = env1_6(NotificationPermissionManager);
binding = env1_5;
if (_isNativeReflectConstruct_121399()) {
Reflect = global.Reflect;
value = Reflect.construct(value, items2, env1_6(this).constructor);
r0 = value;
} else {
value = value.apply(this, items2);
r0 = value;
}
value = binding(this, r0);
value.previousAppState = null;
value.actions = {MESSAGE_CREATE: MESSAGE_CREATE_121419, MESSAGE_REACTION_ADD: MESSAGE_REACTION_ADD_121420,
INVITE_ACCEPT_SUCCESS: INVITE_ACCEPT_SUCCESS_121421, RELATIONSHIP_ADD: RELATIONSHIP_ADD_121422,
POST_CONNECTION_OPEN: POST_CONNECTION_OPEN_121423, APP_STATE_UPDATE: APP_STATE_UPDATE_121424};
value.handleConnectionOpen = env1_8(_fun121426);
value.handleMessageCreate = _fun121427();
value.handleInviteAccept = _fun121431();
value.handleSendFriendRequest = _fun121435();
value.handleAppStateUpdate = _fun121439();
value._handleNotificationAuthorizationStatusUpdate = env1_8(_fun121444);
return value;
function NotificationPermissionManagerMESSAGE_CREATE(a0) { // fn#121419, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:16009:2733, owner: NotificationPermissionManager.MESSAGE_CREATE, offset: 0x02547ca4, size: 38 bytes, params: 2, frame: 11
const binding = env0_0;
binding.handleMessageCreate(a0);
binding.handleMessageCreateForNudge(a0);
}
function NotificationPermissionManagerMESSAGE_REACTION_ADD(a0) { // fn#121420, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:16009:2817, owner: NotificationPermissionManager.MESSAGE_REACTION_ADD, offset: 0x02547cca, size: 27 bytes, params: 2, frame: 11
env0_0.handleReactionAddForNudge(a0);
}
function NotificationPermissionManagerINVITE_ACCEPT_SUCCESS(a0) { // fn#121421, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:16009:2875, owner: NotificationPermissionManager.INVITE_ACCEPT_SUCCESS, offset: 0x02547ce5, size: 25 bytes, params: 2, frame: 11
env0_0.handleInviteAccept(a0);
}
function NotificationPermissionManagerRELATIONSHIP_ADD(a0) { // fn#121422, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:16009:2921, owner: NotificationPermissionManager.RELATIONSHIP_ADD, offset: 0x02547cfe, size: 25 bytes, params: 2, frame: 11
env0_0.handleSendFriendRequest(a0);
}
function NotificationPermissionManagerPOST_CONNECTION_OPEN() { // fn#121423, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:16009:2976, owner: NotificationPermissionManager.POST_CONNECTION_OPEN, offset: 0x02547d17, size: 21 bytes, params: 1, frame: 9
env0_0.handleConnectionOpen();
}
function NotificationPermissionManagerAPP_STATE_UPDATE(a0) { // fn#121424, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:16009:3024, owner: NotificationPermissionManager.APP_STATE_UPDATE, offset: 0x0253bed3, size: 25 bytes, params: 2, frame: 11
env0_0.handleAppStateUpdate(a0);
}
function* _fun121426() { // fn#121426, original name: ?anon_0_, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:16009:3082, offset: 0x02547d37, size: 69 bytes, params: 1, frame: 12
if (true) {
value = environment.__proto__.__proto__.__proto__;
yield env3_31();
if (false) {
return undefined;
}
value = environment.__proto__;
yield NotificationPermissionManager._handleNotificationAuthorizationStatusUpdate();
}
}
function _fun121427() { // fn#121427, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:16009:3215, offset: 0x02547d7c, size: 36 bytes, params: 1, frame: 12
const env0_0 = env2_8(_fun121429);
return _fun121430;
async function _fun121429({message, optimistic, isPushNotification, sendMessageOptions}) { // fn#121429, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:16009:3235, offset: 0x02547db4, size: 213 bytes, params: 2, frame: 18
var value8;
if (false) {
return undefined;
}
value = undefined;
await value;
if (false) {
return undefined;
}
let r4 = optimistic || isPushNotification;
r4 = !r4 ? sendMessageOptions != null : r4;
if (!r4) {
var id = message == null || message.author == null ? value : message.author.id;
var binding = env4_11;
var getId = binding.getId;
var value7 = id === Reflect.apply(getId, binding, []);
if (value7) {
await env4_26(env4_15.MESSAGE_SENT);
value8 = undefined;
if (false) {
return value8;
}
if (value8) {
env4_30(env4_15.MESSAGE_SENT, env4_17.MESSAGE_SENT, 1000);
}
return value;
}
if (value7) {
env4_30(env4_15.MESSAGE_SENT, env4_17.MESSAGE_SENT, 1000);
}
}
return value;
}
function _fun121430() { // fn#121430, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:16009:3487, offset: 0x00c3945f, size: 30 bytes, params: 1, frame: 13
return env0_0.apply(this, arguments);
}
}
function _fun121431() { // fn#121431, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:16009:3554, offset: 0x02547e89, size: 36 bytes, params: 1, frame: 12
const env0_0 = env2_8(_fun121433);
return _fun121434;
async function _fun121433({invite}) { // fn#121433, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:16009:3574, offset: 0x02547ec1, size: 272 bytes, params: 2, frame: 19
var INVITE_ACCEPTED;
var value7;
var value9;
if (false) {
return undefined;
}
value = undefined;
await value;
if (false) {
return undefined;
}
const guild = invite.guild;
const r6 = (guild == null ? value : guild.features) ?? [];
const includes = r6.includes;
const COMMUNITY = env4_19.COMMUNITY;
if (!Reflect.apply(includes, r6, [COMMUNITY])) {
var binding = env4_1;
var value6 = binding(env4_2[24]);
var getConfig = value6.getConfig;
var showOldSheet = Reflect.apply(getConfig, value6, [{location: 'NotificationPermissionManager'}]).showOldSheet;
if (showOldSheet) {
binding = env4_26;
INVITE_ACCEPTED = env4_15.INVITE_ACCEPTED;
await binding(INVITE_ACCEPTED);
value7 = undefined;
if (false) {
return value7;
}
if (value7) {
if (value7) {
env4_30(env4_15.INVITE_ACCEPTED, env4_17.INVITE_ACCEPTED, 1000);
}
return value;
}
binding = env4_28;
INVITE_ACCEPTED = env4_15.INVITE_ACCEPTED;
await binding(INVITE_ACCEPTED);
value9 = undefined;
if (false) {
return value9;
}
if (value9) {
env4_30(env4_15.INVITE_ACCEPTED, env4_17.INVITE_ACCEPTED, 1000);
}
return value;
}
if (showOldSheet) {
env4_30(env4_15.INVITE_ACCEPTED, env4_17.INVITE_ACCEPTED, 1000);
}
}
return value;
}
function _fun121434() { // fn#121434, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:16009:3923, offset: 0x00c3945f, size: 30 bytes, params: 1, frame: 13
return env0_0.apply(this, arguments);
}
}
function _fun121435() { // fn#121435, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:16009:3995, offset: 0x02547fd1, size: 36 bytes, params: 1, frame: 12
const env0_0 = env2_8(_fun121437);
return _fun121438;
async function _fun121437({relationship}) { // fn#121437, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:16009:4015, offset: 0x02548009, size: 181 bytes, params: 2, frame: 19
var binding;
var FRIEND_REQUEST_SENT;
var value5;
var value7;
if (true) {
await undefined;
if (false) {
return undefined;
}
var type = relationship.type;
value = environment.__proto__.__proto__.__proto__.__proto__;
var PENDING_OUTGOING = env4_18.PENDING_OUTGOING;
var value4 = type === PENDING_OUTGOING;
if (value4) {
binding = env4_26;
FRIEND_REQUEST_SENT = env4_15.FRIEND_REQUEST_SENT;
await binding(FRIEND_REQUEST_SENT);
value5 = undefined;
if (false) {
return value5;
}
if (value5) {
if (value5) {
env4_30(env4_15.FRIEND_REQUEST_SENT, env4_17.FRIEND_REQUEST_SENT, 100);
}
return undefined;
}
binding = env4_28;
FRIEND_REQUEST_SENT = env4_15.FRIEND_REQUEST_SENT;
await binding(FRIEND_REQUEST_SENT);
value7 = undefined;
if (false) {
return value7;
}
if (value7) {
env4_30(env4_15.FRIEND_REQUEST_SENT, env4_17.FRIEND_REQUEST_SENT, 100);
}
} else if (value4) {
env4_30(env4_15.FRIEND_REQUEST_SENT, env4_17.FRIEND_REQUEST_SENT, 100);
}
}
}
function _fun121438() { // fn#121438, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:16009:4254, offset: 0x00c3945f, size: 30 bytes, params: 1, frame: 13
return env0_0.apply(this, arguments);
}
}
function _fun121439() { // fn#121439, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:16009:4323, offset: 0x025480be, size: 36 bytes, params: 1, frame: 12
const env0_0 = env2_8(_fun121441);
return _fun121442;
async function _fun121441({state}) { // fn#121441, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:16009:4343, offset: 0x025480f6, size: 219 bytes, params: 2, frame: 19
if (true) {
await undefined;
if (false) {
return undefined;
}
value = environment.__proto__.__proto__;
var previousAppState = NotificationPermissionManager.previousAppState;
var binding = env4_0;
var binding2 = env4_2;
var AppStates = binding(binding2[25]).AppStates;
var BACKGROUND = AppStates.BACKGROUND;
var value5 = previousAppState === BACKGROUND;
AppStates = binding(binding2[25]).AppStates;
var ACTIVE = AppStates.ACTIVE;
if (value5 && state === ACTIVE) {
await NotificationPermissionManager._handleNotificationAuthorizationStatusUpdate();
if (false) {
return undefined;
}
if (state !== env4_0(env4_2[25]).AppStates.ACTIVE) {
NotificationPermissionManager.previousAppState = state;
return undefined;
}
await env4_31();
if (false) {
return undefined;
}
NotificationPermissionManager.previousAppState = state;
} else {
if (state !== env4_0(env4_2[25]).AppStates.ACTIVE) {
NotificationPermissionManager.previousAppState = state;
return undefined;
}
await env4_31();
if (false) {
return undefined;
}
NotificationPermissionManager.previousAppState = state;
}
}
}
function _fun121442() { // fn#121442, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:16009:4621, offset: 0x00c3945f, size: 30 bytes, params: 1, frame: 13
return env0_0.apply(this, arguments);
}
}
function* _fun121444() { // fn#121444, original name: ?anon_0_, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:16009:4717, offset: 0x025481dc, size: 82 bytes, params: 1, frame: 13
if (true) {
value = environment.__proto__.__proto__.__proto__;
var NativePermissionManager = env3_9.NativePermissionManager;
var getNotificationAuthorizationStatus = NativePermissionManager.getNotificationAuthorizationStatus;
yield Reflect.apply(getNotificationAuthorizationStatus, NativePermissionManager, []);
var value3 = undefined;
if (false) {
return value3;
}
env3_0(env3_2[20]).updateNotificationAuthorizationStatus(value3);
}
}
}
function value_121445({channelId, message, optimistic, isPushNotification, sendMessageOptions}) { // fn#121445, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:16009:4975, offset: 0x0254822e, size: 239 bytes, params: 2, frame: 16
var id;
var value;
var value2;
var authenticationStoreBinding;
var channel;
if (!optimistic) {
if (!isPushNotification) {
if (sendMessageOptions == null) {
value = undefined;
id = message == null || message.author == null ? value : message.author.id;
value2 = environment.__proto__;
authenticationStoreBinding = AuthenticationStore;
if (id === authenticationStoreBinding.getId()) {
channel = ChannelStore.getChannel(channelId);
if (channel != null) {
if (!(channel.isThread() ? JoinedThreadsStore.isMuted(channel.id) : UserGuildSettingsStore.isChannelMuted(channel.getGuildId(),
channel.id))) {
value = require(11875) /* metro dependency 11875: PushNotificationActionCreators */;
value.setPushNotificationPermissionEligibleForPrompt(PermissionPromptType.CHANNEL_BANNER);
}
}
}
}
}
}
}
function value_121446(a0) { // fn#121446, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:16009:5374, offset: 0x0254831d, size: 185 bytes, params: 2, frame: 15
var value;
var authenticationStoreBinding;
var channel;
var moduleValue;
const channelId = a0.channelId;
const userId = a0.userId;
if (!a0.optimistic) {
value = environment.__proto__;
authenticationStoreBinding = AuthenticationStore;
if (userId === authenticationStoreBinding.getId()) {
channel = ChannelStore.getChannel(channelId);
if (channel != null) {
if (!(channel.isThread() ? JoinedThreadsStore.isMuted(channel.id) : UserGuildSettingsStore.isChannelMuted(channel.getGuildId(),
channel.id))) {
moduleValue = require(11875) /* metro dependency 11875: PushNotificationActionCreators */;
moduleValue.setPushNotificationPermissionEligibleForPrompt(PermissionPromptType.POST_REACTION_BANNER);
}
}
}
}
}
}
}
global.__d(_fun121398, 15801, [6, 7, 15, 17, 18, 5, 27, 3786, 1226, 1379, 4864, 11872, 11873, 661, 4661, 4080,
15802, 1962, 480, 3738, 11875, 10911, 683, 477, 14889, 676, 4860,
2]) /* metro module 15801, dependencies: [6, 7, 15, 17, 18, 5, 27, 3786, 1226, 1379, 4864, 11872, 11873, 661, 4661, 4080, 15802, 1962, 480, 3738, 11875, 10911, 683, 477, 14889, 676, 4860, 2] */;