233 lines
11 KiB
TypeScript
233 lines
11 KiB
TypeScript
/* Metro module 12603; source: stores/RTCConnectionDesyncStore.tsx; dependencies: [6, 7, 15, 17, 18, 4298, 1379, 4294, 1878, 4297, 4300, 661, 4299, 4268, 4617, 4618, 4406, 566, 694, 2] */
|
|
function _fun96668(global, require, importDefault, importAll, module, exports, dependencyMap) { // fn#96668, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:12793:6, offset: 0x02163050, size: 629 bytes, params: 8, frame: 21
|
|
const env0_0 = require;
|
|
const closure = VOICE_CHANNEL_SELECT_96676;
|
|
const Object = global.Object;
|
|
Object.defineProperty(exports, '__esModule', {value: true});
|
|
const env0_3 = importDefault(6) /* metro dependency 6 */;
|
|
const env0_4 = importDefault(7) /* metro dependency 7 */;
|
|
const env0_5 = importDefault(15) /* metro dependency 15 */;
|
|
const env0_6 = importDefault(17) /* metro dependency 17 */;
|
|
const env0_7 = importDefault(18) /* metro dependency 18 */;
|
|
const voiceStateRecord = importDefault(4298) /* metro dependency 4298: VoiceStateRecord */;
|
|
const channelStore = importDefault(1379) /* metro dependency 1379: ChannelStore */;
|
|
const rtcConnectionStore = importDefault(4294) /* metro dependency 4294: RTCConnectionStore */;
|
|
const userStore = importDefault(1878) /* metro dependency 1878: UserStore */;
|
|
const voiceStateStore = importDefault(4297) /* metro dependency 4297: VoiceStateStore */;
|
|
const env0_13 = (require(4300) /* metro dependency 4300: SortedVoiceStateStore */).makeSortedVoiceState;
|
|
let value = require(661) /* metro dependency 661: Constants */;
|
|
const env0_14 = value.ME;
|
|
const env0_15 = value.RTCConnectionStates;
|
|
const env0_16 = (require(4299) /* metro dependency 4299: CallConstants */).ParticipantTypes;
|
|
value = importDefault(4268) /* metro dependency 4268: CachedEntriesMap */;
|
|
value = new value();
|
|
value = importDefault(4268) /* metro dependency 4268: CachedEntriesMap */;
|
|
value = new value();
|
|
const Set = global.Set;
|
|
let set = new Set();
|
|
const Store = (importDefault(566) /* metro dependency 566: flux */).Store;
|
|
_fun96677(Store).displayName = 'RTCConnectionDesyncStore';
|
|
set = new set(importDefault(694) /* metro dependency 694: Dispatcher */, {CONNECTION_OPEN: function() {
|
|
VOICE_CHANNEL_SELECT_96676();
|
|
}, VOICE_CHANNEL_SELECT: closure, RTC_CONNECTION_STATE: function({state, context}) {
|
|
var r1;
|
|
var r0;
|
|
var value4;
|
|
var value2 = undefined;
|
|
var value3 = context === require(dependencyMap[16]).MediaEngineContextTypes.DEFAULT;
|
|
if (value3) {
|
|
value4 = state === RTCConnectionStates.DISCONNECTED;
|
|
if (value4) {
|
|
VOICE_CHANNEL_SELECT_96676();
|
|
r1 = value2;
|
|
} else {
|
|
r1 = value4;
|
|
}
|
|
r0 = r1;
|
|
} else {
|
|
r0 = value3;
|
|
}
|
|
return r0;
|
|
}, VOICE_STATE_UPDATES: VOICE_STATE_UPDATES_96686,
|
|
RTC_CONNECTION_CLIENT_CONNECT: RTC_CONNECTION_CLIENT_CONNECT_96688,
|
|
RTC_CONNECTION_CLIENT_DISCONNECT: RTC_CONNECTION_CLIENT_DISCONNECT});
|
|
(require(2) /* metro dependency 2 */).fileFinishedImporting('stores/RTCConnectionDesyncStore.tsx');
|
|
exports.default = set;
|
|
}
|
|
|
|
function _isNativeReflectConstruct_96669() { // fn#96669, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:12793:300, offset: 0x021632c5, 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_96669_isNativeReflectConstruct = function() {
|
|
return !!result;
|
|
})();
|
|
}
|
|
|
|
function upsert_96672(a0, a1, a2) { // fn#96672, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:12793:539, offset: 0x02163327, size: 276 bytes, params: 4, frame: 21
|
|
var object2;
|
|
const value = a1;
|
|
const voiceStateRecord = new VoiceStateRecord({userId: a0.id, channelId: a2});
|
|
const sortedVoiceState = makeSortedVoiceState(voiceStateRecord, value ?? ME, a0.id);
|
|
let binding = env0_17;
|
|
binding.set(a0.id, sortedVoiceState);
|
|
object2 = {};
|
|
const USER = ParticipantTypes.USER;
|
|
object2.type = USER;
|
|
object2.user = a0;
|
|
object2.id = a0.id;
|
|
object2.streamId = null;
|
|
object2.voiceState = voiceStateRecord;
|
|
object2.voicePlatform = null;
|
|
object2.speaking = false;
|
|
object2.lastSpoke = 0;
|
|
object2.soundsharing = false;
|
|
object2.ringing = false;
|
|
object2.userNick = (importDefault(4617) /* metro dependency 4617: NicknameUtils */).getName(value, a2, a0);
|
|
object2.userAvatarDecoration = (require(4618) /* metro dependency 4618: useAvatarDecoration */).getAvatarDecoration(a0,
|
|
value);
|
|
object2.localVideoDisabled = false;
|
|
object2.isPoppedOut = false;
|
|
binding = env0_18;
|
|
binding.set(a0.id, object2);
|
|
}
|
|
|
|
function deleteUserDesyncData(a0) { // fn#96673, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:12793:910, offset: 0x0216343b, size: 62 bytes, params: 2, frame: 13
|
|
const value2 = env0_17.delete(a0);
|
|
const value3 = env0_18.delete(a0);
|
|
const value = env0_19.delete(a0);
|
|
let r0 = value2 || value3;
|
|
r0 = !r0 ? value : r0;
|
|
return r0;
|
|
}
|
|
|
|
function retryFailedUsers() { // fn#96674, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:12793:1004, offset: 0x02163479, size: 103 bytes, params: 1, frame: 14
|
|
var value5;
|
|
const channelId = RTCConnectionStore.getChannelId();
|
|
if (channelId == null) {
|
|
return false;
|
|
}
|
|
const channel = ChannelStore.getChannel(channelId);
|
|
if (channel != null) {
|
|
value5 = channel.getGuildId();
|
|
}
|
|
const env0_2 = false;
|
|
env0_19.forEach(_fun96675);
|
|
return env0_2;
|
|
}
|
|
|
|
function VOICE_CHANNEL_SELECT_96676() { // fn#96676, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:12793:1282, offset: 0x02163553, size: 49 bytes, params: 1, frame: 10
|
|
env0_17.clear();
|
|
env0_18.clear();
|
|
env0_19.clear();
|
|
}
|
|
|
|
function _fun96677(a0) { // fn#96677, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:12793:1341, offset: 0x02163584, size: 180 bytes, params: 2, frame: 16
|
|
const closure = RTCConnectionDesyncStore;
|
|
env0_7(closure, a0);
|
|
return env0_4(closure, [{key: 'initialize', value: function() {
|
|
this.waitFor(VoiceStateStore, UserStore, ChannelStore, RTCConnectionStore);
|
|
this.syncWith([UserStore], retryFailedUsers);
|
|
}}, {key: 'desyncedVoiceStatesCount', get: get_96680}, {key: 'getDesyncedUserIds', value: value_96681},
|
|
{key: 'getDesyncedVoiceStates', value: value_96682}, {key: 'getDesyncedParticipants', value: value_96683}]);
|
|
}
|
|
|
|
function VOICE_STATE_UPDATES_96686({voiceStates}) { // fn#96686, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:12793:2392, offset: 0x0216372b, size: 64 bytes, params: 2, frame: 14
|
|
let value = RTCConnectionStore.getChannelId();
|
|
value = value != null;
|
|
return value && voiceStates.reduce(_fun96687, false);
|
|
}
|
|
|
|
function RTC_CONNECTION_CLIENT_CONNECT_96688({userIds, guildId, channelId, context}) { // fn#96688, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:12793:2591, offset: 0x021637a5, size: 101 bytes, params: 2, frame: 15
|
|
const MediaEngineContextTypes = (require(4406) /* metro dependency 4406: mediaEngine */).MediaEngineContextTypes;
|
|
const DEFAULT = MediaEngineContextTypes.DEFAULT;
|
|
return context === DEFAULT && userIds.reduce(_fun96689, false);
|
|
}
|
|
|
|
function RTC_CONNECTION_CLIENT_DISCONNECT({userId, context}) { // fn#96690, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:12793:2904, offset: 0x02163871, size: 68 bytes, params: 2, frame: 14
|
|
const MediaEngineContextTypes = (require(4406) /* metro dependency 4406: mediaEngine */).MediaEngineContextTypes;
|
|
const DEFAULT = MediaEngineContextTypes.DEFAULT;
|
|
return context === DEFAULT && deleteUserDesyncData(userId);
|
|
}
|
|
|
|
function _fun96675(a0) { // fn#96675, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:12793:1154, offset: 0x021634e0, size: 115 bytes, params: 2, frame: 16
|
|
var binding;
|
|
var user;
|
|
var upsert_96672Binding;
|
|
if (VoiceStateStore.getVoiceStateForChannel(env0_0, a0) == null) {
|
|
user = UserStore.getUser(a0);
|
|
if (user != null) {
|
|
binding = env1_19;
|
|
binding.delete(a0);
|
|
upsert_96672Binding = upsert_96672;
|
|
binding = env0_1;
|
|
upsert_96672Binding(user, binding, env0_0);
|
|
}
|
|
} else {
|
|
env1_19.delete(a0);
|
|
}
|
|
}
|
|
|
|
function get_96680() { // fn#96680, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:12793:1798, offset: 0x0216367b, size: 18 bytes, params: 1, frame: 9
|
|
return env1_17.size();
|
|
}
|
|
|
|
function value_96681() { // fn#96681, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:12793:1859, offset: 0x0216368d, size: 18 bytes, params: 1, frame: 9
|
|
return env1_17.keys();
|
|
}
|
|
|
|
function value_96682() { // fn#96682, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:12793:1924, offset: 0x0216369f, size: 18 bytes, params: 1, frame: 9
|
|
return env1_17.values();
|
|
}
|
|
|
|
function value_96683() { // fn#96683, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:12793:1992, offset: 0x021636b1, size: 18 bytes, params: 1, frame: 9
|
|
return env1_18.values();
|
|
}
|
|
|
|
function _fun96687(a0, {userId, channelId}) { // fn#96687, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:12793:2491, offset: 0x0216376b, size: 58 bytes, params: 3, frame: 13
|
|
const value = a0;
|
|
let r0 = channelId === env0_0 && !!deleteUserDesyncData(userId);
|
|
r0 = !r0 ? value : r0;
|
|
return r0;
|
|
}
|
|
|
|
function _fun96689(a0, a1) { // fn#96689, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:12793:2741, offset: 0x0216380a, size: 103 bytes, params: 3, frame: 18
|
|
var r1;
|
|
const value = a0;
|
|
const getVoiceStateForChannel = VoiceStateStore.getVoiceStateForChannel;
|
|
if (Reflect.apply(getVoiceStateForChannel, VoiceStateStore, [channelId, a1]) != null) {
|
|
return value;
|
|
}
|
|
const user = UserStore.getUser(a1);
|
|
if (user == null) {
|
|
env1_19.add(a1);
|
|
r1 = value;
|
|
} else {
|
|
upsert_96672(user, guildId, channelId);
|
|
r1 = true;
|
|
}
|
|
return r1;
|
|
}
|
|
|