265 lines
13 KiB
TypeScript
265 lines
13 KiB
TypeScript
/* Metro module 15678; source: modules/calls/ChannelCallManager.tsx; dependencies: [6, 7, 15, 17, 18, 99, 100, 10757, 4258, 1379, 10907, 1934, 3996, 4297, 4300, 4606, 10756, 4860, 2] */
|
|
function _fun120248(global, require, importDefault, importAll, module, exports, dependencyMap) { // fn#120248, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:15886:6, offset: 0x02525a03, size: 455 bytes, params: 8, frame: 21
|
|
const env0_0 = require;
|
|
const Object = global.Object;
|
|
Object.defineProperty(exports, '__esModule', {value: true});
|
|
const env0_2 = importDefault(6) /* metro dependency 6 */;
|
|
const env0_3 = importDefault(7) /* metro dependency 7 */;
|
|
const env0_4 = importDefault(15) /* metro dependency 15 */;
|
|
const env0_5 = importDefault(17) /* metro dependency 17 */;
|
|
const env0_6 = importDefault(18) /* metro dependency 18 */;
|
|
const env0_7 = importDefault(99) /* metro dependency 99 */;
|
|
let value = importDefault(100) /* metro dependency 100 */;
|
|
const soundpackStore = importDefault(10757) /* metro dependency 10757: SoundpackStore */;
|
|
const callStore = importDefault(4258) /* metro dependency 4258: CallStore */;
|
|
const channelStore = importDefault(1379) /* metro dependency 1379: ChannelStore */;
|
|
const notificationSettingsStore = importDefault(10907) /* metro dependency 10907: NotificationSettingsStore */;
|
|
const selectedChannelStore = importDefault(1934) /* metro dependency 1934: SelectedChannelStore */;
|
|
const streamerModeStore = importDefault(3996) /* metro dependency 3996: StreamerModeStore */;
|
|
const voiceStateStore = importDefault(4297) /* metro dependency 4297: VoiceStateStore */;
|
|
const sortedVoiceStateStore = importDefault(4300) /* metro dependency 4300: SortedVoiceStateStore */;
|
|
const channelRTCStore = importDefault(4606) /* metro dependency 4606: ChannelRTCStore */;
|
|
const soundUtilsModule = require(10756) /* metro dependency 10756: SoundUtils */;
|
|
const env0_17 = soundUtilsModule.createSoundForPack('call_calling', soundpackStore.getSoundpack());
|
|
const env0_18 = value('outboundRingingGuildUserIds');
|
|
value = importDefault(4860) /* metro dependency 4860: AutomaticLifecycleManager */;
|
|
value = _fun120252(value);
|
|
value = new value();
|
|
(require(2) /* metro dependency 2 */).fileFinishedImporting('modules/calls/ChannelCallManager.tsx');
|
|
exports.default = value;
|
|
}
|
|
|
|
function _isNativeReflectConstruct_120249() { // fn#120249, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:15886:264, offset: 0x02525bca, 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_120249_isNativeReflectConstruct = function() {
|
|
return !!result;
|
|
})();
|
|
}
|
|
|
|
function _fun120252(a0) { // fn#120252, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:15886:565, offset: 0x02525c2c, size: 72 bytes, params: 2, frame: 15
|
|
const closure = ChannelCallManager;
|
|
env0_6(closure, a0);
|
|
return env0_3(closure, [{key: '_initialize', value: value_120267}]);
|
|
}
|
|
|
|
function ChannelCallManager(a0) { // fn#120253, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:15886:577, offset: 0x02525c74, size: 307 bytes, params: 2, frame: 21
|
|
var r0;
|
|
var Reflect;
|
|
let value = copyRestArgs(0, undefined);
|
|
let binding = env1_2;
|
|
binding(this, ChannelCallManager);
|
|
const items = [];
|
|
arraySpread(items, value, 0, items);
|
|
value = env1_5(ChannelCallManager);
|
|
binding = env1_4;
|
|
if (_isNativeReflectConstruct_120249()) {
|
|
Reflect = global.Reflect;
|
|
value = Reflect.construct(value, items, env1_5(this).constructor);
|
|
r0 = value;
|
|
} else {
|
|
value = value.apply(this, items);
|
|
r0 = value;
|
|
}
|
|
value = binding(this, r0);
|
|
const Object = global.Object;
|
|
const defineProperty = Object.defineProperty;
|
|
binding = env1_18;
|
|
const Set = global.Set;
|
|
const value4 = Object.create(Set.prototype, {constructor: {value: Set}});
|
|
const set = new Set();
|
|
Reflect.apply(defineProperty, Object, [value, binding, {writable: true,
|
|
value: set instanceof Object ? set : value4}]);
|
|
value.actions = {GUILD_LOCAL_RING_START: GUILD_LOCAL_RING_START, GUILD_RING_STOP: GUILD_RING_STOP_120255};
|
|
value._handleRing = _handleRing;
|
|
value.handleSoundpackUpdate = handleSoundpackUpdate;
|
|
value.handleRingUpdate = handleRingUpdate;
|
|
value.handleGuildRingStart = handleGuildRingStart;
|
|
value.handleGuildRingStop = handleGuildRingStop;
|
|
value.handleChannelRTCStoreChange = handleChannelRTCStoreChange;
|
|
return value;
|
|
}
|
|
|
|
function value_120267() { // fn#120267, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:15886:2199, offset: 0x025261c9, size: 170 bytes, params: 1, frame: 15
|
|
const Map = global.Map;
|
|
let map = new Map();
|
|
map = map.set(CallStore, this.handleRingUpdate);
|
|
map = map.set(NotificationSettingsStore, this.handleRingUpdate);
|
|
map = map.set(StreamerModeStore, this.handleRingUpdate);
|
|
map = map.set(VoiceStateStore, this.handleRingUpdate);
|
|
map = map.set(ChannelRTCStore, this.handleChannelRTCStoreChange);
|
|
this.stores = map.set(SoundpackStore, this.handleSoundpackUpdate);
|
|
}
|
|
|
|
function GUILD_LOCAL_RING_START(a0) { // fn#120254, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:15886:906, owner: ChannelCallManager.GUILD_LOCAL_RING_START, offset: 0x02525da7, size: 23 bytes, params: 2, frame: 11
|
|
return env0_0.handleGuildRingStart(a0);
|
|
}
|
|
|
|
function ChannelCallManagerGUILD_RING_STOP(a0) { // fn#120255, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:15886:951, owner: ChannelCallManager.GUILD_RING_STOP, offset: 0x02525dbe, size: 23 bytes, params: 2, frame: 11
|
|
return env0_0.handleGuildRingStop(a0);
|
|
}
|
|
|
|
function _handleRing(a0, a1) { // fn#120256, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:15886:994, owner: ChannelCallManager._handleRing, offset: 0x02525dd5, size: 134 bytes, params: 3, frame: 14
|
|
const currentClientVoiceChannelId = VoiceStateStore.getCurrentClientVoiceChannelId(a1);
|
|
if (currentClientVoiceChannelId == null) {
|
|
env2_17.stop();
|
|
} else if (currentClientVoiceChannelId != null && SortedVoiceStateStore.countVoiceStatesForChannel(currentClientVoiceChannelId) >= 2) {
|
|
env2_17.stop();
|
|
} else if (a0) {
|
|
if (NotificationSettingsStore.isSoundDisabled('call_calling')) {
|
|
env2_17.stop();
|
|
} else if (StreamerModeStore.disableSounds) {
|
|
env2_17.stop();
|
|
} else {
|
|
env2_17.loop();
|
|
}
|
|
} else {
|
|
env2_17.stop();
|
|
}
|
|
}
|
|
|
|
function handleSoundpackUpdate() { // fn#120257, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:15886:1200, owner: ChannelCallManager.handleSoundpackUpdate, offset: 0x02525e5b, size: 75 bytes, params: 1, frame: 15
|
|
env2_17.stop();
|
|
const soundUtilsModule = require(10756) /* metro dependency 10756: SoundUtils */;
|
|
env2_17 = soundUtilsModule.createSoundForPack('call_calling', SoundpackStore.getSoundpack());
|
|
}
|
|
|
|
function handleRingUpdate() { // fn#120258, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:15886:1297, owner: ChannelCallManager.handleRingUpdate, offset: 0x02525ea6, size: 152 bytes, params: 1, frame: 17
|
|
var environment;
|
|
const value = environment.__proto__.__proto__;
|
|
const channel = ChannelStore.getChannel(SelectedChannelStore.getVoiceChannelId());
|
|
const value4 = null;
|
|
const value5 = undefined;
|
|
const guild_id = value4 == channel ? value5 : channel.guild_id;
|
|
const r4 = value4 != guild_id ? guild_id : value4;
|
|
const value7 = CallStore.getCalls().some(_fun120259);
|
|
const binding = env0_0;
|
|
binding._handleRing(value7 || env2_7(env0_0, env2_18)[env2_18].size > 0, r4);
|
|
return value5;
|
|
}
|
|
|
|
function handleGuildRingStart({ringing, guildId}) { // fn#120260, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:15886:1557, owner: ChannelCallManager.handleGuildRingStart, offset: 0x02525f74, size: 88 bytes, params: 2, frame: 15
|
|
ringing.forEach(_fun120261);
|
|
const binding = env0_0;
|
|
const _handleRing = binding._handleRing;
|
|
const binding2 = env2_7;
|
|
const binding3 = env2_18;
|
|
Reflect.apply(_handleRing, binding, [binding2(binding, binding3)[binding3].size > 0, guildId]);
|
|
}
|
|
|
|
function handleGuildRingStop({ringing, guildId}) { // fn#120262, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:15886:1675, owner: ChannelCallManager.handleGuildRingStop, offset: 0x02525ff9, size: 88 bytes, params: 2, frame: 15
|
|
ringing.forEach(_fun120263);
|
|
const binding = env0_0;
|
|
const _handleRing = binding._handleRing;
|
|
const binding2 = env2_7;
|
|
const binding3 = env2_18;
|
|
Reflect.apply(_handleRing, binding, [binding2(binding, binding3)[binding3].size > 0, guildId]);
|
|
}
|
|
|
|
function handleChannelRTCStoreChange() { // fn#120264, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:15886:1804, owner: ChannelCallManager.handleChannelRTCStoreChange, offset: 0x0252607e, size: 331 bytes, params: 1, frame: 20
|
|
var environment;
|
|
var Set;
|
|
var binding4;
|
|
var binding5;
|
|
var property;
|
|
var items2;
|
|
var value4;
|
|
var set;
|
|
var _handleRing;
|
|
var binding6;
|
|
var binding7;
|
|
var binding8;
|
|
var binding9;
|
|
var value7;
|
|
let value = environment.__proto__.__proto__;
|
|
const voiceChannelId = SelectedChannelStore.getVoiceChannelId();
|
|
let binding = env2_7;
|
|
const binding2 = env0_0;
|
|
const binding3 = env2_18;
|
|
if (binding(binding2, binding3)[binding3].size > 0) {
|
|
if (voiceChannelId == null) {
|
|
binding = env2_7;
|
|
binding8 = env0_0;
|
|
binding9 = env2_18;
|
|
value = binding(binding8, binding9);
|
|
Set = global.Set;
|
|
value7 = Object.create(Set.prototype, {constructor: {value: Set}});
|
|
set = new Set();
|
|
value[binding9] = set instanceof Object ? set : value7;
|
|
binding8._handleRing(binding(binding8, binding9)[binding9].size > 0, null);
|
|
return undefined;
|
|
}
|
|
if (voiceChannelId != null) {
|
|
var env0_0 = ChannelRTCStore.getGuildRingingUsers(voiceChannelId);
|
|
Set = global.Set;
|
|
binding = env2_7;
|
|
binding4 = env0_0;
|
|
binding5 = env2_18;
|
|
property = binding(binding4, binding5)[binding5];
|
|
items2 = [];
|
|
arraySpread(items2, property, 0, items2);
|
|
value4 = items2.filter(_fun120265);
|
|
set = new Set();
|
|
if (set.size > 0) {
|
|
set.forEach(_fun120266);
|
|
binding = env0_0;
|
|
_handleRing = binding._handleRing;
|
|
binding6 = env2_7;
|
|
binding7 = env2_18;
|
|
Reflect.apply(_handleRing, binding, [binding6(binding, binding7)[binding7].size > 0, null]);
|
|
}
|
|
}
|
|
}
|
|
}
|
|
|
|
function _fun120259(a0) { // fn#120259, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:15886:1418, offset: 0x02525f3e, size: 54 bytes, params: 2, frame: 13
|
|
var r0;
|
|
let value = a0.ringing.length > 0;
|
|
if (value) {
|
|
value = environment.__proto__.__proto__.__proto__;
|
|
value = VoiceStateStore.getCurrentClientVoiceChannelId(null);
|
|
value = value === a0.channelId;
|
|
r0 = value;
|
|
} else {
|
|
r0 = value;
|
|
}
|
|
return r0;
|
|
}
|
|
|
|
function _fun120261(a0) { // fn#120261, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:15886:1594, offset: 0x02525fcc, size: 45 bytes, params: 2, frame: 13
|
|
const binding = env3_7;
|
|
const binding2 = env1_0;
|
|
const binding3 = env3_18;
|
|
binding(binding2, binding3)[binding3].add(a0);
|
|
}
|
|
|
|
function _fun120263(a0) { // fn#120263, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:15886:1712, offset: 0x02526051, size: 45 bytes, params: 2, frame: 13
|
|
const binding = env3_7;
|
|
const binding2 = env1_0;
|
|
const binding3 = env3_18;
|
|
binding(binding2, binding3)[binding3].delete(a0);
|
|
}
|
|
|