Initial commit
This commit is contained in:
commit
af3b49f756
16065 files changed
+2938410
No files matched your search
@@ -0,0 +1,805 @@
|
||||
/* Metro module 9597; source: modules/messages/MessageManager.tsx; dependencies: [6, 7, 15, 17, 18, 4257, 1383, 4791, 1379, 1867, 4605, 1934, 3969, 661, 1386, 672, 3, 4816, 9598, 4044, 8876, 7067, 9599, 587, 3974, 1230, 4793, 4647, 1244, 694, 4860, 2] */
|
||||
function _fun75202(global, require, importDefault, importAll, module, exports, dependencyMap) { // fn#75202, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:9783:6, offset: 0x01da5e5a, size: 734 bytes, params: 8, frame: 20
|
||||
const env0_0 = require;
|
||||
const handleChannelSelect_75209 = function(a0) {
|
||||
var guildId = a0.guildId;
|
||||
var channelId = a0.channelId;
|
||||
var messageId = a0.messageId;
|
||||
var jumpType = a0.jumpType;
|
||||
if (a0.skipMessageFetch) {
|
||||
return false;
|
||||
}
|
||||
fetchMessages_75206({guildId: guildId, channelId: channelId, messageId: messageId, jumpType: jumpType});
|
||||
maybeLoadChannelSplitView(guildId, channelId);
|
||||
};
|
||||
const handleVoiceChannelSelect = function({guildId, channelId}) {
|
||||
fetchMessages_75206({guildId: guildId, channelId: channelId});
|
||||
};
|
||||
const handleJumpToVoiceChannelMessage = function({guildId, channelId, messageId, jumpType}) {
|
||||
fetchMessages_75206({guildId: guildId, channelId: channelId, messageId: messageId, jumpType: jumpType});
|
||||
};
|
||||
const maybeLoadChannelSplitView = function(a0, a1) {
|
||||
var fetchMessages_75206Binding;
|
||||
var object;
|
||||
var value2 = ChannelSectionStore.getCurrentSidebarChannelId(a1);
|
||||
if (value2 != null) {
|
||||
fetchMessages_75206Binding = fetchMessages_75206;
|
||||
object = {guildId: a0, channelId: value2};
|
||||
object.messageId = ChannelSectionStore.getCurrentSidebarMessageId(a1);
|
||||
fetchMessages_75206Binding(object);
|
||||
}
|
||||
};
|
||||
const handleChannelSectionStoreChange = function() {
|
||||
var value2 = SelectedChannelStore.getChannelId();
|
||||
var value3 = SelectedGuildStore.getGuildId();
|
||||
if (value3 != null) {
|
||||
if (value2 != null) {
|
||||
if (ChannelSectionStore.getSidebarState(value2)?.type !== require(dependencyMap[26]).SidebarType.VIEW_CHANNEL) {
|
||||
maybeLoadChannelSplitView(value3, value2);
|
||||
}
|
||||
}
|
||||
}
|
||||
};
|
||||
const handleChannelPreload = function({guildId, channelId, context}) {
|
||||
if (context === CURRENT_APP_CONTEXT) {
|
||||
fetchMessages_75206({guildId: guildId, channelId: channelId});
|
||||
maybeLoadChannelSplitView(guildId, channelId);
|
||||
}
|
||||
};
|
||||
const handleAppWillBecomeActive = function() {
|
||||
var value2 = SelectedChannelStore.getChannelId();
|
||||
if (value2 == null) {
|
||||
return false;
|
||||
}
|
||||
importDefault(dependencyMap[21]).fetchNewLocalMessages(value2, MAX_MESSAGES_PER_CHANNEL);
|
||||
};
|
||||
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 gatewayConnectionStore = importDefault(4257) /* metro dependency 4257: GatewayConnectionStore */;
|
||||
const env0_9 = (require(1383) /* metro dependency 1383: ChannelRecord */).isTextChannel;
|
||||
const channelSectionStore = importDefault(4791) /* metro dependency 4791: ChannelSectionStore */;
|
||||
const channelStore = importDefault(1379) /* metro dependency 1379: ChannelStore */;
|
||||
const guildStore = importDefault(1867) /* metro dependency 1867: GuildStore */;
|
||||
const readStateStore = importDefault(4605) /* metro dependency 4605: ReadStateStore */;
|
||||
const selectedChannelStore = importDefault(1934) /* metro dependency 1934: SelectedChannelStore */;
|
||||
const selectedGuildStore = importDefault(3969) /* metro dependency 3969: SelectedGuildStore */;
|
||||
let value = require(661) /* metro dependency 661: Constants */;
|
||||
const env0_16 = value.MAX_MESSAGES_PER_CHANNEL;
|
||||
const env0_17 = value.CURRENT_APP_CONTEXT;
|
||||
const env0_18 = value.ChannelTypes;
|
||||
const env0_19 = value.AbortCodes;
|
||||
const env0_20 = value.Routes;
|
||||
const env0_21 = value.ChannelTypesSets;
|
||||
const env0_22 = (require(1386) /* metro dependency 1386: ChannelConstants */).isStaticChannelRoute;
|
||||
let Millis = (importDefault(672) /* metro dependency 672: Durations */).Millis;
|
||||
const SECOND = Millis.SECOND;
|
||||
const env0_23 = 10 * SECOND;
|
||||
value = importDefault(3) /* metro dependency 3: Logger */;
|
||||
value = new value('MessageManager');
|
||||
Millis = (importDefault(672) /* metro dependency 672: Durations */).Millis;
|
||||
const DAY = Millis.DAY;
|
||||
const env0_26 = 90 * DAY;
|
||||
const env0_28 = {};
|
||||
value = importDefault(4860) /* metro dependency 4860: AutomaticLifecycleManager */;
|
||||
value = _fun75220(value);
|
||||
value = new value();
|
||||
(require(2) /* metro dependency 2 */).fileFinishedImporting('modules/messages/MessageManager.tsx');
|
||||
exports.default = value;
|
||||
}
|
||||
|
||||
function _isNativeReflectConstruct_75203() { // fn#75203, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:9783:405, offset: 0x01da6138, 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_75203_isNativeReflectConstruct = function() {
|
||||
return !!result;
|
||||
})();
|
||||
}
|
||||
|
||||
function fetchMessages_75206({guildId, channelId, messageId, forceFetch, isPreload, jumpType, skipLocalFetch, avoidInitialScroll, fetchKey}) { // fn#75206, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:9783:664, offset: 0x01da619a, size: 1598 bytes, params: 2, frame: 31
|
||||
var type;
|
||||
var r17;
|
||||
var r1;
|
||||
var r16;
|
||||
var r8;
|
||||
var r13;
|
||||
var r10;
|
||||
var r15;
|
||||
var value;
|
||||
var isStaticChannelRouteBinding;
|
||||
var value2;
|
||||
var getChannel;
|
||||
var value3;
|
||||
var GUILD_STORE;
|
||||
var GUILD_THREADS_ONLY;
|
||||
var has;
|
||||
var defaultImport;
|
||||
var getOrCreate;
|
||||
var value4;
|
||||
var some;
|
||||
var messageHasExpiredAttachmentUrl;
|
||||
var binding;
|
||||
var log;
|
||||
var defaultImport2;
|
||||
var clear;
|
||||
var defaultImport3;
|
||||
var value5;
|
||||
var jumpTargetId;
|
||||
var value6;
|
||||
var value7;
|
||||
var mutate;
|
||||
var object2;
|
||||
const JumpTypes = (require(4044) /* metro dependency 4044: Client */).JumpTypes;
|
||||
var ANIMATED;
|
||||
var value8;
|
||||
var defaultImport4;
|
||||
var commit;
|
||||
var focusTargetId;
|
||||
var value9;
|
||||
var value10;
|
||||
var value11;
|
||||
var defaultImport5;
|
||||
var isConnected;
|
||||
var loadingMore;
|
||||
var value12;
|
||||
var ready;
|
||||
var cached;
|
||||
var value13;
|
||||
var getGuild;
|
||||
var value14;
|
||||
var value15;
|
||||
var value16;
|
||||
var value17;
|
||||
var hasUnread;
|
||||
var hasUnread2;
|
||||
var value18;
|
||||
var defaultImport6;
|
||||
var value19;
|
||||
var jumpToMessage;
|
||||
var isThread;
|
||||
var hasOpenedThread;
|
||||
var hasOpenedThread2;
|
||||
var value20;
|
||||
const Storage = (require(587) /* metro dependency 587: Storage */).Storage;
|
||||
var get;
|
||||
var value21;
|
||||
var Date;
|
||||
var now;
|
||||
var value22;
|
||||
var value23;
|
||||
var properties;
|
||||
var properties2;
|
||||
var properties3;
|
||||
var propertyName;
|
||||
var propertyName2;
|
||||
var set;
|
||||
var hasTrackedUnread;
|
||||
var id;
|
||||
var getTrackedAckMessageId;
|
||||
var value24;
|
||||
var concat;
|
||||
var defaultImport7;
|
||||
var fetchMessages;
|
||||
var getMessageLimit;
|
||||
var defaultImport8;
|
||||
var defaultImport9;
|
||||
if (channelId != null) {
|
||||
value = environment;
|
||||
isStaticChannelRouteBinding = isStaticChannelRoute;
|
||||
value2 = undefined;
|
||||
reducibleJoin59: while (true) {
|
||||
if (isStaticChannelRouteBinding(channelId)) {
|
||||
break reducibleJoin59;
|
||||
}
|
||||
getChannel = ChannelStore.getChannel;
|
||||
value3 = Reflect.apply(getChannel, ChannelStore, [channelId]);
|
||||
reducibleJoin4: while (true) {
|
||||
if (value3 == null) {
|
||||
type = value2;
|
||||
break reducibleJoin4;
|
||||
}
|
||||
type = value3.type;
|
||||
break reducibleJoin4;
|
||||
}
|
||||
GUILD_STORE = ChannelTypes.GUILD_STORE;
|
||||
if (type === GUILD_STORE) {
|
||||
break reducibleJoin59;
|
||||
}
|
||||
reducibleJoin7: while (true) {
|
||||
if (value3 == null) {
|
||||
type = value2;
|
||||
break reducibleJoin7;
|
||||
}
|
||||
type = value3.type;
|
||||
break reducibleJoin7;
|
||||
}
|
||||
if (type != null) {
|
||||
GUILD_THREADS_ONLY = ChannelTypesSets.GUILD_THREADS_ONLY;
|
||||
has = GUILD_THREADS_ONLY.has;
|
||||
type = value3.type;
|
||||
reducibleJoin9: while (true) {
|
||||
if (Reflect.apply(has, GUILD_THREADS_ONLY, [type])) {
|
||||
break reducibleJoin59;
|
||||
}
|
||||
break reducibleJoin9;
|
||||
}
|
||||
}
|
||||
defaultImport = importDefault(4816) /* metro dependency 4816: ChannelMessages */;
|
||||
getOrCreate = defaultImport.getOrCreate;
|
||||
value4 = Reflect.apply(getOrCreate, defaultImport, [channelId]);
|
||||
some = value4.some;
|
||||
messageHasExpiredAttachmentUrl = (require(9598) /* metro dependency 9598: SignedAttachmentLinkUtils */).messageHasExpiredAttachmentUrl;
|
||||
reducibleJoin11: while (true) {
|
||||
if (Reflect.apply(some, value4, [messageHasExpiredAttachmentUrl])) {
|
||||
binding = env0_24;
|
||||
log = binding.log;
|
||||
Reflect.apply(log, binding, ['Found expired attachment link, clearing messages']);
|
||||
defaultImport2 = importDefault(4816) /* metro dependency 4816: ChannelMessages */;
|
||||
clear = defaultImport2.clear;
|
||||
Reflect.apply(clear, defaultImport2, [channelId]);
|
||||
defaultImport3 = importDefault(4816) /* metro dependency 4816: ChannelMessages */;
|
||||
getOrCreate = defaultImport3.getOrCreate;
|
||||
value5 = Reflect.apply(getOrCreate, defaultImport3, [channelId]);
|
||||
r17 = value5;
|
||||
break reducibleJoin11;
|
||||
}
|
||||
r17 = value4;
|
||||
break reducibleJoin11;
|
||||
}
|
||||
jumpTargetId = r17.jumpTargetId;
|
||||
value6 = jumpTargetId != null;
|
||||
reducibleJoin13: while (true) {
|
||||
if (value6) {
|
||||
value7 = messageId == null;
|
||||
r1 = value7;
|
||||
break reducibleJoin13;
|
||||
}
|
||||
r1 = value6;
|
||||
break reducibleJoin13;
|
||||
}
|
||||
reducibleJoin15: while (true) {
|
||||
if (r1) {
|
||||
mutate = r17.mutate;
|
||||
ANIMATED = JumpTypes.ANIMATED;
|
||||
value8 = Reflect.apply(mutate, r17, [{'jumpTargetId': null, 'jumped': false, jumpType: ANIMATED}]);
|
||||
defaultImport4 = importDefault(4816) /* metro dependency 4816: ChannelMessages */;
|
||||
commit = defaultImport4.commit;
|
||||
Reflect.apply(commit, defaultImport4, [value8]);
|
||||
r16 = value8;
|
||||
break reducibleJoin15;
|
||||
}
|
||||
r16 = r17;
|
||||
break reducibleJoin15;
|
||||
}
|
||||
focusTargetId = r16.focusTargetId;
|
||||
value9 = focusTargetId != null;
|
||||
reducibleJoin17: while (true) {
|
||||
if (value9) {
|
||||
value10 = messageId == null;
|
||||
r8 = value10;
|
||||
break reducibleJoin17;
|
||||
}
|
||||
r8 = value9;
|
||||
break reducibleJoin17;
|
||||
}
|
||||
reducibleJoin19: while (true) {
|
||||
if (r8) {
|
||||
mutate = r16.mutate;
|
||||
value11 = Reflect.apply(mutate, r16, [{focusTargetId: null}]);
|
||||
defaultImport5 = importDefault(4816) /* metro dependency 4816: ChannelMessages */;
|
||||
commit = defaultImport5.commit;
|
||||
Reflect.apply(commit, defaultImport5, [value11]);
|
||||
r1 = value11;
|
||||
break reducibleJoin19;
|
||||
}
|
||||
r1 = r16;
|
||||
break reducibleJoin19;
|
||||
}
|
||||
reducibleJoin31: while (true) {
|
||||
reducibleJoin29: while (true) {
|
||||
if (isPreload) {
|
||||
isConnected = GatewayConnectionStore.isConnected;
|
||||
if (!Reflect.apply(isConnected, GatewayConnectionStore, [])) {
|
||||
loadingMore = r1.loadingMore;
|
||||
value12 = true;
|
||||
if (!loadingMore) {
|
||||
r8 = value12;
|
||||
break reducibleJoin31;
|
||||
}
|
||||
}
|
||||
loadingMore = r1.loadingMore;
|
||||
if (loadingMore) {
|
||||
break reducibleJoin29;
|
||||
}
|
||||
if (r1.ready) {
|
||||
cached = r1.cached;
|
||||
if (!cached) {
|
||||
break reducibleJoin29;
|
||||
}
|
||||
}
|
||||
value13 = guildId != null;
|
||||
reducibleJoin27: while (true) {
|
||||
if (value13) {
|
||||
getGuild = GuildStore.getGuild;
|
||||
value14 = Reflect.apply(getGuild, GuildStore, [guildId]) == null;
|
||||
r13 = value14;
|
||||
break reducibleJoin27;
|
||||
}
|
||||
r13 = value13;
|
||||
break reducibleJoin27;
|
||||
}
|
||||
if (r13) {
|
||||
r8 = forceFetch;
|
||||
break reducibleJoin31;
|
||||
}
|
||||
r8 = true;
|
||||
break reducibleJoin31;
|
||||
}
|
||||
loadingMore = r1.loadingMore;
|
||||
if (loadingMore) {
|
||||
break reducibleJoin29;
|
||||
}
|
||||
ready = r1.ready;
|
||||
if (ready) {
|
||||
cached = r1.cached;
|
||||
if (!cached) {
|
||||
break reducibleJoin29;
|
||||
}
|
||||
}
|
||||
value13 = guildId != null;
|
||||
reducibleJoin27: while (true) {
|
||||
if (value13) {
|
||||
getGuild = GuildStore.getGuild;
|
||||
value14 = Reflect.apply(getGuild, GuildStore, [guildId]) == null;
|
||||
r13 = value14;
|
||||
break reducibleJoin27;
|
||||
}
|
||||
r13 = value13;
|
||||
break reducibleJoin27;
|
||||
}
|
||||
if (r13) {
|
||||
r8 = forceFetch;
|
||||
break reducibleJoin31;
|
||||
}
|
||||
value15 = true;
|
||||
r8 = value15;
|
||||
break reducibleJoin31;
|
||||
}
|
||||
if (messageId == null) {
|
||||
r8 = forceFetch;
|
||||
break reducibleJoin31;
|
||||
}
|
||||
value16 = true;
|
||||
r8 = value16;
|
||||
break reducibleJoin31;
|
||||
}
|
||||
value17 = (importDefault(8876) /* metro dependency 8876: isChangelogChannel */)(channelId);
|
||||
reducibleJoin33: while (true) {
|
||||
if (value17) {
|
||||
hasUnread = ReadStateStore.hasUnread;
|
||||
hasUnread2 = Reflect.apply(hasUnread, ReadStateStore, [channelId]);
|
||||
r10 = hasUnread2;
|
||||
break reducibleJoin33;
|
||||
}
|
||||
r10 = value17;
|
||||
break reducibleJoin33;
|
||||
}
|
||||
reducibleJoin35: while (true) {
|
||||
if (r10) {
|
||||
value18 = true;
|
||||
r8 = value18;
|
||||
break reducibleJoin35;
|
||||
}
|
||||
break reducibleJoin35;
|
||||
}
|
||||
if (r8) {
|
||||
defaultImport6 = importDefault(4816) /* metro dependency 4816: ChannelMessages */;
|
||||
commit = defaultImport6.commit;
|
||||
mutate = r1.mutate;
|
||||
object2 = {};
|
||||
value19 = true;
|
||||
object2.loadingMore = value19;
|
||||
Reflect.apply(commit, defaultImport6, [Reflect.apply(mutate, r1, [object2])]);
|
||||
if (messageId == null) {
|
||||
if (value3 != null) {
|
||||
isThread = value3.isThread;
|
||||
reducibleJoin52: while (true) {
|
||||
if (Reflect.apply(isThread, value3, [])) {
|
||||
hasOpenedThread = ReadStateStore.hasOpenedThread;
|
||||
hasOpenedThread2 = Reflect.apply(hasOpenedThread, ReadStateStore, [channelId]);
|
||||
value20 = false;
|
||||
reducibleJoin51: while (true) {
|
||||
if (hasOpenedThread2) {
|
||||
r10 = value20;
|
||||
break reducibleJoin51;
|
||||
}
|
||||
reducibleJoin45: while (true) {
|
||||
if (env0_25 != null) {
|
||||
break reducibleJoin45;
|
||||
}
|
||||
get = Storage.get;
|
||||
binding = env0_27;
|
||||
value21 = Reflect.apply(get, Storage, [binding, {}]);
|
||||
reducibleJoin44: while (true) {
|
||||
if (value21 != null) {
|
||||
r13 = value21;
|
||||
break reducibleJoin44;
|
||||
}
|
||||
r13 = {};
|
||||
break reducibleJoin44;
|
||||
}
|
||||
env0_25 = r13;
|
||||
break reducibleJoin45;
|
||||
}
|
||||
if (channelId in env0_25) {
|
||||
r10 = value20;
|
||||
break reducibleJoin51;
|
||||
}
|
||||
binding = env0_25;
|
||||
Date = global.Date;
|
||||
now = Date.now;
|
||||
binding[channelId] = Reflect.apply(now, Date, []);
|
||||
Date = global.Date;
|
||||
now = Date.now;
|
||||
value22 = Reflect.apply(now, Date, []);
|
||||
value23 = value22 - env0_26;
|
||||
binding = env0_25;
|
||||
properties = Object.keys(binding);
|
||||
properties2 = 0;
|
||||
properties3 = properties.length;
|
||||
if (properties !== value2) {
|
||||
r15 = properties2;
|
||||
reducibleLoop47: while (true) {
|
||||
propertyName = properties[r15];
|
||||
propertyName2 = r15 + 1;
|
||||
if (propertyName === value2) {
|
||||
break reducibleLoop47;
|
||||
}
|
||||
if (env0_25[propertyName] < value23) {
|
||||
delete env0_25[propertyName];
|
||||
r15 = propertyName2;
|
||||
continue reducibleLoop47;
|
||||
}
|
||||
r15 = propertyName2;
|
||||
continue reducibleLoop47;
|
||||
}
|
||||
}
|
||||
set = Storage.set;
|
||||
binding = env0_27;
|
||||
Reflect.apply(set, Storage, [binding, env0_25]);
|
||||
r10 = value19;
|
||||
break reducibleJoin51;
|
||||
}
|
||||
if (r10) {
|
||||
binding = env0_24;
|
||||
log = binding.log;
|
||||
id = value3.id;
|
||||
concat = global.HermesInternal.concat;
|
||||
Reflect.apply(log, binding, ['Jumping to start of thread ' + id]);
|
||||
defaultImport9 = importDefault(7067) /* metro dependency 7067: MessageActionCreators */;
|
||||
fetchMessages = defaultImport9.fetchMessages;
|
||||
object2 = {channelId: channelId};
|
||||
value = require(9599) /* metro dependency 9599: getAdaptiveMessageLimitNative */;
|
||||
object2.limit = value.getMessageLimit('MessageManager.threadStart');
|
||||
object2.jump = {messageId: channelId, flash: value20};
|
||||
object2.isPreload = isPreload;
|
||||
object2.skipLocalFetch = skipLocalFetch;
|
||||
object2.avoidInitialScroll = avoidInitialScroll;
|
||||
object2.fetchKey = fetchKey;
|
||||
return Reflect.apply(fetchMessages, defaultImport9, [object2]);
|
||||
}
|
||||
break reducibleJoin52;
|
||||
}
|
||||
break reducibleJoin52;
|
||||
}
|
||||
}
|
||||
if (value3 != null) {
|
||||
isThread = value3.isThread;
|
||||
reducibleJoin57: while (true) {
|
||||
if (Reflect.apply(isThread, value3, [])) {
|
||||
hasTrackedUnread = ReadStateStore.hasTrackedUnread;
|
||||
id = value3.id;
|
||||
if (Reflect.apply(hasTrackedUnread, ReadStateStore, [id])) {
|
||||
ready = r1.ready;
|
||||
if (!ready) {
|
||||
getTrackedAckMessageId = ReadStateStore.getTrackedAckMessageId;
|
||||
id = value3.id;
|
||||
value24 = Reflect.apply(getTrackedAckMessageId, ReadStateStore, [id]);
|
||||
binding = env0_24;
|
||||
log = binding.log;
|
||||
id = value3.id;
|
||||
concat = global.HermesInternal.concat;
|
||||
Reflect.apply(log, binding,
|
||||
['Jumping to most recent message in thread ' + id + ' - ' + value24]);
|
||||
defaultImport7 = importDefault(7067) /* metro dependency 7067: MessageActionCreators */;
|
||||
fetchMessages = defaultImport7.fetchMessages;
|
||||
object2 = {channelId: channelId};
|
||||
value = require(9599) /* metro dependency 9599: getAdaptiveMessageLimitNative */;
|
||||
object2.limit = value.getMessageLimit('MessageManager.threadUnread');
|
||||
object2.jump = {'messageId': null, 'flash': false, 'offset': 1,
|
||||
messageId: value24};
|
||||
object2.isPreload = isPreload;
|
||||
object2.skipLocalFetch = skipLocalFetch;
|
||||
object2.avoidInitialScroll = avoidInitialScroll;
|
||||
object2.fetchKey = fetchKey;
|
||||
return Reflect.apply(fetchMessages, defaultImport7, [object2]);
|
||||
}
|
||||
break reducibleJoin57;
|
||||
}
|
||||
break reducibleJoin57;
|
||||
}
|
||||
break reducibleJoin57;
|
||||
}
|
||||
}
|
||||
defaultImport8 = importDefault(7067) /* metro dependency 7067: MessageActionCreators */;
|
||||
fetchMessages = defaultImport8.fetchMessages;
|
||||
object2 = {channelId: channelId};
|
||||
value = require(9599) /* metro dependency 9599: getAdaptiveMessageLimitNative */;
|
||||
getMessageLimit = value.getMessageLimit;
|
||||
object2.limit = Reflect.apply(getMessageLimit, value, ['MessageManager.initialFetch']);
|
||||
object2.isPreload = isPreload;
|
||||
object2.skipLocalFetch = skipLocalFetch;
|
||||
ANIMATED = JumpTypes.ANIMATED;
|
||||
object2.jump = {jumpType: ANIMATED};
|
||||
object2.avoidInitialScroll = avoidInitialScroll;
|
||||
object2.fetchKey = fetchKey;
|
||||
return Reflect.apply(fetchMessages, defaultImport8, [object2]);
|
||||
}
|
||||
value = importDefault(7067) /* metro dependency 7067: MessageActionCreators */;
|
||||
jumpToMessage = value.jumpToMessage;
|
||||
Reflect.apply(jumpToMessage, value, [{channelId: channelId, messageId: messageId, flash: value19,
|
||||
isPreload: isPreload, skipLocalFetch: skipLocalFetch, jumpType: jumpType,
|
||||
avoidInitialScroll: avoidInitialScroll}]);
|
||||
break reducibleJoin59;
|
||||
}
|
||||
break reducibleJoin59;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
function handleConnectionOpen_75207() { // fn#75207, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:9783:2873, offset: 0x01da67d8, size: 293 bytes, params: 1, frame: 24
|
||||
var channel;
|
||||
var id;
|
||||
var value4;
|
||||
var moduleValue;
|
||||
var matchPath;
|
||||
var moduleValue2;
|
||||
var pathname;
|
||||
var object3;
|
||||
var value5;
|
||||
var fetchMessages_75206Binding;
|
||||
var object4;
|
||||
var messageId;
|
||||
var maybeLoadChannelSplitViewBinding;
|
||||
var guildId;
|
||||
const channelId = SelectedChannelStore.getChannelId();
|
||||
if (channelId != null) {
|
||||
channel = ChannelStore.getChannel(channelId);
|
||||
if (channel != null) {
|
||||
id = channel.id;
|
||||
value4 = undefined;
|
||||
moduleValue = require(3974) /* metro dependency 3974: matchPathCompat */;
|
||||
matchPath = moduleValue.matchPath;
|
||||
moduleValue2 = require(1230) /* metro dependency 1230: router_utils */;
|
||||
pathname = moduleValue2.getHistory().location.pathname;
|
||||
object3 = {};
|
||||
object3.path = Routes.CHANNEL(':guild', ':channel', ':message');
|
||||
object3.exact = true;
|
||||
value5 = Reflect.apply(matchPath, moduleValue, [pathname, object3]);
|
||||
object3 = {channelId: id};
|
||||
object3.messageId = value5 == null || value5.params == null ? value4 : value5.params.message;
|
||||
fetchMessages_75206Binding = fetchMessages_75206;
|
||||
object4 = {};
|
||||
object4.guildId = channel.getGuildId();
|
||||
id = channel.id;
|
||||
object4.channelId = id;
|
||||
messageId = object3.messageId;
|
||||
object4.messageId = messageId;
|
||||
messageId = object3.messageId;
|
||||
object4.avoidInitialScroll = messageId != null;
|
||||
fetchMessages_75206Binding(object4);
|
||||
maybeLoadChannelSplitViewBinding = maybeLoadChannelSplitView;
|
||||
guildId = channel.getGuildId();
|
||||
id = channel.id;
|
||||
maybeLoadChannelSplitViewBinding(guildId, id);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
function loadSelectedChannelIfNecessary() { // fn#75208, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:9783:3386, offset: 0x01da68fd, size: 205 bytes, params: 1, frame: 16
|
||||
var channel;
|
||||
var orCreate;
|
||||
var fetchMessages_75206Binding;
|
||||
var object2;
|
||||
const channelId = SelectedChannelStore.getChannelId();
|
||||
if (channelId != null) {
|
||||
channel = ChannelStore.getChannel(channelId);
|
||||
if (channel != null) {
|
||||
if (isTextChannel(channel.type)) {
|
||||
orCreate = (importDefault(4816) /* metro dependency 4816: ChannelMessages */).getOrCreate(channelId);
|
||||
if (!(orCreate.ready && orCreate.hasFetched)) {
|
||||
fetchMessages_75206Binding = fetchMessages_75206;
|
||||
object2 = {};
|
||||
object2.guildId = channel.getGuildId();
|
||||
object2.channelId = channel.id;
|
||||
fetchMessages_75206Binding(object2);
|
||||
}
|
||||
maybeLoadChannelSplitView(channel.getGuildId(), channel.id);
|
||||
} else {
|
||||
maybeLoadChannelSplitView(channel.getGuildId(), channel.id);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
function handleChannelCreate_75215({channel, messageId}) { // fn#75215, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:9783:4706, offset: 0x01da6b86, size: 94 bytes, params: 2, frame: 14
|
||||
var r1;
|
||||
const guild_id = channel.guild_id;
|
||||
let value = guild_id != null;
|
||||
if (value) {
|
||||
value = SelectedChannelStore.getChannelId(guild_id);
|
||||
value = value === channel.id;
|
||||
r1 = value;
|
||||
} else {
|
||||
r1 = value;
|
||||
}
|
||||
if (r1) {
|
||||
fetchMessages_75206({guildId: guild_id, channelId: channel.id, messageId: messageId});
|
||||
}
|
||||
}
|
||||
|
||||
function handleMessageEditEnd({response}) { // fn#75216, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:9783:4866, offset: 0x01da6be4, size: 260 bytes, params: 2, frame: 21
|
||||
var retry_after;
|
||||
var defaultImport;
|
||||
var show;
|
||||
var object3;
|
||||
const intl = (require(1244) /* metro dependency 1244: indexNative */).intl;
|
||||
const t = (require(1244) /* metro dependency 1244: indexNative */).t;
|
||||
var formatToPlainString;
|
||||
var qoxdQB;
|
||||
var object4;
|
||||
if (response == null) {
|
||||
return null;
|
||||
}
|
||||
if (response.body == null) {
|
||||
return null;
|
||||
}
|
||||
const code = response.body.code;
|
||||
const CHANNEL_FOLLOWING_EDIT_RATE_LIMITED = AbortCodes.CHANNEL_FOLLOWING_EDIT_RATE_LIMITED;
|
||||
if (code === CHANNEL_FOLLOWING_EDIT_RATE_LIMITED) {
|
||||
retry_after = response.body.retry_after;
|
||||
if (retry_after != null) {
|
||||
defaultImport = importDefault(4647) /* metro dependency 4647: AlertActionCreators */;
|
||||
show = defaultImport.show;
|
||||
object3 = {};
|
||||
object3.title = intl.string(t.Whhv4w);
|
||||
formatToPlainString = intl.formatToPlainString;
|
||||
qoxdQB = t.qoxdQB;
|
||||
object4 = {};
|
||||
object4.retryAfterMinutes = global.Math.ceil(retry_after / 60);
|
||||
object3.body = Reflect.apply(formatToPlainString, intl, [qoxdQB, object4]);
|
||||
Reflect.apply(show, defaultImport, [object3]);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
function handleLoadMessagesSuccess({channelId, jump, isStale, isPreview}) { // fn#75217, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:9783:5204, offset: 0x01da6ce8, size: 267 bytes, params: 2, frame: 17
|
||||
var r7;
|
||||
var r1;
|
||||
var Date;
|
||||
var binding;
|
||||
var channelId2;
|
||||
var currentSidebarChannelId;
|
||||
var defaultImport;
|
||||
var fetchMessages;
|
||||
var object2;
|
||||
isPreview = !(isPreview === undefined) && isPreview;
|
||||
if (!isPreview) {
|
||||
r7 = env0_28[channelId] ?? 0;
|
||||
Date = global.Date;
|
||||
if (!(Date.now() - r7 < env0_23)) {
|
||||
binding = env0_28;
|
||||
Date = global.Date;
|
||||
binding[channelId] = Date.now();
|
||||
channelId2 = SelectedChannelStore.getChannelId();
|
||||
currentSidebarChannelId = ChannelSectionStore.getCurrentSidebarChannelId(channelId2);
|
||||
r1 = isStale && GatewayConnectionStore.isConnected();
|
||||
r1 = r1 && (channelId === channelId2 || channelId === currentSidebarChannelId);
|
||||
if (r1) {
|
||||
defaultImport = importDefault(7067) /* metro dependency 7067: MessageActionCreators */;
|
||||
fetchMessages = defaultImport.fetchMessages;
|
||||
object2 = {channelId: channelId};
|
||||
object2.limit = (require(9599) /* metro dependency 9599: getAdaptiveMessageLimitNative */).getMessageLimit('MessageManager.staleFetch');
|
||||
object2.jump = jump;
|
||||
Reflect.apply(fetchMessages, defaultImport, [object2]);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
function handleUploadFail({channelId, messageId, reason, noSendFailed, shouldSendNotification}) { // fn#75218, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:9783:5562, offset: 0x01da6df3, size: 134 bytes, params: 2, frame: 17
|
||||
if (messageId != null && noSendFailed !== true) {
|
||||
(importDefault(694) /* metro dependency 694: Dispatcher */).dispatch({type: 'MESSAGE_SEND_FAILED',
|
||||
channelId: channelId, messageId: messageId, reason: reason ?? null,
|
||||
shouldNotify: shouldSendNotification !== false});
|
||||
}
|
||||
}
|
||||
|
||||
function _fun75220(a0) { // fn#75220, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:9783:5921, offset: 0x01da6ebc, size: 97 bytes, params: 2, frame: 16
|
||||
const closure = MessageManager;
|
||||
env0_7(closure, a0);
|
||||
return env0_4(closure, [{key: '_initialize', value: function() {
|
||||
importDefault(dependencyMap[29]).subscribe('CONNECTION_OPEN', handleConnectionOpen_75207);
|
||||
}}, {key: '_terminate', value: function() {
|
||||
importDefault(dependencyMap[29]).unsubscribe('CONNECTION_OPEN', handleConnectionOpen_75207);
|
||||
}}]);
|
||||
}
|
||||
|
||||
function MessageManager(a0) { // fn#75221, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:9783:5933, offset: 0x01da6f1d, size: 358 bytes, params: 2, frame: 21
|
||||
var r0;
|
||||
var Reflect;
|
||||
let value = copyRestArgs(0, undefined);
|
||||
let binding = env1_3;
|
||||
binding(this, MessageManager);
|
||||
const items = [];
|
||||
arraySpread(items, value, 0, items);
|
||||
value = env1_6(MessageManager);
|
||||
binding = env1_5;
|
||||
if (_isNativeReflectConstruct_75203()) {
|
||||
Reflect = global.Reflect;
|
||||
value = Reflect.construct(value, items, env1_6(this).constructor);
|
||||
r0 = value;
|
||||
} else {
|
||||
value = value.apply(this, items);
|
||||
r0 = value;
|
||||
}
|
||||
value = binding(this, r0);
|
||||
value.fetchMessages = fetchMessages_75206;
|
||||
value.loadSelectedChannelIfNecessary = loadSelectedChannelIfNecessary;
|
||||
const Map = global.Map;
|
||||
const map = new Map();
|
||||
value.stores = map.set(ChannelSectionStore, handleChannelSectionStoreChange);
|
||||
const handleChannelCreate_75215Binding = handleChannelCreate_75215;
|
||||
value.actions = {APP_STATE_UPDATE_WILL_BECOME_ACTIVE: handleAppWillBecomeActive,
|
||||
OVERLAY_INITIALIZE: handleConnectionOpen_75207, CHANNEL_SELECT: handleChannelSelect_75209,
|
||||
VOICE_CHANNEL_SELECT: handleVoiceChannelSelect, THREAD_CREATE: handleChannelCreate_75215Binding,
|
||||
THREAD_LIST_SYNC: function() {
|
||||
loadSelectedChannelIfNecessary();
|
||||
}, CHANNEL_CREATE: handleChannelCreate_75215Binding, CHANNEL_PRELOAD: handleChannelPreload,
|
||||
GUILD_CREATE: function() {
|
||||
loadSelectedChannelIfNecessary();
|
||||
}, MESSAGE_END_EDIT: handleMessageEditEnd, LOAD_MESSAGES_SUCCESS: handleLoadMessagesSuccess,
|
||||
UPLOAD_FAIL: handleUploadFail, CHANNEL_DELETE: function() {
|
||||
loadSelectedChannelIfNecessary();
|
||||
}, THREAD_DELETE: function() {
|
||||
loadSelectedChannelIfNecessary();
|
||||
}, CHANNEL_RTC_JUMP_TO_VOICE_CHANNEL_MESSAGE: handleJumpToVoiceChannelMessage};
|
||||
return value;
|
||||
}
|
||||
|
||||
Reference in new issue
Block a user