2026-07-24 07:16:23 +00:00
// Module ID: 16637
// Function ID: 129752
2026-07-20 16:05:17 +00:00
// Name: onStageConnectionError
2026-07-24 07:16:23 +00:00
// Dependencies: [5, 7541, 6758, 1194, 1348, 1849, 5591, 653, 4195, 1354, 11483, 3, 3831, 1212, 9350, 3982, 1207, 7557, 4138, 5737, 8397, 3981, 15190, 6882, 8537, 5482, 4140, 8961, 675, 4324, 477, 10844, 21, 15188, 6707, 20, 6708, 4808, 12695, 11486, 566, 10833, 9910, 4111, 668, 9537, 8365, 7086, 686, 4337, 1198, 4336, 12909, 2]
2026-07-20 16:05:17 +00:00
// Exports: default
2026-07-24 07:16:23 +00:00
// Module 16637 (onStageConnectionError)
2026-07-23 10:11:24 +00:00
import _isNativeReflectConstruct from "_isNativeReflectConstruct" ;
import closure_6 from "_isNativeReflectConstruct" ;
import closure_7 from "_isNativeReflectConstruct" ;
import closure_8 from "_isNativeReflectConstruct" ;
import closure_9 from "_isNativeReflectConstruct" ;
import { NotificationTypes } from "str2" ;
import ME from "ME" ;
import { StreamTypes } from "StreamIssueReportReasons" ;
import { GuildScheduledEventEntityTypes as closure_16 } from "GUILD_EVENT_MAX_NAME_LENGTH" ;
import { MultiAccountSwitchLocation as closure_17 } from "MAX_ACCOUNTS" ;
import importDefaultResult from "_isNativeReflectConstruct" ;
let closure_11 ;
let closure_12 ;
let closure_13 ;
let closure_14 ;
const require = arg1 ;
2026-07-20 16:05:17 +00:00
function onStageConnectionError() {
2026-07-23 10:11:24 +00:00
let obj = importDefault ( 3831 ) ;
2026-07-20 16:05:17 +00:00
obj = { key : "STAGE_DISCOVERY_CONNECTION_ERROR_GENERIC" } ;
2026-07-23 10:11:24 +00:00
const intl = require ( 1212 ) /* getSystemLocale */ . intl ;
obj . content = intl . string ( require ( 1212 ) /* getSystemLocale */ . t . ah3RLk ) ;
2026-07-24 07:16:23 +00:00
obj . icon = importDefault ( 9350 ) ;
2026-07-20 16:05:17 +00:00
obj . open ( obj ) ;
}
function waitForConnection() {
return new Promise ( ( arg0 ) = > {
2026-07-23 10:11:24 +00:00
outer1_5 ( arg0 ) ;
2026-07-20 16:05:17 +00:00
} ) ;
}
function waitForDataOrConnection() {
return _waitForDataOrConnection ( . . . arguments ) ;
}
function _waitForDataOrConnection() {
// CreateGeneratorClosureLongIndex (0x67)
const obj = callback ( tmp ) ;
return obj ( . . . arguments ) ;
}
function waitForNavigationReady() {
return _waitForNavigationReady ( . . . arguments ) ;
}
function _waitForNavigationReady() {
// CreateGeneratorClosureLongIndex (0x67)
const obj = callback ( tmp ) ;
return obj ( . . . arguments ) ;
}
function _connectToStage() {
return _connectToStage2 ( . . . arguments ) ;
}
function _connectToStage2() {
// CreateGeneratorClosureLongIndex (0x67)
const obj = callback ( tmp ) ;
return obj ( . . . arguments ) ;
}
function _handleStageNotification() {
// CreateGeneratorClosureLongIndex (0x67)
const obj = callback ( tmp ) ;
return obj ( . . . arguments ) ;
}
function _handleGuildEventNotification() {
// CreateGeneratorClosureLongIndex (0x67)
const obj = callback ( tmp ) ;
return obj ( . . . arguments ) ;
}
function _handleRelationshipAddNotification() {
// CreateGeneratorClosureLongIndex (0x67)
const obj = callback ( tmp ) ;
return obj ( . . . arguments ) ;
}
function _handleCallRingNotification() {
// CreateGeneratorClosureLongIndex (0x67)
const obj = callback ( tmp ) ;
return obj ( . . . arguments ) ;
}
function _handleCallConnectNotification() {
// CreateGeneratorClosureLongIndex (0x67)
const obj = callback ( tmp ) ;
return obj ( . . . arguments ) ;
}
function _handleFriendSuggestionCreateNotification() {
// CreateGeneratorClosureLongIndex (0x67)
const obj = callback ( tmp ) ;
return obj ( . . . arguments ) ;
}
function _maybeAckNotificationCenter() {
// CreateGeneratorClosureLongIndex (0x67)
const obj = callback ( tmp ) ;
return obj ( . . . arguments ) ;
}
function receiveNotification_ ( type ) {
2026-07-23 10:11:24 +00:00
const _require = type ;
2026-07-24 07:16:23 +00:00
let obj = _require ( 10833 ) ;
2026-07-20 16:05:17 +00:00
const result = obj . initializeRouteManagerIfNeeded ( ) ;
let importDefault = false ;
if ( "MESSAGE_CREATE" === type . type ) {
const _HermesInternal2 = HermesInternal ;
importDefaultResult . log ( "Notification clicked of type " + type . type + " with guild:" + type . guild_id + " channel:" + type . channel_id + " message:" + type . message_id ) ;
obj = { } ;
( { guild_id : obj10.guildId , channel_id : obj10.channelId , message_id : obj10.messageId } = type ) ;
obj . isPreload = true ;
2026-07-24 07:16:23 +00:00
const messages = importDefault ( 9910 ) . fetchMessages ( obj ) ;
2026-07-20 16:05:17 +00:00
importDefault = true ;
let flag = true ;
2026-07-24 07:16:23 +00:00
const obj9 = importDefault ( 9910 ) ;
2026-07-20 16:05:17 +00:00
} else {
flag = false ;
if ( "GENERIC_PUSH_NOTIFICATION_SENT" === type . type ) {
flag = false ;
if ( null != type . deeplink ) {
flag = false ;
if ( "" !== type . deeplink ) {
2026-07-23 10:11:24 +00:00
const payload = importDefault ( 4111 ) ( type . deeplink ) . payload ;
if ( payload . type === _require ( 668 ) . LinkingTypes . MESSAGE ) {
2026-07-20 16:05:17 +00:00
let tracking_type ;
if ( null != type ) {
tracking_type = type . tracking_type ;
}
if ( null == tracking_type ) {
tracking_type = type . type ;
}
if ( tmp13 ) {
2026-07-24 07:16:23 +00:00
_require ( 9537 ) . receivedNotification ( payload . messageId , payload . channelId , tracking_type ) ;
const obj6 = _require ( 9537 ) ;
2026-07-20 16:05:17 +00:00
}
obj = { } ;
( { guildId : obj8.guildId , channelId : obj8.channelId , messageId : obj8.messageId } = payload ) ;
obj . isPreload = true ;
2026-07-24 07:16:23 +00:00
const messages1 = importDefault ( 9910 ) . fetchMessages ( obj ) ;
2026-07-20 16:05:17 +00:00
importDefault = true ;
flag = true ;
2026-07-24 07:16:23 +00:00
let obj7 = importDefault ( 9910 ) ;
2026-07-23 10:11:24 +00:00
tmp13 = null != tracking_type && null != payload . messageId && null != payload . channelId ;
2026-07-20 16:05:17 +00:00
} else {
2026-07-23 10:11:24 +00:00
if ( payload . type === _require ( 668 ) . LinkingTypes . ICYMI ) {
2026-07-20 16:05:17 +00:00
if ( null != type . channel_id ) {
if ( null != type . message_id ) {
2026-07-24 07:16:23 +00:00
const forNotification = importDefault ( 8365 ) . fetchForNotification ( type . channel_id , type . message_id ) ;
2026-07-20 16:05:17 +00:00
flag = false ;
2026-07-24 07:16:23 +00:00
let obj5 = importDefault ( 8365 ) ;
2026-07-20 16:05:17 +00:00
}
}
}
flag = false ;
2026-07-23 10:11:24 +00:00
if ( payload . type === _require ( 668 ) . LinkingTypes . ICYMI ) {
2026-07-20 16:05:17 +00:00
flag = false ;
if ( null != type . user_id ) {
flag = false ;
if ( null != type . notification_center_id ) {
let status_emoji_id = null ;
if ( null != type . status_emoji_id ) {
status_emoji_id = null ;
if ( "0" !== type . status_emoji_id ) {
status_emoji_id = type . status_emoji_id ;
}
}
2026-07-24 07:16:23 +00:00
let obj1 = { id : type.notification_center_id , type : _require ( 7086 ) . ICYMIItemTypes . CUSTOM_STATUS , score : 1000 } ;
2026-07-23 10:11:24 +00:00
let obj2 = { } ;
2026-07-20 16:05:17 +00:00
( { user_id : obj3.user_id , status_text : obj3.text } = type ) ;
obj2 . emoji_id = status_emoji_id ;
obj2 . emoji_name = type . status_emoji_name ;
obj2 . emoji_animated = type . status_emoji_animated ;
obj1 . data = obj2 ;
2026-07-24 07:16:23 +00:00
const forStatusNotification = importDefault ( 8365 ) . fetchForStatusNotification ( obj1 ) ;
2026-07-20 16:05:17 +00:00
flag = false ;
2026-07-24 07:16:23 +00:00
const obj4 = importDefault ( 8365 ) ;
2026-07-20 16:05:17 +00:00
}
}
}
}
}
}
}
const _HermesInternal = HermesInternal ;
importDefaultResult . log ( "Notification clicked of type " + type . type ) ;
}
type = type . type ;
if ( "MESSAGE_CREATE" !== type ) {
if ( "FORUM_THREAD_CREATED" !== type ) {
if ( "RELATIONSHIP_ADD" !== type ) {
if ( "CALL_RING" !== type ) {
if ( "CALL_CONNECT" !== type ) {
if ( "FRIEND_SUGGESTION_CREATE" !== type ) {
if ( "STAGE_INSTANCE_CREATE" !== type ) {
if ( "GUILD_SCHEDULED_EVENT_UPDATE" !== type ) {
if ( "GUILD_STREAM_START" !== type ) {
if ( "GENERIC_PUSH_NOTIFICATION_SENT" !== type ) {
return flag ;
}
}
}
}
}
}
}
}
}
}
2026-07-23 10:11:24 +00:00
( function dispatch() {
let obj = _true ( outer1_3 [ 48 ] ) ;
2026-07-20 16:05:17 +00:00
obj . dispatch ( { type : "PUSH_NOTIFICATION_CLICK" } ) ;
2026-07-23 10:11:24 +00:00
let obj1 = _true ( outer1_3 [ 28 ] ) ;
obj = { notif_type : "tracking_type" in type ? tmp2.tracking_type : tmp2.type } ;
2026-07-20 16:05:17 +00:00
let user_id = null ;
2026-07-23 10:11:24 +00:00
if ( "user_id" in type ) {
user_id = type . user_id ;
2026-07-20 16:05:17 +00:00
}
obj . notif_user_id = user_id ;
let message_id = null ;
2026-07-23 10:11:24 +00:00
if ( "message_id" in type ) {
message_id = type . message_id ;
2026-07-20 16:05:17 +00:00
}
obj . message_id = message_id ;
let message_type_ = null ;
2026-07-23 10:11:24 +00:00
if ( "message_type_" in type ) {
message_type_ = type . message_type_ ;
2026-07-20 16:05:17 +00:00
}
obj . message_type = message_type_ ;
2026-07-23 10:11:24 +00:00
let tmp9 = "message" in type ;
2026-07-20 16:05:17 +00:00
if ( tmp9 ) {
2026-07-23 10:11:24 +00:00
tmp9 = null != type . message ;
2026-07-20 16:05:17 +00:00
}
obj . has_message = tmp9 ;
let guild_id = null ;
2026-07-23 10:11:24 +00:00
if ( "guild_id" in type ) {
guild_id = type . guild_id ;
2026-07-20 16:05:17 +00:00
}
obj . guild_id = guild_id ;
let channel_id = null ;
2026-07-23 10:11:24 +00:00
if ( "channel_id" in type ) {
channel_id = type . channel_id ;
2026-07-20 16:05:17 +00:00
}
obj . channel_id = channel_id ;
let channel_type = null ;
2026-07-23 10:11:24 +00:00
if ( "channel_type" in type ) {
channel_type = type . channel_type ;
2026-07-20 16:05:17 +00:00
}
obj . channel_type = channel_type ;
let NumberResult = null ;
2026-07-23 10:11:24 +00:00
if ( "rel_type" in type ) {
2026-07-20 16:05:17 +00:00
const _Number = Number ;
2026-07-23 10:11:24 +00:00
NumberResult = Number ( type . rel_type ) ;
2026-07-20 16:05:17 +00:00
}
obj . rel_type = NumberResult ;
let notification_id = null ;
2026-07-23 10:11:24 +00:00
if ( "notification_id" in type ) {
notification_id = type . notification_id ;
2026-07-20 16:05:17 +00:00
}
obj . notification_id = notification_id ;
2026-07-23 10:11:24 +00:00
let tmp22 = "image_url" in type ;
2026-07-20 16:05:17 +00:00
if ( tmp22 ) {
2026-07-23 10:11:24 +00:00
tmp22 = null != type . image_url ;
2026-07-20 16:05:17 +00:00
}
obj . has_image_thumbnail = tmp22 ;
let join_id = null ;
2026-07-23 10:11:24 +00:00
if ( "join_id" in type ) {
join_id = type . join_id ;
2026-07-20 16:05:17 +00:00
}
obj . join_id = join_id ;
let notif_instance_id = null ;
2026-07-23 10:11:24 +00:00
if ( "notif_instance_id" in type ) {
notif_instance_id = type . notif_instance_id ;
2026-07-20 16:05:17 +00:00
}
obj . notif_instance_id = notif_instance_id ;
let notif_type_id = null ;
2026-07-23 10:11:24 +00:00
if ( "notif_type_id" in type ) {
notif_type_id = type . notif_type_id ;
2026-07-20 16:05:17 +00:00
}
obj . notif_type_id = notif_type_id ;
let mention_type = null ;
2026-07-23 10:11:24 +00:00
if ( "mention_type" in type ) {
mention_type = type . mention_type ;
2026-07-20 16:05:17 +00:00
}
obj . mention_type = mention_type ;
2026-07-23 10:11:24 +00:00
obj1 . track ( outer1_11 . NOTIFICATION_CLICKED , obj ) ;
( function maybeAckNotificationCenter ( closure_0 ) {
return outer2_33 ( . . . arguments ) ;
} ) ( type ) ;
type = type . type ;
2026-07-20 16:05:17 +00:00
if ( "MESSAGE_CREATE" === type ) {
2026-07-23 10:11:24 +00:00
if ( null != type . message ) {
obj = { type : "MESSAGE_CREATE" , channelId : type.message.channel_id , message : type.message , optimistic : true , isPushNotification : true } ;
_true ( outer1_3 [ 48 ] ) . dispatch ( obj ) ;
const obj5 = _true ( outer1_3 [ 48 ] ) ;
2026-07-20 16:05:17 +00:00
}
2026-07-23 10:11:24 +00:00
_true ( outer1_3 [ 49 ] ) . popAll ( ) ;
const obj7 = _true ( outer1_3 [ 49 ] ) ;
obj1 = { navigationReplace : true , openChannel : true , skipMessageFetch : _true } ;
type ( outer1_3 [ 50 ] ) . transitionTo ( outer1_14 . CHANNEL ( type . guild_id , type . channel_id , type . message_id ) , obj1 ) ;
const obj8 = type ( outer1_3 [ 50 ] ) ;
2026-07-20 16:05:17 +00:00
} else if ( "FORUM_THREAD_CREATED" === type ) {
2026-07-23 10:11:24 +00:00
outer1_20 ( ) . then ( ( ) = > {
callback ( outer2_3 [ 50 ] ) . transitionTo ( outer2_14 . CHANNEL ( outer1_0 . guild_id , outer1_0 . channel_id ) , { navigationReplace : true , openChannel : true } ) ;
2026-07-20 16:05:17 +00:00
} ) ;
2026-07-23 10:11:24 +00:00
const promise = outer1_20 ( ) ;
2026-07-20 16:05:17 +00:00
} else if ( "RELATIONSHIP_ADD" === type ) {
2026-07-23 10:11:24 +00:00
! ( function handleRelationshipAddNotification ( closure_0 ) {
return outer2_29 ( . . . arguments ) ;
} ) ( type ) ;
2026-07-20 16:05:17 +00:00
} else if ( "CALL_RING" === type ) {
2026-07-23 10:11:24 +00:00
! ( function handleCallRingNotification ( closure_0 ) {
return outer2_30 ( . . . arguments ) ;
} ) ( type ) ;
2026-07-20 16:05:17 +00:00
} else if ( "CALL_CONNECT" === type ) {
2026-07-23 10:11:24 +00:00
! ( function handleCallConnectNotification ( closure_0 ) {
return outer2_31 ( . . . arguments ) ;
} ) ( type ) ;
2026-07-20 16:05:17 +00:00
} else if ( "FRIEND_SUGGESTION_CREATE" === type ) {
2026-07-23 10:11:24 +00:00
! ( function handleFriendSuggestionCreateNotification ( closure_0 ) {
return outer2_32 ( . . . arguments ) ;
} ) ( type ) ;
2026-07-20 16:05:17 +00:00
} else if ( "GUILD_STREAM_START" === type ) {
2026-07-23 10:11:24 +00:00
const obj2 = { streamType : outer1_15.GUILD } ;
( { user_id : obj4.ownerId , guild_id : obj4.guildId , channel_id : obj4.channelId } = type ) ;
_true ( outer1_3 [ 51 ] ) ( obj2 ) ;
2026-07-20 16:05:17 +00:00
} else if ( "GUILD_SCHEDULED_EVENT_UPDATE" === type ) {
2026-07-23 10:11:24 +00:00
! ( function handleGuildEventNotification ( closure_0 ) {
return outer2_28 ( . . . arguments ) ;
} ) ( type ) ;
2026-07-20 16:05:17 +00:00
} else if ( "STAGE_INSTANCE_CREATE" === type ) {
2026-07-23 10:11:24 +00:00
! ( function handleStageNotification ( closure_0 ) {
return outer2_27 ( . . . arguments ) ;
} ) ( type ) ;
2026-07-20 16:05:17 +00:00
} else if ( "GENERIC_PUSH_NOTIFICATION_SENT" === type ) {
2026-07-23 10:11:24 +00:00
if ( null != type . deeplink ) {
if ( "" !== type . deeplink ) {
const obj3 = { payload : _true ( outer1_3 [ 43 ] ) ( type . deeplink ) . payload , waitForConnection : false , skipMessageFetch : _true } ;
_true ( outer1_3 [ 52 ] ) ( obj3 ) ;
2026-07-20 16:05:17 +00:00
}
}
}
2026-07-23 10:11:24 +00:00
} ) ( ) ;
2026-07-20 16:05:17 +00:00
return flag ;
}
2026-07-23 10:11:24 +00:00
require ( "shouldWaitForBlockingModals" ) . addPostConnectionCallback ;
( { AnalyticEvents : closure_11 , ComponentActions : closure_12 , RelationshipTypes : closure_13 , Routes : closure_14 } = ME ) ;
2026-07-20 16:05:17 +00:00
importDefaultResult = new importDefaultResult ( "receiveNotification" ) ;
2026-07-23 10:11:24 +00:00
let result = require ( "_isNativeReflectConstruct" ) . 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 {
2026-07-23 10:11:24 +00:00
data ( 6707 ) . trackAppOpened ( "notification" ) ;
data = getData . getData ( ) ;
const obj2 = data ( 6707 ) ;
2026-07-20 16:05:17 +00:00
const _HermesInternal = HermesInternal ;
2026-07-23 10:11:24 +00:00
importDefault ( 20 ) . mark ( "\u2757" , "Receive notification " + data . type ) ;
2026-07-20 16:05:17 +00:00
if ( null != data . receiving_user_id ) {
if ( null != store . getId ( ) ) {
if ( data . receiving_user_id !== store . getId ( ) ) {
2026-07-23 10:11:24 +00:00
data ( 6708 ) ;
data ( 4808 ) ;
2026-07-24 07:16:23 +00:00
data ( 12695 ) ;
2026-07-20 16:05:17 +00:00
let then = closure_17 ;
2026-07-24 07:16:23 +00:00
const obj = data ( 11486 ) ;
then = data ( 11486 ) . switchAccount ( data . receiving_user_id , false , arg1 ? then.PUSH_NOTIFICATION_INITIAL : then.PUSH_NOTIFICATION ) . then ;
2026-07-20 16:05:17 +00:00
then ( ( ) = > {
2026-07-23 10:11:24 +00:00
const Emitter = outer1_1 ( outer1_3 [ 40 ] ) . Emitter ;
Emitter . batched ( ( ) = > outer2_34 ( outer1_0 ) ) ;
2026-07-20 16:05:17 +00:00
} ) ;
2026-07-24 07:16:23 +00:00
const switchAccountResult = data ( 11486 ) . switchAccount ( data . receiving_user_id , false , arg1 ? then.PUSH_NOTIFICATION_INITIAL : then.PUSH_NOTIFICATION ) ;
2026-07-20 16:05:17 +00:00
}
}
}
2026-07-23 10:11:24 +00:00
let Emitter = importDefault ( 566 ) . Emitter ;
return Emitter . batched ( ( ) = > outer1_34 ( data ) ) ;
2026-07-20 16:05:17 +00:00
}
} ;