decord/source/modules/push_notifications/native/receiveNotification.tsx

1110 lines
35 KiB
TypeScript
Raw Normal View History

// Module ID: 17904
// Function ID: 17905
2026-07-20 16:05:17 +00:00
// Name: onStageConnectionError
// Dependencies: [5, 5558, 7526, 502, 1957, 1371, 6596, 1074, 4602, 1963, 12418, 3, 4259, 1114, 11258, 4418, 1109, 8393, 4571, 7342, 9794, 4417, 16419, 7640, 8179, 7182, 4573, 9187, 1242, 4740, 1115, 9541, 11, 16417, 7475, 10, 7476, 5277, 13633, 12421, 504, 12786, 9946, 4540, 1093, 11632, 8351, 8348, 573, 4763, 1100, 4762, 13853, 2]
2026-07-20 16:05:17 +00:00
// Exports: default
// Module 17904 (onStageConnectionError)
2026-08-24 06:08:38 +00:00
import timestampDefault from "timestamp" /* 3 */;
import isTracingDefault from "isTracing" /* 10 */;
import getSystemLocale from "getSystemLocale" /* 1114 */;
import dispatcherDefault from "dispatcher" /* 4259 */;
import parseQueryDefault from "parseQuery" /* 4540 */;
import fetchMessagesDefault from "fetchMessages" /* 9946 */;
import registerAssetDefault from "registerAsset" /* 11258 */;
2026-08-24 06:08:38 +00:00
import closure_4 from "asyncGeneratorStep" /* 5 */;
import closure_6 from "scheduledEventSort" /* 7526 */;
import closure_7 from "fetchFingerprint" /* 502 */;
import closure_8 from "ensureGuildLoaded" /* 1957 */;
import closure_9 from "mergeGuildAvatar" /* 1371 */;
import { NotificationTypes } from "str2" /* 6596 */;
import ME from "ME" /* 1074 */;
import { StreamTypes } from "StreamIssueReportReasons" /* 4602 */;
import { GuildScheduledEventEntityTypes as closure_16 } from "GUILD_EVENT_MAX_NAME_LENGTH" /* 1963 */;
import { MultiAccountSwitchLocation as closure_17 } from "MAX_ACCOUNTS" /* 12418 */;
2026-07-23 10:11:24 +00:00
2026-08-24 06:08:38 +00:00
require = arg1;
2026-07-20 16:05:17 +00:00
function onStageConnectionError() {
let obj = dispatcherDefault;
2026-07-29 08:29:29 +00:00
obj = { key: "STAGE_DISCOVERY_CONNECTION_ERROR_GENERIC", content: null, icon: null };
2026-08-24 06:08:38 +00:00
const intl = getSystemLocale.intl;
obj[1] = intl.string(getSystemLocale.t.ah3RLk);
obj[2] = registerAssetDefault;
2026-07-20 16:05:17 +00:00
obj.open(obj);
}
function waitForConnection() {
return new Promise((arg0) => {
2026-07-29 08:29:29 +00:00
callback(arg0);
2026-07-20 16:05:17 +00:00
});
}
function waitForDataOrConnection() {
2026-07-29 08:29:29 +00:00
const self = this;
const apply = _waitForDataOrConnection.apply;
if (typeof apply === "unknown") {
let applyArgumentsResult = HermesBuiltin.applyArguments(self);
} else {
applyArgumentsResult = apply(self, arguments);
}
return applyArgumentsResult;
2026-07-20 16:05:17 +00:00
}
function _waitForDataOrConnection() {
2026-07-29 08:29:29 +00:00
const self = this;
let tmp = callback((arg0, arg1) => {
2026-08-24 06:08:38 +00:00
closure_0 = arg0;
closure_1 = arg1;
c3 = 0;
c4 = 0;
2026-07-29 08:29:29 +00:00
return (function*(arg0, arg1) {
if (c4 === 2) {
c4 = 3;
HermesBuiltin.throwTypeError();
} else if (tmp4 === 3) {
if (arg0 === 1) {
throw arg1;
} else if (arg0 === 2) {
let obj = { value: null, done: true };
obj[0] = arg1;
return obj;
} else {
2026-09-01 10:26:29 +00:00
return { value: "HermesInternal", done: null };
2026-07-29 08:29:29 +00:00
}
} else {
try {
c4 = 2;
if (0 === c3) {
if (arg0 === 1) {
c4 = 3;
throw arg1;
} else if (arg0 === 2) {
c4 = 3;
obj = { value: null, done: true };
obj[0] = arg1;
return obj;
} else {
2026-08-24 06:08:38 +00:00
c2 = tmp2;
2026-07-29 08:29:29 +00:00
c2 = undefined;
if (callback()) {
c4 = 3;
} else {
c2 = false;
const promise = new Promise((arg0) => {
2026-08-24 06:08:38 +00:00
closure_0 = arg0;
2026-07-29 08:29:29 +00:00
const result = closure_0.addConditionalChangeListener(() => {
2026-08-24 06:08:38 +00:00
let tmp = !closure_1_2;
if (!closure_1_2) {
const tmp3 = closure_1_1();
2026-07-29 08:29:29 +00:00
let flag = !tmp3;
if (tmp3) {
callback();
flag = false;
}
tmp = flag;
}
return tmp;
});
});
2026-08-24 06:08:38 +00:00
const items = [promise, closure_1_20()];
2026-07-29 08:29:29 +00:00
c3 = 1;
c4 = 1;
2026-08-24 06:08:38 +00:00
obj1 = { value: null, done: false };
2026-07-29 08:29:29 +00:00
obj1[0] = Promise.race(items);
return obj1;
}
}
} else if (arg0 === 1) {
c4 = 3;
throw arg1;
} else if (arg0 !== 2) {
c2 = true;
}
c4 = 3;
obj = { value: null, done: true };
obj[0] = arg1;
return obj;
} catch (tmp13) {
c4 = tmp;
throw tmp13;
}
}
})();
});
2026-08-24 06:08:38 +00:00
closure_22 = tmp;
2026-07-29 08:29:29 +00:00
const apply = tmp.apply;
if (typeof apply === "unknown") {
let applyArgumentsResult = HermesBuiltin.applyArguments(self);
} else {
applyArgumentsResult = apply(self, arguments);
}
return applyArgumentsResult;
2026-07-20 16:05:17 +00:00
}
function waitForNavigationReady() {
2026-07-29 08:29:29 +00:00
const self = this;
const apply = _waitForNavigationReady.apply;
if (typeof apply === "unknown") {
let applyArgumentsResult = HermesBuiltin.applyArguments(self);
} else {
applyArgumentsResult = apply(self, arguments);
}
return applyArgumentsResult;
2026-07-20 16:05:17 +00:00
}
function _waitForNavigationReady() {
2026-07-29 08:29:29 +00:00
const self = this;
const tmp = callback(function*() {
if (v0 === 2) {
v0 = 3;
HermesBuiltin.throwTypeError();
} else if (tmp3 === 3) {
if (arg0 === 1) {
throw arg1;
} else if (arg0 === 2) {
let obj = { value: null, done: true };
obj[0] = arg1;
return obj;
} else {
2026-09-01 10:26:29 +00:00
return { value: "HermesInternal", done: null };
2026-07-29 08:29:29 +00:00
}
} else {
try {
v0 = 2;
if (0 === c1) {
if (arg0 === 1) {
v0 = 3;
throw arg1;
} else if (arg0 === 2) {
v0 = 3;
obj = { value: null, done: true };
obj[0] = arg1;
return obj;
} else {
2026-08-24 06:08:38 +00:00
const rootNavigationRef = v0(closure_1_3[15]).getRootNavigationRef();
2026-07-29 08:29:29 +00:00
let isReadyResult = null != rootNavigationRef;
if (isReadyResult) {
isReadyResult = rootNavigationRef.isReady();
}
if (!isReadyResult) {
const promise = new Promise((arg0) => {
const v3 = arg0;
const ComponentDispatch = v3(table[16]).ComponentDispatch;
ComponentDispatch.subscribeOnce(constants.NAVIGATOR_READY, () => {
callback();
});
});
c1 = 1;
v0 = 1;
2026-08-24 06:08:38 +00:00
obj1 = { value: null, done: false };
2026-07-29 08:29:29 +00:00
obj1[0] = promise;
return obj1;
}
2026-08-24 06:08:38 +00:00
const obj5 = v0(closure_1_3[15]);
2026-07-29 08:29:29 +00:00
}
} else if (arg0 === 1) {
v0 = 3;
throw arg1;
} else if (arg0 === 2) {
v0 = 3;
obj = { value: null, done: true };
obj[0] = arg1;
return obj;
}
v0 = 3;
2026-09-01 10:26:29 +00:00
return { value: "HermesInternal", done: null };
2026-07-29 08:29:29 +00:00
} catch (tmp11) {
v0 = tmp;
throw tmp11;
}
}
});
2026-08-24 06:08:38 +00:00
closure_24 = tmp;
2026-07-29 08:29:29 +00:00
const apply = tmp.apply;
if (typeof apply === "unknown") {
let applyArgumentsResult = HermesBuiltin.applyArguments(self);
} else {
applyArgumentsResult = apply(self, arguments);
}
return applyArgumentsResult;
2026-07-20 16:05:17 +00:00
}
function _connectToStage() {
2026-07-29 08:29:29 +00:00
const self = this;
const apply = _connectToStage2.apply;
if (typeof apply === "unknown") {
let applyArgumentsResult = HermesBuiltin.applyArguments(self);
} else {
applyArgumentsResult = apply(self, arguments);
}
return applyArgumentsResult;
2026-07-20 16:05:17 +00:00
}
function _connectToStage2() {
2026-07-29 08:29:29 +00:00
const self = this;
const tmp = callback((arg0, arg1) => {
2026-08-24 06:08:38 +00:00
closure_0 = arg0;
closure_1 = arg1;
c6 = 0;
c7 = 0;
c5 = 0;
2026-07-29 08:29:29 +00:00
return (function*(arg0, arg1) {
2026-08-24 06:08:38 +00:00
dependencyMap = tmp3;
yield closure_1_20();
c5 = 1;
const obj2 = callback(8393);
2026-08-04 21:03:28 +00:00
yield obj2.connectOrLurkStage(callback, closure_1, true);
if (2 === tmp7) {
c5 = 0;
callback2();
2026-08-24 06:08:38 +00:00
c7 = 3;
2026-08-04 21:03:28 +00:00
} else if (arg0 === 1) {
2026-07-29 08:29:29 +00:00
c7 = 3;
2026-08-04 21:03:28 +00:00
throw arg1;
} else if (arg0 !== 2) {
2026-08-24 06:08:38 +00:00
closure_2 = arg1;
const obj = callback(8393);
2026-08-04 21:03:28 +00:00
obj.navigateToStage(closure_2, null);
c5 = 0;
2026-07-29 08:29:29 +00:00
}
2026-08-04 21:03:28 +00:00
c5 = 0;
return arg1;
2026-07-29 08:29:29 +00:00
})();
});
2026-08-24 06:08:38 +00:00
closure_26 = tmp;
2026-07-29 08:29:29 +00:00
const apply = tmp.apply;
if (typeof apply === "unknown") {
let applyArgumentsResult = HermesBuiltin.applyArguments(self);
} else {
applyArgumentsResult = apply(self, arguments);
}
return applyArgumentsResult;
2026-07-20 16:05:17 +00:00
}
function _handleStageNotification() {
2026-07-29 08:29:29 +00:00
const self = this;
const tmp = callback((arg0) => {
2026-08-24 06:08:38 +00:00
closure_0 = arg0;
c2 = 0;
c1 = 0;
2026-07-29 08:29:29 +00:00
return (function*(arg0) {
if (c1 === 2) {
c1 = 3;
HermesBuiltin.throwTypeError();
} else if (tmp3 === 3) {
if (arg0 === 1) {
throw arg1;
} else if (arg0 === 2) {
let obj = { value: null, done: true };
obj[0] = arg1;
return obj;
} else {
2026-09-01 10:26:29 +00:00
return { value: "HermesInternal", done: null };
2026-07-29 08:29:29 +00:00
}
} else {
try {
c1 = 2;
if (0 === c2) {
if (arg0 === 1) {
c1 = 3;
throw arg1;
} else if (arg0 === 2) {
c1 = 3;
obj = { value: null, done: true };
obj[0] = arg1;
return obj;
} else {
c2 = 1;
c1 = 1;
2026-08-24 06:08:38 +00:00
obj1 = { value: null, done: false };
obj1[0] = closure_1_25(closure_0.guild_id, closure_0.channel_id);
2026-07-29 08:29:29 +00:00
return obj1;
}
} else if (arg0 === 1) {
c1 = 3;
throw arg1;
} else if (arg0 === 2) {
c1 = 3;
obj = { value: null, done: true };
obj[0] = arg1;
return obj;
} else {
c1 = 3;
2026-09-01 10:26:29 +00:00
return { value: "HermesInternal", done: null };
2026-07-29 08:29:29 +00:00
}
} catch (tmp7) {
c1 = tmp;
throw tmp7;
}
}
})();
});
2026-08-24 06:08:38 +00:00
closure_27 = tmp;
2026-07-29 08:29:29 +00:00
const apply = tmp.apply;
if (typeof apply === "unknown") {
let applyArgumentsResult = HermesBuiltin.applyArguments(self);
} else {
applyArgumentsResult = apply(self, arguments);
}
return applyArgumentsResult;
2026-07-20 16:05:17 +00:00
}
function _handleGuildEventNotification() {
2026-07-29 08:29:29 +00:00
const self = this;
const tmp = callback((arg0) => {
2026-08-24 06:08:38 +00:00
closure_0 = arg0;
c3 = 0;
c4 = 0;
2026-07-29 08:29:29 +00:00
return (function*(arg0) {
if (c4 === 2) {
c4 = 3;
HermesBuiltin.throwTypeError();
} else if (tmp5 === 3) {
if (arg0 === 1) {
throw arg1;
} else if (arg0 === 2) {
let obj = { value: null, done: true };
obj[0] = arg1;
return obj;
} else {
2026-09-01 10:26:29 +00:00
return { value: "HermesInternal", done: null };
2026-07-29 08:29:29 +00:00
}
} else {
try {
c4 = 2;
if (0 === dependencyMap) {
if (arg0 === 1) {
c4 = 3;
throw arg1;
} else if (arg0 === 2) {
c4 = 3;
obj = { value: null, done: true };
obj[0] = arg1;
return obj;
} else {
let id = tmp2;
let guild_scheduled_event_id = tmp3;
let channel_id;
guild_scheduled_event_id = undefined;
id = undefined;
const _Number = Number;
const NumberResult = Number(channel_id.guild_scheduled_event_entity_type);
2026-08-24 06:08:38 +00:00
if (closure_1_16.STAGE_INSTANCE === NumberResult) {
2026-07-29 08:29:29 +00:00
const channel_id2 = tmp43.channel_id;
if (null == channel_id2) {
2026-08-24 06:08:38 +00:00
closure_1_19();
2026-07-29 08:29:29 +00:00
c4 = 3;
c4 = 3;
2026-08-24 06:08:38 +00:00
obj1 = { value: null, done: true };
2026-07-29 08:29:29 +00:00
obj1[0] = arg1;
return obj1;
} else {
dependencyMap = 2;
c4 = 1;
const obj2 = { value: null, done: false };
2026-08-24 06:08:38 +00:00
obj2[0] = closure_1_25(tmp43.guild_id, channel_id2);
2026-07-29 08:29:29 +00:00
return obj2;
}
} else if (tmp46.VOICE === NumberResult) {
channel_id = tmp43.channel_id;
if (null == channel_id) {
(function onVoiceConnectionError() {
let obj = guild_scheduled_event_id(4259);
2026-07-29 08:29:29 +00:00
obj = { key: "VOICE_CONNECTION_ERROR_GENERIC", content: null, icon: null };
const intl = channel_id(1114).intl;
obj[1] = intl.string(channel_id(1114).t.S69lJR);
obj[2] = guild_scheduled_event_id(11258);
2026-07-29 08:29:29 +00:00
obj.open(obj);
})();
c4 = 3;
c4 = 3;
let obj3 = { value: null, done: true };
obj3[0] = arg1;
return obj3;
} else {
dependencyMap = 3;
c4 = 1;
const obj4 = { value: null, done: false };
2026-08-24 06:08:38 +00:00
obj4[0] = closure_1_20();
2026-07-29 08:29:29 +00:00
return obj4;
}
} else if (tmp46.EXTERNAL === NumberResult) {
guild_scheduled_event_id = tmp43.guild_scheduled_event_id;
let obj6 = callback(7342);
2026-07-29 08:29:29 +00:00
obj6.transitionToGuild(tmp43.guild_id);
dependencyMap = 1;
c4 = 1;
const obj5 = { value: null, done: false };
2026-08-24 06:08:38 +00:00
obj5[0] = closure_1_20();
2026-07-29 08:29:29 +00:00
return obj5;
} else {
c4 = 3;
}
}
} else if (1 === tmp6) {
if (arg0 === 1) {
c4 = 3;
throw arg1;
} else if (arg0 === 2) {
c4 = 3;
obj6 = { value: null, done: true };
obj6[0] = arg1;
return obj6;
} else {
id = guildScheduledEvent.getGuildScheduledEvent(guild_scheduled_event_id);
if (null != id) {
obj3 = channel_id(9794);
2026-07-29 08:29:29 +00:00
const obj7 = { eventId: null, event: null };
obj7[0] = id.id;
obj7[1] = id;
const result = obj3.openGuildEventDetails(obj7);
}
}
} else if (2 === tmp6) {
if (arg0 === 1) {
c4 = 3;
throw arg1;
}
} else if (arg0 === 1) {
c4 = 3;
throw arg1;
} else if (arg0 !== 2) {
obj = channel_id(4571);
2026-07-29 08:29:29 +00:00
obj.transitionToChannel(channel_id);
}
c4 = 3;
2026-09-01 10:26:29 +00:00
return { value: "HermesInternal", done: null };
2026-07-29 08:29:29 +00:00
} catch (tmp31) {
c4 = tmp;
throw tmp31;
}
}
})();
});
2026-08-24 06:08:38 +00:00
closure_28 = tmp;
2026-07-29 08:29:29 +00:00
const apply = tmp.apply;
if (typeof apply === "unknown") {
let applyArgumentsResult = HermesBuiltin.applyArguments(self);
} else {
applyArgumentsResult = apply(self, arguments);
}
return applyArgumentsResult;
2026-07-20 16:05:17 +00:00
}
function _handleRelationshipAddNotification() {
2026-07-29 08:29:29 +00:00
const self = this;
const tmp = callback((arg0) => {
2026-08-24 06:08:38 +00:00
closure_0 = arg0;
c3 = 0;
c4 = 0;
2026-07-29 08:29:29 +00:00
return (function*(arg0) {
if (c4 === 2) {
c4 = 3;
HermesBuiltin.throwTypeError();
} else if (tmp4 === 3) {
if (arg0 === 1) {
throw arg1;
} else if (arg0 === 2) {
let obj = { value: null, done: true };
obj[0] = arg1;
return obj;
} else {
2026-09-01 10:26:29 +00:00
return { value: "HermesInternal", done: null };
2026-07-29 08:29:29 +00:00
}
} else {
try {
c4 = 2;
if (0 === dependencyMap) {
if (arg0 === 1) {
c4 = 3;
throw arg1;
} else if (arg0 === 2) {
c4 = 3;
obj = { value: null, done: true };
obj[0] = arg1;
return obj;
} else {
let user_id = tmp5;
let callback = tmp2;
callback = undefined;
user_id = undefined;
dependencyMap = 1;
c4 = 1;
2026-08-24 06:08:38 +00:00
obj1 = { value: null, done: false };
obj1[0] = closure_1_23();
2026-07-29 08:29:29 +00:00
return obj1;
}
} else if (1 === tmp5) {
if (arg0 === 1) {
c4 = 3;
throw arg1;
} else if (arg0 === 2) {
c4 = 3;
const obj2 = { value: null, done: true };
obj2[0] = arg1;
return obj2;
} else {
const _Number = Number;
callback = Number(lib.rel_type);
if (callback === constants2.PENDING_INCOMING) {
user_id = lib.user_id;
lib(4417).navigateToRootTab({ screen: "notifications" });
const obj8 = lib(4417);
user_id(16419).setTab(lib(7640).NotificationCenterTabs.ForYou);
2026-07-29 08:29:29 +00:00
dependencyMap = 2;
c4 = 1;
let obj3 = { value: null, done: false };
2026-08-24 06:08:38 +00:00
obj3[0] = callback2(closure_9, () => null != closure_1_9.getUser(user_id));
2026-07-29 08:29:29 +00:00
return obj3;
} else {
if (callback !== constants2.FRIEND) {
if (lib.notification_type === constants.REMINDER) {
let obj5 = lib(4418);
2026-07-29 08:29:29 +00:00
const rootNavigationRef = obj5.getRootNavigationRef();
if (rootNavigationRef != null) {
rootNavigationRef.navigate("friends", { screen: "requests" });
}
}
} else {
obj3 = callback(4573);
2026-07-29 08:29:29 +00:00
const obj4 = { recipientIds: null };
obj4[0] = lib.user_id;
obj3.openPrivateChannel(obj4);
}
c4 = 3;
}
}
} else if (arg0 === 1) {
c4 = 3;
throw arg1;
} else if (arg0 === 2) {
c4 = 3;
obj5 = { value: null, done: true };
obj5[0] = arg1;
return obj5;
} else {
obj = { userId: null, sourceAnalyticsLocations: null };
obj[0] = user_id;
const items = [callback(7182).PUSH_NOTIFICATION];
2026-07-29 08:29:29 +00:00
obj[1] = items;
callback(8179)(obj);
2026-07-29 08:29:29 +00:00
c4 = 3;
const obj6 = { value: null, done: true };
obj6[0] = undefined;
return obj6;
}
} catch (tmp45) {
c4 = tmp;
throw tmp45;
}
}
})();
});
2026-08-24 06:08:38 +00:00
closure_29 = tmp;
2026-07-29 08:29:29 +00:00
const apply = tmp.apply;
if (typeof apply === "unknown") {
let applyArgumentsResult = HermesBuiltin.applyArguments(self);
} else {
applyArgumentsResult = apply(self, arguments);
}
return applyArgumentsResult;
2026-07-20 16:05:17 +00:00
}
function _handleCallRingNotification() {
2026-07-29 08:29:29 +00:00
const self = this;
const tmp = callback((arg0) => {
2026-08-24 06:08:38 +00:00
closure_0 = arg0;
c3 = 0;
c4 = 0;
2026-07-29 08:29:29 +00:00
return (function*(arg0) {
if (c4 === 2) {
c4 = 3;
HermesBuiltin.throwTypeError();
} else if (tmp4 === 3) {
if (arg0 === 1) {
throw arg1;
} else if (arg0 === 2) {
let obj = { value: null, done: true };
obj[0] = arg1;
return obj;
} else {
2026-09-01 10:26:29 +00:00
return { value: "HermesInternal", done: null };
2026-07-29 08:29:29 +00:00
}
} else {
try {
c4 = 2;
if (0 === table) {
if (arg0 === 1) {
c4 = 3;
throw arg1;
} else if (arg0 === 2) {
c4 = 3;
obj = { value: null, done: true };
obj[0] = arg1;
return obj;
} else {
2026-08-24 06:08:38 +00:00
closure_2 = tmp2;
closure_1 = tmp5;
2026-07-29 08:29:29 +00:00
table = 1;
c4 = 1;
2026-08-24 06:08:38 +00:00
obj1 = { value: null, done: false };
obj1[0] = closure_1_21(closure_1_8, () => null != closure_1_8.getChannel(channel_id.channel_id));
2026-07-29 08:29:29 +00:00
return obj1;
}
} else if (arg0 === 1) {
c4 = 3;
throw arg1;
} else if (arg0 === 2) {
c4 = 3;
const obj2 = { value: null, done: true };
obj2[0] = arg1;
return obj2;
} else {
obj = lib(table[18]);
obj.transitionToChannel(lib.channel_id);
c4 = 3;
2026-09-01 10:26:29 +00:00
return { value: "HermesInternal", done: null };
2026-07-29 08:29:29 +00:00
}
} catch (tmp15) {
c4 = tmp;
throw tmp15;
}
}
})();
});
2026-08-24 06:08:38 +00:00
closure_30 = tmp;
2026-07-29 08:29:29 +00:00
const apply = tmp.apply;
if (typeof apply === "unknown") {
let applyArgumentsResult = HermesBuiltin.applyArguments(self);
} else {
applyArgumentsResult = apply(self, arguments);
}
return applyArgumentsResult;
2026-07-20 16:05:17 +00:00
}
function _handleCallConnectNotification() {
2026-07-29 08:29:29 +00:00
const self = this;
const tmp = callback((arg0) => {
2026-08-24 06:08:38 +00:00
closure_0 = arg0;
c3 = 0;
c4 = 0;
2026-07-29 08:29:29 +00:00
return (function*(arg0) {
if (c4 === 2) {
c4 = 3;
HermesBuiltin.throwTypeError();
} else if (tmp3 === 3) {
if (arg0 === 1) {
throw arg1;
} else if (arg0 === 2) {
let obj = { value: null, done: true };
obj[0] = arg1;
return obj;
} else {
2026-09-01 10:26:29 +00:00
return { value: "HermesInternal", done: null };
2026-07-29 08:29:29 +00:00
}
} else {
try {
c4 = 2;
if (0 === dependencyMap) {
if (arg0 === 1) {
c4 = 3;
throw arg1;
} else if (arg0 === 2) {
c4 = 3;
obj = { value: null, done: true };
obj[0] = arg1;
return obj;
} else {
2026-08-24 06:08:38 +00:00
c2 = 0;
2026-07-29 08:29:29 +00:00
const callback = tmp4;
dependencyMap = 1;
c4 = 1;
2026-08-24 06:08:38 +00:00
obj1 = { value: null, done: false };
obj1[0] = closure_1_21(closure_1_8, () => null != closure_1_8.getChannel(channel_id.channel_id));
2026-07-29 08:29:29 +00:00
return obj1;
}
} else if (1 === tmp4) {
if (arg0 === 1) {
c4 = 3;
throw arg1;
} else if (arg0 === 2) {
c4 = 3;
let obj2 = { value: null, done: true };
obj2[0] = arg1;
return obj2;
} else {
lib(4571).transitionToChannel(lib.channel_id);
2026-07-29 08:29:29 +00:00
dependencyMap = 2;
c4 = 1;
let obj3 = { value: null, done: false };
obj3[0] = callback2();
return obj3;
}
} else if (arg0 === 1) {
c4 = 3;
throw arg1;
} else if (arg0 === 2) {
c4 = 3;
let obj4 = { value: null, done: true };
obj4[0] = arg1;
return obj4;
} else {
const tmp60 = callback(9187);
2026-07-29 08:29:29 +00:00
const call = tmp60.call;
const channel_id = lib.channel_id;
if (typeof call === "unknown") {
tmp60(false, false);
} else {
call(channel_id, false, false);
}
obj = callback(1242);
2026-07-29 08:29:29 +00:00
const obj5 = { location: null, guild_id: null, ringer_user_id: null };
obj5[0] = callback(7182).PUSH_NOTIFICATION;
2026-07-29 08:29:29 +00:00
obj5[1] = lib.guild_id;
obj5[2] = lib.user_id;
obj2 = lib(4740);
2026-07-29 08:29:29 +00:00
const merged = Object.assign(obj2.collectChannelAnalyticsMetadataFromId(lib.channel_id));
obj.track(constants.RING_CALL_ACCEPTED, obj5);
obj3 = lib(1115);
2026-07-29 08:29:29 +00:00
if (obj3.isAndroid()) {
if (lib.is_fullscreen_call_ui) {
obj4 = callback(1242);
2026-07-29 08:29:29 +00:00
let obj6 = { action_type: "join" };
obj6 = lib(4740);
2026-07-29 08:29:29 +00:00
const merged1 = Object.assign(obj6.collectChannelAnalyticsMetadataFromId(lib.channel_id));
obj4.track(constants.CALLKIT_CLICKED, obj6);
}
callback(9541)(lib.channel_id);
2026-07-29 08:29:29 +00:00
}
c4 = 3;
2026-09-01 10:26:29 +00:00
return { value: "HermesInternal", done: null };
2026-07-29 08:29:29 +00:00
}
} catch (tmp50) {
c4 = tmp;
throw tmp50;
}
}
})();
});
2026-08-24 06:08:38 +00:00
closure_31 = tmp;
2026-07-29 08:29:29 +00:00
const apply = tmp.apply;
if (typeof apply === "unknown") {
let applyArgumentsResult = HermesBuiltin.applyArguments(self);
} else {
applyArgumentsResult = apply(self, arguments);
}
return applyArgumentsResult;
2026-07-20 16:05:17 +00:00
}
function _handleFriendSuggestionCreateNotification() {
2026-07-29 08:29:29 +00:00
const self = this;
const tmp = callback((arg0) => {
2026-08-24 06:08:38 +00:00
closure_0 = arg0;
c3 = 0;
c4 = 0;
2026-07-29 08:29:29 +00:00
return (function*(arg0) {
if (c4 === 2) {
c4 = 3;
HermesBuiltin.throwTypeError();
} else if (tmp4 === 3) {
if (arg0 === 1) {
throw arg1;
} else if (arg0 === 2) {
let obj = { value: null, done: true };
obj[0] = arg1;
return obj;
} else {
2026-09-01 10:26:29 +00:00
return { value: "HermesInternal", done: null };
2026-07-29 08:29:29 +00:00
}
} else {
try {
c4 = 2;
if (0 === dependencyMap) {
if (arg0 === 1) {
c4 = 3;
throw arg1;
} else if (arg0 === 2) {
c4 = 3;
obj = { value: null, done: true };
obj[0] = arg1;
return obj;
} else {
let user_id = tmp5;
let navigation = tmp2;
navigation = undefined;
user_id = undefined;
dependencyMap = 1;
c4 = 1;
2026-08-24 06:08:38 +00:00
obj1 = { value: null, done: false };
obj1[0] = closure_1_23();
2026-07-29 08:29:29 +00:00
return obj1;
}
} else if (1 === tmp5) {
if (arg0 === 1) {
c4 = 3;
throw arg1;
} else if (arg0 === 2) {
c4 = 3;
const obj2 = { value: null, done: true };
obj2[0] = arg1;
return obj2;
} else {
navigation = lib(4418).getRootNavigationRef();
2026-07-29 08:29:29 +00:00
if (null != navigation) {
const obj3 = { screen: "add-friends", params: null };
obj3[1] = { sourcePage: "Notifications" };
navigation.navigate("friends", obj3);
}
user_id = lib.user_id;
dependencyMap = 2;
c4 = 1;
const obj4 = { value: null, done: false };
2026-08-24 06:08:38 +00:00
obj4[0] = callback(closure_9, () => null != closure_1_9.getUser(user_id));
2026-07-29 08:29:29 +00:00
return obj4;
}
} else if (arg0 === 1) {
c4 = 3;
throw arg1;
} else if (arg0 === 2) {
c4 = 3;
const obj5 = { value: null, done: true };
obj5[0] = arg1;
return obj5;
} else {
obj = { userId: null, sourceAnalyticsLocations: null };
obj[0] = user_id;
const items = [navigation(7182).PUSH_NOTIFICATION];
2026-07-29 08:29:29 +00:00
obj[1] = items;
navigation(8179)(obj);
2026-07-29 08:29:29 +00:00
c4 = 3;
2026-09-01 10:26:29 +00:00
return { value: "HermesInternal", done: null };
2026-07-29 08:29:29 +00:00
}
} catch (tmp24) {
c4 = tmp;
throw tmp24;
}
}
})();
});
2026-08-24 06:08:38 +00:00
closure_32 = tmp;
2026-07-29 08:29:29 +00:00
const apply = tmp.apply;
if (typeof apply === "unknown") {
let applyArgumentsResult = HermesBuiltin.applyArguments(self);
} else {
applyArgumentsResult = apply(self, arguments);
}
return applyArgumentsResult;
2026-07-20 16:05:17 +00:00
}
function _maybeAckNotificationCenter() {
2026-07-29 08:29:29 +00:00
const self = this;
const tmp = callback((arg0) => {
2026-08-24 06:08:38 +00:00
closure_0 = arg0;
c3 = 0;
c4 = 0;
2026-07-29 08:29:29 +00:00
return (function*(arg0) {
if (c4 === 2) {
c4 = 3;
HermesBuiltin.throwTypeError();
} else if (tmp4 === 3) {
if (arg0 === 1) {
throw arg1;
} else if (arg0 === 2) {
let obj = { value: null, done: true };
obj[0] = arg1;
return obj;
} else {
2026-09-01 10:26:29 +00:00
return { value: "HermesInternal", done: null };
2026-07-29 08:29:29 +00:00
}
} else {
try {
c4 = 2;
if (0 === dependencyMap) {
if (arg0 === 1) {
c4 = 3;
throw arg1;
} else if (arg0 === 2) {
c4 = 3;
obj = { value: null, done: true };
obj[0] = arg1;
return obj;
} else {
2026-08-24 06:08:38 +00:00
closure_2 = tmp5;
2026-07-29 08:29:29 +00:00
let prop = tmp2;
prop = undefined;
closure_2 = undefined;
prop = null;
if ("notification_center_id" in lib) {
prop = tmp38.notification_center_id;
}
let since = null;
if ("since" in lib) {
since = tmp38.since;
}
if ("RELATIONSHIP_ADD" === lib.type) {
const _Number = Number;
2026-08-24 06:08:38 +00:00
if (Number(tmp38.rel_type) === closure_1_13.PENDING_INCOMING) {
2026-07-29 08:29:29 +00:00
if (null != since) {
dependencyMap = 1;
c4 = 1;
2026-08-24 06:08:38 +00:00
obj1 = { value: null, done: false };
obj1[0] = closure_1_20();
2026-07-29 08:29:29 +00:00
return obj1;
}
}
}
if (null != prop) {
dependencyMap = 2;
c4 = 1;
const obj2 = { value: null, done: false };
2026-08-24 06:08:38 +00:00
obj2[0] = closure_1_20();
2026-07-29 08:29:29 +00:00
return obj2;
} else {
c4 = 3;
}
}
} else if (1 === tmp5) {
if (arg0 === 1) {
c4 = 3;
throw arg1;
} else if (arg0 === 2) {
c4 = 3;
const obj3 = { value: null, done: true };
obj3[0] = arg1;
return obj3;
} else {
const _Date = Date;
const _String = String;
const date = new Date(String(lib.since));
closure_2 = prop(11).fromTimestamp(date.getTime());
const obj8 = prop(11);
const _HermesInternal = HermesInternal;
const items = ["incoming_friend_requests_" + lib.user_id + "_" + closure_2];
const result = lib(16417).markNotificationCenterLocalItemsAcked(items);
const obj10 = lib(16417);
2026-07-29 08:29:29 +00:00
}
} else if (arg0 === 1) {
c4 = 3;
throw arg1;
} else if (arg0 !== 2) {
obj = lib(16417);
2026-07-29 08:29:29 +00:00
const result1 = obj.markNotificationCenterRemoteItemAcked(prop);
}
c4 = 3;
const obj4 = { value: null, done: true };
obj4[0] = arg1;
return obj4;
} catch (tmp18) {
c4 = tmp;
throw tmp18;
}
}
})();
});
2026-08-24 06:08:38 +00:00
closure_33 = tmp;
2026-07-29 08:29:29 +00:00
const apply = tmp.apply;
if (typeof apply === "unknown") {
let applyArgumentsResult = HermesBuiltin.applyArguments(self);
} else {
applyArgumentsResult = apply(self, arguments);
}
return applyArgumentsResult;
2026-07-20 16:05:17 +00:00
}
function receiveNotification_(type) {
const _require = type;
let obj = _require(12786);
2026-07-20 16:05:17 +00:00
const result = obj.initializeRouteManagerIfNeeded();
if ("MESSAGE_CREATE" === type.type) {
2026-07-20 16:05:17 +00:00
const _HermesInternal2 = HermesInternal;
logger.log("Notification clicked of type " + type.type + " with guild:" + type.guild_id + " channel:" + type.channel_id + " message:" + type.message_id);
2026-07-29 08:29:29 +00:00
obj = { guildId: null, channelId: null, messageId: null, isPreload: true };
({ guild_id: obj10[0], channel_id: obj10[1], message_id: obj10[2] } = type);
2026-08-24 06:08:38 +00:00
const messages = fetchMessagesDefault.fetchMessages(obj);
2026-09-03 10:05:34 +00:00
const obj9 = fetchMessagesDefault;
2026-07-20 16:05:17 +00:00
} else {
if ("GENERIC_PUSH_NOTIFICATION_SENT" === type.type) {
if (null != type.deeplink) {
if ("" !== type.deeplink) {
const payload = parseQueryDefault(type.deeplink).payload;
if (payload.type === tmp(1093).LinkingTypes.MESSAGE) {
2026-07-20 16:05:17 +00:00
let tracking_type;
if (type != null) {
tracking_type = type.tracking_type;
2026-07-20 16:05:17 +00:00
}
2026-09-03 10:05:34 +00:00
if (tracking_type == null) {
tracking_type = type.type;
2026-07-20 16:05:17 +00:00
}
2026-07-29 08:29:29 +00:00
if (tmp8) {
tmp(11632).receivedNotification(payload.messageId, payload.channelId, tracking_type);
const tmpResult = tmp(11632);
2026-07-20 16:05:17 +00:00
}
let tmp20Result = tmp20(9946);
2026-07-29 08:29:29 +00:00
obj = { guildId: null, channelId: null, messageId: null, isPreload: true };
2026-09-03 10:05:34 +00:00
({ guildId: obj8[0], channelId: obj8[1], messageId: obj8[2] } = payload);
const messages1 = tmp20Result.fetchMessages(obj);
2026-09-03 10:05:34 +00:00
tmp8 = null != tracking_type && null != payload.messageId && null != payload.channelId;
2026-07-20 16:05:17 +00:00
} else {
if (payload.type === tmp(1093).LinkingTypes.ICYMI) {
if (null != type.channel_id) {
if (null != type.message_id) {
tmp20Result = tmp20(8351);
const forNotification = tmp20Result.fetchForNotification(type.channel_id, type.message_id);
2026-07-20 16:05:17 +00:00
}
}
}
if (payload.type === tmp(1093).LinkingTypes.ICYMI) {
if (null != type.user_id) {
if (null != type.notification_center_id) {
2026-07-20 16:05:17 +00:00
let status_emoji_id = null;
if (null != type.status_emoji_id) {
2026-07-20 16:05:17 +00:00
status_emoji_id = null;
if ("0" !== type.status_emoji_id) {
status_emoji_id = type.status_emoji_id;
2026-07-20 16:05:17 +00:00
}
}
2026-08-24 06:08:38 +00:00
obj1 = { id: null, type: null, score: 1000, data: null };
obj1[0] = type.notification_center_id;
obj1[1] = tmp(8348).ICYMIItemTypes.CUSTOM_STATUS;
2026-07-29 08:29:29 +00:00
const obj2 = { user_id: null, text: null, emoji_id: null, emoji_name: null, emoji_animated: null };
({ user_id: obj3[0], status_text: obj3[1] } = type);
2026-07-29 08:29:29 +00:00
obj2[2] = status_emoji_id;
obj2[3] = type.status_emoji_name;
obj2[4] = type.status_emoji_animated;
2026-07-29 08:29:29 +00:00
obj1[3] = obj2;
const forStatusNotification = tmp20(8351).fetchForStatusNotification(obj1);
const tmp20Result1 = tmp20(8351);
2026-07-20 16:05:17 +00:00
}
}
}
}
}
}
}
const _HermesInternal = HermesInternal;
logger.log("Notification clicked of type " + type.type);
2026-07-29 08:29:29 +00:00
}
2026-07-20 16:05:17 +00:00
}
2026-07-29 08:29:29 +00:00
require("processCallbacks").addPostConnectionCallback;
({ AnalyticEvents: unpackModuleId, ComponentActions: closure_12, RelationshipTypes: map1, Routes: closure_14 } = ME);
2026-08-24 06:08:38 +00:00
let closure_18 = new timestampDefault("receiveNotification");
let tmp3 = new timestampDefault("receiveNotification");
let result = require("set").fileFinishedImporting("modules/push_notifications/native/receiveNotification.tsx");
2026-07-20 16:05:17 +00:00
export default function receiveNotification(getData) {
if (null == getData.getData) {
return false;
} else {
data(7475).trackAppOpened("notification");
2026-07-23 10:11:24 +00:00
data = getData.getData();
const obj3 = data(7475);
2026-07-29 08:29:29 +00:00
const tmp11 = importDefault;
2026-07-20 16:05:17 +00:00
const _HermesInternal = HermesInternal;
2026-08-24 06:08:38 +00:00
isTracingDefault.mark("\u2757", "Receive notification " + data.type);
2026-07-20 16:05:17 +00:00
if (null != data.receiving_user_id) {
2026-07-29 08:29:29 +00:00
if (null != id.getId()) {
if (data.receiving_user_id !== obj.getId()) {
tmp7(7476);
tmp7(5277);
tmp7(13633);
2026-07-29 08:29:29 +00:00
let receiving_user_id = data.receiving_user_id;
receiving_user_id = tmp7(12421).switchAccount(receiving_user_id, false, arg1 ? tmp5.PUSH_NOTIFICATION_INITIAL : tmp5.PUSH_NOTIFICATION);
2026-07-29 08:29:29 +00:00
receiving_user_id.then(() => {
2026-08-24 06:08:38 +00:00
const Emitter = closure_1_1(closure_1_3[40]).Emitter;
Emitter.batched(() => closure_1_34(closure_0));
2026-07-20 16:05:17 +00:00
});
const tmp7Result2 = tmp7(12421);
2026-07-20 16:05:17 +00:00
}
}
2026-07-29 08:29:29 +00:00
obj = id;
2026-07-20 16:05:17 +00:00
}
let Emitter = tmp11(504).Emitter;
2026-08-24 06:08:38 +00:00
return Emitter.batched(() => closure_1_34(data));
2026-07-20 16:05:17 +00:00
}
};