Initial commit
This commit is contained in:
commit
af3b49f756
16065 files changed
+2938410
No files matched your search
@@ -0,0 +1,300 @@
|
||||
/* Metro module 12552; source: modules/guild_home/ActiveChannelsStore.tsx; dependencies: [6, 7, 15, 17, 18, 1379, 3969, 1386, 21, 22, 566, 694, 2] */
|
||||
function _fun95994(global, require, importDefault, importAll, module, exports, dependencyMap) { // fn#95994, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:12742:6, offset: 0x02152fd3, size: 498 bytes, params: 8, frame: 20
|
||||
const resetStore = function() {
|
||||
env0_11 = {};
|
||||
env0_12 = {};
|
||||
env0_13 = {};
|
||||
env0_14 = {};
|
||||
};
|
||||
const closure = CHANNEL_DELETE_96002;
|
||||
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 channelStore = importDefault(1379) /* metro dependency 1379: ChannelStore */;
|
||||
const selectedGuildStore = importDefault(3969) /* metro dependency 3969: SelectedGuildStore */;
|
||||
const env0_9 = (require(1386) /* metro dependency 1386: ChannelConstants */).isGuildHomeChannel;
|
||||
let env0_11 = {};
|
||||
let env0_12 = {};
|
||||
let env0_13 = {};
|
||||
let env0_14 = {};
|
||||
const Store = (importDefault(566) /* metro dependency 566: flux */).Store;
|
||||
let value = _fun96003(Store);
|
||||
value.displayName = 'ActiveChannelsStore';
|
||||
value = new value(importDefault(694) /* metro dependency 694: Dispatcher */, {CHANNEL_SELECT: CHANNEL_SELECT_96010,
|
||||
MESSAGE_CREATE: MESSAGE_CREATE_96014, GUILD_DELETE: GUILD_DELETE_96015, CHANNEL_DELETE: closure,
|
||||
THREAD_DELETE: closure, ACTIVE_CHANNELS_FETCH_START: ACTIVE_CHANNELS_FETCH_START,
|
||||
ACTIVE_CHANNELS_FETCH_SUCCESS: ACTIVE_CHANNELS_FETCH_SUCCESS,
|
||||
ACTIVE_CHANNELS_FETCH_FAILURE: ACTIVE_CHANNELS_FETCH_FAILURE, CONNECTION_OPEN: CONNECTION_OPEN_96021});
|
||||
(require(2) /* metro dependency 2 */).fileFinishedImporting('modules/guild_home/ActiveChannelsStore.tsx');
|
||||
exports.default = value;
|
||||
exports.MAX_STORED_MESSAGES = 26;
|
||||
}
|
||||
|
||||
function _isNativeReflectConstruct_95995() { // fn#95995, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:12742:197, offset: 0x021531c5, 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_95995_isNativeReflectConstruct = function() {
|
||||
return !!result;
|
||||
})();
|
||||
}
|
||||
|
||||
function truncateOldMessageData(a0) { // fn#95999, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:12742:462, offset: 0x02153246, size: 234 bytes, params: 2, frame: 21
|
||||
var defaultImport;
|
||||
var fromTimestamp;
|
||||
var Date;
|
||||
var index;
|
||||
var Math;
|
||||
var value3;
|
||||
var binding;
|
||||
var defaultImport3;
|
||||
const property = env0_12[a0];
|
||||
if (property != null) {
|
||||
defaultImport = importDefault(21) /* metro dependency 21: SnowflakeUtils */;
|
||||
fromTimestamp = defaultImport.fromTimestamp;
|
||||
Date = global.Date;
|
||||
var env0_0 = Reflect.apply(fromTimestamp, defaultImport, [Date.now() - env0_10]);
|
||||
index = (importDefault(22) /* metro dependency 22 */).findIndex(property, _fun96000);
|
||||
if (index === -1) {
|
||||
env0_12[a0] = [];
|
||||
} else {
|
||||
Math = global.Math;
|
||||
value3 = Math.max(index, property.length - 26);
|
||||
binding = env0_12;
|
||||
defaultImport3 = importDefault(22) /* metro dependency 22 */;
|
||||
binding[a0] = defaultImport3.slice(property, value3);
|
||||
}
|
||||
binding = env0_13;
|
||||
Date = global.Date;
|
||||
binding[a0] = Date.now();
|
||||
}
|
||||
}
|
||||
|
||||
function addMessage(a0, a1, a2, a3) { // fn#96001, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:12742:754, offset: 0x0215336c, size: 151 bytes, params: 5, frame: 15
|
||||
let property = env0_11[a0];
|
||||
property.add(a1);
|
||||
property = env0_13[a1];
|
||||
if (property == null || property + 300000 > global.Date.now()) {
|
||||
truncateOldMessageData(a1);
|
||||
}
|
||||
if (env0_12[a1] == null) {
|
||||
env0_12[a1] = [];
|
||||
}
|
||||
env0_12[a1].push({id: a2, userId: a3});
|
||||
}
|
||||
|
||||
function CHANNEL_DELETE_96002({channel}) { // fn#96002, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:12742:910, offset: 0x02153403, size: 41 bytes, params: 2, frame: 4
|
||||
delete env0_12[channel.id];
|
||||
delete env0_13[channel.id];
|
||||
}
|
||||
|
||||
function _fun96003(a0) { // fn#96003, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:12742:988, offset: 0x0215342c, size: 176 bytes, params: 2, frame: 16
|
||||
const closure = ActiveChannelsStore;
|
||||
env0_6(closure, a0);
|
||||
return env0_3(closure, [{key: 'initialize', value: function() {
|
||||
this.waitFor(ChannelStore, SelectedGuildStore);
|
||||
}}, {key: 'getActiveChannelsFetchStatus', value: value_96006}, {key: 'getActiveChannelIds', value: value_96007},
|
||||
{key: 'getChannelMessageData', value: value_96008}, {key: 'shouldFetch', value: value_96009}]);
|
||||
}
|
||||
|
||||
function CHANNEL_SELECT_96010({channelId, guildId}) { // fn#96010, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:12742:1717, offset: 0x0215350d, size: 213 bytes, params: 2, frame: 18
|
||||
var property;
|
||||
var defaultImport;
|
||||
var chain;
|
||||
var Array;
|
||||
var value6;
|
||||
if (isGuildHomeChannel(channelId)) {
|
||||
if (guildId == null) {
|
||||
return false;
|
||||
}
|
||||
property = env0_11[guildId];
|
||||
if (property == null) {
|
||||
return false;
|
||||
}
|
||||
property.forEach(_fun96011);
|
||||
defaultImport = importDefault(22) /* metro dependency 22 */;
|
||||
chain = defaultImport.chain;
|
||||
Array = global.Array;
|
||||
value6 = Reflect.apply(chain, defaultImport,
|
||||
[Array.from(property)]).filter(_fun96012).sortBy(_fun96013).value();
|
||||
env0_11[guildId] = new global.Set();
|
||||
return undefined;
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
function MESSAGE_CREATE_96014({channelId, message, optimistic, isPushNotification}) { // fn#96014, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:12742:2103, offset: 0x0215365a, size: 143 bytes, params: 2, frame: 21
|
||||
var r1;
|
||||
var r0;
|
||||
var value4;
|
||||
var addMessageBinding;
|
||||
var id2;
|
||||
var author;
|
||||
if (optimistic) {
|
||||
return false;
|
||||
}
|
||||
if (isPushNotification) {
|
||||
return false;
|
||||
}
|
||||
var value;
|
||||
const channel = ChannelStore.getChannel(channelId);
|
||||
if (channel == null) {
|
||||
return false;
|
||||
}
|
||||
const guild_id = channel.guild_id;
|
||||
const value3 = guild_id != null;
|
||||
if (value3) {
|
||||
value4 = env0_11[guild_id] != null;
|
||||
if (value4) {
|
||||
addMessageBinding = addMessage;
|
||||
id2 = message.id;
|
||||
author = message.author;
|
||||
value = undefined;
|
||||
addMessageBinding(guild_id, channelId, id2, author == null ? value : author.id);
|
||||
r1 = value;
|
||||
} else {
|
||||
r1 = value4;
|
||||
}
|
||||
r0 = r1;
|
||||
} else {
|
||||
r0 = value3;
|
||||
}
|
||||
return r0;
|
||||
}
|
||||
|
||||
function ACTIVE_CHANNELS_FETCH_START({guildId}) { // fn#96016, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:12742:2525, offset: 0x021536e9, size: 59 bytes, params: 2, frame: 12
|
||||
const binding = env0_14;
|
||||
const object2 = {'loading': true, 'error': null};
|
||||
const Date = global.Date;
|
||||
object2.fetchedAt = Date.now();
|
||||
binding[guildId] = object2;
|
||||
}
|
||||
|
||||
function ACTIVE_CHANNELS_FETCH_SUCCESS({guildId, channels}) { // fn#96017, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:12742:2659, offset: 0x02153724, size: 122 bytes, params: 2, frame: 17
|
||||
let binding = env0_14;
|
||||
const object2 = {'loading': false, 'error': null};
|
||||
const Date = global.Date;
|
||||
object2.fetchedAt = Date.now();
|
||||
binding[guildId] = object2;
|
||||
binding = env0_11;
|
||||
const Set = global.Set;
|
||||
binding[guildId] = new Set();
|
||||
channels.forEach(function({channel_id, messages}) {
|
||||
messages.forEach(_fun96019);
|
||||
});
|
||||
}
|
||||
|
||||
function ACTIVE_CHANNELS_FETCH_FAILURE({guildId, error}) { // fn#96020, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:12742:2920, offset: 0x021537f5, size: 48 bytes, params: 2, frame: 4
|
||||
env0_14[guildId] = {'loading': false, 'error': null, 'fetchedAt': null, error: error};
|
||||
}
|
||||
|
||||
function CONNECTION_OPEN_96021() { // fn#96021, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:12742:3041, offset: 0x02153825, size: 210 bytes, params: 1, frame: 19
|
||||
var resetStoreBinding;
|
||||
var property;
|
||||
var property2;
|
||||
var Array;
|
||||
var object2;
|
||||
var value3;
|
||||
var value4;
|
||||
var value5;
|
||||
const guildId = SelectedGuildStore.getGuildId();
|
||||
if (guildId != null) {
|
||||
property = env0_14[guildId];
|
||||
property2 = env0_11[guildId];
|
||||
Array = global.Array;
|
||||
value3 = Array.from(property2 ?? []);
|
||||
value4 = value3.reduce(_fun96022, {});
|
||||
resetStoreBinding = resetStore;
|
||||
value5 = undefined;
|
||||
resetStoreBinding();
|
||||
if (global.Date.now() - ((property == null ? value5 : property.fetchedAt) ?? 0) < env0_10) {
|
||||
object2 = {};
|
||||
object2[guildId] = property;
|
||||
object2 = {};
|
||||
object2[guildId] = property2;
|
||||
copyDataProperties({}, value4, value3);
|
||||
}
|
||||
} else {
|
||||
resetStore();
|
||||
}
|
||||
}
|
||||
|
||||
function _fun96000({id}) { // fn#96000, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:12742:629, offset: 0x02153330, size: 60 bytes, params: 2, frame: 13
|
||||
let value = environment.__proto__;
|
||||
value = importDefault(21) /* metro dependency 21: SnowflakeUtils */;
|
||||
value = value.compare(id, env0_0);
|
||||
return value > 0;
|
||||
}
|
||||
|
||||
function value_96009(a0) { // fn#96009, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:12742:1557, offset: 0x021534dc, size: 49 bytes, params: 2, frame: 5
|
||||
var r0;
|
||||
var property;
|
||||
let value = environment.__proto__;
|
||||
const value2 = env1_11[a0] == null;
|
||||
if (value2) {
|
||||
property = env1_14[a0];
|
||||
value = property != null;
|
||||
value = !(value && property.loading);
|
||||
r0 = value;
|
||||
} else {
|
||||
r0 = value2;
|
||||
}
|
||||
return r0;
|
||||
}
|
||||
|
||||
function _fun96011(a0) { // fn#96011, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:12742:1842, offset: 0x021535e2, size: 57 bytes, params: 2, frame: 14
|
||||
const truncateOldMessageDataBinding = truncateOldMessageData;
|
||||
const value2 = undefined;
|
||||
truncateOldMessageDataBinding(a0);
|
||||
const property = env1_12[a0];
|
||||
if ((property == null ? value2 : property.length) === 0) {
|
||||
delete env1_12[a0];
|
||||
}
|
||||
return value2;
|
||||
}
|
||||
|
||||
function _fun96012(a0) { // fn#96012, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:12742:1974, offset: 0x0215361b, size: 16 bytes, params: 2, frame: 2
|
||||
return a0 in env1_12;
|
||||
}
|
||||
|
||||
function _fun96013(a0) { // fn#96013, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:12742:1994, offset: 0x0215362b, size: 47 bytes, params: 2, frame: 4
|
||||
const value = environment.__proto__;
|
||||
return -(env1_12[a0]?.length ?? 0);
|
||||
}
|
||||
|
||||
function _fun96018({channel_id, messages}) { // fn#96018, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:12742:2799, offset: 0x0215379e, size: 41 bytes, params: 2, frame: 11
|
||||
messages.forEach(function(a0) {
|
||||
addMessage(guildId, channel_id, a0.message_id, a0.user_id);
|
||||
});
|
||||
}
|
||||
|
||||
function _fun96022(a0, a1) { // fn#96022, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:12742:3161, offset: 0x021538f7, size: 33 bytes, params: 3, frame: 4
|
||||
a0[a1] = env1_12[a1] ?? [];
|
||||
return a0;
|
||||
}
|
||||
|
||||
Reference in new issue
Block a user