619 lines
33 KiB
TypeScript
619 lines
33 KiB
TypeScript
/* Metro module 16192; source: modules/go_live/ApplicationStreamingManager.tsx; dependencies: [7, 6, 15, 17, 18, 4492, 1226, 1379, 4111, 4402, 1934, 4395, 1878, 4286, 661, 22, 8913, 672, 4285, 4041, 694, 9235, 16170, 4860, 2] */
|
|
import ClassCallCheck from '../../by-id/module-00006-ClassCallCheck.js'; /* Metro dependency 6 */
|
|
import CreateClass from '../../by-id/module-00007-CreateClass.js'; /* Metro dependency 7 */
|
|
import PossibleConstructorReturn from '../../by-id/module-00015-PossibleConstructorReturn.js'; /* Metro dependency 15 */
|
|
import Module00017 from '../../by-id/module-00017.js'; /* Metro dependency 17 */
|
|
import Inherits from '../../by-id/module-00018-Inherits.js'; /* Metro dependency 18 */
|
|
import Dispatcher from '../../Dispatcher.tsx'; /* Metro dependency 694 */
|
|
import AuthenticationStore from '../../stores/AuthenticationStore.tsx'; /* Metro dependency 1226 */
|
|
import ChannelStore from '../../stores/ChannelStore.tsx'; /* Metro dependency 1379 */
|
|
import UserStore from '../../stores/UserStore.tsx'; /* Metro dependency 1878 */
|
|
import SelectedChannelStore from '../../stores/SelectedChannelStore.tsx'; /* Metro dependency 1934 */
|
|
import GuildMemberCountStore from '../../stores/GuildMemberCountStore.tsx'; /* Metro dependency 4111 */
|
|
import StreamRTCConnectionStore from '../../stores/StreamRTCConnectionStore.tsx'; /* Metro dependency 4395 */
|
|
import RTCRegionStore from '../../stores/RTCRegionStore.tsx'; /* Metro dependency 4402 */
|
|
import ApplicationStreamingStore from '../../stores/ApplicationStreamingStore.tsx'; /* Metro dependency 4492 */
|
|
import * as FileImportTrackerModule from '../../by-id/module-00002-FileImportTracker.js'; /* Metro dependency 2 */
|
|
import * as TimersModule from '../../external/discord_common/js/packages/timers/Timers.tsx'; /* Metro dependency 4041 */
|
|
import * as StreamKeyUtilsModule from './utils/StreamKeyUtils.tsx'; /* Metro dependency 4285 */
|
|
import * as ConstantsModule from './Constants.tsx'; /* Metro dependency 4286 */
|
|
import * as StreamActionCreatorsModule from '../../actions/StreamActionCreators.tsx'; /* Metro dependency 8913 */
|
|
|
|
function _fun125095(global, require, importDefault, importAll, module, exports, dependencyMap) { // fn#125095, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:16400:6, offset: 0x025cddf4, size: 623 bytes, params: 8, frame: 23
|
|
const env0_0 = require;
|
|
const _arrayLikeToArray_125098 = function(a0, a1) {
|
|
var r0;
|
|
var r1;
|
|
var r2;
|
|
var value3;
|
|
var length;
|
|
var value5;
|
|
var value = undefined;
|
|
var value2 = value == null;
|
|
reducibleJoin2: while (true) {
|
|
if (value2) {
|
|
r0 = value2;
|
|
break reducibleJoin2;
|
|
}
|
|
value3 = value > a0.length;
|
|
r0 = value3;
|
|
break reducibleJoin2;
|
|
}
|
|
reducibleJoin4: while (true) {
|
|
if (r0) {
|
|
length = a0.length;
|
|
r1 = length;
|
|
break reducibleJoin4;
|
|
}
|
|
r1 = value;
|
|
break reducibleJoin4;
|
|
}
|
|
value = (0, global.Array)(r1);
|
|
var value4 = 0;
|
|
if (value4 < r1) {
|
|
r2 = value4;
|
|
reducibleLoop5: while (true) {
|
|
value[r2] = a0[r2];
|
|
value5 = typeof r2 === 'bigint' ? r2 + 1n : +r2 + 1;
|
|
if (value5 < r1) {
|
|
r2 = value5;
|
|
continue reducibleLoop5;
|
|
}
|
|
break reducibleLoop5;
|
|
}
|
|
}
|
|
return value;
|
|
};
|
|
const Object = global.Object;
|
|
Object.defineProperty(exports, '__esModule', {value: true});
|
|
UserStore;
|
|
let value = ConstantsModule;
|
|
value.GO_LIVE_NOTIFY_FRIENDS_MIN_MEMBER_COUNT;
|
|
value.STREAM_NOTIFY_GUILD_MAX_SIZE;
|
|
value = require(661) /* metro dependency 661: Constants */;
|
|
const env0_15 = value.ApplicationStreamDeleteReasons;
|
|
const env0_16 = value.ApplicationStreamStates;
|
|
value = require(22) /* metro dependency 22 */;
|
|
value.debounce((StreamActionCreatorsModule).notifyStreamStart, 1000);
|
|
const env0_17 = {};
|
|
const env0_18 = {};
|
|
let Millis = (importDefault(672) /* metro dependency 672: Durations */).Millis;
|
|
const MINUTE = Millis.MINUTE;
|
|
const env0_19 = 3 * MINUTE;
|
|
Millis = (importDefault(672) /* metro dependency 672: Durations */).Millis;
|
|
let SECOND = Millis.SECOND;
|
|
const env0_20 = 5 * SECOND;
|
|
Millis = (importDefault(672) /* metro dependency 672: Durations */).Millis;
|
|
SECOND = Millis.SECOND;
|
|
const env0_21 = 12 * SECOND;
|
|
value = importDefault(4860) /* metro dependency 4860: AutomaticLifecycleManager */;
|
|
value = _fun125108(value);
|
|
(FileImportTrackerModule).fileFinishedImporting('modules/go_live/ApplicationStreamingManager.tsx');
|
|
exports.default = value;
|
|
function _createForOfIteratorHelperLoose_125096(a0, a1) { // fn#125096, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:16400:395, offset: 0x025ce063, size: 372 bytes, params: 3, frame: 20
|
|
var r6;
|
|
var r9;
|
|
var r5;
|
|
var value3;
|
|
var regexp;
|
|
const env0_0 = a0;
|
|
const Symbol = global.Symbol;
|
|
let value = typeof Symbol !== 'undefined';
|
|
let r1 = value && a0[global.Symbol.iterator];
|
|
r1 = !r1 ? a0['@@iterator'] : r1;
|
|
if (r1) {
|
|
value = r1.call(a0);
|
|
return value.next.bind(value);
|
|
}
|
|
const Array = global.Array;
|
|
if (Array.isArray(a0)) {
|
|
if (r1) {
|
|
}
|
|
return _fun125097;
|
|
}
|
|
value = undefined;
|
|
if (a0) {
|
|
if (typeof a0 === 'string') {
|
|
value = _arrayLikeToArray_125098(a0, value);
|
|
r5 = value;
|
|
} else {
|
|
value3 = ({}).toString.call(a0).slice(8, -1);
|
|
r6 = value3 === 'Object' && a0.constructor;
|
|
r9 = r6 ? a0.constructor.name : value3;
|
|
if (r9 === 'Map') {
|
|
r6 = global.Array.from(a0);
|
|
} else if (r9 === 'Set') {
|
|
r6 = global.Array.from(a0);
|
|
} else if (r9 === 'Arguments') {
|
|
value = _arrayLikeToArray_125098(a0, value);
|
|
r6 = value;
|
|
} else {
|
|
regexp = RegExp('^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$', '');
|
|
if (regexp.test(r9)) {
|
|
value = _arrayLikeToArray_125098(a0, value);
|
|
r6 = value;
|
|
} else {
|
|
r6 = value;
|
|
}
|
|
}
|
|
r5 = r6;
|
|
}
|
|
} else {
|
|
r5 = value;
|
|
}
|
|
if (r5) {
|
|
if (r5) {
|
|
}
|
|
return _fun125097;
|
|
}
|
|
const TypeError = global.TypeError;
|
|
throw new TypeError('Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.');
|
|
function _fun125097() { // fn#125097, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:16400:966, offset: 0x00c39d73, size: 69 bytes, params: 1, frame: 5
|
|
return env0_1 >= env0_0.length ? {done: true} : {done: false,
|
|
value: env0_0[typeof env0_1 === 'bigint' ? env0_1 : +env0_1]};
|
|
}
|
|
|
|
}
|
|
|
|
function _isNativeReflectConstruct_125099() { // fn#125099, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:16400:1305, offset: 0x025ce1d7, 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_125099_isNativeReflectConstruct = function() {
|
|
return !!result;
|
|
})();
|
|
}
|
|
|
|
function clearSpectatorReconnectionTimer(a0) { // fn#125102, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:16400:1653, offset: 0x025ce239, size: 42 bytes, params: 2, frame: 11
|
|
const property = env0_17[a0];
|
|
if (property != null) {
|
|
property.stop();
|
|
}
|
|
delete env0_17[a0];
|
|
}
|
|
|
|
function clearConnectTimeout(a0) { // fn#125103, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:16400:1740, offset: 0x025ce263, size: 42 bytes, params: 2, frame: 11
|
|
const property = env0_18[a0];
|
|
if (property != null) {
|
|
property.stop();
|
|
}
|
|
delete env0_18[a0];
|
|
}
|
|
|
|
function maybeAutowatchStream(a0, a1) { // fn#125104, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:16400:1815, offset: 0x025ce28d, size: 255 bytes, params: 3, frame: 16
|
|
var r0;
|
|
var applicationStreamingStoreBinding;
|
|
var getActiveStreamForUser;
|
|
var getGuildId;
|
|
var getStreamForUser;
|
|
var value3;
|
|
var value4;
|
|
var value5;
|
|
var value6;
|
|
var value;
|
|
const selectedChannelStoreBinding = SelectedChannelStore;
|
|
const getVoiceChannelId = selectedChannelStoreBinding.getVoiceChannelId;
|
|
if (Reflect.apply(getVoiceChannelId, selectedChannelStoreBinding, []) === a0) {
|
|
var channel = ChannelStore.getChannel(a0);
|
|
if (channel == null) {
|
|
return false;
|
|
}
|
|
if (channel.isDM()) {
|
|
applicationStreamingStoreBinding = ApplicationStreamingStore;
|
|
getActiveStreamForUser = applicationStreamingStoreBinding.getActiveStreamForUser;
|
|
getGuildId = channel.getGuildId;
|
|
if (Reflect.apply(getActiveStreamForUser, applicationStreamingStoreBinding, [a1, Reflect.apply(getGuildId,
|
|
channel,
|
|
[])]) != null) {
|
|
return false;
|
|
}
|
|
applicationStreamingStoreBinding = ApplicationStreamingStore;
|
|
getStreamForUser = applicationStreamingStoreBinding.getStreamForUser;
|
|
getGuildId = channel.getGuildId;
|
|
value3 = Reflect.apply(getStreamForUser, applicationStreamingStoreBinding, [a1, Reflect.apply(getGuildId,
|
|
channel,
|
|
[])]);
|
|
if (value3 == null) {
|
|
return false;
|
|
}
|
|
value4 = (require(4285) /* metro dependency 4285: StreamKeyUtils */).encodeStreamKey(value3);
|
|
value5 = value4 !== env0_22;
|
|
if (value5) {
|
|
env0_22 = value4;
|
|
value = require(8913) /* metro dependency 8913: StreamActionCreators */;
|
|
value6 = true;
|
|
value.watchStream(value3, {noFocus: value6});
|
|
r0 = value6;
|
|
} else {
|
|
r0 = value5;
|
|
}
|
|
return r0;
|
|
}
|
|
if (channel.isGuildStageVoice()) {
|
|
applicationStreamingStoreBinding = ApplicationStreamingStore;
|
|
getActiveStreamForUser = applicationStreamingStoreBinding.getActiveStreamForUser;
|
|
getGuildId = channel.getGuildId;
|
|
if (Reflect.apply(getActiveStreamForUser, applicationStreamingStoreBinding, [a1, Reflect.apply(getGuildId,
|
|
channel,
|
|
[])]) != null) {
|
|
return false;
|
|
}
|
|
applicationStreamingStoreBinding = ApplicationStreamingStore;
|
|
getStreamForUser = applicationStreamingStoreBinding.getStreamForUser;
|
|
getGuildId = channel.getGuildId;
|
|
value3 = Reflect.apply(getStreamForUser, applicationStreamingStoreBinding, [a1, Reflect.apply(getGuildId,
|
|
channel,
|
|
[])]);
|
|
if (value3 == null) {
|
|
return false;
|
|
}
|
|
value5 = (require(4285) /* metro dependency 4285: StreamKeyUtils */).encodeStreamKey(value3) !== env0_22;
|
|
if (value5) {
|
|
value = require(8913) /* metro dependency 8913: StreamActionCreators */;
|
|
value6 = true;
|
|
value.watchStream(value3, {noFocus: value6});
|
|
r0 = value6;
|
|
} else {
|
|
r0 = value5;
|
|
}
|
|
return r0;
|
|
}
|
|
}
|
|
return false;
|
|
}
|
|
|
|
function updateRegion(a0, a1) { // fn#125105, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:16400:2196, offset: 0x025ce38c, size: 117 bytes, params: 3, frame: 16
|
|
const r2 = a1 ?? RTCRegionStore.getPreferredRegion();
|
|
if (r2 != null && r2 !== RTCRegionStore.getRegion(StreamRTCConnectionStore.getHostname(a0))) {
|
|
(require(8913) /* metro dependency 8913: StreamActionCreators */).changeStreamRegion(a0, r2);
|
|
}
|
|
}
|
|
|
|
function maybeStartConnectTimeout(a0, a1) { // fn#125106, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:16400:2340, offset: 0x025ce401, size: 147 bytes, params: 3, frame: 16
|
|
var r3;
|
|
var property;
|
|
var timeout;
|
|
const env0_0 = a0;
|
|
const allActiveStreamKeys = StreamRTCConnectionStore.getAllActiveStreamKeys();
|
|
if (!allActiveStreamKeys.includes(a0)) {
|
|
property = env0_18[a0];
|
|
if (property != null) {
|
|
r3 = property;
|
|
} else {
|
|
timeout = new (require(4041) /* metro dependency 4041: Timers */).Timeout();
|
|
}
|
|
env0_18[a0] = r3;
|
|
r3.start(a1 ? env0_21 : env0_20, _fun125107);
|
|
}
|
|
function _fun125107() { // fn#125107, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:16400:2497, offset: 0x025ce494, size: 61 bytes, params: 1, frame: 13
|
|
const value = environment.__proto__;
|
|
(Dispatcher).dispatch({type: 'STREAM_TIMED_OUT', streamKey: env0_0});
|
|
}
|
|
|
|
}
|
|
|
|
function _fun125108(a0) { // fn#125108, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:16400:2569, offset: 0x025ce4d1, size: 42 bytes, params: 2, frame: 14
|
|
const BaseApplicationStreamingManager2 = BaseApplicationStreamingManager;
|
|
Inherits(BaseApplicationStreamingManager2, a0);
|
|
return CreateClass(BaseApplicationStreamingManager2);
|
|
function BaseApplicationStreamingManager(a0) { // fn#125109, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:16400:2581, offset: 0x025ce4fb, size: 380 bytes, params: 2, frame: 20
|
|
var environment;
|
|
var r0;
|
|
var Reflect;
|
|
let value = copyRestArgs(0, undefined);
|
|
let value2 = environment.__proto__;
|
|
let binding = env1_4;
|
|
binding(this, BaseApplicationStreamingManager);
|
|
const items2 = [];
|
|
arraySpread(items2, value, 0, items2);
|
|
value = env1_6(BaseApplicationStreamingManager);
|
|
binding = env1_5;
|
|
if (_isNativeReflectConstruct_125099()) {
|
|
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.handleStreamWatch = handleStreamWatch;
|
|
value.handleStreamStart = handleStreamStart;
|
|
value.handleStreamCreate = function({streamKey}) {
|
|
clearConnectTimeout(streamKey);
|
|
var value2 = require(dependencyMap[18]).decodeStreamKey(streamKey);
|
|
value2.ownerId;
|
|
GuildMemberCountStore.getMemberCount(value2.guildId);
|
|
};
|
|
value.handleStreamUpdate = function({streamKey}) {
|
|
clearConnectTimeout(streamKey);
|
|
};
|
|
value.handleStreamDelete = handleStreamDelete;
|
|
value.handleStreamClose = function({streamKey}) {
|
|
clearSpectatorReconnectionTimer(streamKey);
|
|
clearConnectTimeout(streamKey);
|
|
};
|
|
value.handleVoiceChannelSelect = handleVoiceChannelSelect_125117;
|
|
value.handleVoiceStateUpdates = function({voiceStates}) {
|
|
voiceStates.forEach(_fun125120);
|
|
};
|
|
value.handleCallUpdate = handleCallUpdate_125122;
|
|
value.handleChannelUpdates = handleChannelUpdates_125123;
|
|
var handleStreamWatch = value.handleStreamWatch;
|
|
var handleStreamStart = value.handleStreamStart;
|
|
var handleStreamDelete = value.handleStreamDelete;
|
|
value.actions = {STREAM_WATCH: handleStreamWatch, STREAM_START: handleStreamStart,
|
|
STREAM_CREATE: value.handleStreamCreate, STREAM_UPDATE: value.handleStreamUpdate,
|
|
STREAM_DELETE: handleStreamDelete, STREAM_CLOSE: value.handleStreamClose, CALL_UPDATE: value.handleCallUpdate,
|
|
CHANNEL_UPDATES: value.handleChannelUpdates, VOICE_CHANNEL_SELECT: value.handleVoiceChannelSelect,
|
|
VOICE_STATE_UPDATES: value.handleVoiceStateUpdates};
|
|
return value;
|
|
function handleStreamWatch({streamKey, allowMultiple}) { // fn#125110, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:16400:2880, owner: BaseApplicationStreamingManager.handleStreamWatch, offset: 0x025ce677, size: 152 bytes, params: 2, frame: 18
|
|
var environment;
|
|
const value = environment.__proto__.__proto__;
|
|
maybeStartConnectTimeout(streamKey,
|
|
ChannelStore.getChannel(StreamKeyUtilsModule.decodeStreamKey(streamKey).channelId)?.isGuildStageVoice());
|
|
clearSpectatorReconnectionTimer(streamKey);
|
|
if (!allowMultiple) {
|
|
ApplicationStreamingStore.getAllActiveStreams().forEach(_fun125111);
|
|
}
|
|
function _fun125111(a0) { // fn#125111, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:16400:3113, offset: 0x025ce70f, size: 116 bytes, params: 2, frame: 15
|
|
const value = environment.__proto__.__proto__.__proto__;
|
|
const value2 = (StreamKeyUtilsModule).encodeStreamKey(a0);
|
|
const ownerId = a0.ownerId;
|
|
const authenticationStoreBinding = AuthenticationStore;
|
|
const getId = authenticationStoreBinding.getId;
|
|
if (ownerId !== Reflect.apply(getId, authenticationStoreBinding, []) && value2 !== streamKey) {
|
|
(require(8913) /* metro dependency 8913: StreamActionCreators */).stopStream(value2, false);
|
|
}
|
|
}
|
|
|
|
}
|
|
|
|
function handleStreamStart(a0) { // fn#125112, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:16400:3233, owner: BaseApplicationStreamingManager.handleStreamStart, offset: 0x025ce783, size: 156 bytes, params: 2, frame: 20
|
|
const channelId = a0.channelId;
|
|
const streamType = a0.streamType;
|
|
const guildId = a0.guildId;
|
|
const value = environment.__proto__.__proto__;
|
|
const channel = ChannelStore.getChannel(channelId);
|
|
const maybeStartConnectTimeoutBinding = maybeStartConnectTimeout;
|
|
const value3 = undefined;
|
|
const encodeStreamKey = StreamKeyUtilsModule.encodeStreamKey;
|
|
const object = {streamType: streamType, guildId: guildId, channelId: channelId};
|
|
object.ownerId = AuthenticationStore.getId();
|
|
maybeStartConnectTimeoutBinding(Reflect.apply(encodeStreamKey, StreamKeyUtilsModule, [object]),
|
|
channel == null ? value3 : channel.isGuildStageVoice());
|
|
env0_0.platformHandleStreamStart(a0);
|
|
return value3;
|
|
}
|
|
|
|
function handleStreamDelete({reason, streamKey}) { // fn#125115, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:16400:3703, owner: BaseApplicationStreamingManager.handleStreamDelete, offset: 0x025ce88a, size: 152 bytes, params: 2, frame: 17
|
|
var reportAVError;
|
|
var object;
|
|
var moduleValue;
|
|
let value = environment.__proto__.__proto__;
|
|
clearConnectTimeout(streamKey);
|
|
const STREAM_FULL = ApplicationStreamDeleteReasons.STREAM_FULL;
|
|
if (reason === STREAM_FULL) {
|
|
value = require(dependencyMap[21]);
|
|
reportAVError = value.reportAVError;
|
|
object = {};
|
|
object.type = require(dependencyMap[21]).AVError.STREAM_FULL;
|
|
moduleValue = require(dependencyMap[22]);
|
|
copyDataProperties(object, moduleValue.getStreamErrorContext(streamKey), dependencyMap);
|
|
Reflect.apply(reportAVError, value, [object]);
|
|
env0_0.platformShowStreamFull();
|
|
}
|
|
}
|
|
|
|
function BaseApplicationStreamingManagerHandleVoiceChannelSelect({channelId}) { // fn#125117, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:16400:4026, owner: BaseApplicationStreamingManager.handleVoiceChannelSelect, offset: 0x025ce944, size: 87 bytes, params: 2, frame: 15
|
|
var environment;
|
|
var value;
|
|
var property;
|
|
if (channelId != null) {
|
|
value = environment.__proto__.__proto__;
|
|
property = ApplicationStreamingStore.getAllApplicationStreamsForChannel(channelId).filter(function({ownerId}) {
|
|
return ownerId !== AuthenticationStore.getId();
|
|
})[0];
|
|
if (property != null) {
|
|
maybeAutowatchStream(channelId, property.ownerId);
|
|
}
|
|
}
|
|
}
|
|
|
|
function BaseApplicationStreamingManagerHandleVoiceStateUpdates({voiceStates}) { // fn#125119, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:16400:4222, owner: BaseApplicationStreamingManager.handleVoiceStateUpdates, offset: 0x025ce9bb, size: 32 bytes, params: 2, frame: 11
|
|
voiceStates.forEach(_fun125120);
|
|
function _fun125120(a0) { // fn#125120, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:16400:4253, offset: 0x025ce9db, size: 411 bytes, params: 2, frame: 23
|
|
var environment;
|
|
var r5;
|
|
var activeStreamForUser;
|
|
var value3;
|
|
var property;
|
|
const Timeout = (TimersModule).Timeout;
|
|
var timeout;
|
|
var clearSpectatorReconnectionTimerBinding;
|
|
var moduleValue2;
|
|
var streamForUser;
|
|
const userId = a0.userId;
|
|
const channelId = a0.channelId;
|
|
const guildId = a0.guildId;
|
|
const selfStream = a0.selfStream;
|
|
let value = environment.__proto__;
|
|
env1_0.platformHandleVoiceStateUpdate(a0);
|
|
value = environment.__proto__.__proto__.__proto__;
|
|
const authenticationStoreBinding = AuthenticationStore;
|
|
const getId = authenticationStoreBinding.getId;
|
|
if (userId !== Reflect.apply(getId, authenticationStoreBinding, [])) {
|
|
if (channelId == null) {
|
|
return undefined;
|
|
}
|
|
if (selfStream) {
|
|
if (maybeAutowatchStream(channelId, userId)) {
|
|
return undefined;
|
|
}
|
|
activeStreamForUser = ApplicationStreamingStore.getActiveStreamForUser(userId, guildId);
|
|
if (activeStreamForUser == null) {
|
|
return undefined;
|
|
}
|
|
if (activeStreamForUser.channelId !== channelId) {
|
|
return undefined;
|
|
}
|
|
if (!selfStream) {
|
|
if (activeStreamForUser.state !== ApplicationStreamStates.ENDED) {
|
|
value3 = (require(4285) /* metro dependency 4285: StreamKeyUtils */).encodeStreamKey(activeStreamForUser);
|
|
property = env3_17[value3];
|
|
if (property != null) {
|
|
r5 = property;
|
|
} else {
|
|
timeout = new Timeout();
|
|
}
|
|
r5.start(env3_19, _fun125121);
|
|
env3_17[value3] = r5;
|
|
}
|
|
}
|
|
if (selfStream) {
|
|
if (activeStreamForUser.state !== ApplicationStreamStates.ENDED) {
|
|
return undefined;
|
|
}
|
|
clearSpectatorReconnectionTimerBinding = clearSpectatorReconnectionTimer;
|
|
moduleValue2 = require(4285) /* metro dependency 4285: StreamKeyUtils */;
|
|
clearSpectatorReconnectionTimerBinding(moduleValue2.encodeStreamKey(activeStreamForUser));
|
|
streamForUser = ApplicationStreamingStore.getStreamForUser(userId, guildId);
|
|
if (streamForUser == null) {
|
|
return undefined;
|
|
}
|
|
(require(8913) /* metro dependency 8913: StreamActionCreators */).watchStream(streamForUser);
|
|
return undefined;
|
|
}
|
|
return undefined;
|
|
}
|
|
activeStreamForUser = ApplicationStreamingStore.getActiveStreamForUser(userId, guildId);
|
|
if (activeStreamForUser == null) {
|
|
return undefined;
|
|
}
|
|
if (activeStreamForUser.channelId !== channelId) {
|
|
return undefined;
|
|
}
|
|
if (!selfStream) {
|
|
if (activeStreamForUser.state !== ApplicationStreamStates.ENDED) {
|
|
value3 = (require(4285) /* metro dependency 4285: StreamKeyUtils */).encodeStreamKey(activeStreamForUser);
|
|
property = env3_17[value3];
|
|
if (property != null) {
|
|
r5 = property;
|
|
} else {
|
|
timeout = new Timeout();
|
|
}
|
|
r5.start(env3_19, _fun125121);
|
|
env3_17[value3] = r5;
|
|
}
|
|
}
|
|
if (selfStream) {
|
|
if (activeStreamForUser.state !== ApplicationStreamStates.ENDED) {
|
|
return undefined;
|
|
}
|
|
clearSpectatorReconnectionTimerBinding = clearSpectatorReconnectionTimer;
|
|
moduleValue2 = require(4285) /* metro dependency 4285: StreamKeyUtils */;
|
|
clearSpectatorReconnectionTimerBinding(moduleValue2.encodeStreamKey(activeStreamForUser));
|
|
streamForUser = ApplicationStreamingStore.getStreamForUser(userId, guildId);
|
|
if (streamForUser == null) {
|
|
return undefined;
|
|
}
|
|
(require(8913) /* metro dependency 8913: StreamActionCreators */).watchStream(streamForUser);
|
|
return undefined;
|
|
}
|
|
}
|
|
function _fun125121() { // fn#125121, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:16400:4596, offset: 0x025ceb76, size: 48 bytes, params: 1, frame: 13
|
|
const value = environment.__proto__.__proto__.__proto__.__proto__;
|
|
return (StreamActionCreatorsModule).closeStream(env0_0, false);
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
function BaseApplicationStreamingManagerHandleCallUpdate({channelId, region}) { // fn#125122, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:16400:4823, owner: BaseApplicationStreamingManager.handleCallUpdate, offset: 0x025ceba6, size: 96 bytes, params: 2, frame: 16
|
|
var updateRegionBinding;
|
|
let value = environment.__proto__.__proto__;
|
|
const currentUserActiveStream = ApplicationStreamingStore.getCurrentUserActiveStream();
|
|
const channelId = currentUserActiveStream?.channelId;
|
|
if (channelId === channelId) {
|
|
updateRegionBinding = updateRegion;
|
|
value = require(4285) /* metro dependency 4285: StreamKeyUtils */;
|
|
updateRegionBinding(value.encodeStreamKey(currentUserActiveStream), region);
|
|
}
|
|
}
|
|
|
|
function BaseApplicationStreamingManagerHandleChannelUpdates({channels}) { // fn#125123, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:16400:4990, owner: BaseApplicationStreamingManager.handleChannelUpdates, offset: 0x025cec06, size: 140 bytes, params: 2, frame: 19
|
|
var r1;
|
|
var value3;
|
|
var value4;
|
|
var done;
|
|
var value5;
|
|
var channelId;
|
|
var id;
|
|
var updateRegionBinding;
|
|
var moduleValue;
|
|
var value6;
|
|
var rtcRegion;
|
|
var value7;
|
|
const currentUserActiveStream = ApplicationStreamingStore.getCurrentUserActiveStream();
|
|
if (currentUserActiveStream != null) {
|
|
value3 = _createForOfIteratorHelperLoose_125096(channels);
|
|
value4 = value3();
|
|
done = value4.done;
|
|
if (!done) {
|
|
r1 = value4;
|
|
while (true) {
|
|
value5 = r1.value;
|
|
channelId = currentUserActiveStream.channelId;
|
|
id = value5.id;
|
|
if (channelId === id) {
|
|
updateRegionBinding = updateRegion;
|
|
moduleValue = require(4285) /* metro dependency 4285: StreamKeyUtils */;
|
|
value6 = moduleValue.encodeStreamKey(currentUserActiveStream);
|
|
rtcRegion = value5.rtcRegion;
|
|
updateRegionBinding(value6, rtcRegion);
|
|
}
|
|
value7 = value3();
|
|
done = value7.done;
|
|
if (done) {
|
|
break;
|
|
}
|
|
r1 = value7;
|
|
continue;
|
|
}
|
|
}
|
|
}
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
global.__d(_fun125095, 16192, [7, 6, 15, 17, 18, 4492, 1226, 1379, 4111, 4402, 1934, 4395, 1878, 4286, 661, 22,
|
|
8913, 672, 4285, 4041, 694, 9235, 16170, 4860,
|
|
2]) /* metro module 16192, dependencies: [7, 6, 15, 17, 18, 4492, 1226, 1379, 4111, 4402, 1934, 4395, 1878, 4286, 661, 22, 8913, 672, 4285, 4041, 694, 9235, 16170, 4860, 2] */;
|