Initial commit

This commit is contained in:
janisslsm committed 2026-07-27 16:20:00 +03:00
commit af3b49f756
16065 files changed
+2938410

No files matched your search

@@ -0,0 +1,51 @@
/* Metro module 11344; source: modules/messages/native/hooks/useChannelLoading.tsx; dependencies: [57, 31, 11345, 9835, 4595, 2] */
function _fun86737(global, require, importDefault, importAll, module, exports, dependencyMap) { // fn#86737, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:11530:6, offset: 0x01f9e2c4, size: 137 bytes, params: 8, frame: 19
const env0_0 = require;
const Object = global.Object;
Object.defineProperty(exports, '__esModule', {value: true});
const env0_3 = importDefault(57) /* metro dependency 57 */;
const env0_4 = importAll(31) /* metro dependency 31 */;
(require(2) /* metro dependency 2 */).fileFinishedImporting('modules/messages/native/hooks/useChannelLoading.tsx');
exports.default = useChannelLoading;
}
function useChannelLoading({channelId, jumpTargetId, oldestUnreadMessageId, shouldJumpToOriginalPost}) { // fn#86738, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:11530:211, offset: 0x01f9e34d, size: 150 bytes, params: 2, frame: 16
const property = shouldJumpToOriginalPost(env0_4.useState(_fun86739), 1)[0];
const closure = startOrCancelLatestMessagesLoad;
(importDefault(4595) /* metro dependency 4595: useMountEffect */)(function() {
startOrCancelLatestMessagesLoad(false);
return _fun86742;
});
return {channelLatestMessageLoadingStatsManager: property, startOrCancelLatestMessagesLoad: closure};
}
function _fun86739() { // fn#86739, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:11530:337, offset: 0x01f9e3e3, size: 51 bytes, params: 1, frame: 11
let value = environment.__proto__;
value = importDefault(11345) /* metro dependency 11345: ChannelLatestMessageLoadingStatsManager */;
const value2 = Object.create(value.prototype, {constructor: {value: value}});
value = new value('Messages');
return value instanceof Object ? value : value2;
}
function startOrCancelLatestMessagesLoad(a0) { // fn#86740, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:11530:412, owner: useChannelLoading.startOrCancelLatestMessagesLoad, offset: 0x01f9e416, size: 95 bytes, params: 2, frame: 15
let value = environment.__proto__;
value = require(9835) /* metro dependency 9835: MessagesUtils */;
const startOrCancelChannelLatestMessagesLoad = value.startOrCancelChannelLatestMessagesLoad;
const object2 = {};
object2.jumpTargetId = jumpTargetId;
object2.oldestUnreadMessageId = oldestUnreadMessageId;
object2.shouldJumpToOriginalPost = shouldJumpToOriginalPost(a0);
object2.channelId = channelId;
object2.tracker = env0_4;
Reflect.apply(startOrCancelChannelLatestMessagesLoad, value, [object2]);
}
function _fun86741() { // fn#86741, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:11530:574, offset: 0x01f9e475, size: 27 bytes, params: 1, frame: 11
startOrCancelLatestMessagesLoad(false);
return _fun86742;
}
function _fun86742() { // fn#86742, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:11530:615, offset: 0x01f9e490, size: 21 bytes, params: 1, frame: 9
env1_4.cancel();
}
@@ -0,0 +1,721 @@
/* Metro module 11517; source: modules/messages/native/hooks/useRowManager.tsx; dependencies: [14, 11518, 4044, 9850, 477, 9849, 2] */
function _fun88173(global, require, importDefault, importAll, module, exports, dependencyMap) { // fn#88173, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:11703:6, offset: 0x01fd7640, size: 125 bytes, params: 8, frame: 18
const env0_0 = require;
const _arrayLikeToArray_88176 = 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 Object = global.Object;
Object.defineProperty(exports, '__esModule', {value: true});
(require(2) /* metro dependency 2 */).fileFinishedImporting('modules/messages/native/hooks/useRowManager.tsx');
exports.default = useRowManager;
}
function _createForOfIteratorHelperLoose_88174(a0, a1) { // fn#88174, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:11703:46, offset: 0x01fd76bd, size: 372 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 _fun88175;
}
value = undefined;
if (a0) {
if (typeof a0 === 'string') {
value = _arrayLikeToArray_88176(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_88176(a0, value);
r6 = value;
} else {
regexp = RegExp('^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$', '');
if (regexp.test(r9)) {
value = _arrayLikeToArray_88176(a0, value);
r6 = value;
} else {
r6 = value;
}
}
r5 = r6;
}
} else {
r5 = value;
}
if (r5) {
if (r5) {
}
return _fun88175;
}
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 useRowManager({chatManager, rowGenerator, animatingStickerMessageIdRef, canAddNewReactions, channel, messages, isMessagesReady, uploads, roleStyle, oldestUnreadMessageId, replyingMessageId, inlineAttachmentMedia, inlineEmbedMedia, renderEmbeds, renderReactions, animateEmoji, gifAutoPlay, timestampHourCycle, currentUserId, renderCommunicationDisabled, selectedSummary, enableSwipeActions, isResourceChannel, shouldObscureSpoiler, shouldDisableInteractiveComponents, unloadableContentEntryMessageIds, containerWidth, chatRef, loadedRef, animatedRef, hasMoreMessagesAfterForLastUpdateRef, updateNativeRows, isLoadingAtTop, channelLatestMessageLoadingStatsManager, channelId, isMessagesCached, chatUpdatesQueue, shouldJumpToOriginalPost, findMessageIndex, scrollToTopMessage, useReducedMotion}) { // fn#88177, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:11703:1099, offset: 0x01fd7831, size: 483 bytes, params: 2, frame: 5
return {createRows: createRows, updateRows: updateRows_88184, scrollToMessageId: scrollToMessageId,
maybeRescrollToMessageId: function(a0) {
var value = a1;
var value2 = a2;
var value3 = a3;
var env0_0 = a0;
var env0_1 = value !== undefined ? value : false;
var env0_2 = value2 !== undefined ? value2 : require(dependencyMap[2]).JumpTypes.INSTANT;
var env0_3 = value3 !== undefined ? value3 : false;
if (a0 != null) {
global.setTimeout(_fun88181, 50);
}
}};
}
function createRows({forceRender, updateMessageIds, ignoreEmbedDescriptionCache}) { // fn#88178, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:11703:1958, owner: useRowManager.createRows, offset: 0x01fd7a14, size: 125 bytes, params: 2, frame: 13
var environment;
var r0;
var value;
if (channel != null) {
if (messages != null) {
if (isMessagesReady) {
value = environment.__proto__;
value = (importDefault(14) /* metro dependency 14: TTITracker */).firstRowGenerator.measure(_fun88179);
r0 = value;
} else {
r0 = null;
}
} else {
r0 = null;
}
} else {
r0 = null;
}
return r0;
}
function useRowManagerMaybeRescrollToMessageId(a0) { // fn#88180, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:11703:2858, owner: useRowManager.maybeRescrollToMessageId, offset: 0x01fd7c2e, size: 115 bytes, params: 2, frame: 17
var environment;
var INSTANT;
let value = a1;
const value2 = a2;
const value3 = a3;
const env0_0 = a0;
const env0_1 = value !== undefined ? value : false;
if (value2 === undefined) {
value = environment.__proto__;
INSTANT = (require(4044) /* metro dependency 4044: Client */).JumpTypes.INSTANT;
}
const env0_3 = value3 !== undefined ? value3 : false;
if (a0 != null) {
global.setTimeout(_fun88181, 50);
}
}
function scrollToMessageId({scrollToMessageId, jumpTargetId, jumpType, scrollPosition, minimizeScrolling, isRescrolling, hasJumpedToOriginalPost}) { // fn#88182, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:11703:3259, owner: useRowManager.scrollToMessageId, offset: 0x01fd7d96, size: 440 bytes, params: 2, frame: 25
const JumpTypes = (require(4044) /* metro dependency 4044: Client */).JumpTypes;
var messageIndex;
var defaultImport;
jumpTargetId = jumpTargetId === undefined ? null : jumpTargetId;
const r10 = jumpType !== undefined ? jumpType : JumpTypes.ANIMATED;
const r7 = scrollPosition !== undefined ? scrollPosition : (require(9850) /* metro dependency 9850: NativeChatUtils */).ChatScrollPosition.TOP;
minimizeScrolling = !(minimizeScrolling === undefined) && minimizeScrolling;
isRescrolling = !(isRescrolling === undefined) && isRescrolling;
hasJumpedToOriginalPost = !(hasJumpedToOriginalPost === undefined) && hasJumpedToOriginalPost;
const r3 = useReducedMotion || r10 === JumpTypes.INSTANT;
const value4 = !r3;
const platformUtilsModule = require(477) /* metro dependency 477: PlatformUtils */;
if (platformUtilsModule.isIOS()) {
if (isRescrolling) {
messageIndex = findMessageIndex(scrollToMessageId);
if (messageIndex != null) {
if (minimizeScrolling) {
global.setTimeout(_fun88183, 5);
} else {
defaultImport = importDefault(9850) /* metro dependency 9850: NativeChatUtils */;
defaultImport.scrollTo(chatRef.current, messageIndex, {animated: value4,
highlight: jumpTargetId === scrollToMessageId, position: r7});
}
}
} else {
maybeRescrollToMessageId_88180(scrollToMessageId, true, r3 ? JumpTypes.INSTANT : JumpTypes.ANIMATED,
hasJumpedToOriginalPost);
}
} else {
messageIndex = findMessageIndex(scrollToMessageId);
if (messageIndex != null) {
if (minimizeScrolling) {
global.setTimeout(_fun88183, 5);
} else {
defaultImport = importDefault(9850) /* metro dependency 9850: NativeChatUtils */;
defaultImport.scrollTo(chatRef.current, messageIndex, {animated: value4,
highlight: jumpTargetId === scrollToMessageId, position: r7});
}
}
}
}
function useRowManagerUpdateRows() { // fn#88184, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:11703:3820, owner: useRowManager.updateRows, offset: 0x01fd7fa5, size: 953 bytes, params: 1, frame: 30
var environment;
var MIDDLE;
var r10;
var object2;
var createRowsBinding;
var rows;
var chatUpdatesQueueBinding;
var value4;
var defaultImport;
var messageIndex;
var value5;
var defaultImport2;
var value6;
var defaultImport3;
var current6;
var value8;
var updateNativeRowsBinding;
const value = a0;
const value2 = undefined;
let r1 = value !== value2 ? value : {};
let forceRender = r1.forceRender;
forceRender = !(forceRender === value2) && forceRender;
const forceReload = r1.forceReload;
const updateMessageIds = r1.updateMessageIds;
const r9 = updateMessageIds !== value2 ? updateMessageIds : new global.Set();
const scrollToMessageId3 = r1.scrollToMessageId;
const scrollToMessageId2 = scrollToMessageId3 !== value2 ? scrollToMessageId3 : null;
let jumpTargetId = r1.jumpTargetId;
jumpTargetId = jumpTargetId === value2 ? null : jumpTargetId;
const jumpType = r1.jumpType;
const r19 = jumpType !== value2 ? jumpType : (require(4044) /* metro dependency 4044: Client */).JumpTypes.ANIMATED;
let focusTargetId = r1.focusTargetId;
focusTargetId = focusTargetId === value2 ? null : focusTargetId;
let ignoreEmbedDescriptionCache = r1.ignoreEmbedDescriptionCache;
ignoreEmbedDescriptionCache = !(ignoreEmbedDescriptionCache === value2) && ignoreEmbedDescriptionCache;
let messagesNewlyLoaded = r1.messagesNewlyLoaded;
messagesNewlyLoaded = !(messagesNewlyLoaded === value2) && messagesNewlyLoaded;
let shouldInitialScroll = r1.shouldInitialScroll;
shouldInitialScroll = !(shouldInitialScroll === value2) && shouldInitialScroll;
let minimizeScrolling = r1.minimizeScrolling;
minimizeScrolling = !(minimizeScrolling === value2) && minimizeScrolling;
let isRescrolling = r1.isRescrolling;
isRescrolling = !(isRescrolling === value2) && isRescrolling;
const overrideScrollJumpType = r1.overrideScrollJumpType;
let isAnimated = r1.isAnimated;
isAnimated = isAnimated === value2 || isAnimated;
let hasJumpedToOriginalPost = r1.hasJumpedToOriginalPost;
hasJumpedToOriginalPost = !(hasJumpedToOriginalPost === value2) && hasJumpedToOriginalPost;
let current = chatRef.current;
if (current != null) {
createRowsBinding = createRows;
object2 = {forceRender: forceRender, updateMessageIds: r9,
ignoreEmbedDescriptionCache: ignoreEmbedDescriptionCache};
rows = createRowsBinding(object2);
current = loadedRef.current;
MIDDLE = selectedSummary != null ? selectedSummary.startId !== scrollToMessageId2 ? value2 : (require(9850) /* metro dependency 9850: NativeChatUtils */).ChatScrollPosition.MIDDLE : value2;
if (rows == null) {
if (loadedRef.current) {
chatUpdatesQueueBinding = chatUpdatesQueue;
if (chatUpdatesQueueBinding.hasUpdates()) {
chatUpdatesQueue.tryFlush();
} else if (loadedRef.current) {
if (scrollToMessageId2 == null) {
if (focusTargetId != null) {
messageIndex = findMessageIndex(focusTargetId);
if (messageIndex != null) {
value5 = environment.__proto__;
defaultImport2 = importDefault(9850) /* metro dependency 9850: NativeChatUtils */;
defaultImport2.focus(chatRef.current, messageIndex);
}
}
} else if (shouldJumpToOriginalPost(hasJumpedToOriginalPost)) {
if (focusTargetId != null) {
messageIndex = findMessageIndex(focusTargetId);
if (messageIndex != null) {
value5 = environment.__proto__;
defaultImport2 = importDefault(9850) /* metro dependency 9850: NativeChatUtils */;
defaultImport2.focus(chatRef.current, messageIndex);
}
}
} else {
scrollToMessageId({scrollToMessageId: scrollToMessageId2, jumpTargetId: jumpTargetId,
jumpType: r19,
scrollPosition: MIDDLE, minimizeScrolling: minimizeScrolling, isRescrolling: isRescrolling,
hasJumpedToOriginalPost: hasJumpedToOriginalPost});
}
} else if (rows == null) {
if (scrollToMessageId2 == null) {
if (focusTargetId != null) {
messageIndex = findMessageIndex(focusTargetId);
if (messageIndex != null) {
value5 = environment.__proto__;
defaultImport2 = importDefault(9850) /* metro dependency 9850: NativeChatUtils */;
defaultImport2.focus(chatRef.current, messageIndex);
}
}
} else if (shouldJumpToOriginalPost(hasJumpedToOriginalPost)) {
if (focusTargetId != null) {
messageIndex = findMessageIndex(focusTargetId);
if (messageIndex != null) {
value5 = environment.__proto__;
defaultImport2 = importDefault(9850) /* metro dependency 9850: NativeChatUtils */;
defaultImport2.focus(chatRef.current, messageIndex);
}
}
} else {
scrollToMessageId({scrollToMessageId: scrollToMessageId2, jumpTargetId: jumpTargetId,
jumpType: r19,
scrollPosition: MIDDLE, minimizeScrolling: minimizeScrolling, isRescrolling: isRescrolling,
hasJumpedToOriginalPost: hasJumpedToOriginalPost});
}
} else if (rows.length !== 0) {
if (scrollToMessageId2 == null) {
if (focusTargetId != null) {
messageIndex = findMessageIndex(focusTargetId);
if (messageIndex != null) {
value5 = environment.__proto__;
defaultImport2 = importDefault(9850) /* metro dependency 9850: NativeChatUtils */;
defaultImport2.focus(chatRef.current, messageIndex);
}
}
} else if (shouldJumpToOriginalPost(hasJumpedToOriginalPost)) {
if (focusTargetId != null) {
messageIndex = findMessageIndex(focusTargetId);
if (messageIndex != null) {
value5 = environment.__proto__;
defaultImport2 = importDefault(9850) /* metro dependency 9850: NativeChatUtils */;
defaultImport2.focus(chatRef.current, messageIndex);
}
}
} else {
scrollToMessageId({scrollToMessageId: scrollToMessageId2, jumpTargetId: jumpTargetId,
jumpType: r19,
scrollPosition: MIDDLE, minimizeScrolling: minimizeScrolling, isRescrolling: isRescrolling,
hasJumpedToOriginalPost: hasJumpedToOriginalPost});
}
} else {
value4 = environment.__proto__;
defaultImport = importDefault(9850) /* metro dependency 9850: NativeChatUtils */;
defaultImport.fadeIn(chatRef.current);
}
} else if (loadedRef.current) {
if (scrollToMessageId2 == null) {
if (focusTargetId != null) {
messageIndex = findMessageIndex(focusTargetId);
if (messageIndex != null) {
value5 = environment.__proto__;
defaultImport2 = importDefault(9850) /* metro dependency 9850: NativeChatUtils */;
defaultImport2.focus(chatRef.current, messageIndex);
}
}
} else if (shouldJumpToOriginalPost(hasJumpedToOriginalPost)) {
if (focusTargetId != null) {
messageIndex = findMessageIndex(focusTargetId);
if (messageIndex != null) {
value5 = environment.__proto__;
defaultImport2 = importDefault(9850) /* metro dependency 9850: NativeChatUtils */;
defaultImport2.focus(chatRef.current, messageIndex);
}
}
} else {
scrollToMessageId({scrollToMessageId: scrollToMessageId2, jumpTargetId: jumpTargetId, jumpType: r19,
scrollPosition: MIDDLE, minimizeScrolling: minimizeScrolling, isRescrolling: isRescrolling,
hasJumpedToOriginalPost: hasJumpedToOriginalPost});
}
} else if (rows == null) {
if (scrollToMessageId2 == null) {
if (focusTargetId != null) {
messageIndex = findMessageIndex(focusTargetId);
if (messageIndex != null) {
value5 = environment.__proto__;
defaultImport2 = importDefault(9850) /* metro dependency 9850: NativeChatUtils */;
defaultImport2.focus(chatRef.current, messageIndex);
}
}
} else if (shouldJumpToOriginalPost(hasJumpedToOriginalPost)) {
if (focusTargetId != null) {
messageIndex = findMessageIndex(focusTargetId);
if (messageIndex != null) {
value5 = environment.__proto__;
defaultImport2 = importDefault(9850) /* metro dependency 9850: NativeChatUtils */;
defaultImport2.focus(chatRef.current, messageIndex);
}
}
} else {
scrollToMessageId({scrollToMessageId: scrollToMessageId2, jumpTargetId: jumpTargetId, jumpType: r19,
scrollPosition: MIDDLE, minimizeScrolling: minimizeScrolling, isRescrolling: isRescrolling,
hasJumpedToOriginalPost: hasJumpedToOriginalPost});
}
} else if (rows.length !== 0) {
if (scrollToMessageId2 == null) {
if (focusTargetId != null) {
messageIndex = findMessageIndex(focusTargetId);
if (messageIndex != null) {
value5 = environment.__proto__;
defaultImport2 = importDefault(9850) /* metro dependency 9850: NativeChatUtils */;
defaultImport2.focus(chatRef.current, messageIndex);
}
}
} else if (shouldJumpToOriginalPost(hasJumpedToOriginalPost)) {
if (focusTargetId != null) {
messageIndex = findMessageIndex(focusTargetId);
if (messageIndex != null) {
value5 = environment.__proto__;
defaultImport2 = importDefault(9850) /* metro dependency 9850: NativeChatUtils */;
defaultImport2.focus(chatRef.current, messageIndex);
}
}
} else {
scrollToMessageId({scrollToMessageId: scrollToMessageId2, jumpTargetId: jumpTargetId, jumpType: r19,
scrollPosition: MIDDLE, minimizeScrolling: minimizeScrolling, isRescrolling: isRescrolling,
hasJumpedToOriginalPost: hasJumpedToOriginalPost});
}
} else {
value4 = environment.__proto__;
defaultImport = importDefault(9850) /* metro dependency 9850: NativeChatUtils */;
defaultImport.fadeIn(chatRef.current);
}
} else if (rows.length > 0) {
value6 = environment.__proto__;
defaultImport3 = importDefault(9849) /* metro dependency 9849: computeScrollData */;
object2 = {};
object2.rows = chatManager.getPreviousRows();
object2.scrollToMessageId = scrollToMessageId2;
object2.jumpTargetId = jumpTargetId;
r10 = overrideScrollJumpType ?? messages.jumpType;
object2.jumpType = r10;
current6 = loadedRef.current;
r10 = current6 ? shouldInitialScroll : !current6;
object2.shouldInitialScroll = r10;
object2.animated = animatedRef.current;
object2.scrollPosition = MIDDLE;
object2.focusTargetId = focusTargetId;
value8 = defaultImport3(object2);
loadedRef.current = true;
updateNativeRowsBinding = updateNativeRows;
object2 = {rows: rows};
object2.hasMoreMessagesAfter = messages.hasMoreAfter;
object2.isLoadingAtTop = isLoadingAtTop(rows, hasMoreMessagesAfterForLastUpdateRef.current);
object2.scrollData = value8;
object2.HACK_iOSForceAnimations = messagesNewlyLoaded;
object2.forceReload = forceReload;
object2.isAnimated = isAnimated;
updateNativeRowsBinding(object2);
if (!current) {
channelLatestMessageLoadingStatsManager.finish({channelId: channelId,
areMessagesCached: isMessagesCached});
}
} else if (loadedRef.current) {
chatUpdatesQueueBinding = chatUpdatesQueue;
if (chatUpdatesQueueBinding.hasUpdates()) {
chatUpdatesQueue.tryFlush();
} else if (loadedRef.current) {
if (scrollToMessageId2 == null) {
if (focusTargetId != null) {
messageIndex = findMessageIndex(focusTargetId);
if (messageIndex != null) {
value5 = environment.__proto__;
defaultImport2 = importDefault(9850) /* metro dependency 9850: NativeChatUtils */;
defaultImport2.focus(chatRef.current, messageIndex);
}
}
} else if (shouldJumpToOriginalPost(hasJumpedToOriginalPost)) {
if (focusTargetId != null) {
messageIndex = findMessageIndex(focusTargetId);
if (messageIndex != null) {
value5 = environment.__proto__;
defaultImport2 = importDefault(9850) /* metro dependency 9850: NativeChatUtils */;
defaultImport2.focus(chatRef.current, messageIndex);
}
}
} else {
scrollToMessageId({scrollToMessageId: scrollToMessageId2, jumpTargetId: jumpTargetId, jumpType: r19,
scrollPosition: MIDDLE, minimizeScrolling: minimizeScrolling, isRescrolling: isRescrolling,
hasJumpedToOriginalPost: hasJumpedToOriginalPost});
}
} else if (rows == null) {
if (scrollToMessageId2 == null) {
if (focusTargetId != null) {
messageIndex = findMessageIndex(focusTargetId);
if (messageIndex != null) {
value5 = environment.__proto__;
defaultImport2 = importDefault(9850) /* metro dependency 9850: NativeChatUtils */;
defaultImport2.focus(chatRef.current, messageIndex);
}
}
} else if (shouldJumpToOriginalPost(hasJumpedToOriginalPost)) {
if (focusTargetId != null) {
messageIndex = findMessageIndex(focusTargetId);
if (messageIndex != null) {
value5 = environment.__proto__;
defaultImport2 = importDefault(9850) /* metro dependency 9850: NativeChatUtils */;
defaultImport2.focus(chatRef.current, messageIndex);
}
}
} else {
scrollToMessageId({scrollToMessageId: scrollToMessageId2, jumpTargetId: jumpTargetId, jumpType: r19,
scrollPosition: MIDDLE, minimizeScrolling: minimizeScrolling, isRescrolling: isRescrolling,
hasJumpedToOriginalPost: hasJumpedToOriginalPost});
}
} else if (rows.length !== 0) {
if (scrollToMessageId2 == null) {
if (focusTargetId != null) {
messageIndex = findMessageIndex(focusTargetId);
if (messageIndex != null) {
value5 = environment.__proto__;
defaultImport2 = importDefault(9850) /* metro dependency 9850: NativeChatUtils */;
defaultImport2.focus(chatRef.current, messageIndex);
}
}
} else if (shouldJumpToOriginalPost(hasJumpedToOriginalPost)) {
if (focusTargetId != null) {
messageIndex = findMessageIndex(focusTargetId);
if (messageIndex != null) {
value5 = environment.__proto__;
defaultImport2 = importDefault(9850) /* metro dependency 9850: NativeChatUtils */;
defaultImport2.focus(chatRef.current, messageIndex);
}
}
} else {
scrollToMessageId({scrollToMessageId: scrollToMessageId2, jumpTargetId: jumpTargetId, jumpType: r19,
scrollPosition: MIDDLE, minimizeScrolling: minimizeScrolling, isRescrolling: isRescrolling,
hasJumpedToOriginalPost: hasJumpedToOriginalPost});
}
} else {
value4 = environment.__proto__;
defaultImport = importDefault(9850) /* metro dependency 9850: NativeChatUtils */;
defaultImport.fadeIn(chatRef.current);
}
} else if (loadedRef.current) {
if (scrollToMessageId2 == null) {
if (focusTargetId != null) {
messageIndex = findMessageIndex(focusTargetId);
if (messageIndex != null) {
value5 = environment.__proto__;
defaultImport2 = importDefault(9850) /* metro dependency 9850: NativeChatUtils */;
defaultImport2.focus(chatRef.current, messageIndex);
}
}
} else if (shouldJumpToOriginalPost(hasJumpedToOriginalPost)) {
if (focusTargetId != null) {
messageIndex = findMessageIndex(focusTargetId);
if (messageIndex != null) {
value5 = environment.__proto__;
defaultImport2 = importDefault(9850) /* metro dependency 9850: NativeChatUtils */;
defaultImport2.focus(chatRef.current, messageIndex);
}
}
} else {
scrollToMessageId({scrollToMessageId: scrollToMessageId2, jumpTargetId: jumpTargetId, jumpType: r19,
scrollPosition: MIDDLE, minimizeScrolling: minimizeScrolling, isRescrolling: isRescrolling,
hasJumpedToOriginalPost: hasJumpedToOriginalPost});
}
} else if (rows == null) {
if (scrollToMessageId2 == null) {
if (focusTargetId != null) {
messageIndex = findMessageIndex(focusTargetId);
if (messageIndex != null) {
value5 = environment.__proto__;
defaultImport2 = importDefault(9850) /* metro dependency 9850: NativeChatUtils */;
defaultImport2.focus(chatRef.current, messageIndex);
}
}
} else if (shouldJumpToOriginalPost(hasJumpedToOriginalPost)) {
if (focusTargetId != null) {
messageIndex = findMessageIndex(focusTargetId);
if (messageIndex != null) {
value5 = environment.__proto__;
defaultImport2 = importDefault(9850) /* metro dependency 9850: NativeChatUtils */;
defaultImport2.focus(chatRef.current, messageIndex);
}
}
} else {
scrollToMessageId({scrollToMessageId: scrollToMessageId2, jumpTargetId: jumpTargetId, jumpType: r19,
scrollPosition: MIDDLE, minimizeScrolling: minimizeScrolling, isRescrolling: isRescrolling,
hasJumpedToOriginalPost: hasJumpedToOriginalPost});
}
} else if (rows.length !== 0) {
if (scrollToMessageId2 == null) {
if (focusTargetId != null) {
messageIndex = findMessageIndex(focusTargetId);
if (messageIndex != null) {
value5 = environment.__proto__;
defaultImport2 = importDefault(9850) /* metro dependency 9850: NativeChatUtils */;
defaultImport2.focus(chatRef.current, messageIndex);
}
}
} else if (shouldJumpToOriginalPost(hasJumpedToOriginalPost)) {
if (focusTargetId != null) {
messageIndex = findMessageIndex(focusTargetId);
if (messageIndex != null) {
value5 = environment.__proto__;
defaultImport2 = importDefault(9850) /* metro dependency 9850: NativeChatUtils */;
defaultImport2.focus(chatRef.current, messageIndex);
}
}
} else {
scrollToMessageId({scrollToMessageId: scrollToMessageId2, jumpTargetId: jumpTargetId, jumpType: r19,
scrollPosition: MIDDLE, minimizeScrolling: minimizeScrolling, isRescrolling: isRescrolling,
hasJumpedToOriginalPost: hasJumpedToOriginalPost});
}
} else {
value4 = environment.__proto__;
defaultImport = importDefault(9850) /* metro dependency 9850: NativeChatUtils */;
defaultImport.fadeIn(chatRef.current);
}
r1 = loadedRef.current && loadedRef.current !== current;
r1 = r1 && isResourceChannel;
if (r1) {
global.setTimeout(function() {
return scrollToTopMessage();
}, 100);
}
}
return value2;
}
function _fun88179() { // fn#88179, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:11703:2081, offset: 0x01fd7a91, size: 413 bytes, params: 1, frame: 17
var object2;
var r2;
var value6;
var value7;
var value8;
const chatManagerBinding = chatManager;
const setup = chatManagerBinding.setup;
const messagesBinding = messages;
Reflect.apply(setup, chatManagerBinding, [messagesBinding]);
rowGenerator.setOptions({inlineAttachmentMedia: inlineAttachmentMedia, inlineEmbedMedia: inlineEmbedMedia,
renderEmbeds: renderEmbeds, renderReactions: renderReactions, animateEmoji: animateEmoji,
animatingStickerMessageId: animatingStickerMessageIdRef.current, constrainedWidth: containerWidth,
gifAutoPlay: gifAutoPlay, timestampHourCycle: timestampHourCycle,
renderCommunicationDisabled: renderCommunicationDisabled,
ignoreEmbedDescriptionCache: ignoreEmbedDescriptionCache, enableSwipeActions: enableSwipeActions,
shouldObscureSpoiler: shouldObscureSpoiler,
shouldDisableInteractiveComponents: shouldDisableInteractiveComponents});
const _createForOfIteratorHelperLoose_88174Binding = _createForOfIteratorHelperLoose_88174;
const defaultImport = importDefault(11518) /* metro dependency 11518: createChannelStream */;
object2 = {};
object2.channel = channel;
object2.messages = messagesBinding;
object2.uploads = uploads;
object2.oldestUnreadMessageId = oldestUnreadMessageId;
object2.replyingMessageId = replyingMessageId;
object2.currentUserId = currentUserId;
object2.canAddNewReactions = canAddNewReactions();
object2.selectedSummary = selectedSummary;
object2.chatManager = chatManagerBinding;
object2.roleStyle = roleStyle;
object2.forceRender = forceRender;
object2.updateMessageIds = updateMessageIds;
object2.isResourceChannel = isResourceChannel;
object2.unloadableContentEntryMessageIds = unloadableContentEntryMessageIds;
const value4 = _createForOfIteratorHelperLoose_88174Binding(defaultImport(object2));
const value5 = value4();
let done = value5.done;
if (!done) {
for (r2 = value5; true; r2 = value8) {
value6 = r2.value;
value7 = rowGenerator.generate(value6);
chatManager.createRow(value7);
value8 = value4();
done = value8.done;
if (done) {
break;
}
}
}
return chatManager.createChangeset();
}
function _fun88181() { // fn#88181, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:11703:2924, offset: 0x01fd7ca1, size: 245 bytes, params: 1, frame: 20
var r2;
var updateRows_88184Binding;
var binding;
var value4;
const JumpTypes = (require(4044) /* metro dependency 4044: Client */).JumpTypes;
var value5;
var value6;
var defaultImport;
const messageIndex = findMessageIndex(env0_0);
if (messageIndex != null) {
if (chatRef.current != null) {
if (env0_1) {
updateRows_88184Binding = updateRows_88184;
binding = env0_0;
value4 = environment.__proto__.__proto__;
value5 = true;
updateRows_88184Binding({scrollToMessageId: binding, jumpTargetId: binding, jumpType: env0_2,
focusTargetId: binding, overrideScrollJumpType: JumpTypes.INSTANT, isRescrolling: value5,
hasJumpedToOriginalPost: env0_3});
r2 = value5;
} else {
r2 = false;
}
if (!r2) {
value6 = environment.__proto__.__proto__;
defaultImport = importDefault(9850) /* metro dependency 9850: NativeChatUtils */;
defaultImport.scrollTo(chatRef.current, messageIndex, {animated: env0_2 === JumpTypes.ANIMATED});
}
}
}
}
function _fun88183() { // fn#88183, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:11703:3567, offset: 0x01fd7f4e, size: 87 bytes, params: 1, frame: 18
let value = environment.__proto__.__proto__;
value = importDefault(9850) /* metro dependency 9850: NativeChatUtils */;
value.scrollIntoView(chatRef.current, env0_3, {animated: env0_2, highlight: jumpTargetId === scrollToMessageId});
}
@@ -0,0 +1,414 @@
/* Metro module 11346; source: modules/messages/native/hooks/useScrollHandlers.tsx; dependencies: [31, 7729, 3, 4559, 9764, 690, 9850, 9852, 6531, 2] */
function _fun86749(global, require, importDefault, importAll, module, exports, dependencyMap) { // fn#86749, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:11532:6, offset: 0x01f9e6fc, size: 195 bytes, params: 8, frame: 19
const env0_0 = require;
const Object = global.Object;
Object.defineProperty(exports, '__esModule', {value: true});
const env0_3 = importAll(31) /* metro dependency 31 */;
let value = require(7729) /* metro dependency 7729: useChatBottomManagerUIStore */;
const env0_4 = value.updateIsAtBottom;
const env0_5 = value.updateShouldShowJumpToPresentButton;
value = importDefault(3) /* metro dependency 3: Logger */;
value = new value('useScrollHandlers');
(require(2) /* metro dependency 2 */).fileFinishedImporting('modules/messages/native/hooks/useScrollHandlers.tsx');
exports.default = useScrollHandlers;
}
function useScrollHandlers({chatRef, chatManager, chatUpdatesQueue, pendingUpdatesQueueRef, animatedRef, fetchMoreBefore, fetchMoreAfter, handleVisibleMessagesChange, applyNativeRowsUpdate, messages, channel, channelId, screenIndex, onScroll, useReducedMotion, isStaff, visibleMessagesWindowHandler}) { // fn#86750, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:11532:308, offset: 0x01f9e7bf, size: 445 bytes, params: 2, frame: 21
const binding = pendingUpdatesQueueRef;
return {hasHandledScrollRef: binding.useRef(false), isAtBottomRef: binding.useRef(false),
isNearBottomRef: binding.useRef(false), isNearTopRef: binding.useRef(false),
deceleratingRef: binding.useRef(false), draggingRef: binding.useRef(false),
firstIgnoredScrollEventTimestampRef: binding.useRef(undefined), loadMoreBefore: function() {
animatedRef.current = true;
fetchMoreBefore();
}, loadMoreAfter: function() {
animatedRef.current = true;
fetchMoreAfter();
}, scrollToTop: scrollToTop_86756, scrollToRelativeOffset: scrollToRelativeOffset_86757,
scrollToTopMessage: scrollToTopMessage_86758, updateNativeRows: updateNativeRows,
handleScrollCallbacks: handleScrollCallbacks, handleScroll: handleScroll,
handleScrollPosition: handleScrollPosition};
}
function handleScrollCallbacks({eventTimestamp, isAtBottom, isNearBottom, isNearTop, dragging, decelerating, isFirstMessageVisible}) { // fn#86753, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:11532:837, owner: useScrollHandlers.handleScrollCallbacks, offset: 0x01f9e9b2, size: 436 bytes, params: 2, frame: 26
var r10;
var r5;
var loadingMore;
var value3;
var isScreenReaderEnabled;
var defaultImport;
isNearBottom = !(isNearBottom === undefined) && isNearBottom;
isNearTop = !(isNearTop === undefined) && isNearTop;
dragging = !(dragging === undefined) && dragging;
decelerating = !(decelerating === undefined) && decelerating;
isFirstMessageVisible = !(isFirstMessageVisible === undefined) && isFirstMessageVisible;
if (channel == null) {
return false;
}
if (messages.length !== 0) {
value3 = environment.__proto__;
isScreenReaderEnabled = (require(4559) /* metro dependency 4559: useIsScreenReaderEnabledNative */).getIsScreenReaderEnabled();
loadingMore = messages.loadingMore;
if (loadingMore) {
r5 = !loadingMore;
} else {
r10 = dragging || decelerating;
r10 = !r10 ? isScreenReaderEnabled : r10;
r5 = r10;
}
r5 = r5 && pendingUpdatesQueueRef.current.length === 0;
if (env0_21.current) {
if (env0_20.current) {
if (!(env0_19.current === isAtBottom && env0_18.current)) {
defaultImport = importDefault(9764) /* metro dependency 9764: DimensionActionCreators */;
defaultImport.updateChannelDimensions(channel.id, eventTimestamp, isAtBottom ? 1 : 0, 1, 0);
env0_18.current = true;
}
} else if (isNearBottom) {
if (messages.hasMoreAfter) {
if (r5) {
loadMoreAfter_86752();
} else if (!(env0_19.current === isAtBottom && env0_18.current)) {
defaultImport = importDefault(9764) /* metro dependency 9764: DimensionActionCreators */;
defaultImport.updateChannelDimensions(channel.id, eventTimestamp, isAtBottom ? 1 : 0, 1, 0);
env0_18.current = true;
}
} else if (!(env0_19.current === isAtBottom && env0_18.current)) {
defaultImport = importDefault(9764) /* metro dependency 9764: DimensionActionCreators */;
defaultImport.updateChannelDimensions(channel.id, eventTimestamp, isAtBottom ? 1 : 0, 1, 0);
env0_18.current = true;
}
} else if (!(env0_19.current === isAtBottom && env0_18.current)) {
defaultImport = importDefault(9764) /* metro dependency 9764: DimensionActionCreators */;
defaultImport.updateChannelDimensions(channel.id, eventTimestamp, isAtBottom ? 1 : 0, 1, 0);
env0_18.current = true;
}
} else if (isNearTop) {
if (messages.hasMoreBefore) {
if (r5) {
loadMoreBefore_86751();
} else if (env0_20.current) {
if (!(env0_19.current === isAtBottom && env0_18.current)) {
defaultImport = importDefault(9764) /* metro dependency 9764: DimensionActionCreators */;
defaultImport.updateChannelDimensions(channel.id, eventTimestamp, isAtBottom ? 1 : 0, 1, 0);
env0_18.current = true;
}
} else if (isNearBottom) {
if (messages.hasMoreAfter) {
if (r5) {
loadMoreAfter_86752();
} else if (!(env0_19.current === isAtBottom && env0_18.current)) {
defaultImport = importDefault(9764) /* metro dependency 9764: DimensionActionCreators */;
defaultImport.updateChannelDimensions(channel.id, eventTimestamp, isAtBottom ? 1 : 0, 1, 0);
env0_18.current = true;
}
} else if (!(env0_19.current === isAtBottom && env0_18.current)) {
defaultImport = importDefault(9764) /* metro dependency 9764: DimensionActionCreators */;
defaultImport.updateChannelDimensions(channel.id, eventTimestamp, isAtBottom ? 1 : 0, 1, 0);
env0_18.current = true;
}
} else if (!(env0_19.current === isAtBottom && env0_18.current)) {
defaultImport = importDefault(9764) /* metro dependency 9764: DimensionActionCreators */;
defaultImport.updateChannelDimensions(channel.id, eventTimestamp, isAtBottom ? 1 : 0, 1, 0);
env0_18.current = true;
}
} else if (env0_20.current) {
if (!(env0_19.current === isAtBottom && env0_18.current)) {
defaultImport = importDefault(9764) /* metro dependency 9764: DimensionActionCreators */;
defaultImport.updateChannelDimensions(channel.id, eventTimestamp, isAtBottom ? 1 : 0, 1, 0);
env0_18.current = true;
}
} else if (isNearBottom) {
if (messages.hasMoreAfter) {
if (r5) {
loadMoreAfter_86752();
} else if (!(env0_19.current === isAtBottom && env0_18.current)) {
defaultImport = importDefault(9764) /* metro dependency 9764: DimensionActionCreators */;
defaultImport.updateChannelDimensions(channel.id, eventTimestamp, isAtBottom ? 1 : 0, 1, 0);
env0_18.current = true;
}
} else if (!(env0_19.current === isAtBottom && env0_18.current)) {
defaultImport = importDefault(9764) /* metro dependency 9764: DimensionActionCreators */;
defaultImport.updateChannelDimensions(channel.id, eventTimestamp, isAtBottom ? 1 : 0, 1, 0);
env0_18.current = true;
}
} else if (!(env0_19.current === isAtBottom && env0_18.current)) {
defaultImport = importDefault(9764) /* metro dependency 9764: DimensionActionCreators */;
defaultImport.updateChannelDimensions(channel.id, eventTimestamp, isAtBottom ? 1 : 0, 1, 0);
env0_18.current = true;
}
} else if (env0_20.current) {
if (!(env0_19.current === isAtBottom && env0_18.current)) {
defaultImport = importDefault(9764) /* metro dependency 9764: DimensionActionCreators */;
defaultImport.updateChannelDimensions(channel.id, eventTimestamp, isAtBottom ? 1 : 0, 1, 0);
env0_18.current = true;
}
} else if (isNearBottom) {
if (messages.hasMoreAfter) {
if (r5) {
loadMoreAfter_86752();
} else if (!(env0_19.current === isAtBottom && env0_18.current)) {
defaultImport = importDefault(9764) /* metro dependency 9764: DimensionActionCreators */;
defaultImport.updateChannelDimensions(channel.id, eventTimestamp, isAtBottom ? 1 : 0, 1, 0);
env0_18.current = true;
}
} else if (!(env0_19.current === isAtBottom && env0_18.current)) {
defaultImport = importDefault(9764) /* metro dependency 9764: DimensionActionCreators */;
defaultImport.updateChannelDimensions(channel.id, eventTimestamp, isAtBottom ? 1 : 0, 1, 0);
env0_18.current = true;
}
} else if (!(env0_19.current === isAtBottom && env0_18.current)) {
defaultImport = importDefault(9764) /* metro dependency 9764: DimensionActionCreators */;
defaultImport.updateChannelDimensions(channel.id, eventTimestamp, isAtBottom ? 1 : 0, 1, 0);
env0_18.current = true;
}
onScroll({isFirstMessageVisible: isFirstMessageVisible});
chatUpdatesQueue.tryFlush();
} else {
loadingMore = messages.loadingMore;
if (loadingMore) {
return false;
}
isScreenReaderEnabled = (require(4559) /* metro dependency 4559: useIsScreenReaderEnabledNative */).getIsScreenReaderEnabled();
loadingMore = messages.loadingMore;
if (loadingMore) {
r5 = !loadingMore;
} else {
r10 = dragging || decelerating;
r10 = !r10 ? isScreenReaderEnabled : r10;
r5 = r10;
}
r5 = r5 && pendingUpdatesQueueRef.current.length === 0;
if (env0_21.current) {
if (env0_20.current) {
if (!(env0_19.current === isAtBottom && env0_18.current)) {
defaultImport = importDefault(9764) /* metro dependency 9764: DimensionActionCreators */;
defaultImport.updateChannelDimensions(channel.id, eventTimestamp, isAtBottom ? 1 : 0, 1, 0);
env0_18.current = true;
}
} else if (isNearBottom) {
if (messages.hasMoreAfter) {
if (r5) {
loadMoreAfter_86752();
} else if (!(env0_19.current === isAtBottom && env0_18.current)) {
defaultImport = importDefault(9764) /* metro dependency 9764: DimensionActionCreators */;
defaultImport.updateChannelDimensions(channel.id, eventTimestamp, isAtBottom ? 1 : 0, 1, 0);
env0_18.current = true;
}
} else if (!(env0_19.current === isAtBottom && env0_18.current)) {
defaultImport = importDefault(9764) /* metro dependency 9764: DimensionActionCreators */;
defaultImport.updateChannelDimensions(channel.id, eventTimestamp, isAtBottom ? 1 : 0, 1, 0);
env0_18.current = true;
}
} else if (!(env0_19.current === isAtBottom && env0_18.current)) {
defaultImport = importDefault(9764) /* metro dependency 9764: DimensionActionCreators */;
defaultImport.updateChannelDimensions(channel.id, eventTimestamp, isAtBottom ? 1 : 0, 1, 0);
env0_18.current = true;
}
} else if (isNearTop) {
if (messages.hasMoreBefore) {
if (r5) {
loadMoreBefore_86751();
} else if (env0_20.current) {
if (!(env0_19.current === isAtBottom && env0_18.current)) {
defaultImport = importDefault(9764) /* metro dependency 9764: DimensionActionCreators */;
defaultImport.updateChannelDimensions(channel.id, eventTimestamp, isAtBottom ? 1 : 0, 1, 0);
env0_18.current = true;
}
} else if (isNearBottom) {
if (messages.hasMoreAfter) {
if (r5) {
loadMoreAfter_86752();
} else if (!(env0_19.current === isAtBottom && env0_18.current)) {
defaultImport = importDefault(9764) /* metro dependency 9764: DimensionActionCreators */;
defaultImport.updateChannelDimensions(channel.id, eventTimestamp, isAtBottom ? 1 : 0, 1, 0);
env0_18.current = true;
}
} else if (!(env0_19.current === isAtBottom && env0_18.current)) {
defaultImport = importDefault(9764) /* metro dependency 9764: DimensionActionCreators */;
defaultImport.updateChannelDimensions(channel.id, eventTimestamp, isAtBottom ? 1 : 0, 1, 0);
env0_18.current = true;
}
} else if (!(env0_19.current === isAtBottom && env0_18.current)) {
defaultImport = importDefault(9764) /* metro dependency 9764: DimensionActionCreators */;
defaultImport.updateChannelDimensions(channel.id, eventTimestamp, isAtBottom ? 1 : 0, 1, 0);
env0_18.current = true;
}
} else if (env0_20.current) {
if (!(env0_19.current === isAtBottom && env0_18.current)) {
defaultImport = importDefault(9764) /* metro dependency 9764: DimensionActionCreators */;
defaultImport.updateChannelDimensions(channel.id, eventTimestamp, isAtBottom ? 1 : 0, 1, 0);
env0_18.current = true;
}
} else if (isNearBottom) {
if (messages.hasMoreAfter) {
if (r5) {
loadMoreAfter_86752();
} else if (!(env0_19.current === isAtBottom && env0_18.current)) {
defaultImport = importDefault(9764) /* metro dependency 9764: DimensionActionCreators */;
defaultImport.updateChannelDimensions(channel.id, eventTimestamp, isAtBottom ? 1 : 0, 1, 0);
env0_18.current = true;
}
} else if (!(env0_19.current === isAtBottom && env0_18.current)) {
defaultImport = importDefault(9764) /* metro dependency 9764: DimensionActionCreators */;
defaultImport.updateChannelDimensions(channel.id, eventTimestamp, isAtBottom ? 1 : 0, 1, 0);
env0_18.current = true;
}
} else if (!(env0_19.current === isAtBottom && env0_18.current)) {
defaultImport = importDefault(9764) /* metro dependency 9764: DimensionActionCreators */;
defaultImport.updateChannelDimensions(channel.id, eventTimestamp, isAtBottom ? 1 : 0, 1, 0);
env0_18.current = true;
}
} else if (env0_20.current) {
if (!(env0_19.current === isAtBottom && env0_18.current)) {
defaultImport = importDefault(9764) /* metro dependency 9764: DimensionActionCreators */;
defaultImport.updateChannelDimensions(channel.id, eventTimestamp, isAtBottom ? 1 : 0, 1, 0);
env0_18.current = true;
}
} else if (isNearBottom) {
if (messages.hasMoreAfter) {
if (r5) {
loadMoreAfter_86752();
} else if (!(env0_19.current === isAtBottom && env0_18.current)) {
defaultImport = importDefault(9764) /* metro dependency 9764: DimensionActionCreators */;
defaultImport.updateChannelDimensions(channel.id, eventTimestamp, isAtBottom ? 1 : 0, 1, 0);
env0_18.current = true;
}
} else if (!(env0_19.current === isAtBottom && env0_18.current)) {
defaultImport = importDefault(9764) /* metro dependency 9764: DimensionActionCreators */;
defaultImport.updateChannelDimensions(channel.id, eventTimestamp, isAtBottom ? 1 : 0, 1, 0);
env0_18.current = true;
}
} else if (!(env0_19.current === isAtBottom && env0_18.current)) {
defaultImport = importDefault(9764) /* metro dependency 9764: DimensionActionCreators */;
defaultImport.updateChannelDimensions(channel.id, eventTimestamp, isAtBottom ? 1 : 0, 1, 0);
env0_18.current = true;
}
onScroll({isFirstMessageVisible: isFirstMessageVisible});
chatUpdatesQueue.tryFlush();
}
return true;
}
function handleScroll({eventTimestamp, isAtBottom, isNearBottom, isNearTop, dragging, decelerating, shouldShowJumpToPresent, isFirstMessageVisible}) { // fn#86754, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:11532:1361, owner: useScrollHandlers.handleScroll, offset: 0x01f9eb66, size: 249 bytes, params: 2, frame: 21
var environment;
var value;
isNearBottom = !(isNearBottom === undefined) && isNearBottom;
isNearTop = !(isNearTop === undefined) && isNearTop;
dragging = !(dragging === undefined) && dragging;
decelerating = !(decelerating === undefined) && decelerating;
shouldShowJumpToPresent = !(shouldShowJumpToPresent === undefined) && shouldShowJumpToPresent;
isFirstMessageVisible = !(isFirstMessageVisible === undefined) && isFirstMessageVisible;
if (handleScrollCallbacks({eventTimestamp: eventTimestamp, isAtBottom: isAtBottom, isNearBottom: isNearBottom,
isNearTop: isNearTop, dragging: dragging, decelerating: decelerating,
shouldShowJumpToPresent: shouldShowJumpToPresent, isFirstMessageVisible: isFirstMessageVisible})) {
env0_19.current = isAtBottom;
env0_20.current = isNearBottom;
env0_21.current = isNearTop;
env0_23.current = dragging;
env0_22.current = decelerating;
value = environment.__proto__;
value = require(690) /* metro dependency 690: ReactBatchUpdatesNative */;
value.batchUpdates(function() {
updateShouldShowJumpToPresentButton(channelId, screenIndex,
shouldShowJumpToPresent || messages.hasMoreAfter);
updateIsAtBottom(screenIndex, isAtBottom);
});
}
}
function useScrollHandlersScrollToTop() { // fn#86756, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:11532:2020, owner: useScrollHandlers.scrollToTop, offset: 0x01f9eca2, size: 70 bytes, params: 1, frame: 16
let value = a0;
let r4 = !(value !== undefined) || value;
value = environment.__proto__;
value = importDefault(9850) /* metro dependency 9850: NativeChatUtils */;
const scrollToTop = value.scrollToTop;
const current = chatRef.current;
r4 = r4 && !useReducedMotion;
Reflect.apply(scrollToTop, value, [current, r4]);
}
function useScrollHandlersScrollToRelativeOffset(a0) { // fn#86757, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:11532:2090, owner: useScrollHandlers.scrollToRelativeOffset, offset: 0x01f9ece8, size: 74 bytes, params: 2, frame: 17
let value = a1;
let r5 = !(value !== undefined) || value;
value = environment.__proto__;
value = importDefault(9850) /* metro dependency 9850: NativeChatUtils */;
const scrollToRelativeOffset = value.scrollToRelativeOffset;
const current = chatRef.current;
r5 = r5 && !useReducedMotion;
Reflect.apply(scrollToRelativeOffset, value, [current, a0, r5]);
}
function useScrollHandlersScrollToTopMessage() { // fn#86758, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:11532:2171, owner: useScrollHandlers.scrollToTopMessage, offset: 0x01f9ed32, size: 90 bytes, params: 1, frame: 14
var value3;
var defaultImport;
const previousRows = chatManager.getPreviousRows();
if (previousRows.length > 0) {
value3 = environment.__proto__;
defaultImport = importDefault(9850) /* metro dependency 9850: NativeChatUtils */;
defaultImport.scrollTo(chatRef.current, previousRows.length - 1);
}
}
function updateNativeRows(a0) { // fn#86759, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:11532:2271, owner: useScrollHandlers.updateNativeRows, offset: 0x01f9ed8c, size: 101 bytes, params: 2, frame: 12
if (chatUpdatesQueue.isBlocking) {
chatUpdatesQueue.add(a0);
} else if (a0.isLoadingAtTop) {
if (env0_22.current) {
chatUpdatesQueue.add(a0);
} else if (env0_23.current) {
chatUpdatesQueue.add(a0);
} else {
applyNativeRowsUpdate(a0);
}
} else {
applyNativeRowsUpdate(a0);
}
}
function useScrollHandlersHandleScrollPosition({timeStamp, nativeEvent}) { // fn#86760, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:11532:2444, owner: useScrollHandlers.handleScrollPosition, offset: 0x01f9edf1, size: 407 bytes, params: 2, frame: 32
var binding;
const isAtBottom = nativeEvent.isAtBottom;
const isNearBottom = nativeEvent.isNearBottom;
const isNearTop = nativeEvent.isNearTop;
const dragging = nativeEvent.dragging;
const decelerating = nativeEvent.decelerating;
const shouldShowJumpToPresent = nativeEvent.shouldShowJumpToPresent;
const isFirstMessageVisible = nativeEvent.isFirstMessageVisible;
const firstVisibleMessageIndex = nativeEvent.firstVisibleMessageIndex;
const firstVisibleMessagePercentVisible = nativeEvent.firstVisibleMessagePercentVisible;
const lastVisibleMessageIndex = nativeEvent.lastVisibleMessageIndex;
const changesetUpdateId = nativeEvent.changesetUpdateId;
const lastVisibleMessagePercentVisible = nativeEvent.lastVisibleMessagePercentVisible;
const changesetIdForChat = (require(9852) /* metro dependency 9852: ChatChangesetUpdateTracker */).getChangesetIdForChat(chatRef.current);
if (changesetUpdateId !== changesetIdForChat) {
if (env0_17.current == null) {
env0_17.current = timeStamp;
}
if (isStaff) {
binding = env1_6;
binding.log('STAFF-ACK-LOG: Ignoring outdated scroll event.', channelId, changesetUpdateId,
changesetIdForChat,
timeStamp);
}
} else {
var handleVisibleMessagesChangeBinding = handleVisibleMessagesChange;
var object2 = {firstVisibleMessageRowIndex: firstVisibleMessageIndex,
lastVisibleMessageRowIndex: lastVisibleMessageIndex,
firstVisibleMessagePercentVisible: firstVisibleMessagePercentVisible,
lastVisibleMessagePercentVisible: lastVisibleMessagePercentVisible};
var QuestsVisibleMessagesChangedSource = (require(6531) /* metro dependency 6531: QuestTypes */).QuestsVisibleMessagesChangedSource;
var SCROLL = QuestsVisibleMessagesChangedSource.SCROLL;
object2.source = SCROLL;
handleVisibleMessagesChangeBinding(object2);
var r17 = env0_17.current ?? timeStamp;
env0_17.current = undefined;
handleScroll({eventTimestamp: r17, isAtBottom: isAtBottom, isNearBottom: isNearBottom, isNearTop: isNearTop,
dragging: dragging, decelerating: decelerating, shouldShowJumpToPresent: shouldShowJumpToPresent,
isFirstMessageVisible: isFirstMessageVisible});
visibleMessagesWindowHandler.handleScrollPosition({rows: chatManager._rows,
firstVisibleMessageRowIndex: firstVisibleMessageIndex,
lastVisibleMessageRowIndex: lastVisibleMessageIndex});
}
}