2026-09-22 07:41:18 +00:00
// Module ID: 4780
// Function ID: 4781
2026-09-10 05:38:07 +00:00
// Name: RTCConnectionStore
2026-09-22 07:41:18 +00:00
// Dependencies: [4774, 502, 4781, 1074, 4782, 3, 4784, 4811, 573, 14100, 2037, 4786, 5630, 14101, 504, 14103, 1241, 1980, 2]
2026-07-20 16:05:17 +00:00
2026-09-22 07:41:18 +00:00
// Module 4780 (RTCConnectionStore)
2026-09-10 05:38:07 +00:00
import LoggerDefault from "Logger" /* 3 */ ;
2026-09-05 10:56:28 +00:00
import initializeDefault from "initialize" /* 504 */ ;
2026-09-10 05:38:07 +00:00
import DispatcherDefault from "Dispatcher" /* 573 */ ;
2026-09-22 07:41:18 +00:00
import TimeUtils from "TimeUtils" /* 4786 */ ;
import VoiceStateAnalyticsDefault from "VoiceStateAnalytics" /* 14100 */ ;
import useSpatialAudioControlState from "useSpatialAudioControlState" /* 14101 */ ;
import trackVideoToggle from "trackVideoToggle" /* 14103 */ ;
import GameConsoleStore from "GameConsoleStore" /* 4774 */ ;
2026-09-10 05:38:07 +00:00
import AuthenticationStore from "AuthenticationStore" /* 502 */ ;
2026-09-22 07:41:18 +00:00
import SortedVoiceStateStore from "SortedVoiceStateStore" /* 4781 */ ;
2026-07-23 10:11:24 +00:00
2026-09-10 05:38:07 +00:00
require = fn ;
function createRTCConnection ( guildId , channelId , createdTime ) {
if ( null == sessionId ) {
2026-07-20 16:05:17 +00:00
const _Error = Error ;
2026-09-10 05:38:07 +00:00
const error = new Error ( "Creating RTCConnection without session." ) ;
2026-07-20 16:05:17 +00:00
throw error ;
} else {
2026-09-10 05:38:07 +00:00
const id = AuthenticationStore . getId ( ) ;
let obj = { userId : id , sessionId , guildId , channelId , joinVoiceId , createdTime } ;
2026-09-22 07:41:18 +00:00
_default = new _default ( 4784 ) . default ( obj ) ;
_default . on ( _default ( 4811 ) . RTCConnectionEvent . State , ( state , arg1 , arg2 ) = > {
2026-09-10 05:38:07 +00:00
closure_1 = arg1 ;
2026-08-24 06:08:38 +00:00
dependencyMap = arg2 ;
2026-09-10 05:38:07 +00:00
closure_1 ( 573 ) . wait ( ( ) = > {
const merged = Object . assign ( closure_1 ) ;
const merged1 = Object . assign ( closure_2 ) ;
return DispatcherDefault . dispatch ( { type : "RTC_CONNECTION_STATE" , state } ) ;
2026-07-20 16:05:17 +00:00
} ) ;
} ) ;
2026-09-22 07:41:18 +00:00
_default . on ( _default ( 4811 ) . RTCConnectionEvent . Video , ( guildId , channelId , userId , streamId , rtcServerId ) = > {
2026-09-10 05:38:07 +00:00
DispatcherDefault . wait ( ( ) = > {
const obj = DispatcherDefault ;
return obj . dispatch ( { type : "RTC_CONNECTION_VIDEO" , guildId , channelId , userId , streamId , rtcServerId , context : MediaEngineContextTypes.DEFAULT , mediaEngineConnectionId : _default.getMediaEngineConnectionId ( ) } ) ;
2026-07-20 16:05:17 +00:00
} ) ;
} ) ;
2026-09-22 07:41:18 +00:00
_default . on ( _default ( 4811 ) . RTCConnectionEvent . Ping , ( pings , quality ) = > {
2026-09-10 05:38:07 +00:00
quality ( 573 ) . wait ( ( ) = > DispatcherDefault . dispatch ( { type : "RTC_CONNECTION_PING" , pings , quality } ) ) ;
2026-07-20 16:05:17 +00:00
} ) ;
2026-09-22 07:41:18 +00:00
_default . on ( _default ( 4811 ) . RTCConnectionEvent . OutboundLossRate , ( lossRate ) = > {
2026-09-10 05:38:07 +00:00
closure_1 ( 573 ) . wait ( ( ) = > DispatcherDefault . dispatch ( { type : "RTC_CONNECTION_LOSS_RATE" , lossRate } ) ) ;
2026-07-20 16:05:17 +00:00
} ) ;
2026-09-22 07:41:18 +00:00
_default . on ( _default ( 4811 ) . RTCConnectionEvent . Speaking , ( userId , speaking ) = > {
2026-09-10 05:38:07 +00:00
if ( speaking != null ) {
speaking . setSpeaking ( userId , speaking ) ;
2026-07-20 16:05:17 +00:00
}
} ) ;
2026-09-22 07:41:18 +00:00
_default . on ( _default ( 4811 ) . RTCConnectionEvent . Flags , ( userId , flags ) = > {
2026-09-10 05:38:07 +00:00
DispatcherDefault . wait ( ( ) = > {
DispatcherDefault . dispatch ( { type : "RTC_CONNECTION_FLAGS" , flags , userId , guildId : _default.guildId , channelId : _default.channelId , context : _default.context } ) ;
2026-07-20 16:05:17 +00:00
} ) ;
} ) ;
2026-09-22 07:41:18 +00:00
_default . on ( _default ( 4811 ) . RTCConnectionEvent . UsersMerged , ( userIds , context ) = > {
2026-09-10 05:38:07 +00:00
DispatcherDefault . dispatch ( { type : "RTC_CONNECTION_USERS_MERGED" , userIds , context } ) ;
2026-07-20 16:05:17 +00:00
} ) ;
2026-09-22 07:41:18 +00:00
_default . on ( _default ( 4811 ) . RTCConnectionEvent . ClientConnect , ( userIds ) = > {
2026-09-10 05:38:07 +00:00
DispatcherDefault . wait ( ( ) = > {
DispatcherDefault . dispatch ( { type : "RTC_CONNECTION_CLIENT_CONNECT" , userIds , guildId : _default.guildId , channelId : _default.channelId , context : _default.context } ) ;
2026-07-20 16:05:17 +00:00
} ) ;
} ) ;
2026-09-22 07:41:18 +00:00
_default . on ( _default ( 4811 ) . RTCConnectionEvent . ClientDisconnect , ( userId ) = > {
2026-09-10 05:38:07 +00:00
DispatcherDefault . wait ( ( ) = > {
DispatcherDefault . dispatch ( { type : "RTC_CONNECTION_CLIENT_DISCONNECT" , userId , guildId : _default.guildId , channelId : _default.channelId , context : _default.context } ) ;
2026-07-20 16:05:17 +00:00
} ) ;
} ) ;
2026-09-22 07:41:18 +00:00
_default . on ( _default ( 4811 ) . RTCConnectionEvent . Platform , ( userId , platform , channelId ) = > {
2026-09-10 05:38:07 +00:00
dependencyMap = channelId ;
platform ( 573 ) . wait ( ( ) = > {
DispatcherDefault . dispatch ( { type : "RTC_CONNECTION_PLATFORM" , platform , userId , channelId } ) ;
2026-07-20 16:05:17 +00:00
} ) ;
} ) ;
2026-09-22 07:41:18 +00:00
_default . on ( _default ( 4811 ) . RTCConnectionEvent . SecureFramesUpdate , ( ) = > {
2026-09-10 05:38:07 +00:00
DispatcherDefault . wait ( ( ) = > {
closure_1_1 ( dependencyMap [ 8 ] ) . dispatch ( { type : "RTC_CONNECTION_SECURE_FRAMES_UPDATE" } ) ;
2026-07-20 16:05:17 +00:00
} ) ;
} ) ;
2026-09-22 07:41:18 +00:00
_default . on ( _default ( 4811 ) . RTCConnectionEvent . RosterMapUpdate , ( userIds ) = > {
2026-09-10 05:38:07 +00:00
closure_1 ( 573 ) . wait ( ( ) = > {
DispatcherDefault . dispatch ( { type : "RTC_CONNECTION_ROSTER_MAP_UPDATE" , userIds } ) ;
2026-07-20 16:05:17 +00:00
} ) ;
} ) ;
2026-09-10 05:38:07 +00:00
const tmp322 = new VoiceStateAnalyticsDefault ( AuthenticationStore . getId ( ) , channelId ) ;
const speaking = tmp322 ;
2026-08-24 06:08:38 +00:00
c15 = null ;
c18 = false ;
c19 = false ;
2026-07-20 16:05:17 +00:00
return _default ;
}
}
function destroyRTCConnection ( arg0 ) {
let flag = arg0 ;
if ( arg0 === undefined ) {
flag = true ;
}
if ( null == redux ) {
return false ;
} else {
2026-09-10 05:38:07 +00:00
obj2 = { duration : redux.getDuration ( ) , mediaSessionId : null , rtcConnectionId : null , wasEverMultiParticipant : null , wasEverRtcConnected : null , voiceStateAnalytics : null , channelId : null } ;
2026-07-29 08:29:29 +00:00
let mediaSessionId = redux . getMediaSessionId ( ) ;
if ( mediaSessionId == null ) {
mediaSessionId = null ;
}
2026-09-10 05:38:07 +00:00
obj2 . mediaSessionId = mediaSessionId ;
obj2 . rtcConnectionId = redux . getRTCConnectionId ( ) ;
obj2 . wasEverMultiParticipant = wasEverMultiParticipant ;
obj2 . wasEverRtcConnected = wasEverRtcConnected ;
obj2 . voiceStateAnalytics = voiceStateAnalytics ;
obj2 . channelId = redux . channelId ;
const obj3 = { type : "MEDIA_ENGINE_CONNECTION_STATS_HISTORY_RESET" , mediaEngineConnectionId : redux.getMediaEngineConnectionId ( ) } ;
DispatcherDefault . dispatch ( obj3 ) ;
2026-07-20 16:05:17 +00:00
redux . destroy ( ) ;
2026-07-23 10:11:24 +00:00
redux = null ;
2026-09-10 05:38:07 +00:00
voiceStateAnalytics = null ;
2026-08-24 06:08:38 +00:00
c22 = false ;
2026-07-20 16:05:17 +00:00
if ( flag ) {
2026-09-10 05:38:07 +00:00
closure_20 = null ;
2026-07-20 16:05:17 +00:00
}
}
}
function handleClearRemoteDisconnectVoiceChannelId() {
2026-08-24 06:08:38 +00:00
c14 = null ;
2026-07-20 16:05:17 +00:00
}
function handleChannelDelete ( arg0 ) {
if ( null != redux ) {
if ( redux . channelId === tmp . id ) {
destroyRTCConnection ( ) ;
}
}
return false ;
}
function handleRtcAction() {
return true ;
}
2026-09-10 05:38:07 +00:00
const Constants = fn ( 1074 ) ;
( { RTCConnectionStates : closure_8 , AppStates : closure_9 , RTCConnectionQuality : c10 } = Constants ) ;
2026-09-22 07:41:18 +00:00
const MediaEngineContextTypes = fn ( 4782 ) . MediaEngineContextTypes ;
2026-09-10 05:38:07 +00:00
let closure_12 = new LoggerDefault ( "RTCConnectionStore" ) ;
2026-07-29 08:29:29 +00:00
let closure_13 = [ ] ;
let c14 = null ;
let c16 = null ;
let c17 = null ;
2026-09-10 05:38:07 +00:00
const wasEverMultiParticipant = false ;
2026-07-29 08:29:29 +00:00
let c19 = false ;
2026-09-10 05:38:07 +00:00
let closure_20 = null ;
let closure_21 = null ;
2026-07-29 08:29:29 +00:00
let c22 = false ;
let c23 = null ;
let c24 = null ;
2026-08-24 06:08:38 +00:00
const Store = initializeDefault . Store ;
2026-07-29 08:29:29 +00:00
class RTCConnectionStore extends Store {
}
const prototype = RTCConnectionStore . prototype ;
prototype [ "initialize" ] = function initialize() {
2026-09-10 05:38:07 +00:00
this . waitFor ( AuthenticationStore , GameConsoleStore , SortedVoiceStateStore ) ;
2026-08-24 06:08:38 +00:00
const result = trackVideoToggle . setVideoToggleAnalyticsParams ( this . getRTCConnectionId , this . getMediaSessionId ) ;
2026-07-29 08:29:29 +00:00
} ;
prototype [ "getRTCConnection" ] = function getRTCConnection() {
return closure_3 ;
} ;
prototype [ "getState" ] = function getState() {
if ( null != redux ) {
let DISCONNECTED = redux . state ;
} else {
DISCONNECTED = constants . DISCONNECTED ;
2026-07-20 16:05:17 +00:00
}
2026-07-29 08:29:29 +00:00
return DISCONNECTED ;
} ;
prototype [ "isConnected" ] = function isConnected() {
return this . getState ( ) === constants . RTC_CONNECTED ;
} ;
prototype [ "isDisconnected" ] = function isDisconnected() {
return this . getState ( ) === constants . DISCONNECTED ;
} ;
prototype [ "getRemoteDisconnectVoiceChannelId" ] = function getRemoteDisconnectVoiceChannelId() {
return c14 ;
} ;
prototype [ "getLastSessionVoiceChannelId" ] = function getLastSessionVoiceChannelId() {
return c16 ;
} ;
prototype [ "setLastSessionVoiceChannelId" ] = function setLastSessionVoiceChannelId ( arg0 ) {
2026-09-10 05:38:07 +00:00
c16 = arg0 ;
2026-07-29 08:29:29 +00:00
} ;
prototype [ "getGuildId" ] = function getGuildId() {
let guildId ;
if ( redux != null ) {
guildId = redux . guildId ;
}
return guildId ;
} ;
prototype [ "getChannelId" ] = function getChannelId() {
let channelId ;
if ( redux != null ) {
channelId = redux . channelId ;
}
return channelId ;
} ;
prototype [ "getHostname" ] = function getHostname() {
let str = "" ;
if ( null != redux ) {
str = redux . hostname ;
}
return str ;
} ;
prototype [ "getQuality" ] = function getQuality() {
if ( null != redux ) {
let UNKNOWN = redux . quality ;
} else {
UNKNOWN = constants3 . UNKNOWN ;
}
return UNKNOWN ;
} ;
prototype [ "getPings" ] = function getPings() {
if ( null != redux ) {
let pings = redux . getPings ( ) ;
} else {
pings = closure_13 ;
}
return pings ;
} ;
prototype [ "getAveragePing" ] = function getAveragePing() {
let num = 0 ;
if ( null != closure_3 ) {
let averagePing ;
if ( closure_3 != null ) {
averagePing = obj . getAveragePing ( ) ;
}
num = averagePing ;
obj = closure_3 ;
}
return num ;
} ;
prototype [ "getLastPing" ] = function getLastPing() {
let lastPing ;
2026-09-10 05:38:07 +00:00
if ( authStore != null ) {
lastPing = authStore . getLastPing ( ) ;
2026-07-29 08:29:29 +00:00
}
return lastPing ;
} ;
prototype [ "getOutboundLossRate" ] = function getOutboundLossRate() {
let outboundLossRate ;
2026-09-10 05:38:07 +00:00
if ( authStore != null ) {
outboundLossRate = authStore . getOutboundLossRate ( ) ;
2026-07-29 08:29:29 +00:00
}
return outboundLossRate ;
} ;
prototype [ "getMediaSessionId" ] = function getMediaSessionId() {
let mediaSessionId ;
2026-09-10 05:38:07 +00:00
if ( authStore != null ) {
mediaSessionId = authStore . getMediaSessionId ( ) ;
2026-07-29 08:29:29 +00:00
}
return mediaSessionId ;
} ;
prototype [ "getRTCConnectionId" ] = function getRTCConnectionId() {
let rTCConnectionId ;
2026-09-10 05:38:07 +00:00
if ( authStore != null ) {
rTCConnectionId = authStore . getRTCConnectionId ( ) ;
2026-07-29 08:29:29 +00:00
}
return rTCConnectionId ;
} ;
prototype [ "getDuration" ] = function getDuration() {
let duration ;
2026-09-10 05:38:07 +00:00
if ( authStore != null ) {
duration = authStore . getDuration ( ) ;
2026-07-29 08:29:29 +00:00
}
if ( duration == null ) {
let duration1 ;
2026-09-10 05:38:07 +00:00
if ( obj2 != null ) {
duration1 = obj2 . duration ;
2026-07-20 16:05:17 +00:00
}
2026-07-29 08:29:29 +00:00
duration = duration1 ;
}
return duration ;
} ;
prototype [ "getLastRTCConnectionState" ] = function getLastRTCConnectionState() {
2026-09-10 05:38:07 +00:00
return obj2 ;
2026-07-29 08:29:29 +00:00
} ;
prototype [ "getPacketStats" ] = function getPacketStats() {
let packetStats ;
2026-09-10 05:38:07 +00:00
if ( authStore != null ) {
packetStats = authStore . getPacketStats ( ) ;
2026-07-29 08:29:29 +00:00
}
return packetStats ;
} ;
prototype [ "getVoiceStateStats" ] = function getVoiceStateStats() {
let stats ;
2026-09-10 05:38:07 +00:00
if ( voiceStateAnalytics != null ) {
stats = voiceStateAnalytics . getStats ( ) ;
2026-07-29 08:29:29 +00:00
}
return stats ;
} ;
prototype [ "getUserVoiceSettingsStats" ] = function getUserVoiceSettingsStats ( arg0 ) {
let userVoiceSettingsStats ;
2026-09-10 05:38:07 +00:00
if ( voiceStateAnalytics != null ) {
userVoiceSettingsStats = voiceStateAnalytics . getUserVoiceSettingsStats ( arg0 ) ;
2026-07-29 08:29:29 +00:00
}
return userVoiceSettingsStats ;
} ;
prototype [ "getWasEverMultiParticipant" ] = function getWasEverMultiParticipant() {
2026-09-10 05:38:07 +00:00
return closure_18 ;
2026-07-29 08:29:29 +00:00
} ;
prototype [ "getWasEverRtcConnected" ] = function getWasEverRtcConnected() {
return c19 ;
} ;
prototype [ "getUserIds" ] = function getUserIds() {
let userIds ;
2026-09-10 05:38:07 +00:00
if ( authStore != null ) {
userIds = authStore . getUserIds ( ) ;
2026-07-29 08:29:29 +00:00
}
return userIds ;
} ;
prototype [ "getJoinVoiceId" ] = function getJoinVoiceId() {
return c23 ;
} ;
prototype [ "isUserConnected" ] = function isUserConnected ( arg0 ) {
let isUserConnected ;
2026-09-10 05:38:07 +00:00
if ( authStore != null ) {
isUserConnected = authStore . getIsUserConnected ( arg0 ) ;
2026-07-29 08:29:29 +00:00
}
return isUserConnected ;
} ;
prototype [ "getSecureFramesState" ] = function getSecureFramesState() {
let secureFramesState ;
2026-09-10 05:38:07 +00:00
if ( authStore != null ) {
secureFramesState = authStore . getSecureFramesState ( ) ;
2026-07-29 08:29:29 +00:00
}
return secureFramesState ;
} ;
prototype [ "getSecureFramesRosterMapEntry" ] = function getSecureFramesRosterMapEntry ( arg0 ) {
let secureFramesRosterMap ;
2026-09-10 05:38:07 +00:00
if ( authStore != null ) {
secureFramesRosterMap = authStore . getSecureFramesRosterMap ( ) ;
2026-07-29 08:29:29 +00:00
}
2026-09-10 05:38:07 +00:00
value = undefined ;
2026-07-29 08:29:29 +00:00
if ( secureFramesRosterMap != null ) {
value = secureFramesRosterMap . get ( arg0 ) ;
}
return value ;
} ;
prototype [ "getLastNonZeroRemoteVideoSinkWantsTime" ] = function getLastNonZeroRemoteVideoSinkWantsTime() {
2026-09-10 05:38:07 +00:00
return closure_21 ;
2026-07-29 08:29:29 +00:00
} ;
prototype [ "getWasMoved" ] = function getWasMoved() {
return c22 ;
} ;
RTCConnectionStore . displayName = "RTCConnectionStore" ;
2026-09-10 05:38:07 +00:00
const rTCConnectionStore = new RTCConnectionStore ( DispatcherDefault , {
2026-07-20 16:05:17 +00:00
CONNECTION_OPEN : function handleConnectionOpen ( sessionId ) {
sessionId = sessionId . sessionId ;
2026-08-24 06:08:38 +00:00
c14 = null ;
c16 = null ;
2026-07-20 16:05:17 +00:00
destroyRTCConnection ( false ) ;
2026-09-10 05:38:07 +00:00
if ( null != _null ) {
const timeout = _null . timeout ;
2026-07-29 08:29:29 +00:00
timeout . stop ( ) ;
2026-09-10 05:38:07 +00:00
_null = null ;
2026-07-29 08:29:29 +00:00
}
2026-07-20 16:05:17 +00:00
return false ;
} ,
CONNECTION_CLOSED : function handleConnectionClosed() {
2026-08-24 06:08:38 +00:00
c4 = null ;
c14 = null ;
c16 = null ;
2026-07-20 16:05:17 +00:00
destroyRTCConnection ( false ) ;
2026-09-10 05:38:07 +00:00
if ( null != _null ) {
const timeout = _null . timeout ;
2026-07-29 08:29:29 +00:00
timeout . stop ( ) ;
2026-09-10 05:38:07 +00:00
_null = null ;
2026-07-29 08:29:29 +00:00
}
2026-07-20 16:05:17 +00:00
} ,
LOGOUT : function handleLogout() {
2026-09-10 05:38:07 +00:00
closure_20 = null ;
2026-07-20 16:05:17 +00:00
return false ;
} ,
RTC_CONNECTION_STATE : function handleRTCConnectionState ( state ) {
if ( state . state === constants . RTC_CONNECTED ) {
2026-08-24 06:08:38 +00:00
c19 = true ;
2026-07-29 08:29:29 +00:00
if ( null != closure_3 ) {
2026-09-10 05:38:07 +00:00
closure_20 = TimeUtils . now ( ) ;
2026-07-20 16:05:17 +00:00
}
}
return true ;
} ,
RTC_CONNECTION_PING : function handleRtcConnectionPing() {
2026-07-29 08:29:29 +00:00
if ( null != closure_3 ) {
2026-09-10 05:38:07 +00:00
closure_20 = TimeUtils . now ( ) ;
2026-07-20 16:05:17 +00:00
}
return true ;
} ,
RTC_CONNECTION_LOSS_RATE : handleRtcAction ,
RTC_CONNECTION_UPDATE_ID : function handleRtcConnectionUpdateId ( connection ) {
2026-07-29 08:29:29 +00:00
return connection . connection === closure_3 ;
2026-07-20 16:05:17 +00:00
} ,
RTC_CONNECTION_SECURE_FRAMES_UPDATE : handleRtcAction ,
RTC_CONNECTION_CLIENT_CONNECT : handleRtcAction ,
RTC_CONNECTION_CLIENT_DISCONNECT : handleRtcAction ,
RTC_CONNECTION_REMOTE_VIDEO_SINK_WANTS : function handleRtcConnectionRemoteVideoSinkWants ( context ) {
let tmp2 = context . context === MediaEngineContextTypes . DEFAULT ;
if ( tmp2 ) {
const _Object = Object ;
const entries = Object . entries ( tmp ) ;
2026-09-10 05:38:07 +00:00
const someResult = entries . some ( ( item ) = > {
[ tmp , tmp2 ] = item ;
2026-07-20 16:05:17 +00:00
let tmp3 = "any" !== tmp ;
if ( tmp3 ) {
tmp3 = 0 !== tmp2 ;
}
return tmp3 ;
} ) ;
2026-07-29 08:29:29 +00:00
if ( someResult ) {
2026-07-20 16:05:17 +00:00
const _performance = performance ;
2026-08-24 06:08:38 +00:00
closure_21 = performance . now ( ) ;
2026-07-20 16:05:17 +00:00
}
2026-07-29 08:29:29 +00:00
tmp2 = someResult ;
2026-07-20 16:05:17 +00:00
}
return tmp2 ;
} ,
VIDEO_SIZE_UPDATE : function handleVideoSizeUpdate ( arg0 ) {
2026-09-10 05:38:07 +00:00
if ( authStore != null ) {
authStore . setVideoSize ( tmp , tmp2 , tmp3 ) ;
2026-07-20 16:05:17 +00:00
}
} ,
2026-08-25 06:04:03 +00:00
VOICE_STATE_UPDATES : function handleVoiceStateUpdates ( arg0 ) {
( { voiceStates , receivedAt : require } = arg0 ) ;
2026-09-10 05:38:07 +00:00
return voiceStates . reduce ( ( acc , userId ) = > {
if ( c17 != null ) {
2026-07-20 16:05:17 +00:00
obj . updateVoiceStates ( userId . userId , userId . channelId ) ;
}
2026-07-29 08:29:29 +00:00
let tmp2 = closure_18 ;
if ( ! closure_18 ) {
let num ;
2026-09-10 05:38:07 +00:00
if ( c17 != null ) {
2026-07-29 08:29:29 +00:00
num = obj2 . getStats ( ) . max_voice_state_count ;
2026-07-20 16:05:17 +00:00
}
2026-07-29 08:29:29 +00:00
if ( num == null ) {
num = 0 ;
2026-07-20 16:05:17 +00:00
}
tmp2 = num > 1 ;
2026-09-10 05:38:07 +00:00
obj2 = c17 ;
2026-07-20 16:05:17 +00:00
}
2026-07-29 08:29:29 +00:00
closure_18 = tmp2 ;
2026-09-10 05:38:07 +00:00
if ( AuthenticationStore . getId ( ) !== userId . userId ) {
return acc ;
2026-07-20 16:05:17 +00:00
} else {
2026-09-10 05:38:07 +00:00
let tmp4 = null != config ;
2026-07-29 08:29:29 +00:00
if ( tmp4 ) {
2026-09-10 05:38:07 +00:00
tmp4 = userId . channelId === config . channelId ;
2026-07-20 16:05:17 +00:00
}
2026-07-29 08:29:29 +00:00
if ( tmp4 ) {
2026-09-10 05:38:07 +00:00
if ( null != config ) {
const timeout = config . timeout ;
2026-07-29 08:29:29 +00:00
timeout . stop ( ) ;
2026-09-10 05:38:07 +00:00
config = null ;
2026-07-29 08:29:29 +00:00
}
2026-07-20 16:05:17 +00:00
}
2026-07-29 08:29:29 +00:00
if ( null != closure_3 ) {
2026-09-10 05:38:07 +00:00
if ( userId . sessionId === c4 ) {
2026-07-20 16:05:17 +00:00
if ( null == userId . guildId ) {
2026-08-25 06:04:03 +00:00
if ( ! tmp26 ) {
2026-09-10 05:38:07 +00:00
destroyRTCConnection ( ) ;
2026-07-20 16:05:17 +00:00
}
if ( null != userId . channelId ) {
2026-07-29 08:29:29 +00:00
let channelId = null ;
2026-08-24 06:08:38 +00:00
c16 = null ;
2026-09-10 05:38:07 +00:00
closure_3 = createRTCConnection ( userId . guildId , userId . channelId , _require ) ;
2026-07-29 08:29:29 +00:00
let num9 ;
2026-09-10 05:38:07 +00:00
if ( c17 != null ) {
2026-07-29 08:29:29 +00:00
num9 = obj7 . getStats ( ) . max_voice_state_count ;
2026-07-20 16:05:17 +00:00
}
2026-07-29 08:29:29 +00:00
if ( num9 == null ) {
num9 = 0 ;
2026-07-20 16:05:17 +00:00
}
2026-07-29 08:29:29 +00:00
closure_18 = num9 > 1 ;
2026-09-10 05:38:07 +00:00
obj7 = c17 ;
2026-07-20 16:05:17 +00:00
}
2026-08-25 06:04:03 +00:00
tmp26 = userId . guildId !== closure_3 . guildId && null == userId . channelId ;
2026-07-20 16:05:17 +00:00
}
if ( null == userId . channelId ) {
2026-09-10 05:38:07 +00:00
destroyRTCConnection ( ) ;
2026-07-20 16:05:17 +00:00
} else {
2026-07-29 08:29:29 +00:00
closure_3 . setNextChannelId ( userId . channelId ) ;
2026-08-24 06:08:38 +00:00
c22 = true ;
c23 = null ;
2026-07-29 08:29:29 +00:00
closure_3 . clearJoinVoiceId ( ) ;
2026-07-20 16:05:17 +00:00
}
2026-07-29 08:29:29 +00:00
} else if ( userId . guildId === closure_3 . guildId ) {
2026-08-25 06:04:03 +00:00
if ( ! tmp19 ) {
2026-07-29 08:29:29 +00:00
channelId = closure_3 . channelId ;
2026-07-20 16:05:17 +00:00
}
2026-09-10 05:38:07 +00:00
destroyRTCConnection ( ) ;
tmp19 = null != GameConsoleStore . getAwaitingRemoteSessionInfo ( ) && null != GameConsoleStore . getRemoteSessionId ( ) ;
2026-07-20 16:05:17 +00:00
}
} else {
2026-09-10 05:38:07 +00:00
if ( userId . sessionId === c4 ) {
2026-07-20 16:05:17 +00:00
if ( null != userId . channelId ) {
2026-07-29 08:29:29 +00:00
if ( ! tmp4 ) {
2026-09-10 05:38:07 +00:00
if ( null != closure_20 ) {
if ( obj3 . now ( ) - closure_20 >= 300000 ) {
DispatcherDefault . wait ( ( ) = > closure_1_0 ( closure_1_2 [ 12 ] ) . default . disconnect ( ) ) ;
return acc ;
2026-07-20 16:05:17 +00:00
}
2026-09-10 05:38:07 +00:00
obj3 = TimeUtils ;
2026-07-20 16:05:17 +00:00
}
}
2026-07-29 08:29:29 +00:00
channelId = null ;
c16 = null ;
2026-09-10 05:38:07 +00:00
closure_3 = createRTCConnection ( userId . guildId , userId . channelId , _require ) ;
2026-07-29 08:29:29 +00:00
let num5 ;
2026-09-10 05:38:07 +00:00
if ( c17 != null ) {
2026-07-29 08:29:29 +00:00
num5 = obj5 . getStats ( ) . max_voice_state_count ;
2026-07-20 16:05:17 +00:00
}
2026-07-29 08:29:29 +00:00
if ( num5 == null ) {
num5 = 0 ;
2026-07-20 16:05:17 +00:00
}
2026-07-29 08:29:29 +00:00
closure_18 = num5 > 1 ;
2026-09-10 05:38:07 +00:00
obj5 = c17 ;
2026-07-20 16:05:17 +00:00
}
}
2026-09-10 05:38:07 +00:00
return acc ;
2026-07-20 16:05:17 +00:00
}
return true ;
}
2026-09-10 05:38:07 +00:00
obj = c17 ;
2026-07-20 16:05:17 +00:00
} , false ) ;
} ,
VOICE_CHANNEL_SELECT : function handleVoiceChannelSelect ( channelId ) {
let tmp = null == redux ;
if ( ! tmp ) {
let tmp2 = null != channelId . channelId ;
if ( tmp2 ) {
tmp2 = redux . channelId === channelId . channelId ;
}
tmp = tmp2 ;
}
if ( ! tmp ) {
destroyRTCConnection ( ) ;
}
2026-09-10 05:38:07 +00:00
joinVoiceId = channelId . joinVoiceId ;
_require = channelId ;
if ( null != obj ) {
const timeout = obj . timeout ;
2026-07-29 08:29:29 +00:00
timeout . stop ( ) ;
2026-09-10 05:38:07 +00:00
obj = null ;
2026-07-29 08:29:29 +00:00
}
if ( null != channelId . channelId ) {
2026-09-10 05:38:07 +00:00
const timeout1 = new require ( "Timers" ) . Timeout ( ) ;
timeout1 . start ( 30000 , ( ) = > {
logger . warn ( "No VOICE_STATE_UPDATE received within 30000ms of VOICE_CHANNEL_SELECT" , { joinVoiceId : channelId.joinVoiceId , channelId : channelId.channelId , guildId : channelId.guildId } ) ;
2026-08-24 06:08:38 +00:00
c24 = null ;
2026-07-29 08:29:29 +00:00
} ) ;
2026-09-10 05:38:07 +00:00
obj = { joinVoiceId : null , channelId : null , guildId : null , timeout : null } ;
( { joinVoiceId : obj2.joinVoiceId , channelId : obj2.channelId , guildId : obj2.guildId } = channelId ) ;
obj . timeout = timeout1 ;
2026-07-29 08:29:29 +00:00
}
2026-07-20 16:05:17 +00:00
} ,
AUDIO_SET_NOISE_CANCELLATION : function handleAudioSetNoiseCancellation ( enabled ) {
2026-09-10 05:38:07 +00:00
if ( authStore != null ) {
const result = authStore . setNoiseCancellationEnabled ( enabled . enabled ) ;
2026-07-20 16:05:17 +00:00
}
} ,
AUDIO_SET_AUDIO_MIXER_SETTINGS : function handleAudioSetAudioMixerSettings ( context ) {
if ( context . context !== MediaEngineContextTypes . DEFAULT ) {
return false ;
2026-07-22 07:54:56 +00:00
} else {
2026-07-29 08:29:29 +00:00
let flag = context . settings . enabled ;
if ( flag == null ) {
flag = false ;
2026-07-22 07:54:56 +00:00
}
2026-07-29 08:29:29 +00:00
if ( flag ) {
2026-09-03 10:05:34 +00:00
flag = useSpatialAudioControlState . isSpatialAudioEligible ( "RTCConnectionStore" ) ;
2026-07-29 08:29:29 +00:00
}
2026-09-10 05:38:07 +00:00
if ( authStore != null ) {
const result = authStore . setSpatialAudioEnabled ( flag ) ;
2026-07-22 07:54:56 +00:00
}
2026-07-20 16:05:17 +00:00
}
} ,
VOICE_SERVER_UPDATE : function handleVoiceServerUpdate ( guildId ) {
let tmp = null != redux ;
if ( tmp ) {
2026-07-29 08:29:29 +00:00
let tmp3 = null == guildId . guildId ;
if ( ! tmp3 ) {
tmp3 = guildId . guildId === redux . guildId ;
}
if ( tmp3 ) {
let tmp5 = null == guildId . channelId ;
if ( ! tmp5 ) {
tmp5 = guildId . channelId === redux . getNextChannelId ( ) ;
2026-07-20 16:05:17 +00:00
}
2026-07-29 08:29:29 +00:00
if ( tmp5 ) {
2026-07-20 16:05:17 +00:00
redux . connect ( guildId . endpoint , guildId . token ) ;
}
2026-07-29 08:29:29 +00:00
tmp3 = tmp5 ;
2026-07-20 16:05:17 +00:00
}
2026-07-29 08:29:29 +00:00
tmp = tmp3 ;
2026-07-20 16:05:17 +00:00
}
return tmp ;
} ,
CLEAR_REMOTE_DISCONNECT_VOICE_CHANNEL_ID : handleClearRemoteDisconnectVoiceChannelId ,
REMOTE_SESSION_CONNECT : handleClearRemoteDisconnectVoiceChannelId ,
CLEAR_LAST_SESSION_VOICE_CHANNEL_ID : function handleClearLastSessionVoiceChannelId() {
2026-08-24 06:08:38 +00:00
c16 = null ;
2026-07-20 16:05:17 +00:00
} ,
GUILD_DELETE : function handleGuildDelete ( arg0 ) {
if ( null != redux ) {
if ( redux . guildId === tmp . id ) {
destroyRTCConnection ( ) ;
}
}
return false ;
} ,
CHANNEL_DELETE : handleChannelDelete ,
THREAD_DELETE : handleChannelDelete ,
CALL_DELETE : function handleCallDelete ( arg0 ) {
if ( null != redux ) {
if ( redux . channelId === tmp ) {
destroyRTCConnection ( ) ;
}
}
return false ;
} ,
APP_STATE_UPDATE : function handleFocus ( state ) {
let tmp = state . state === constants2 . ACTIVE ;
if ( tmp ) {
tmp = null != redux ;
}
if ( tmp ) {
redux . resetBackoff ( "App state is active" ) ;
}
return false ;
} ,
RTC_DEBUG_SET_SIMULCAST_OVERRIDE : function handleSimulcastDebugOverrideChanged ( arg0 ) {
2026-09-10 05:38:07 +00:00
if ( authStore != null ) {
const result = authStore . setSimulcastDebugOverride ( tmp , tmp2 , tmp3 ) ;
2026-07-20 16:05:17 +00:00
}
}
} ) ;
2026-07-23 10:11:24 +00:00
let obj = {
2026-07-20 16:05:17 +00:00
CONNECTION_OPEN : function handleConnectionOpen ( sessionId ) {
sessionId = sessionId . sessionId ;
2026-08-24 06:08:38 +00:00
c14 = null ;
c16 = null ;
2026-07-20 16:05:17 +00:00
destroyRTCConnection ( false ) ;
2026-09-10 05:38:07 +00:00
if ( null != _null ) {
const timeout = _null . timeout ;
2026-07-29 08:29:29 +00:00
timeout . stop ( ) ;
2026-09-10 05:38:07 +00:00
_null = null ;
2026-07-29 08:29:29 +00:00
}
2026-07-20 16:05:17 +00:00
return false ;
} ,
CONNECTION_CLOSED : function handleConnectionClosed() {
2026-08-24 06:08:38 +00:00
c4 = null ;
c14 = null ;
c16 = null ;
2026-07-20 16:05:17 +00:00
destroyRTCConnection ( false ) ;
2026-09-10 05:38:07 +00:00
if ( null != _null ) {
const timeout = _null . timeout ;
2026-07-29 08:29:29 +00:00
timeout . stop ( ) ;
2026-09-10 05:38:07 +00:00
_null = null ;
2026-07-29 08:29:29 +00:00
}
2026-07-20 16:05:17 +00:00
} ,
LOGOUT : function handleLogout() {
2026-09-10 05:38:07 +00:00
closure_20 = null ;
2026-07-20 16:05:17 +00:00
return false ;
} ,
RTC_CONNECTION_STATE : function handleRTCConnectionState ( state ) {
if ( state . state === constants . RTC_CONNECTED ) {
2026-08-24 06:08:38 +00:00
c19 = true ;
2026-07-29 08:29:29 +00:00
if ( null != closure_3 ) {
2026-09-10 05:38:07 +00:00
closure_20 = TimeUtils . now ( ) ;
2026-07-20 16:05:17 +00:00
}
}
return true ;
} ,
RTC_CONNECTION_PING : function handleRtcConnectionPing() {
2026-07-29 08:29:29 +00:00
if ( null != closure_3 ) {
2026-09-10 05:38:07 +00:00
closure_20 = TimeUtils . now ( ) ;
2026-07-20 16:05:17 +00:00
}
return true ;
} ,
RTC_CONNECTION_LOSS_RATE : handleRtcAction ,
RTC_CONNECTION_UPDATE_ID : function handleRtcConnectionUpdateId ( connection ) {
2026-07-29 08:29:29 +00:00
return connection . connection === closure_3 ;
2026-07-20 16:05:17 +00:00
} ,
RTC_CONNECTION_SECURE_FRAMES_UPDATE : handleRtcAction ,
RTC_CONNECTION_CLIENT_CONNECT : handleRtcAction ,
RTC_CONNECTION_CLIENT_DISCONNECT : handleRtcAction ,
RTC_CONNECTION_REMOTE_VIDEO_SINK_WANTS : function handleRtcConnectionRemoteVideoSinkWants ( context ) {
let tmp2 = context . context === MediaEngineContextTypes . DEFAULT ;
if ( tmp2 ) {
const _Object = Object ;
const entries = Object . entries ( tmp ) ;
2026-09-10 05:38:07 +00:00
const someResult = entries . some ( ( item ) = > {
[ tmp , tmp2 ] = item ;
2026-07-20 16:05:17 +00:00
let tmp3 = "any" !== tmp ;
if ( tmp3 ) {
tmp3 = 0 !== tmp2 ;
}
return tmp3 ;
} ) ;
2026-07-29 08:29:29 +00:00
if ( someResult ) {
2026-07-20 16:05:17 +00:00
const _performance = performance ;
2026-08-24 06:08:38 +00:00
closure_21 = performance . now ( ) ;
2026-07-20 16:05:17 +00:00
}
2026-07-29 08:29:29 +00:00
tmp2 = someResult ;
2026-07-20 16:05:17 +00:00
}
return tmp2 ;
} ,
VIDEO_SIZE_UPDATE : function handleVideoSizeUpdate ( arg0 ) {
2026-09-10 05:38:07 +00:00
if ( authStore != null ) {
authStore . setVideoSize ( tmp , tmp2 , tmp3 ) ;
2026-07-20 16:05:17 +00:00
}
} ,
2026-08-25 06:04:03 +00:00
VOICE_STATE_UPDATES : function handleVoiceStateUpdates ( arg0 ) {
( { voiceStates , receivedAt : require } = arg0 ) ;
2026-09-10 05:38:07 +00:00
return voiceStates . reduce ( ( acc , userId ) = > {
if ( c17 != null ) {
2026-07-20 16:05:17 +00:00
obj . updateVoiceStates ( userId . userId , userId . channelId ) ;
}
2026-07-29 08:29:29 +00:00
let tmp2 = closure_18 ;
if ( ! closure_18 ) {
let num ;
2026-09-10 05:38:07 +00:00
if ( c17 != null ) {
2026-07-29 08:29:29 +00:00
num = obj2 . getStats ( ) . max_voice_state_count ;
2026-07-20 16:05:17 +00:00
}
2026-07-29 08:29:29 +00:00
if ( num == null ) {
num = 0 ;
2026-07-20 16:05:17 +00:00
}
tmp2 = num > 1 ;
2026-09-10 05:38:07 +00:00
obj2 = c17 ;
2026-07-20 16:05:17 +00:00
}
2026-07-29 08:29:29 +00:00
closure_18 = tmp2 ;
2026-09-10 05:38:07 +00:00
if ( AuthenticationStore . getId ( ) !== userId . userId ) {
return acc ;
2026-07-20 16:05:17 +00:00
} else {
2026-09-10 05:38:07 +00:00
let tmp4 = null != config ;
2026-07-29 08:29:29 +00:00
if ( tmp4 ) {
2026-09-10 05:38:07 +00:00
tmp4 = userId . channelId === config . channelId ;
2026-07-20 16:05:17 +00:00
}
2026-07-29 08:29:29 +00:00
if ( tmp4 ) {
2026-09-10 05:38:07 +00:00
if ( null != config ) {
const timeout = config . timeout ;
2026-07-29 08:29:29 +00:00
timeout . stop ( ) ;
2026-09-10 05:38:07 +00:00
config = null ;
2026-07-29 08:29:29 +00:00
}
2026-07-20 16:05:17 +00:00
}
2026-07-29 08:29:29 +00:00
if ( null != closure_3 ) {
2026-09-10 05:38:07 +00:00
if ( userId . sessionId === c4 ) {
2026-07-20 16:05:17 +00:00
if ( null == userId . guildId ) {
2026-08-25 06:04:03 +00:00
if ( ! tmp26 ) {
2026-09-10 05:38:07 +00:00
destroyRTCConnection ( ) ;
2026-07-20 16:05:17 +00:00
}
if ( null != userId . channelId ) {
2026-07-29 08:29:29 +00:00
let channelId = null ;
2026-08-24 06:08:38 +00:00
c16 = null ;
2026-09-10 05:38:07 +00:00
closure_3 = createRTCConnection ( userId . guildId , userId . channelId , _require ) ;
2026-07-29 08:29:29 +00:00
let num9 ;
2026-09-10 05:38:07 +00:00
if ( c17 != null ) {
2026-07-29 08:29:29 +00:00
num9 = obj7 . getStats ( ) . max_voice_state_count ;
2026-07-20 16:05:17 +00:00
}
2026-07-29 08:29:29 +00:00
if ( num9 == null ) {
num9 = 0 ;
2026-07-20 16:05:17 +00:00
}
2026-07-29 08:29:29 +00:00
closure_18 = num9 > 1 ;
2026-09-10 05:38:07 +00:00
obj7 = c17 ;
2026-07-20 16:05:17 +00:00
}
2026-08-25 06:04:03 +00:00
tmp26 = userId . guildId !== closure_3 . guildId && null == userId . channelId ;
2026-07-20 16:05:17 +00:00
}
if ( null == userId . channelId ) {
2026-09-10 05:38:07 +00:00
destroyRTCConnection ( ) ;
2026-07-20 16:05:17 +00:00
} else {
2026-07-29 08:29:29 +00:00
closure_3 . setNextChannelId ( userId . channelId ) ;
2026-08-24 06:08:38 +00:00
c22 = true ;
c23 = null ;
2026-07-29 08:29:29 +00:00
closure_3 . clearJoinVoiceId ( ) ;
2026-07-20 16:05:17 +00:00
}
2026-07-29 08:29:29 +00:00
} else if ( userId . guildId === closure_3 . guildId ) {
2026-08-25 06:04:03 +00:00
if ( ! tmp19 ) {
2026-07-29 08:29:29 +00:00
channelId = closure_3 . channelId ;
2026-07-20 16:05:17 +00:00
}
2026-09-10 05:38:07 +00:00
destroyRTCConnection ( ) ;
tmp19 = null != GameConsoleStore . getAwaitingRemoteSessionInfo ( ) && null != GameConsoleStore . getRemoteSessionId ( ) ;
2026-07-20 16:05:17 +00:00
}
} else {
2026-09-10 05:38:07 +00:00
if ( userId . sessionId === c4 ) {
2026-07-20 16:05:17 +00:00
if ( null != userId . channelId ) {
2026-07-29 08:29:29 +00:00
if ( ! tmp4 ) {
2026-09-10 05:38:07 +00:00
if ( null != closure_20 ) {
if ( obj3 . now ( ) - closure_20 >= 300000 ) {
DispatcherDefault . wait ( ( ) = > closure_1_0 ( closure_1_2 [ 12 ] ) . default . disconnect ( ) ) ;
return acc ;
2026-07-20 16:05:17 +00:00
}
2026-09-10 05:38:07 +00:00
obj3 = TimeUtils ;
2026-07-20 16:05:17 +00:00
}
}
2026-07-29 08:29:29 +00:00
channelId = null ;
c16 = null ;
2026-09-10 05:38:07 +00:00
closure_3 = createRTCConnection ( userId . guildId , userId . channelId , _require ) ;
2026-07-29 08:29:29 +00:00
let num5 ;
2026-09-10 05:38:07 +00:00
if ( c17 != null ) {
2026-07-29 08:29:29 +00:00
num5 = obj5 . getStats ( ) . max_voice_state_count ;
2026-07-20 16:05:17 +00:00
}
2026-07-29 08:29:29 +00:00
if ( num5 == null ) {
num5 = 0 ;
2026-07-20 16:05:17 +00:00
}
2026-07-29 08:29:29 +00:00
closure_18 = num5 > 1 ;
2026-09-10 05:38:07 +00:00
obj5 = c17 ;
2026-07-20 16:05:17 +00:00
}
}
2026-09-10 05:38:07 +00:00
return acc ;
2026-07-20 16:05:17 +00:00
}
return true ;
}
2026-09-10 05:38:07 +00:00
obj = c17 ;
2026-07-20 16:05:17 +00:00
} , false ) ;
} ,
VOICE_CHANNEL_SELECT : function handleVoiceChannelSelect ( channelId ) {
let tmp = null == redux ;
if ( ! tmp ) {
let tmp2 = null != channelId . channelId ;
if ( tmp2 ) {
tmp2 = redux . channelId === channelId . channelId ;
}
tmp = tmp2 ;
}
if ( ! tmp ) {
destroyRTCConnection ( ) ;
}
2026-09-10 05:38:07 +00:00
joinVoiceId = channelId . joinVoiceId ;
_require = channelId ;
if ( null != obj ) {
const timeout = obj . timeout ;
2026-07-29 08:29:29 +00:00
timeout . stop ( ) ;
2026-09-10 05:38:07 +00:00
obj = null ;
2026-07-29 08:29:29 +00:00
}
if ( null != channelId . channelId ) {
2026-09-10 05:38:07 +00:00
const timeout1 = new require ( "Timers" ) . Timeout ( ) ;
timeout1 . start ( 30000 , ( ) = > {
logger . warn ( "No VOICE_STATE_UPDATE received within 30000ms of VOICE_CHANNEL_SELECT" , { joinVoiceId : channelId.joinVoiceId , channelId : channelId.channelId , guildId : channelId.guildId } ) ;
2026-08-24 06:08:38 +00:00
c24 = null ;
2026-07-29 08:29:29 +00:00
} ) ;
2026-09-10 05:38:07 +00:00
obj = { joinVoiceId : null , channelId : null , guildId : null , timeout : null } ;
( { joinVoiceId : obj2.joinVoiceId , channelId : obj2.channelId , guildId : obj2.guildId } = channelId ) ;
obj . timeout = timeout1 ;
2026-07-29 08:29:29 +00:00
}
2026-07-20 16:05:17 +00:00
} ,
AUDIO_SET_NOISE_CANCELLATION : function handleAudioSetNoiseCancellation ( enabled ) {
2026-09-10 05:38:07 +00:00
if ( authStore != null ) {
const result = authStore . setNoiseCancellationEnabled ( enabled . enabled ) ;
2026-07-20 16:05:17 +00:00
}
} ,
AUDIO_SET_AUDIO_MIXER_SETTINGS : function handleAudioSetAudioMixerSettings ( context ) {
if ( context . context !== MediaEngineContextTypes . DEFAULT ) {
return false ;
2026-07-22 07:54:56 +00:00
} else {
2026-07-29 08:29:29 +00:00
let flag = context . settings . enabled ;
if ( flag == null ) {
flag = false ;
}
if ( flag ) {
2026-09-03 10:05:34 +00:00
flag = useSpatialAudioControlState . isSpatialAudioEligible ( "RTCConnectionStore" ) ;
2026-07-22 07:54:56 +00:00
}
2026-09-10 05:38:07 +00:00
if ( authStore != null ) {
const result = authStore . setSpatialAudioEnabled ( flag ) ;
2026-07-22 07:54:56 +00:00
}
2026-07-20 16:05:17 +00:00
}
} ,
VOICE_SERVER_UPDATE : function handleVoiceServerUpdate ( guildId ) {
let tmp = null != redux ;
if ( tmp ) {
2026-07-29 08:29:29 +00:00
let tmp3 = null == guildId . guildId ;
if ( ! tmp3 ) {
tmp3 = guildId . guildId === redux . guildId ;
}
if ( tmp3 ) {
let tmp5 = null == guildId . channelId ;
if ( ! tmp5 ) {
tmp5 = guildId . channelId === redux . getNextChannelId ( ) ;
2026-07-20 16:05:17 +00:00
}
2026-07-29 08:29:29 +00:00
if ( tmp5 ) {
2026-07-20 16:05:17 +00:00
redux . connect ( guildId . endpoint , guildId . token ) ;
}
2026-07-29 08:29:29 +00:00
tmp3 = tmp5 ;
2026-07-20 16:05:17 +00:00
}
2026-07-29 08:29:29 +00:00
tmp = tmp3 ;
2026-07-20 16:05:17 +00:00
}
return tmp ;
} ,
CLEAR_REMOTE_DISCONNECT_VOICE_CHANNEL_ID : handleClearRemoteDisconnectVoiceChannelId ,
REMOTE_SESSION_CONNECT : handleClearRemoteDisconnectVoiceChannelId ,
CLEAR_LAST_SESSION_VOICE_CHANNEL_ID : function handleClearLastSessionVoiceChannelId() {
2026-08-24 06:08:38 +00:00
c16 = null ;
2026-07-20 16:05:17 +00:00
} ,
GUILD_DELETE : function handleGuildDelete ( arg0 ) {
if ( null != redux ) {
if ( redux . guildId === tmp . id ) {
destroyRTCConnection ( ) ;
}
}
return false ;
} ,
CHANNEL_DELETE : handleChannelDelete ,
THREAD_DELETE : handleChannelDelete ,
CALL_DELETE : function handleCallDelete ( arg0 ) {
if ( null != redux ) {
if ( redux . channelId === tmp ) {
destroyRTCConnection ( ) ;
}
}
return false ;
} ,
APP_STATE_UPDATE : function handleFocus ( state ) {
let tmp = state . state === constants2 . ACTIVE ;
if ( tmp ) {
tmp = null != redux ;
}
if ( tmp ) {
redux . resetBackoff ( "App state is active" ) ;
}
return false ;
} ,
RTC_DEBUG_SET_SIMULCAST_OVERRIDE : function handleSimulcastDebugOverrideChanged ( arg0 ) {
2026-09-10 05:38:07 +00:00
if ( authStore != null ) {
const result = authStore . setSimulcastDebugOverride ( tmp , tmp2 , tmp3 ) ;
2026-07-20 16:05:17 +00:00
}
}
} ;
2026-09-10 05:38:07 +00:00
let tmp3 = new LoggerDefault ( "RTCConnectionStore" ) ;
2026-09-19 06:52:51 +00:00
fn ( 1980 ) ( 1241 , dependencyMap . paths ) . then ( ( addExtraAnalyticsDecorator ) = > {
2026-07-29 08:29:29 +00:00
const result = addExtraAnalyticsDecorator . addExtraAnalyticsDecorator ( ( arg0 ) = > {
arg0 . client_rtc_state = state . getState ( ) ;
} ) ;
} ) ;
2026-09-10 05:38:07 +00:00
const size = fn ( 2 ) ;
let result = size . fileFinishedImporting ( "stores/RTCConnectionStore.tsx" ) ;
2026-07-20 16:05:17 +00:00
2026-07-29 08:29:29 +00:00
export default rTCConnectionStore ;