641 lines
27 KiB
TypeScript
641 lines
27 KiB
TypeScript
/* Metro module 1934; source: stores/SelectedChannelStore.tsx; dependencies: [6, 7, 15, 17, 18, 1383, 1226, 1379, 1935, 1867, 4259, 3784, 3969, 661, 1386, 587, 22, 1360, 483, 566, 694, 2] */
|
|
function _fun21362(global, require, importDefault, importAll, module, exports, dependencyMap) { // fn#21362, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:2061:6, offset: 0x00eeeb1b, size: 752 bytes, params: 8, frame: 21
|
|
const env0_0 = require;
|
|
const _arrayLikeToArray_21368 = 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 stringifyGuildId = function(a0) {
|
|
return (0, global.String)(a0);
|
|
};
|
|
const closure = function(a0) {
|
|
a0.type;
|
|
var channel = a0.channel;
|
|
navigateAwayFromChannel(channel.id, channel.guild_id, channel.parent_id);
|
|
};
|
|
const Object = global.Object;
|
|
Object.defineProperty(exports, '__esModule', {value: true});
|
|
const env0_4 = importDefault(6) /* metro dependency 6 */;
|
|
const env0_5 = importDefault(7) /* metro dependency 7 */;
|
|
const env0_6 = importDefault(15) /* metro dependency 15 */;
|
|
const env0_7 = importDefault(17) /* metro dependency 17 */;
|
|
const env0_8 = importDefault(18) /* metro dependency 18 */;
|
|
let value = require(1383) /* metro dependency 1383: ChannelRecord */;
|
|
const env0_9 = value.isGuildTextChannelType;
|
|
const env0_10 = value.THREAD_CHANNEL_TYPES;
|
|
const authenticationStore = importDefault(1226) /* metro dependency 1226: AuthenticationStore */;
|
|
const channelStore = importDefault(1379) /* metro dependency 1379: ChannelStore */;
|
|
const guildChannelStore = importDefault(1935) /* metro dependency 1935: GuildChannelStore */;
|
|
const guildStore = importDefault(1867) /* metro dependency 1867: GuildStore */;
|
|
const mediaEngineStore = importDefault(4259) /* metro dependency 4259: MediaEngineStore */;
|
|
const permissionStore = importDefault(3784) /* metro dependency 3784: PermissionStore */;
|
|
const selectedGuildStore = importDefault(3969) /* metro dependency 3969: SelectedGuildStore */;
|
|
value = require(661) /* metro dependency 661: Constants */;
|
|
const env0_18 = value.ChannelTypes;
|
|
const env0_19 = value.ME;
|
|
const env0_20 = value.Permissions;
|
|
value.Routes;
|
|
const env0_21 = (require(1386) /* metro dependency 1386: ChannelConstants */).isGuildHomeChannel;
|
|
const env0_30 = {};
|
|
const env0_31 = {};
|
|
const env0_32 = {};
|
|
const Set = global.Set;
|
|
let set = new Set();
|
|
const Store = (importDefault(566) /* metro dependency 566: flux */).Store;
|
|
_fun21380(Store).displayName = 'SelectedChannelStore';
|
|
set = new set(importDefault(694) /* metro dependency 694: Dispatcher */, {CONNECTION_OPEN: CONNECTION_OPEN_21391,
|
|
OVERLAY_INITIALIZE: OVERLAY_INITIALIZE_21392, CONNECTION_CLOSED: function() {
|
|
env0_22 = null;
|
|
}, CHANNEL_SELECT: CHANNEL_SELECT_21394, CHANNEL_CREATE: CHANNEL_CREATE_21395, CHANNEL_DELETE: closure,
|
|
CHANNEL_UPDATES: function({channels}) {
|
|
var r2;
|
|
var navigateAwayFromChannelBinding;
|
|
var id;
|
|
var guild_id;
|
|
var value4;
|
|
var value2 = _createForOfIteratorHelperLoose_21366(channels);
|
|
var value3 = value2();
|
|
if (!value3.done) {
|
|
r2 = value3;
|
|
while (true) {
|
|
channels = r2.value;
|
|
if (channels.isScheduledForDeletion()) {
|
|
THREAD_CHANNEL_TYPES.has(channels.type);
|
|
navigateAwayFromChannelBinding = navigateAwayFromChannel;
|
|
id = channels.id;
|
|
guild_id = channels.guild_id;
|
|
navigateAwayFromChannelBinding(id, guild_id, channels.parent_id);
|
|
}
|
|
value4 = value2();
|
|
if (value4.done) {
|
|
break;
|
|
}
|
|
r2 = value4;
|
|
continue;
|
|
}
|
|
}
|
|
}, THREAD_DELETE: closure, GUILD_CREATE: GUILD_CREATE_21397, GUILD_DELETE: GUILD_DELETE_21398,
|
|
VOICE_CHANNEL_SELECT: VOICE_CHANNEL_SELECT, VOICE_STATE_UPDATES: function({voiceStates}) {
|
|
return voiceStates.reduce(_fun21401, false);
|
|
}, CHANNEL_FOLLOWER_CREATED: CHANNEL_FOLLOWER_CREATED, LOGOUT: LOGOUT_21404});
|
|
(require(2) /* metro dependency 2 */).fileFinishedImporting('stores/SelectedChannelStore.tsx');
|
|
exports.default = set;
|
|
exports.findFirstVoiceChannelId = findFirstVoiceChannelId;
|
|
}
|
|
|
|
function _isNativeReflectConstruct_21363() { // fn#21363, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:2061:380, offset: 0x00eeee0b, size: 94 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_21363_isNativeReflectConstruct = function() {
|
|
return !!result;
|
|
})();
|
|
}
|
|
|
|
function _createForOfIteratorHelperLoose_21366(a0, a1) { // fn#21366, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:2061:573, offset: 0x00eeee69, size: 370 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 _fun21367;
|
|
}
|
|
value = undefined;
|
|
if (a0) {
|
|
if (typeof a0 === 'string') {
|
|
value = _arrayLikeToArray_21368(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_21368(a0, value);
|
|
r6 = value;
|
|
} else {
|
|
regexp = RegExp('^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$', '');
|
|
if (regexp.test(r9)) {
|
|
value = _arrayLikeToArray_21368(a0, value);
|
|
r6 = value;
|
|
} else {
|
|
r6 = value;
|
|
}
|
|
}
|
|
r5 = r6;
|
|
}
|
|
} else {
|
|
r5 = value;
|
|
}
|
|
if (r5) {
|
|
if (r5) {
|
|
}
|
|
return _fun21367;
|
|
}
|
|
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 saveStorage() { // fn#21370, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:2061:1597, offset: 0x00eeefdb, size: 240 bytes, params: 1, frame: 21
|
|
var value;
|
|
const Storage = (require(587) /* metro dependency 587: Storage */).Storage;
|
|
const set = Storage.set;
|
|
const binding = env0_29;
|
|
const object2 = {selectedChannelId: env0_24, selectedVoiceChannelId: env0_26,
|
|
lastChannelFollowingDestination: env0_25, lastConnectedTime: env0_27, selectedChannelIds: env0_30,
|
|
mostRecentSelectedTextChannelIds: env0_32};
|
|
const value2 = (importDefault(22) /* metro dependency 22 */)(env0_30);
|
|
const value3 = value2.values();
|
|
const concat = value3.concat;
|
|
const defaultImport2 = importDefault(22) /* metro dependency 22 */;
|
|
value = Reflect.apply(Reflect.apply(concat, value3, [defaultImport2.values(env0_32)]).filter, value,
|
|
[(require(1360) /* metro dependency 1360: GlobalUtils */).isNotNullish]);
|
|
value = value.uniq();
|
|
value = value.filter(_fun21371);
|
|
object2.knownThreadIds = value.value();
|
|
Reflect.apply(set, Storage, [binding, object2]);
|
|
}
|
|
|
|
function findDefaultChannelId(a0) { // fn#21372, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:2061:1993, offset: 0x00eef112, size: 42 bytes, params: 2, frame: 12
|
|
if (a0 != null) {
|
|
var defaultChannel;
|
|
defaultChannel = GuildChannelStore.getDefaultChannel(a0);
|
|
if (defaultChannel != null) {
|
|
return defaultChannel.id;
|
|
}
|
|
}
|
|
}
|
|
|
|
function setMostRecentTextChannel(a0, a1) { // fn#21373, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:2061:2091, offset: 0x00eef13c, size: 126 bytes, params: 3, frame: 17
|
|
var r0;
|
|
if (a0 == null) {
|
|
return false;
|
|
}
|
|
if (a1 == null) {
|
|
return false;
|
|
}
|
|
if (env0_32[a0] === a1) {
|
|
return false;
|
|
}
|
|
const channel = ChannelStore.getChannel(a1);
|
|
let r4 = channel != null && isGuildTextChannelType(channel.type);
|
|
r4 = r4 ? !(channel?.getGuildId() === a0) : !r4;
|
|
if (r4) {
|
|
r0 = !r4;
|
|
} else {
|
|
env0_32[a0] = a1;
|
|
r0 = true;
|
|
}
|
|
return r0;
|
|
}
|
|
|
|
function cleanupPreviouslySelected() { // fn#21374, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:2061:2290, offset: 0x00eef1ba, size: 180 bytes, params: 1, frame: 20
|
|
let env0_0 = false;
|
|
const guildsArray = GuildStore.getGuildsArray();
|
|
const defaultImport = importDefault(22) /* metro dependency 22 */;
|
|
defaultImport.each(env0_30, _fun21375);
|
|
const defaultImport2 = defaultImport;
|
|
defaultImport2.each(env0_32, _fun21376);
|
|
guildsArray.forEach(_fun21377);
|
|
env0_0 = env0_27 != null && global.Date.now() - env0_27 >= 300000 || env0_0;
|
|
return env0_0;
|
|
}
|
|
|
|
function navigateAwayFromChannel(a0, a1) { // fn#21378, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:2061:2683, offset: 0x00eef36a, size: 123 bytes, params: 3, frame: 17
|
|
var r5;
|
|
var guildId;
|
|
const value = a1;
|
|
env0_33.delete(a0);
|
|
if (value != null) {
|
|
r5 = value;
|
|
} else {
|
|
guildId = SelectedGuildStore.getGuildId();
|
|
r5 = env0_30[stringifyGuildId(guildId)] !== a0 ? value : guildId;
|
|
}
|
|
GuildStore.getGuild(r5);
|
|
if (!(env0_26 !== a0) && true) {
|
|
saveStorage();
|
|
}
|
|
}
|
|
|
|
function _fun21380(a0) { // fn#21380, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:2061:2974, offset: 0x00eef414, size: 235 bytes, params: 2, frame: 16
|
|
const closure = SelectedChannelStore;
|
|
env0_8(closure, a0);
|
|
return env0_5(closure, [{key: 'initialize', value: value_21382}, {key: 'getChannelId', value: value_21384},
|
|
{key: 'getVoiceChannelId', value: value_21385}, {key: 'getMostRecentSelectedTextChannelId', value: value_21386},
|
|
{key: 'getCurrentlySelectedChannelId', value: value_21387}, {key: 'getLastSelectedChannelId',
|
|
value: value_21388}, {key: 'getLastSelectedChannels', value: value_21389},
|
|
{key: 'getLastChannelFollowingDestination', value: value_21390}]);
|
|
}
|
|
|
|
function CONNECTION_OPEN_21391({sessionId}) { // fn#21391, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:2061:4624, offset: 0x00eef7b2, size: 147 bytes, params: 2, frame: 19
|
|
var r2;
|
|
var channel;
|
|
var value3;
|
|
var can;
|
|
var moduleValue;
|
|
if (env0_26 != null) {
|
|
channel = ChannelStore.getChannel(env0_26);
|
|
value3 = channel != null;
|
|
if (value3) {
|
|
can = PermissionStore.can;
|
|
moduleValue = importAll(483) /* metro dependency 483: BigFlagUtils */;
|
|
r2 = Reflect.apply(can, PermissionStore, [moduleValue.combine(Permissions.VIEW_CHANNEL,
|
|
Permissions.CONNECT),
|
|
channel]);
|
|
} else {
|
|
r2 = value3;
|
|
}
|
|
if (r2) {
|
|
}
|
|
}
|
|
if (cleanupPreviouslySelected()) {
|
|
saveStorage();
|
|
}
|
|
}
|
|
|
|
function OVERLAY_INITIALIZE_21392(a0) { // fn#21392, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:2061:4840, offset: 0x00eef845, size: 100 bytes, params: 2, frame: 14
|
|
const sessionId = a0.sessionId;
|
|
env0_26 = a0.selectedVoiceChannelId;
|
|
env0_30 = {};
|
|
env0_31 = {};
|
|
const selectedChannelId = a0.selectedChannelId;
|
|
env0_30[a0.selectedGuildId] = a0.selectedChannelId;
|
|
setMostRecentTextChannel(a0.selectedGuildId, selectedChannelId);
|
|
cleanupPreviouslySelected();
|
|
}
|
|
|
|
function CHANNEL_SELECT_21394({guildId, channelId}) { // fn#21394, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:2061:5140, offset: 0x00eef8b6, size: 169 bytes, params: 2, frame: 17
|
|
if (guildId === undefined) {
|
|
return false;
|
|
}
|
|
const r4 = channelId ?? findDefaultChannelId(guildId);
|
|
if (env0_24 != null && r4 !== env0_24) {
|
|
}
|
|
env0_24 = r4;
|
|
setMostRecentTextChannel(guildId, r4);
|
|
let binding = env0_30;
|
|
let stringifyGuildIdBinding = stringifyGuildId;
|
|
if (binding[stringifyGuildIdBinding(guildId)] !== r4) {
|
|
binding = env0_31;
|
|
stringifyGuildIdBinding = stringifyGuildId;
|
|
binding[stringifyGuildIdBinding(guildId)] = env0_30[stringifyGuildIdBinding(guildId)];
|
|
binding = env0_30;
|
|
binding[stringifyGuildIdBinding(guildId)] = env0_24;
|
|
}
|
|
saveStorage();
|
|
}
|
|
|
|
function CHANNEL_CREATE_21395({channel}) { // fn#21395, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:2061:5441, offset: 0x00eef95f, size: 129 bytes, params: 2, frame: 14
|
|
var guild_id;
|
|
const type = channel.type;
|
|
const GUILD_ANNOUNCEMENT = ChannelTypes.GUILD_ANNOUNCEMENT;
|
|
if (GUILD_ANNOUNCEMENT === type) {
|
|
guild_id = channel.guild_id;
|
|
if (guild_id != null && env0_32[guild_id] == null) {
|
|
env0_32[guild_id] = channel.id;
|
|
}
|
|
if (guild_id == null) {
|
|
return false;
|
|
}
|
|
if (env0_30[guild_id] == null) {
|
|
env0_30[guild_id] = findDefaultChannelId(guild_id);
|
|
return true;
|
|
}
|
|
} else {
|
|
var GUILD_TEXT = ChannelTypes.GUILD_TEXT;
|
|
if (GUILD_TEXT !== type) {
|
|
return false;
|
|
}
|
|
guild_id = channel.guild_id;
|
|
if (guild_id != null && env0_32[guild_id] == null) {
|
|
env0_32[guild_id] = channel.id;
|
|
}
|
|
if (guild_id == null) {
|
|
return false;
|
|
}
|
|
if (env0_30[guild_id] == null) {
|
|
env0_30[guild_id] = findDefaultChannelId(guild_id);
|
|
return true;
|
|
}
|
|
}
|
|
return false;
|
|
}
|
|
|
|
function GUILD_CREATE_21397({guild}) { // fn#21397, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:2061:5984, offset: 0x00eefa54, size: 86 bytes, params: 2, frame: 15
|
|
var findDefaultChannelIdBinding;
|
|
var defaultChannelId;
|
|
var setMostRecentTextChannelBinding;
|
|
let binding = env0_30;
|
|
let id = guild.id;
|
|
if (binding[id] == null) {
|
|
findDefaultChannelIdBinding = findDefaultChannelId;
|
|
id = guild.id;
|
|
defaultChannelId = findDefaultChannelIdBinding(id);
|
|
binding = env0_30;
|
|
id = guild.id;
|
|
binding[id] = defaultChannelId;
|
|
setMostRecentTextChannelBinding = setMostRecentTextChannel;
|
|
id = guild.id;
|
|
setMostRecentTextChannelBinding(id, defaultChannelId);
|
|
saveStorage();
|
|
}
|
|
}
|
|
|
|
function GUILD_DELETE_21398({guild}) { // fn#21398, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:2061:6145, offset: 0x00eefaaa, size: 79 bytes, params: 2, frame: 12
|
|
const id = guild.id;
|
|
const unavailable = guild.unavailable;
|
|
if (env0_26 !== env0_30[id]) {
|
|
}
|
|
if (unavailable) {
|
|
return false;
|
|
}
|
|
delete env0_32[id];
|
|
delete env0_30[id];
|
|
saveStorage();
|
|
}
|
|
|
|
function VOICE_CHANNEL_SELECT({channelId}) { // fn#21399, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:2061:6295, offset: 0x00eefaf9, size: 134 bytes, params: 2, frame: 15
|
|
var guild_id;
|
|
var r2;
|
|
if (channelId == null) {
|
|
guild_id = ChannelStore.getChannel(env0_26)?.guild_id;
|
|
r2 = guild_id != null && guild_id !== SelectedGuildStore.getGuildId();
|
|
r2 = r2 && env0_30[guild_id] === env0_26;
|
|
if (r2) {
|
|
env0_30[guild_id] = findDefaultChannelId(guild_id);
|
|
}
|
|
}
|
|
saveStorage();
|
|
}
|
|
|
|
function VOICE_STATE_UPDATES({voiceStates}) { // fn#21400, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:2061:6515, offset: 0x00eefb7f, size: 32 bytes, params: 2, frame: 13
|
|
return voiceStates.reduce(_fun21401, false);
|
|
}
|
|
|
|
function CHANNEL_FOLLOWER_CREATED({channelId, guildId}) { // fn#21403, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:2061:7118, offset: 0x00eefd31, size: 73 bytes, params: 2, frame: 12
|
|
var object;
|
|
if (!(env0_25 != null && channelId === env0_25.channelId)) {
|
|
object = {channelId: channelId, guildId: guildId};
|
|
saveStorage();
|
|
}
|
|
}
|
|
|
|
function LOGOUT_21404() { // fn#21404, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:2061:7276, offset: 0x00eefd7a, size: 80 bytes, params: 1, frame: 13
|
|
env0_30 = {};
|
|
env0_32 = {};
|
|
env0_25 = {};
|
|
const Storage = (require(587) /* metro dependency 587: Storage */).Storage;
|
|
Storage.remove(env0_29);
|
|
}
|
|
|
|
function findFirstVoiceChannelId(a0) { // fn#21405, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:2061:7476, offset: 0x00eefdca, size: 78 bytes, params: 2, frame: 14
|
|
const mutableBasicGuildChannelsForGuild = ChannelStore.getMutableBasicGuildChannelsForGuild(a0);
|
|
const value = undefined;
|
|
const value3 = (importDefault(22) /* metro dependency 22 */).find(mutableBasicGuildChannelsForGuild,
|
|
function({type}) {
|
|
return type === ChannelTypes.GUILD_VOICE;
|
|
});
|
|
return value3 == null ? value : value3.id;
|
|
}
|
|
|
|
function _fun21371(a0) { // fn#21371, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:2061:1909, offset: 0x00eef0cb, size: 71 bytes, params: 2, frame: 13
|
|
const value = environment.__proto__;
|
|
const basicChannel = ChannelStore.getBasicChannel(a0);
|
|
return env1_33.has(a0) || basicChannel != null && THREAD_CHANNEL_TYPES.has(basicChannel.type);
|
|
}
|
|
|
|
function _fun21375(a0, a1) { // fn#21375, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:2061:2381, offset: 0x00eef26e, size: 113 bytes, params: 3, frame: 15
|
|
var r2;
|
|
var r0;
|
|
let value = a0 != null;
|
|
if (value) {
|
|
value = environment.__proto__;
|
|
r2 = ChannelStore.hasChannel(a0) || a0 === env1_24;
|
|
r2 = !r2 ? env1_33.has(a0) : r2;
|
|
r2 = !r2 ? isGuildHomeChannel(a0) : r2;
|
|
r0 = r2;
|
|
} else {
|
|
r0 = value;
|
|
}
|
|
if (!r0) {
|
|
value = environment.__proto__;
|
|
delete env1_30[a1];
|
|
delete env1_31[a1];
|
|
}
|
|
}
|
|
|
|
function _fun21376(a0, a1) { // fn#21376, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:2061:2491, offset: 0x00eef2df, size: 80 bytes, params: 3, frame: 13
|
|
if (!(a0 != null && (ChannelStore.hasChannel(a0) || env1_33.has(a0)))) {
|
|
value = environment.__proto__;
|
|
delete env1_32[a1];
|
|
}
|
|
}
|
|
|
|
function _fun21377(a0) { // fn#21377, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:2061:2570, offset: 0x00eef32f, size: 59 bytes, params: 2, frame: 14
|
|
if (env1_32[a0.id] == null) {
|
|
setMostRecentTextChannel(a0.id, env1_30[a0.id]);
|
|
}
|
|
}
|
|
|
|
function SelectedChannelStore() { // fn#21381, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:2061:2986, offset: 0x00eef4ff, size: 113 bytes, params: 1, frame: 20
|
|
const value = environment.__proto__;
|
|
env1_4(this, SelectedChannelStore);
|
|
const value3 = env1_7(SelectedChannelStore);
|
|
return env1_6(this, _isNativeReflectConstruct_21363() ? global.Reflect.construct(value3, arguments,
|
|
env1_7(this).constructor) : value3.apply(this, arguments));
|
|
}
|
|
|
|
function value_21382() { // fn#21382, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:2061:3304, offset: 0x00eef570, size: 288 bytes, params: 1, frame: 24
|
|
var set;
|
|
const Storage = (require(587) /* metro dependency 587: Storage */).Storage;
|
|
const r2 = Storage.get(env1_29) ?? ({selectedChannelId: env1_24, selectedVoiceChannelId: env1_26,
|
|
lastChannelFollowingDestination: env1_25, lastConnectedTime: env1_27, selectedChannelIds: env1_30,
|
|
mostRecentSelectedTextChannelIds: env1_32});
|
|
if (r2.knownThreadIds != null) {
|
|
set = new global.Set(r2.knownThreadIds);
|
|
}
|
|
env1_26 = r2.selectedVoiceChannelId;
|
|
env1_25 = r2.lastChannelFollowingDestination;
|
|
env1_27 = r2.lastConnectedTime;
|
|
env1_32 = r2.mostRecentSelectedTextChannelIds ?? ({});
|
|
let selectedChannelIds = r2.selectedChannelIds;
|
|
if (selectedChannelIds != null) {
|
|
selectedChannelIds = r2.selectedChannelIds;
|
|
}
|
|
this.mustEmitChanges(function(a0) {
|
|
return a0.type !== 'CONNECTION_OPEN' && a0.type !== 'VOICE_STATE_UPDATES';
|
|
});
|
|
this.waitFor(AuthenticationStore, ChannelStore, GuildChannelStore, GuildStore, MediaEngineStore, PermissionStore,
|
|
SelectedGuildStore);
|
|
}
|
|
|
|
function value_21384(a0) { // fn#21384, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:2061:3905, offset: 0x00eef6b2, size: 108 bytes, params: 2, frame: 17
|
|
var r7;
|
|
var r1;
|
|
let value = a0;
|
|
const value2 = a1;
|
|
let r0 = !(value2 !== undefined) || value2;
|
|
const stringifyGuildIdBinding = stringifyGuildId;
|
|
const value5 = null;
|
|
if (value === ME) {
|
|
r1 = value5;
|
|
} else {
|
|
r7 = value5 != value ? value : SelectedGuildStore.getGuildId();
|
|
r1 = value5 != r7 ? r7 : value5;
|
|
}
|
|
const property = env1_30[stringifyGuildIdBinding(r1)];
|
|
if (r0) {
|
|
if (value5 != property) {
|
|
r1 = property;
|
|
} else {
|
|
value = findDefaultChannelId(value);
|
|
r1 = value;
|
|
}
|
|
r0 = r1;
|
|
} else {
|
|
r0 = property;
|
|
}
|
|
return r0;
|
|
}
|
|
|
|
function value_21385() { // fn#21385, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:2061:4091, offset: 0x00eef71e, size: 28 bytes, params: 1, frame: 10
|
|
return MediaEngineStore.isSupported() ? env1_26 : null;
|
|
}
|
|
|
|
function value_21386(a0) { // fn#21386, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:2061:4182, offset: 0x00eef73a, size: 42 bytes, params: 2, frame: 4
|
|
const value = null;
|
|
return value == a0 ? value : value != env1_32[a0] ? env1_32[a0] : value;
|
|
}
|
|
|
|
function value_21387(a0) { // fn#21387, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:2061:4287, offset: 0x00eef764, size: 31 bytes, params: 2, frame: 3
|
|
return a0 != null ? env1_30[a0] : env1_24;
|
|
}
|
|
|
|
function value_21388(a0) { // fn#21388, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:2061:4361, offset: 0x00eef783, size: 31 bytes, params: 2, frame: 3
|
|
return a0 != null ? env1_31[a0] : env1_23;
|
|
}
|
|
|
|
function value_21389(a0) { // fn#21389, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:2061:4434, offset: 0x00eef7a2, size: 16 bytes, params: 2, frame: 2
|
|
return env1_31[a0];
|
|
}
|
|
|
|
function _fun21401(a0, a1) { // fn#21401, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:2061:6582, offset: 0x00eefb9f, size: 366 bytes, params: 3, frame: 17
|
|
var r6;
|
|
var r4;
|
|
var clearInterval;
|
|
var value10;
|
|
var channel;
|
|
if (a1.sessionId === env1_22) {
|
|
clearInterval = global.clearInterval;
|
|
value10 = undefined;
|
|
clearInterval(env1_28);
|
|
channel = ChannelStore.getChannel(env1_26);
|
|
env1_26 = !(a1.guildId !== (channel == null ? value10 : channel.getGuildId()) && a1.channelId == null) ? a1.channelId : env1_26;
|
|
env1_27 = global.Date.now();
|
|
if (env1_26 != null) {
|
|
env1_28 = global.setInterval(function() {
|
|
var Date = global.Date;
|
|
env2_27 = Date.now();
|
|
saveStorage();
|
|
}, 60000);
|
|
}
|
|
saveStorage();
|
|
} else {
|
|
var userId = a1.userId;
|
|
var getId = AuthenticationStore.getId;
|
|
if (userId !== Reflect.apply(getId, AuthenticationStore, [])) {
|
|
return a0;
|
|
}
|
|
clearInterval = global.clearInterval;
|
|
var value2 = undefined;
|
|
clearInterval(env1_28);
|
|
var channel2 = ChannelStore.getChannel(env1_26);
|
|
r6 = channel2 == null ? value2 : channel2.getGuildId();
|
|
var value5 = ChannelStore.getChannel(a1.channelId);
|
|
r4 = r6 != null && (value5 == null ? value2 : value5.getGuildId()) === r6;
|
|
r4 = !r4 ? env1_26 === a1.channelId : r4;
|
|
if (r4) {
|
|
}
|
|
saveStorage();
|
|
}
|
|
return true;
|
|
}
|
|
|