1710 lines
79 KiB
TypeScript
1710 lines
79 KiB
TypeScript
/* Metro module 9835; source: modules/messages/native/MessagesUtils.tsx; dependencies: [57, 5, 7729, 4833, 1379, 1945, 4798, 4814, 4401, 3784, 4605, 1878, 8178, 661, 4631, 4627, 1909, 4841, 7151, 6664, 3773, 3857, 1244, 9836, 9837, 1900, 4081, 4082, 8919, 7153, 7155, 4863, 6797, 4800, 21, 3856, 9849, 14, 22, 477, 1583, 683, 9850, 7067, 6531, 4044, 9484, 9854, 2] */
|
|
function _fun77013(global, require, importDefault, importAll, module, exports, dependencyMap) { // fn#77013, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:10021:6, offset: 0x01ded2ec, size: 925 bytes, params: 8, frame: 23
|
|
const env0_0 = require;
|
|
const _arrayLikeToArray_77016 = 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 closure = getVisibleMessages;
|
|
const closure2 = recordTimings;
|
|
const closure3 = getMessage_77020;
|
|
const closure4 = maybeRescrollToMessageId;
|
|
let Object = global.Object;
|
|
Object.defineProperty(exports, '__esModule', {value: true});
|
|
const env0_3 = importDefault(57) /* metro dependency 57 */;
|
|
const env0_4 = importDefault(5) /* metro dependency 5 */;
|
|
const env0_5 = (require(7729) /* metro dependency 7729: useChatBottomManagerUIStore */).updateShouldShowJumpToPresentButton;
|
|
const referencedMessageStore = importDefault(4833) /* metro dependency 4833: ReferencedMessageStore */;
|
|
const channelStore = importDefault(1379) /* metro dependency 1379: ChannelStore */;
|
|
const guildMemberStore = importDefault(1945) /* metro dependency 1945: GuildMemberStore */;
|
|
const guildVerificationStore = importDefault(4798) /* metro dependency 4798: GuildVerificationStore */;
|
|
const messageStore = importDefault(4814) /* metro dependency 4814: MessageStore */;
|
|
const networkStore = importDefault(4401) /* metro dependency 4401: NetworkStore */;
|
|
const permissionStore = importDefault(3784) /* metro dependency 3784: PermissionStore */;
|
|
const readStateStore = importDefault(4605) /* metro dependency 4605: ReadStateStore */;
|
|
const userStore = importDefault(1878) /* metro dependency 1878: UserStore */;
|
|
let value = require(8178) /* metro dependency 8178: RowGeneratorConstants */;
|
|
const env0_15 = value.RowType;
|
|
const env0_16 = value.Changeset;
|
|
value = require(661) /* metro dependency 661: Constants */;
|
|
const env0_17 = value.AnalyticEvents;
|
|
const env0_18 = value.MessageEmbedTypes;
|
|
const env0_19 = value.MessageTypes;
|
|
const env0_20 = value.Permissions;
|
|
const env0_21 = value.MAX_MESSAGES_PER_CHANNEL;
|
|
(require(2) /* metro dependency 2 */).fileFinishedImporting('modules/messages/native/MessagesUtils.tsx');
|
|
exports.getLongPressSelectedMedia = getLongPressSelectedMedia;
|
|
exports.toObscuredMedia = toObscuredMedia;
|
|
exports.handleAddOrRemoveReaction = handleAddOrRemoveReaction;
|
|
exports.handleToggleFollowForumPost = handleToggleFollowForumPost;
|
|
exports.handleCopyLinkForumPost = handleCopyLinkForumPost;
|
|
exports.findMessageIndex = findMessageIndex;
|
|
exports.getVisibleMessages = closure;
|
|
exports.shouldJumpToOriginalPost = shouldJumpToOriginalPost;
|
|
exports.startOrCancelChannelLatestMessagesLoad = function(a0) {
|
|
if (a0.jumpTargetId != null) {
|
|
a0.tracker.cancel();
|
|
} else if (a0.oldestUnreadMessageId != null) {
|
|
a0.tracker.cancel();
|
|
} else if (a0.shouldJumpToOriginalPost) {
|
|
a0.tracker.cancel();
|
|
} else {
|
|
a0.tracker.start({channelId: a0.channelId});
|
|
}
|
|
};
|
|
exports.recordTimings = closure2;
|
|
exports.findMessageIndexInRows = findMessageIndexInRows;
|
|
exports.getMessage = closure3;
|
|
exports.isLoadingAtTop = isLoadingAtTop;
|
|
exports.handleTapTableView = handleTapTableView;
|
|
exports.handleMediaPlayFinishedAnalytics = handleMediaPlayFinishedAnalytics;
|
|
exports.scrollToBottom = scrollToBottom;
|
|
exports.scrollToTop = scrollToTop_77044;
|
|
exports.scrollToRelativeOffset = scrollToRelativeOffset;
|
|
exports.scrollToTopMessage = scrollToTopMessage;
|
|
exports.canAddNewReactions = canAddNewReactions;
|
|
exports.loadMoreBefore = loadMoreBefore;
|
|
exports.loadMoreAfter = loadMoreAfter;
|
|
exports.clearRows = clearRows;
|
|
exports.handleFirstLayout = function(a0, a1, a2, a3, a4) {
|
|
var object = {firstVisibleMessageRowIndex: a1, lastVisibleMessageRowIndex: a2,
|
|
firstVisibleMessagePercentVisible: a3, lastVisibleMessagePercentVisible: a4};
|
|
object.source = require(dependencyMap[44]).QuestsVisibleMessagesChangedSource.FIRST_LAYOUT;
|
|
a0(object);
|
|
};
|
|
exports.handleMessageVisibilityChanged = function(a0, a1, a2, a3, a4) {
|
|
var object = {firstVisibleMessageRowIndex: a1, lastVisibleMessageRowIndex: a2,
|
|
firstVisibleMessagePercentVisible: a3, lastVisibleMessagePercentVisible: a4};
|
|
object.source = require(dependencyMap[44]).QuestsVisibleMessagesChangedSource.VISIBILITY_CHANGED;
|
|
a0(object);
|
|
};
|
|
exports.handleLongPressSticker = function(a0, a1, a2) {
|
|
var value = a0;
|
|
var Set = global.Set;
|
|
var value3 = new Set([value]);
|
|
var value5 = null;
|
|
if (value5 != a1) {
|
|
value3.add(a1);
|
|
}
|
|
var r0 = a1 === value ? value5 : value;
|
|
a2({forceRender: true, updateMessageIds: value3});
|
|
return r0;
|
|
};
|
|
exports.handleTapNavBar = function() {
|
|
return _handleTapNavBar.apply(this, arguments);
|
|
};
|
|
exports.jumpToPresent = jumpToPresent_77055;
|
|
exports.scrollToNewMessages = scrollToNewMessages;
|
|
exports.syncMessageDisplay = syncMessageDisplay;
|
|
exports.getChatRef = function(a0) {
|
|
return a0;
|
|
};
|
|
exports.maybeRescrollToMessageId = closure4;
|
|
exports.scrollToMessageIdWithRescroll = scrollToMessageIdWithRescroll;
|
|
exports.handleVisibleMessagesChange = handleVisibleMessagesChange;
|
|
exports.getVoiceStateChannelSummaryFromVoiceStates = function(a0) {
|
|
var Object = global.Object;
|
|
var value = Object.entries(a0);
|
|
value = value.filter(_fun77064);
|
|
value = value.map(_fun77065);
|
|
value = value.sort();
|
|
return value.join('|');
|
|
};
|
|
exports.getVoiceChannelIdChangedAuthorIds = getVoiceChannelIdChangedAuthorIds;
|
|
}
|
|
|
|
function _createForOfIteratorHelperLoose_77014(a0, a1) { // fn#77014, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:10021:412, offset: 0x01ded689, 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 _fun77015;
|
|
}
|
|
value = undefined;
|
|
if (a0) {
|
|
if (typeof a0 === 'string') {
|
|
value = _arrayLikeToArray_77016(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_77016(a0, value);
|
|
r6 = value;
|
|
} else {
|
|
regexp = RegExp('^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$', '');
|
|
if (regexp.test(r9)) {
|
|
value = _arrayLikeToArray_77016(a0, value);
|
|
r6 = value;
|
|
} else {
|
|
r6 = value;
|
|
}
|
|
}
|
|
r5 = r6;
|
|
}
|
|
} else {
|
|
r5 = value;
|
|
}
|
|
if (r5) {
|
|
if (r5) {
|
|
}
|
|
return _fun77015;
|
|
}
|
|
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 getVisibleMessages({firstVisibleMessageRowIndex, lastVisibleMessageRowIndex, firstVisibleMessagePercentVisible, lastVisibleMessagePercentVisible, chatManager, channelId}) { // fn#77017, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:10021:1322, offset: 0x01ded7fd, size: 350 bytes, params: 2, frame: 33
|
|
var r4;
|
|
var id;
|
|
var r21;
|
|
var r19;
|
|
var _rows;
|
|
var _messages;
|
|
var items2;
|
|
var value;
|
|
var value2;
|
|
var value3;
|
|
var property;
|
|
var type;
|
|
var MESSAGE;
|
|
var message;
|
|
var value4;
|
|
var value5;
|
|
var getMessage;
|
|
var value6;
|
|
var push;
|
|
var state;
|
|
var value7;
|
|
if (firstVisibleMessageRowIndex != null) {
|
|
reducibleJoin21: while (true) {
|
|
if (lastVisibleMessageRowIndex == null) {
|
|
break reducibleJoin21;
|
|
}
|
|
if (firstVisibleMessageRowIndex < 0) {
|
|
break reducibleJoin21;
|
|
}
|
|
if (lastVisibleMessageRowIndex < 0) {
|
|
break reducibleJoin21;
|
|
}
|
|
_rows = chatManager._rows;
|
|
if (_rows == null) {
|
|
break reducibleJoin21;
|
|
}
|
|
_messages = chatManager._messages;
|
|
if (_messages != null) {
|
|
items2 = [];
|
|
value = environment;
|
|
value2 = 1;
|
|
value3 = undefined;
|
|
if (firstVisibleMessageRowIndex >= lastVisibleMessageRowIndex) {
|
|
r4 = firstVisibleMessageRowIndex;
|
|
reducibleLoop7: while (true) {
|
|
_rows = chatManager._rows;
|
|
property = _rows[r4];
|
|
reducibleJoin19: while (true) {
|
|
if (property == null) {
|
|
break reducibleJoin19;
|
|
}
|
|
type = property.type;
|
|
MESSAGE = RowType.MESSAGE;
|
|
if (type !== MESSAGE) {
|
|
break reducibleJoin19;
|
|
}
|
|
message = property.message;
|
|
reducibleJoin11: while (true) {
|
|
if (message == null) {
|
|
id = value3;
|
|
break reducibleJoin11;
|
|
}
|
|
id = message.id;
|
|
break reducibleJoin11;
|
|
}
|
|
if (id == null) {
|
|
break reducibleJoin19;
|
|
}
|
|
reducibleJoin17: while (true) {
|
|
reducibleJoin16: while (true) {
|
|
if (r4 !== firstVisibleMessageRowIndex) {
|
|
value4 = r4 === lastVisibleMessageRowIndex;
|
|
if (value4) {
|
|
value5 = lastVisibleMessagePercentVisible != null;
|
|
r21 = value5;
|
|
break reducibleJoin16;
|
|
}
|
|
r21 = value4;
|
|
break reducibleJoin16;
|
|
}
|
|
if (firstVisibleMessagePercentVisible != null) {
|
|
r19 = firstVisibleMessagePercentVisible;
|
|
break reducibleJoin17;
|
|
}
|
|
value4 = r4 === lastVisibleMessageRowIndex;
|
|
if (value4) {
|
|
value5 = lastVisibleMessagePercentVisible != null;
|
|
r21 = value5;
|
|
break reducibleJoin16;
|
|
}
|
|
r21 = value4;
|
|
break reducibleJoin16;
|
|
}
|
|
if (r21) {
|
|
r19 = lastVisibleMessagePercentVisible;
|
|
break reducibleJoin17;
|
|
}
|
|
r19 = value2;
|
|
break reducibleJoin17;
|
|
}
|
|
message = property.message;
|
|
id = message.id;
|
|
getMessage = MessageStore.getMessage;
|
|
value6 = Reflect.apply(getMessage, MessageStore, [channelId, id]);
|
|
if (value6 == null) {
|
|
break reducibleJoin19;
|
|
}
|
|
push = items2.push;
|
|
state = value6.state;
|
|
Reflect.apply(push, items2, [{message: value6, percentVisible: r19, state: state}]);
|
|
break reducibleJoin19;
|
|
}
|
|
value7 = typeof r4 === 'bigint' ? r4 - 1n : +r4 - 1;
|
|
if (value7 >= lastVisibleMessageRowIndex) {
|
|
r4 = value7;
|
|
continue reducibleLoop7;
|
|
}
|
|
break reducibleLoop7;
|
|
}
|
|
}
|
|
return items2;
|
|
}
|
|
break reducibleJoin21;
|
|
}
|
|
}
|
|
return [];
|
|
}
|
|
|
|
function recordTimings(a0, a1) { // fn#77018, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:10021:1859, offset: 0x01ded95b, size: 107 bytes, params: 3, frame: 19
|
|
const value = importDefault(14) /* metro dependency 14: TTITracker */;
|
|
value.recordMessageRender(a0, a1.map(function(a0) {
|
|
return a0.id;
|
|
}), a1.hasFetched || a1.ready && !a1.cached, a1.hasMoreAfter);
|
|
}
|
|
|
|
function getMessage_77020(a0, a1) { // fn#77020, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:10021:1984, offset: 0x01ded9c6, size: 68 bytes, params: 3, frame: 14
|
|
const env0_0 = a1;
|
|
const value = importDefault(22) /* metro dependency 22 */;
|
|
return value.find(a0.toArray(), _fun77021);
|
|
}
|
|
|
|
function _handleTapNavBar() { // fn#77022, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:10021:2076, offset: 0x01deda0a, size: 50 bytes, params: 1, frame: 14
|
|
return env0_4(_fun77024).apply(this, arguments);
|
|
}
|
|
|
|
function maybeRescrollToMessageId(a0, {chatRef, findMessageIndex, updateRows, updateRowsEnabled, jumpType}) { // fn#77027, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:10021:2645, offset: 0x01dedbd2, size: 145 bytes, params: 3, frame: 16
|
|
var INSTANT;
|
|
const env0_0 = a0;
|
|
const env0_4 = updateRowsEnabled !== undefined && updateRowsEnabled;
|
|
if (jumpType === undefined) {
|
|
INSTANT = (require(4044) /* metro dependency 4044: Client */).JumpTypes.INSTANT;
|
|
}
|
|
if (a0 != null) {
|
|
global.setTimeout(_fun77028, 50);
|
|
}
|
|
}
|
|
|
|
function parseVoiceStateChannelIdSummary(a0) { // fn#77029, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:10021:3135, offset: 0x01dedd4c, size: 183 bytes, params: 2, frame: 25
|
|
var r2;
|
|
var r1;
|
|
var value7;
|
|
var value8;
|
|
var value9;
|
|
var property;
|
|
var property2;
|
|
var set;
|
|
var value10;
|
|
const Map = global.Map;
|
|
const map = new Map();
|
|
if (a0 != null) {
|
|
var value2 = '';
|
|
if (value2 === a0) {
|
|
return map;
|
|
}
|
|
var value5 = _createForOfIteratorHelperLoose_77014(a0.split('|'));
|
|
var value6 = value5();
|
|
var done = value6.done;
|
|
if (!done) {
|
|
r2 = value6;
|
|
while (true) {
|
|
value7 = r2.value;
|
|
value8 = value7.split(':');
|
|
value9 = env0_3(value8, 2);
|
|
property = value9[0];
|
|
property2 = value9[1];
|
|
if (property != null) {
|
|
set = map.set;
|
|
if (property2 != null) {
|
|
r1 = property2;
|
|
continue;
|
|
}
|
|
r1 = value2;
|
|
continue;
|
|
Reflect.apply(set, map, [property, r1]);
|
|
}
|
|
value10 = value5();
|
|
done = value10.done;
|
|
if (done) {
|
|
break;
|
|
}
|
|
r2 = value10;
|
|
continue;
|
|
}
|
|
}
|
|
}
|
|
return map;
|
|
}
|
|
|
|
function getLongPressSelectedMedia(a0, a1, a2, a3, a4) { // fn#77030, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:10021:3489, offset: 0x01dede03, size: 954 bytes, params: 6, frame: 24
|
|
var url;
|
|
var r9;
|
|
var r0;
|
|
var r3;
|
|
var r6;
|
|
var r5;
|
|
var property;
|
|
var media;
|
|
var object2;
|
|
var closure;
|
|
var video;
|
|
var image;
|
|
var contentMessage;
|
|
var value6;
|
|
var moduleValue;
|
|
var moduleValue2;
|
|
var moduleValue3;
|
|
var content_type;
|
|
let value = a0;
|
|
let type = value.type;
|
|
const THREAD_STARTER_MESSAGE = MessageTypes.THREAD_STARTER_MESSAGE;
|
|
const r1 = type !== THREAD_STARTER_MESSAGE || value.messageReference == null ? value : ReferencedMessageStore.getMessageByReference(value.messageReference).message ?? value;
|
|
if (a2 === 'attachment') {
|
|
property = r1.attachments[a1];
|
|
value = null;
|
|
if (value != property) {
|
|
r3 = property;
|
|
} else {
|
|
contentMessage = r1.getContentMessage();
|
|
r3 = value == contentMessage ? undefined : contentMessage.attachments[a1];
|
|
}
|
|
if (value == r3) {
|
|
r0 = value;
|
|
} else {
|
|
object2 = {sourceType: 'attachment', source: r3};
|
|
value6 = undefined;
|
|
moduleValue = require(4631) /* metro dependency 4631: MediaFormatTesters */;
|
|
if (moduleValue.isVideoFile(r3.filename)) {
|
|
r5 = 'video';
|
|
} else {
|
|
moduleValue2 = require(4631) /* metro dependency 4631: MediaFormatTesters */;
|
|
if (moduleValue2.isAudioFile(r3.filename)) {
|
|
r6 = 'audio';
|
|
} else {
|
|
moduleValue3 = require(4631) /* metro dependency 4631: MediaFormatTesters */;
|
|
r6 = moduleValue3.isImageFile(r3.filename) ? 'image' : 'file';
|
|
}
|
|
r5 = r6;
|
|
}
|
|
object2.mediaType = r5;
|
|
object2.mediaUrl = r3.url;
|
|
content_type = r3.content_type;
|
|
object2.contentType = value != content_type ? content_type : value6;
|
|
r0 = object2;
|
|
}
|
|
return r0;
|
|
}
|
|
if (a2 === 'embed') {
|
|
property = r1.embeds[a1];
|
|
if (property == null) {
|
|
return null;
|
|
}
|
|
closure = getLongPressSelectedMediaGetEmbedMedia;
|
|
type = property.type;
|
|
if (type !== MessageEmbedTypes.IMAGE) {
|
|
type = property.type;
|
|
if (type !== MessageEmbedTypes.GIFV) {
|
|
if (property.type !== MessageEmbedTypes.RICH) {
|
|
return null;
|
|
}
|
|
image = property.image;
|
|
value = undefined;
|
|
url = image == null ? value : image.url;
|
|
if (url != null) {
|
|
image = property.image;
|
|
url = image.url;
|
|
image = property.image;
|
|
return closure('image', url, image.contentType);
|
|
}
|
|
video = property.video;
|
|
url = video == null ? value : video.url;
|
|
if (url != null) {
|
|
video = property.video;
|
|
url = video.url;
|
|
video = property.video;
|
|
return closure('video', url, video.contentType);
|
|
}
|
|
return null;
|
|
}
|
|
video = property.video;
|
|
value = undefined;
|
|
url = video == null ? value : video.url;
|
|
if (url != null) {
|
|
video = property.video;
|
|
r9 = video.proxyURL == null ? property.video.url : property.video.proxyURL !== '' ? property.video.proxyURL : property.video.url;
|
|
video = property.video;
|
|
return closure('video', r9, video.contentType);
|
|
}
|
|
type = property.type;
|
|
if (type !== MessageEmbedTypes.RICH) {
|
|
return null;
|
|
}
|
|
image = property.image;
|
|
value = undefined;
|
|
url = image == null ? value : image.url;
|
|
if (url != null) {
|
|
image = property.image;
|
|
url = image.url;
|
|
image = property.image;
|
|
return closure('image', url, image.contentType);
|
|
}
|
|
video = property.video;
|
|
url = video == null ? value : video.url;
|
|
if (url != null) {
|
|
video = property.video;
|
|
url = video.url;
|
|
video = property.video;
|
|
return closure('video', url, video.contentType);
|
|
}
|
|
return null;
|
|
}
|
|
url = property.url;
|
|
if (url != null) {
|
|
return closure('image', property.url);
|
|
}
|
|
type = property.type;
|
|
if (type !== MessageEmbedTypes.GIFV) {
|
|
if (property.type !== MessageEmbedTypes.RICH) {
|
|
return null;
|
|
}
|
|
image = property.image;
|
|
value = undefined;
|
|
url = image == null ? value : image.url;
|
|
if (url != null) {
|
|
image = property.image;
|
|
url = image.url;
|
|
image = property.image;
|
|
return closure('image', url, image.contentType);
|
|
}
|
|
video = property.video;
|
|
url = video == null ? value : video.url;
|
|
if (url != null) {
|
|
video = property.video;
|
|
url = video.url;
|
|
video = property.video;
|
|
return closure('video', url, video.contentType);
|
|
}
|
|
return null;
|
|
}
|
|
video = property.video;
|
|
value = undefined;
|
|
url = video == null ? value : video.url;
|
|
if (url != null) {
|
|
video = property.video;
|
|
r9 = video.proxyURL == null ? property.video.url : property.video.proxyURL !== '' ? property.video.proxyURL : property.video.url;
|
|
video = property.video;
|
|
return closure('video', r9, video.contentType);
|
|
}
|
|
type = property.type;
|
|
if (type !== MessageEmbedTypes.RICH) {
|
|
return null;
|
|
}
|
|
image = property.image;
|
|
value = undefined;
|
|
url = image == null ? value : image.url;
|
|
if (url != null) {
|
|
image = property.image;
|
|
url = image.url;
|
|
image = property.image;
|
|
return closure('image', url, image.contentType);
|
|
}
|
|
video = property.video;
|
|
url = video == null ? value : video.url;
|
|
if (url != null) {
|
|
video = property.video;
|
|
url = video.url;
|
|
video = property.video;
|
|
return closure('video', url, video.contentType);
|
|
}
|
|
} else if (a2 === 'component') {
|
|
if (a3 == null) {
|
|
return null;
|
|
}
|
|
value = require(4627) /* metro dependency 4627: InteractionComponentUtils */;
|
|
value = value.flattenComponents(r1.components);
|
|
value = value.get(a3);
|
|
if (value == null) {
|
|
return null;
|
|
}
|
|
if (value.type === (require(1909) /* metro dependency 1909: Server */).ComponentType.MEDIA_GALLERY) {
|
|
if (a4 == null) {
|
|
return null;
|
|
}
|
|
property = value.items[a4];
|
|
if (property == null) {
|
|
return null;
|
|
}
|
|
media = property.media;
|
|
object2 = {sourceType: 'component', source: value};
|
|
value = require(4631) /* metro dependency 4631: MediaFormatTesters */;
|
|
value = value.isVideoContentType(media.contentType);
|
|
object2.mediaType = value ? 'video' : 'image';
|
|
object2.mediaUrl = media.url;
|
|
return object2;
|
|
}
|
|
return null;
|
|
}
|
|
return null;
|
|
}
|
|
|
|
function toObscuredMedia(a0) { // fn#77032, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:10021:5130, offset: 0x01dee1ed, size: 149 bytes, params: 2, frame: 14
|
|
const ObscuredMediaTypes = (require(4841) /* metro dependency 4841: ExplicitMediaRedactionModels */).ObscuredMediaTypes;
|
|
return a0.sourceType === 'attachment' ? {type: ObscuredMediaTypes.Attachment,
|
|
media: a0.source} : a0.sourceType !== 'embed' ? null : {type: ObscuredMediaTypes.Embed, media: a0.source};
|
|
}
|
|
|
|
function handleAddOrRemoveReaction(a0, a1, a2) { // fn#77033, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:10021:5369, offset: 0x01dee282, size: 910 bytes, params: 4, frame: 28
|
|
var r12;
|
|
var object2;
|
|
var moduleValue2;
|
|
var open;
|
|
var isForumPost2;
|
|
var intl;
|
|
var string;
|
|
var t;
|
|
let value = a3;
|
|
const value2 = a4;
|
|
const value3 = undefined;
|
|
const r7 = value !== value3 ? value : false;
|
|
const r5 = value2 !== value3 ? value2 : (require(7151) /* metro dependency 7151: ReactionActionCreators */).ReactionLocations.MESSAGE;
|
|
value = a1.getGuildId();
|
|
const currentUser = UserStore.getCurrentUser();
|
|
const value6 = null;
|
|
const id = value6 == currentUser ? value3 : currentUser.id;
|
|
const r10 = value6 != value && GuildVerificationStore.canChatInGuild(value);
|
|
const r2 = value6 != value && (require(6664) /* metro dependency 6664: useShowMemberVerificationGate */).shouldShowMembershipVerificationGate(value);
|
|
if (value6 != value) {
|
|
if (value6 != id) {
|
|
value = GuildMemberStore.getMember(value, id);
|
|
r12 = value;
|
|
} else {
|
|
r12 = value6;
|
|
}
|
|
} else {
|
|
r12 = value6;
|
|
}
|
|
value = require(3773) /* metro dependency 3773: CommunicationDisabledUtils */;
|
|
value = value.isMemberCommunicationDisabled(r12);
|
|
if (a1.isArchivedLockedThread()) {
|
|
value = importDefault(3857) /* metro dependency 3857: ToastActionCreators */;
|
|
open = value.open;
|
|
object2 = {key: 'ARCHIVED_POST_REACTIONS_DISABLED_TOAST'};
|
|
isForumPost2 = a1.isForumPost();
|
|
intl = (require(1244) /* metro dependency 1244: indexNative */).intl;
|
|
string = intl.string;
|
|
t = (require(1244) /* metro dependency 1244: indexNative */).t;
|
|
object2.content = isForumPost2 ? Reflect.apply(string, intl, [t.EJQrFq]) : Reflect.apply(string, intl,
|
|
[t.X2L3Oa]);
|
|
object2.icon = importDefault(9836) /* metro dependency 9836 */;
|
|
Reflect.apply(open, value, [object2]);
|
|
} else {
|
|
if (value6 != a2) {
|
|
if (r7) {
|
|
if (!a2.me_burst !== true) {
|
|
if (a2.me === true) {
|
|
value = require(4081) /* metro dependency 4081: HapticUtilsNative */;
|
|
value.triggerHapticFeedback((importDefault(4082) /* metro dependency 4082: HapticFeedbackTypes */).IMPACT_LIGHT);
|
|
value = require(7151) /* metro dependency 7151: ReactionActionCreators */;
|
|
value.removeReaction({channelId: a1.id, messageId: a0, emoji: a2.emoji, location: r5,
|
|
options: {burst: r7}});
|
|
return value3;
|
|
}
|
|
if (r7) {
|
|
if (a2.me_burst === true) {
|
|
value = require(4081) /* metro dependency 4081: HapticUtilsNative */;
|
|
value.triggerHapticFeedback((importDefault(4082) /* metro dependency 4082: HapticFeedbackTypes */).IMPACT_LIGHT);
|
|
value = require(7151) /* metro dependency 7151: ReactionActionCreators */;
|
|
value.removeReaction({channelId: a1.id, messageId: a0, emoji: a2.emoji, location: r5,
|
|
options: {burst: r7}});
|
|
return value3;
|
|
}
|
|
if (r2) {
|
|
if (r2) {
|
|
value = a1.getGuildId();
|
|
if (value6 == value) {
|
|
return value3;
|
|
}
|
|
return (require(8919) /* metro dependency 8919: MemberVerificationModalActionCreators */).openMemberVerificationModal(value);
|
|
}
|
|
return value3;
|
|
}
|
|
if (a1.isPrivate()) {
|
|
if (value) {
|
|
if (r2) {
|
|
value = a1.getGuildId();
|
|
if (value6 == value) {
|
|
return value3;
|
|
}
|
|
return (require(8919) /* metro dependency 8919: MemberVerificationModalActionCreators */).openMemberVerificationModal(value);
|
|
}
|
|
return value3;
|
|
}
|
|
value = require(7151) /* metro dependency 7151: ReactionActionCreators */;
|
|
value.addReaction(a1.id, a0, a2.emoji, r5, {burst: r7});
|
|
if (!r7) {
|
|
value = require(4081) /* metro dependency 4081: HapticUtilsNative */;
|
|
value.triggerHapticFeedback((importDefault(4082) /* metro dependency 4082: HapticFeedbackTypes */).IMPACT_LIGHT);
|
|
}
|
|
return value3;
|
|
}
|
|
if (r10) {
|
|
if (value) {
|
|
if (r2) {
|
|
value = a1.getGuildId();
|
|
if (value6 == value) {
|
|
return value3;
|
|
}
|
|
return (require(8919) /* metro dependency 8919: MemberVerificationModalActionCreators */).openMemberVerificationModal(value);
|
|
}
|
|
return value3;
|
|
}
|
|
value = require(7151) /* metro dependency 7151: ReactionActionCreators */;
|
|
value.addReaction(a1.id, a0, a2.emoji, r5, {burst: r7});
|
|
if (!r7) {
|
|
value = require(4081) /* metro dependency 4081: HapticUtilsNative */;
|
|
value.triggerHapticFeedback((importDefault(4082) /* metro dependency 4082: HapticFeedbackTypes */).IMPACT_LIGHT);
|
|
}
|
|
return value3;
|
|
}
|
|
if (r2) {
|
|
value = a1.getGuildId();
|
|
if (value6 == value) {
|
|
return value3;
|
|
}
|
|
return (require(8919) /* metro dependency 8919: MemberVerificationModalActionCreators */).openMemberVerificationModal(value);
|
|
}
|
|
return value3;
|
|
}
|
|
if (r2) {
|
|
if (r2) {
|
|
value = a1.getGuildId();
|
|
if (value6 == value) {
|
|
return value3;
|
|
}
|
|
return (require(8919) /* metro dependency 8919: MemberVerificationModalActionCreators */).openMemberVerificationModal(value);
|
|
}
|
|
return value3;
|
|
}
|
|
if (a1.isPrivate()) {
|
|
if (value) {
|
|
if (r2) {
|
|
value = a1.getGuildId();
|
|
if (value6 == value) {
|
|
return value3;
|
|
}
|
|
return (require(8919) /* metro dependency 8919: MemberVerificationModalActionCreators */).openMemberVerificationModal(value);
|
|
}
|
|
return value3;
|
|
}
|
|
value = require(7151) /* metro dependency 7151: ReactionActionCreators */;
|
|
value.addReaction(a1.id, a0, a2.emoji, r5, {burst: r7});
|
|
if (!r7) {
|
|
value = require(4081) /* metro dependency 4081: HapticUtilsNative */;
|
|
value.triggerHapticFeedback((importDefault(4082) /* metro dependency 4082: HapticFeedbackTypes */).IMPACT_LIGHT);
|
|
}
|
|
return value3;
|
|
}
|
|
if (r10) {
|
|
if (value) {
|
|
if (r2) {
|
|
value = a1.getGuildId();
|
|
if (value6 == value) {
|
|
return value3;
|
|
}
|
|
return (require(8919) /* metro dependency 8919: MemberVerificationModalActionCreators */).openMemberVerificationModal(value);
|
|
}
|
|
return value3;
|
|
}
|
|
value = require(7151) /* metro dependency 7151: ReactionActionCreators */;
|
|
value.addReaction(a1.id, a0, a2.emoji, r5, {burst: r7});
|
|
if (!r7) {
|
|
value = require(4081) /* metro dependency 4081: HapticUtilsNative */;
|
|
value.triggerHapticFeedback((importDefault(4082) /* metro dependency 4082: HapticFeedbackTypes */).IMPACT_LIGHT);
|
|
}
|
|
return value3;
|
|
}
|
|
if (r2) {
|
|
value = a1.getGuildId();
|
|
if (value6 == value) {
|
|
return value3;
|
|
}
|
|
return (require(8919) /* metro dependency 8919: MemberVerificationModalActionCreators */).openMemberVerificationModal(value);
|
|
}
|
|
return value3;
|
|
}
|
|
moduleValue2 = require(1900) /* metro dependency 1900: PremiumTypeUtils */;
|
|
if (moduleValue2.isPremium(currentUser)) {
|
|
if (a2.me === true) {
|
|
value = require(4081) /* metro dependency 4081: HapticUtilsNative */;
|
|
value.triggerHapticFeedback((importDefault(4082) /* metro dependency 4082: HapticFeedbackTypes */).IMPACT_LIGHT);
|
|
value = require(7151) /* metro dependency 7151: ReactionActionCreators */;
|
|
value.removeReaction({channelId: a1.id, messageId: a0, emoji: a2.emoji, location: r5,
|
|
options: {burst: r7}});
|
|
return value3;
|
|
}
|
|
if (r7) {
|
|
if (a2.me_burst === true) {
|
|
value = require(4081) /* metro dependency 4081: HapticUtilsNative */;
|
|
value.triggerHapticFeedback((importDefault(4082) /* metro dependency 4082: HapticFeedbackTypes */).IMPACT_LIGHT);
|
|
value = require(7151) /* metro dependency 7151: ReactionActionCreators */;
|
|
value.removeReaction({channelId: a1.id, messageId: a0, emoji: a2.emoji, location: r5,
|
|
options: {burst: r7}});
|
|
return value3;
|
|
}
|
|
if (r2) {
|
|
if (r2) {
|
|
value = a1.getGuildId();
|
|
if (value6 == value) {
|
|
return value3;
|
|
}
|
|
return (require(8919) /* metro dependency 8919: MemberVerificationModalActionCreators */).openMemberVerificationModal(value);
|
|
}
|
|
return value3;
|
|
}
|
|
if (a1.isPrivate()) {
|
|
if (value) {
|
|
if (r2) {
|
|
value = a1.getGuildId();
|
|
if (value6 == value) {
|
|
return value3;
|
|
}
|
|
return (require(8919) /* metro dependency 8919: MemberVerificationModalActionCreators */).openMemberVerificationModal(value);
|
|
}
|
|
return value3;
|
|
}
|
|
value = require(7151) /* metro dependency 7151: ReactionActionCreators */;
|
|
value.addReaction(a1.id, a0, a2.emoji, r5, {burst: r7});
|
|
if (!r7) {
|
|
value = require(4081) /* metro dependency 4081: HapticUtilsNative */;
|
|
value.triggerHapticFeedback((importDefault(4082) /* metro dependency 4082: HapticFeedbackTypes */).IMPACT_LIGHT);
|
|
}
|
|
return value3;
|
|
}
|
|
if (r10) {
|
|
if (value) {
|
|
if (r2) {
|
|
value = a1.getGuildId();
|
|
if (value6 == value) {
|
|
return value3;
|
|
}
|
|
return (require(8919) /* metro dependency 8919: MemberVerificationModalActionCreators */).openMemberVerificationModal(value);
|
|
}
|
|
return value3;
|
|
}
|
|
value = require(7151) /* metro dependency 7151: ReactionActionCreators */;
|
|
value.addReaction(a1.id, a0, a2.emoji, r5, {burst: r7});
|
|
if (!r7) {
|
|
value = require(4081) /* metro dependency 4081: HapticUtilsNative */;
|
|
value.triggerHapticFeedback((importDefault(4082) /* metro dependency 4082: HapticFeedbackTypes */).IMPACT_LIGHT);
|
|
}
|
|
return value3;
|
|
}
|
|
if (r2) {
|
|
value = a1.getGuildId();
|
|
if (value6 == value) {
|
|
return value3;
|
|
}
|
|
return (require(8919) /* metro dependency 8919: MemberVerificationModalActionCreators */).openMemberVerificationModal(value);
|
|
}
|
|
return value3;
|
|
}
|
|
if (r2) {
|
|
if (r2) {
|
|
value = a1.getGuildId();
|
|
if (value6 == value) {
|
|
return value3;
|
|
}
|
|
return (require(8919) /* metro dependency 8919: MemberVerificationModalActionCreators */).openMemberVerificationModal(value);
|
|
}
|
|
return value3;
|
|
}
|
|
if (a1.isPrivate()) {
|
|
if (value) {
|
|
if (r2) {
|
|
value = a1.getGuildId();
|
|
if (value6 == value) {
|
|
return value3;
|
|
}
|
|
return (require(8919) /* metro dependency 8919: MemberVerificationModalActionCreators */).openMemberVerificationModal(value);
|
|
}
|
|
return value3;
|
|
}
|
|
value = require(7151) /* metro dependency 7151: ReactionActionCreators */;
|
|
value.addReaction(a1.id, a0, a2.emoji, r5, {burst: r7});
|
|
if (!r7) {
|
|
value = require(4081) /* metro dependency 4081: HapticUtilsNative */;
|
|
value.triggerHapticFeedback((importDefault(4082) /* metro dependency 4082: HapticFeedbackTypes */).IMPACT_LIGHT);
|
|
}
|
|
return value3;
|
|
}
|
|
if (r10) {
|
|
if (value) {
|
|
if (r2) {
|
|
value = a1.getGuildId();
|
|
if (value6 == value) {
|
|
return value3;
|
|
}
|
|
return (require(8919) /* metro dependency 8919: MemberVerificationModalActionCreators */).openMemberVerificationModal(value);
|
|
}
|
|
return value3;
|
|
}
|
|
value = require(7151) /* metro dependency 7151: ReactionActionCreators */;
|
|
value.addReaction(a1.id, a0, a2.emoji, r5, {burst: r7});
|
|
if (!r7) {
|
|
value = require(4081) /* metro dependency 4081: HapticUtilsNative */;
|
|
value.triggerHapticFeedback((importDefault(4082) /* metro dependency 4082: HapticFeedbackTypes */).IMPACT_LIGHT);
|
|
}
|
|
return value3;
|
|
}
|
|
if (r2) {
|
|
value = a1.getGuildId();
|
|
if (value6 == value) {
|
|
return value3;
|
|
}
|
|
return (require(8919) /* metro dependency 8919: MemberVerificationModalActionCreators */).openMemberVerificationModal(value);
|
|
}
|
|
return value3;
|
|
}
|
|
value = require(9837) /* metro dependency 9837: ReactionUtils */;
|
|
return value.handleOutOfSuperReactions();
|
|
}
|
|
if (a2.me === true) {
|
|
value = require(4081) /* metro dependency 4081: HapticUtilsNative */;
|
|
value.triggerHapticFeedback((importDefault(4082) /* metro dependency 4082: HapticFeedbackTypes */).IMPACT_LIGHT);
|
|
value = require(7151) /* metro dependency 7151: ReactionActionCreators */;
|
|
value.removeReaction({channelId: a1.id, messageId: a0, emoji: a2.emoji, location: r5,
|
|
options: {burst: r7}});
|
|
return value3;
|
|
}
|
|
if (r7) {
|
|
if (a2.me_burst === true) {
|
|
value = require(4081) /* metro dependency 4081: HapticUtilsNative */;
|
|
value.triggerHapticFeedback((importDefault(4082) /* metro dependency 4082: HapticFeedbackTypes */).IMPACT_LIGHT);
|
|
value = require(7151) /* metro dependency 7151: ReactionActionCreators */;
|
|
value.removeReaction({channelId: a1.id, messageId: a0, emoji: a2.emoji, location: r5,
|
|
options: {burst: r7}});
|
|
return value3;
|
|
}
|
|
if (r2) {
|
|
if (r2) {
|
|
value = a1.getGuildId();
|
|
if (value6 == value) {
|
|
return value3;
|
|
}
|
|
return (require(8919) /* metro dependency 8919: MemberVerificationModalActionCreators */).openMemberVerificationModal(value);
|
|
}
|
|
return value3;
|
|
}
|
|
if (a1.isPrivate()) {
|
|
if (value) {
|
|
if (r2) {
|
|
value = a1.getGuildId();
|
|
if (value6 == value) {
|
|
return value3;
|
|
}
|
|
return (require(8919) /* metro dependency 8919: MemberVerificationModalActionCreators */).openMemberVerificationModal(value);
|
|
}
|
|
return value3;
|
|
}
|
|
value = require(7151) /* metro dependency 7151: ReactionActionCreators */;
|
|
value.addReaction(a1.id, a0, a2.emoji, r5, {burst: r7});
|
|
if (!r7) {
|
|
value = require(4081) /* metro dependency 4081: HapticUtilsNative */;
|
|
value.triggerHapticFeedback((importDefault(4082) /* metro dependency 4082: HapticFeedbackTypes */).IMPACT_LIGHT);
|
|
}
|
|
return value3;
|
|
}
|
|
if (r10) {
|
|
if (value) {
|
|
if (r2) {
|
|
value = a1.getGuildId();
|
|
if (value6 == value) {
|
|
return value3;
|
|
}
|
|
return (require(8919) /* metro dependency 8919: MemberVerificationModalActionCreators */).openMemberVerificationModal(value);
|
|
}
|
|
return value3;
|
|
}
|
|
value = require(7151) /* metro dependency 7151: ReactionActionCreators */;
|
|
value.addReaction(a1.id, a0, a2.emoji, r5, {burst: r7});
|
|
if (!r7) {
|
|
value = require(4081) /* metro dependency 4081: HapticUtilsNative */;
|
|
value.triggerHapticFeedback((importDefault(4082) /* metro dependency 4082: HapticFeedbackTypes */).IMPACT_LIGHT);
|
|
}
|
|
return value3;
|
|
}
|
|
if (r2) {
|
|
value = a1.getGuildId();
|
|
if (value6 == value) {
|
|
return value3;
|
|
}
|
|
return (require(8919) /* metro dependency 8919: MemberVerificationModalActionCreators */).openMemberVerificationModal(value);
|
|
}
|
|
return value3;
|
|
}
|
|
if (r2) {
|
|
if (r2) {
|
|
value = a1.getGuildId();
|
|
if (value6 == value) {
|
|
return value3;
|
|
}
|
|
return (require(8919) /* metro dependency 8919: MemberVerificationModalActionCreators */).openMemberVerificationModal(value);
|
|
}
|
|
return value3;
|
|
}
|
|
if (a1.isPrivate()) {
|
|
if (value) {
|
|
if (r2) {
|
|
value = a1.getGuildId();
|
|
if (value6 == value) {
|
|
return value3;
|
|
}
|
|
return (require(8919) /* metro dependency 8919: MemberVerificationModalActionCreators */).openMemberVerificationModal(value);
|
|
}
|
|
return value3;
|
|
}
|
|
value = require(7151) /* metro dependency 7151: ReactionActionCreators */;
|
|
value.addReaction(a1.id, a0, a2.emoji, r5, {burst: r7});
|
|
if (!r7) {
|
|
value = require(4081) /* metro dependency 4081: HapticUtilsNative */;
|
|
value.triggerHapticFeedback((importDefault(4082) /* metro dependency 4082: HapticFeedbackTypes */).IMPACT_LIGHT);
|
|
}
|
|
return value3;
|
|
}
|
|
if (r10) {
|
|
if (value) {
|
|
if (r2) {
|
|
value = a1.getGuildId();
|
|
if (value6 == value) {
|
|
return value3;
|
|
}
|
|
return (require(8919) /* metro dependency 8919: MemberVerificationModalActionCreators */).openMemberVerificationModal(value);
|
|
}
|
|
return value3;
|
|
}
|
|
value = require(7151) /* metro dependency 7151: ReactionActionCreators */;
|
|
value.addReaction(a1.id, a0, a2.emoji, r5, {burst: r7});
|
|
if (!r7) {
|
|
value = require(4081) /* metro dependency 4081: HapticUtilsNative */;
|
|
value.triggerHapticFeedback((importDefault(4082) /* metro dependency 4082: HapticFeedbackTypes */).IMPACT_LIGHT);
|
|
}
|
|
return value3;
|
|
}
|
|
if (r2) {
|
|
value = a1.getGuildId();
|
|
if (value6 == value) {
|
|
return value3;
|
|
}
|
|
return (require(8919) /* metro dependency 8919: MemberVerificationModalActionCreators */).openMemberVerificationModal(value);
|
|
}
|
|
return value3;
|
|
}
|
|
value = require(9837) /* metro dependency 9837: ReactionUtils */;
|
|
value.handleAddNewReactions(a1, a0, r5, {burst: r7});
|
|
}
|
|
return value3;
|
|
}
|
|
|
|
function handleToggleFollowForumPost(a0, a1) { // fn#77034, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:10021:6541, offset: 0x01dee610, size: 119 bytes, params: 3, frame: 16
|
|
const hapticUtilsNativeModule = require(4081) /* metro dependency 4081: HapticUtilsNative */;
|
|
const triggerHapticFeedback = hapticUtilsNativeModule.triggerHapticFeedback;
|
|
const IMPACT_LIGHT = (importDefault(4082) /* metro dependency 4082: HapticFeedbackTypes */).IMPACT_LIGHT;
|
|
Reflect.apply(triggerHapticFeedback, hapticUtilsNativeModule, [IMPACT_LIGHT]);
|
|
const value = importDefault(7153) /* metro dependency 7153: ThreadActionCreators */;
|
|
if (a1) {
|
|
value.leaveThread(a0, 'iOS Forum Toolbar');
|
|
} else {
|
|
value.joinThread(a0, 'iOS Forum Toolbar');
|
|
}
|
|
}
|
|
|
|
function handleCopyLinkForumPost(a0, a1, a2) { // fn#77035, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:10021:6814, offset: 0x01dee687, size: 419 bytes, params: 4, frame: 22
|
|
var moduleValue2;
|
|
var moduleValue4;
|
|
var copy;
|
|
var moduleValue5;
|
|
var moduleValue6;
|
|
var moduleValue7;
|
|
const channel = ChannelStore.getChannel(a1);
|
|
const value3 = undefined;
|
|
const channel2 = ChannelStore.getChannel(channel == null ? value3 : channel.parent_id);
|
|
const r3 = channel2 == null ? value3 : channel2.isMediaChannel();
|
|
const r9 = r3 != null && r3;
|
|
(require(7155) /* metro dependency 7155: Tracking */).trackForumPostLinkCopied({postId: a1, location: a2});
|
|
if (r9) {
|
|
moduleValue2 = require(4863) /* metro dependency 4863: AppAnalyticsUtils */;
|
|
moduleValue2.trackWithMetadata(AnalyticEvents.MEDIA_POST_SHARE_PROMPT_CLICKED, {media_post_id: a1});
|
|
}
|
|
const hapticUtilsNativeModule = require(4081) /* metro dependency 4081: HapticUtilsNative */;
|
|
const triggerHapticFeedback = hapticUtilsNativeModule.triggerHapticFeedback;
|
|
const IMPACT_LIGHT = (importDefault(4082) /* metro dependency 4082: HapticFeedbackTypes */).IMPACT_LIGHT;
|
|
Reflect.apply(triggerHapticFeedback, hapticUtilsNativeModule, [IMPACT_LIGHT]);
|
|
if (channel == null) {
|
|
moduleValue6 = require(6797) /* metro dependency 6797: ClipboardUtilsNative */;
|
|
copy = moduleValue6.copy;
|
|
moduleValue7 = require(4800) /* metro dependency 4800: ChannelUtils */;
|
|
Reflect.apply(copy, moduleValue6, [moduleValue7.getChannelPermalink(a0, a1,
|
|
r9 !== true ? value3 : (importDefault(21) /* metro dependency 21: SnowflakeUtils */).castChannelIdAsMessageId(a1))]);
|
|
} else {
|
|
moduleValue4 = require(6797) /* metro dependency 6797: ClipboardUtilsNative */;
|
|
copy = moduleValue4.copy;
|
|
moduleValue5 = require(4800) /* metro dependency 4800: ChannelUtils */;
|
|
Reflect.apply(copy, moduleValue4, [moduleValue5.getChannelLinkToCopy(channel, channel2)]);
|
|
}
|
|
(require(3856) /* metro dependency 3856: ToastUtils */).presentLinkCopied();
|
|
return value3;
|
|
}
|
|
|
|
function findMessageIndex(a0, a1) { // fn#77036, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:10021:7380, offset: 0x01dee82a, size: 55 bytes, params: 3, frame: 13
|
|
if (a1 != null) {
|
|
return (require(9849) /* metro dependency 9849: computeScrollData */).findMessageRowIndex(a0, a1);
|
|
}
|
|
}
|
|
|
|
function shouldJumpToOriginalPost(a0, a1, a2, a3) { // fn#77037, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:10021:7534, offset: 0x01dee861, size: 79 bytes, params: 5, frame: 12
|
|
var r0;
|
|
let value = a0.isForumPost();
|
|
if (value) {
|
|
value = importDefault(21) /* metro dependency 21: SnowflakeUtils */;
|
|
value = value.castChannelIdAsMessageId(a1);
|
|
value = value === a2.jumpTargetId;
|
|
r0 = value;
|
|
} else {
|
|
r0 = value;
|
|
}
|
|
r0 = r0 && !a3;
|
|
return r0;
|
|
}
|
|
|
|
function findMessageIndexInRows(a0, a1) { // fn#77039, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:10021:7951, offset: 0x01dee903, size: 55 bytes, params: 3, frame: 13
|
|
if (a0 != null) {
|
|
return (require(9849) /* metro dependency 9849: computeScrollData */).findMessageRowIndex(a1, a0);
|
|
}
|
|
}
|
|
|
|
function isLoadingAtTop(a0, a1) { // fn#77040, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:10021:8085, offset: 0x01dee93a, size: 102 bytes, params: 3, frame: 15
|
|
var r2;
|
|
var value2;
|
|
var value3;
|
|
var done;
|
|
var value4;
|
|
var changeType;
|
|
var INSERT;
|
|
var value5;
|
|
if (a1) {
|
|
value2 = _createForOfIteratorHelperLoose_77014(a0);
|
|
value3 = value2();
|
|
done = value3.done;
|
|
if (done) {
|
|
return false;
|
|
}
|
|
r2 = value3;
|
|
loopExit3: while (true) {
|
|
value4 = r2.value;
|
|
changeType = value4.changeType;
|
|
INSERT = Changeset.INSERT;
|
|
if (changeType === INSERT) {
|
|
break loopExit3;
|
|
}
|
|
value5 = value2();
|
|
done = value5.done;
|
|
if (done) {
|
|
return false;
|
|
}
|
|
r2 = value5;
|
|
continue;
|
|
}
|
|
return value4.index <= 1;
|
|
}
|
|
return false;
|
|
}
|
|
|
|
function handleTapTableView(a0, a1) { // fn#77041, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:10021:8283, offset: 0x01dee9a0, size: 106 bytes, params: 3, frame: 13
|
|
var current;
|
|
if ((require(477) /* metro dependency 477: PlatformUtils */).isIOS() && a1 !== (require(1583) /* metro dependency 1583: KeyboardTypes */).KeyboardTypes.SYSTEM) {
|
|
current = a0.current;
|
|
if (current != null) {
|
|
current.closeCustomKeyboard();
|
|
}
|
|
}
|
|
}
|
|
|
|
function handleMediaPlayFinishedAnalytics(a0) { // fn#77042, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:10021:8461, offset: 0x01deea0a, size: 305 bytes, params: 2, frame: 20
|
|
const defaultImport = importDefault(683) /* metro dependency 683: AnalyticsUtils */;
|
|
const track = defaultImport.track;
|
|
const MEDIA_PLAY_FINISHED = AnalyticEvents.MEDIA_PLAY_FINISHED;
|
|
const object2 = {};
|
|
object2.play_time_sec = a0.playWallTimeMs / 1000;
|
|
object2.play_wall_time_ms = a0.playWallTimeMs;
|
|
const Math = global.Math;
|
|
object2.first_play_waiting_ms = Math.min(a0.firstPlayWaitingMs, 600000);
|
|
object2.stall_count = a0.stallCount;
|
|
object2.stall_ms = a0.stallMs;
|
|
object2.seek_count = a0.seekCount;
|
|
const value2 = null;
|
|
object2.seek_waiting_ms = value2;
|
|
object2.media_source = a0.mediaSource;
|
|
let mimeType = a0.mimeType;
|
|
if (value2 != mimeType) {
|
|
mimeType = a0.mimeType;
|
|
mimeType = mimeType === '' ? value2 : a0.mimeType;
|
|
} else {
|
|
mimeType = value2;
|
|
}
|
|
object2.mime_type = mimeType;
|
|
object2.file_size = value2;
|
|
object2.file_duration_sec = a0.fileDurationSec;
|
|
object2.connection_type = NetworkStore.getType();
|
|
object2.effective_connection_speed = NetworkStore.getEffectiveConnectionSpeed();
|
|
object2.service_provider = NetworkStore.getServiceProvider();
|
|
Reflect.apply(track, defaultImport, [MEDIA_PLAY_FINISHED, object2]);
|
|
}
|
|
|
|
function scrollToBottom({current}, a1, a2) { // fn#77043, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:10021:9045, offset: 0x01deeb3b, size: 104 bytes, params: 4, frame: 15
|
|
let value = a3;
|
|
let r4 = !(value !== undefined) || value;
|
|
const object2 = {};
|
|
const Date = global.Date;
|
|
object2.eventTimestamp = Date.now();
|
|
object2.isAtBottom = true;
|
|
a2(object2);
|
|
value = importDefault(9850) /* metro dependency 9850: NativeChatUtils */;
|
|
const scrollToBottom = value.scrollToBottom;
|
|
r4 = r4 && !a1;
|
|
Reflect.apply(scrollToBottom, value, [current, r4]);
|
|
}
|
|
|
|
function scrollToTop_77044({current}, a1) { // fn#77044, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:10021:9183, offset: 0x01deeba3, size: 65 bytes, params: 3, frame: 15
|
|
let value = a2;
|
|
let r4 = !(value !== undefined) || value;
|
|
value = importDefault(9850) /* metro dependency 9850: NativeChatUtils */;
|
|
const scrollToTop = value.scrollToTop;
|
|
r4 = r4 && !a1;
|
|
Reflect.apply(scrollToTop, value, [current, r4]);
|
|
}
|
|
|
|
function scrollToRelativeOffset({current}, a1, a2) { // fn#77045, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:10021:9279, offset: 0x01deebe4, size: 69 bytes, params: 4, frame: 16
|
|
let value = a3;
|
|
let r5 = !(value !== undefined) || value;
|
|
value = importDefault(9850) /* metro dependency 9850: NativeChatUtils */;
|
|
const scrollToRelativeOffset = value.scrollToRelativeOffset;
|
|
r5 = r5 && !a1;
|
|
Reflect.apply(scrollToRelativeOffset, value, [current, a2, r5]);
|
|
}
|
|
|
|
function scrollToTopMessage(a0, a1) { // fn#77046, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:10021:9397, offset: 0x01deec29, size: 85 bytes, params: 3, frame: 14
|
|
var defaultImport;
|
|
const previousRows = a1.getPreviousRows();
|
|
if (previousRows.length > 0) {
|
|
defaultImport = importDefault(9850) /* metro dependency 9850: NativeChatUtils */;
|
|
defaultImport.scrollTo(a0.current, previousRows.length - 1);
|
|
}
|
|
}
|
|
|
|
function canAddNewReactions(a0, a1) { // fn#77047, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:10021:9531, offset: 0x01deec7e, size: 53 bytes, params: 3, frame: 14
|
|
let r0 = a1 && PermissionStore.can(Permissions.ADD_REACTIONS, a0);
|
|
r0 = !r0 ? a0.isPrivate() : r0;
|
|
return r0;
|
|
}
|
|
|
|
function loadMoreBefore(a0, a1, a2) { // fn#77048, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:10021:9633, offset: 0x01deecb3, size: 120 bytes, params: 4, frame: 16
|
|
var defaultImport;
|
|
var fetchMessages;
|
|
var value4;
|
|
const value = undefined;
|
|
a2(true);
|
|
if (a1.hasMoreBefore && !a1.loadingMore) {
|
|
defaultImport = importDefault(7067) /* metro dependency 7067: MessageActionCreators */;
|
|
fetchMessages = defaultImport.fetchMessages;
|
|
value4 = a1.first();
|
|
Reflect.apply(fetchMessages, defaultImport, [{channelId: a0, before: value4 == null ? value : value4.id,
|
|
limit: MAX_MESSAGES_PER_CHANNEL}]);
|
|
}
|
|
return value;
|
|
}
|
|
|
|
function loadMoreAfter(a0, a1, a2) { // fn#77049, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:10021:9812, offset: 0x01deed2b, size: 120 bytes, params: 4, frame: 16
|
|
var defaultImport;
|
|
var fetchMessages;
|
|
var value4;
|
|
const value = undefined;
|
|
a2(true);
|
|
if (a1.hasMoreAfter && !a1.loadingMore) {
|
|
defaultImport = importDefault(7067) /* metro dependency 7067: MessageActionCreators */;
|
|
fetchMessages = defaultImport.fetchMessages;
|
|
value4 = a1.last();
|
|
Reflect.apply(fetchMessages, defaultImport, [{channelId: a0, after: value4 == null ? value : value4.id,
|
|
limit: MAX_MESSAGES_PER_CHANNEL}]);
|
|
}
|
|
return value;
|
|
}
|
|
|
|
function clearRows({current}, a1, a2, a3, a4) { // fn#77050, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:10021:9983, offset: 0x01deeda3, size: 110 bytes, params: 6, frame: 16
|
|
a4({'animated': false, 'hasHandledScroll': false, 'isNearBottom': false, 'isAtBottom': false, 'isNearTop': false,
|
|
'decelerating': false, 'dragging': false, 'hasMoreMessagesAfterForLastUpdate': false,
|
|
'pendingUpdatesQueue': null, '_loaded': false, 'animatingStickerMessageId': null, pendingUpdatesQueue: []});
|
|
a1.clear();
|
|
updateShouldShowJumpToPresentButton(a2, a3, false);
|
|
(importDefault(9850) /* metro dependency 9850: NativeChatUtils */).clearRows(current);
|
|
}
|
|
|
|
function jumpToPresent_77055(a0, a1, a2) { // fn#77055, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:10021:11106, offset: 0x01deef1b, size: 180 bytes, params: 4, frame: 15
|
|
const jumpReturnTargetId = a0.jumpReturnTargetId;
|
|
if (jumpReturnTargetId == null) {
|
|
if (!a0.loadingMore) {
|
|
if (a0.hasMoreAfter) {
|
|
(importDefault(7067) /* metro dependency 7067: MessageActionCreators */).fetchMessages({channelId: a1.id,
|
|
|
|
limit: MAX_MESSAGES_PER_CHANNEL, jump: {present: true}});
|
|
} else {
|
|
a2();
|
|
}
|
|
}
|
|
} else {
|
|
(importDefault(7067) /* metro dependency 7067: MessageActionCreators */).jumpToMessage({channelId: a1.id,
|
|
messageId: jumpReturnTargetId, flash: true});
|
|
}
|
|
}
|
|
|
|
function scrollToNewMessages({channel}) { // fn#77056, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:10021:11360, offset: 0x01deefcf, size: 110 bytes, params: 2, frame: 15
|
|
(importDefault(7067) /* metro dependency 7067: MessageActionCreators */).jumpToMessage({channelId: channel.id,
|
|
messageId: ReadStateStore.ackMessageId(channel.id) ?? channel.id, offset: 1, context: 'Mark As Read'});
|
|
}
|
|
|
|
function syncMessageDisplay({messages, isMessagesReady, oldestUnreadMessageId, channelId, updateRows, scrollToMessageId}) { // fn#77057, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:10021:11552, offset: 0x01def03d, size: 273 bytes, params: 2, frame: 21
|
|
var object2;
|
|
var jumpTargetId;
|
|
const JumpTypes = (require(4044) /* metro dependency 4044: Client */).JumpTypes;
|
|
if (isMessagesReady) {
|
|
object2 = {};
|
|
jumpTargetId = messages.jumpTargetId;
|
|
object2.scrollToMessageId = jumpTargetId;
|
|
jumpTargetId = messages.jumpTargetId;
|
|
object2.jumpTargetId = jumpTargetId;
|
|
object2.jumpType = JumpTypes.INSTANT;
|
|
object2.focusTargetId = messages.focusTargetId;
|
|
updateRows(object2);
|
|
jumpTargetId = messages.jumpTargetId;
|
|
if (jumpTargetId != null) {
|
|
object2 = {};
|
|
jumpTargetId = messages.jumpTargetId;
|
|
object2.scrollToMessageId = jumpTargetId;
|
|
jumpTargetId = messages.jumpTargetId;
|
|
object2.jumpTargetId = jumpTargetId;
|
|
object2.jumpType = JumpTypes.INSTANT;
|
|
scrollToMessageId(object2);
|
|
} else if (oldestUnreadMessageId != null) {
|
|
global.setTimeout(function() {
|
|
var scrollToMessageIdBinding = scrollToMessageId;
|
|
var object = {};
|
|
object.scrollToMessageId = oldestUnreadMessageId;
|
|
object.jumpTargetId = messages.jumpTargetId;
|
|
object.jumpType = require(dependencyMap[45]).JumpTypes.INSTANT;
|
|
return scrollToMessageIdBinding(object);
|
|
}, 50);
|
|
}
|
|
} else {
|
|
updateRows({});
|
|
}
|
|
recordTimings(channelId, messages);
|
|
}
|
|
|
|
function scrollToMessageIdWithRescroll({scrollToMessageId, jumpTargetId, jumpType, scrollPosition, minimizeScrolling, isRescrolling, useReducedMotion, chatRef, findMessageIndex, updateRows}) { // fn#77060, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:10021:12237, offset: 0x01def1a0, size: 462 bytes, params: 2, frame: 26
|
|
const JumpTypes = (require(4044) /* metro dependency 4044: Client */).JumpTypes;
|
|
var messageIndex;
|
|
let value = null;
|
|
const r8 = jumpTargetId === undefined ? value : jumpTargetId;
|
|
const r12 = jumpType !== undefined ? jumpType : JumpTypes.ANIMATED;
|
|
const r7 = scrollPosition !== undefined ? scrollPosition : (require(9850) /* metro dependency 9850: NativeChatUtils */).ChatScrollPosition.TOP;
|
|
const r4 = minimizeScrolling !== undefined && minimizeScrolling;
|
|
const r11 = isRescrolling !== undefined && isRescrolling;
|
|
const r3 = useReducedMotion || r12 === JumpTypes.INSTANT;
|
|
const value8 = !r3;
|
|
const platformUtilsModule = require(477) /* metro dependency 477: PlatformUtils */;
|
|
if (platformUtilsModule.isIOS()) {
|
|
if (r11) {
|
|
messageIndex = findMessageIndex(scrollToMessageId);
|
|
if (value != messageIndex) {
|
|
if (r4) {
|
|
global.setTimeout(_fun77061, 5);
|
|
} else {
|
|
value = importDefault(9850) /* metro dependency 9850: NativeChatUtils */;
|
|
value.scrollTo(chatRef.current, messageIndex, {animated: value8,
|
|
highlight: r8 === scrollToMessageId,
|
|
position: r7});
|
|
}
|
|
}
|
|
} else {
|
|
maybeRescrollToMessageId(scrollToMessageId, {chatRef: chatRef, findMessageIndex: findMessageIndex,
|
|
updateRows: updateRows, updateRowsEnabled: true,
|
|
jumpType: r3 ? JumpTypes.INSTANT : JumpTypes.ANIMATED});
|
|
}
|
|
} else {
|
|
messageIndex = findMessageIndex(scrollToMessageId);
|
|
if (value != messageIndex) {
|
|
if (r4) {
|
|
global.setTimeout(_fun77061, 5);
|
|
} else {
|
|
value = importDefault(9850) /* metro dependency 9850: NativeChatUtils */;
|
|
value.scrollTo(chatRef.current, messageIndex, {animated: value8, highlight: r8 === scrollToMessageId,
|
|
position: r7});
|
|
}
|
|
}
|
|
}
|
|
}
|
|
|
|
function handleVisibleMessagesChange({firstVisibleMessageRowIndex, firstVisibleMessagePercentVisible, lastVisibleMessageRowIndex, lastVisibleMessagePercentVisible, source, chatManager, shouldTrackAnnouncementMessageViews, shouldTrackOfficialMessageViews, shouldTrackRichPresenceInviteEmbedViews, shouldTrackVoiceInviteEmbedViews, guildId, channelId, channel}) { // fn#77062, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:10021:13054, offset: 0x01def3c2, size: 351 bytes, params: 2, frame: 27
|
|
var value;
|
|
var visibleMessages;
|
|
if (firstVisibleMessageRowIndex != null) {
|
|
if (lastVisibleMessageRowIndex != null) {
|
|
if (firstVisibleMessagePercentVisible != null) {
|
|
if (lastVisibleMessagePercentVisible != null) {
|
|
visibleMessages = getVisibleMessages({firstVisibleMessageRowIndex: firstVisibleMessageRowIndex,
|
|
lastVisibleMessageRowIndex: lastVisibleMessageRowIndex,
|
|
firstVisibleMessagePercentVisible: firstVisibleMessagePercentVisible,
|
|
lastVisibleMessagePercentVisible: lastVisibleMessagePercentVisible, chatManager: chatManager,
|
|
channelId: channelId});
|
|
if (!(visibleMessages.length <= 0)) {
|
|
value = require(9484) /* metro dependency 9484: QuestActionCreators */;
|
|
value.questsVisibleMobileMessagesChanged({visibleMessages: visibleMessages, source: source});
|
|
value = require(9854) /* metro dependency 9854: MessageImpressionAnalyticsHelpers */;
|
|
value.handleAnnouncementMessageViewTracking(visibleMessages,
|
|
shouldTrackAnnouncementMessageViews,
|
|
guildId,
|
|
channel);
|
|
value = require(9854) /* metro dependency 9854: MessageImpressionAnalyticsHelpers */;
|
|
value.handleOfficialMessageViewTracking(visibleMessages, shouldTrackOfficialMessageViews,
|
|
guildId,
|
|
channel);
|
|
value = require(9854) /* metro dependency 9854: MessageImpressionAnalyticsHelpers */;
|
|
value.handleRichPresenceInviteEmbedViewTracking(visibleMessages,
|
|
shouldTrackRichPresenceInviteEmbedViews,
|
|
guildId,
|
|
channel);
|
|
value = require(9854) /* metro dependency 9854: MessageImpressionAnalyticsHelpers */;
|
|
value.handleVoiceInviteEmbedViewTracking(visibleMessages, shouldTrackVoiceInviteEmbedViews,
|
|
guildId,
|
|
channel);
|
|
}
|
|
}
|
|
}
|
|
}
|
|
}
|
|
}
|
|
|
|
function getVoiceStateChannelSummaryFromVoiceStates(a0) { // fn#77063, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:10021:14014, offset: 0x01def521, size: 84 bytes, params: 2, frame: 12
|
|
const Object = global.Object;
|
|
let value = Object.entries(a0);
|
|
value = value.filter(function(a0) {
|
|
var r0;
|
|
var r1;
|
|
var r2;
|
|
var item3;
|
|
var value3;
|
|
var iterator = a0[Symbol.iterator]();
|
|
var iterator2 = iterator.next;
|
|
var item2 = Reflect.apply(iterator2, iterator, []);
|
|
var item = item2.value;
|
|
item2 = item2.done ? undefined : iterator;
|
|
var value = undefined;
|
|
var value2 = item2 === value;
|
|
if (value2) {
|
|
r0 = value;
|
|
r1 = item2;
|
|
r2 = value2;
|
|
} else {
|
|
item3 = Reflect.apply(iterator2, item2, []);
|
|
item = item3.value;
|
|
item3 = item3.done ? undefined : item2;
|
|
value3 = item3 === value;
|
|
if (value3) {
|
|
r0 = value;
|
|
r1 = item3;
|
|
r2 = value3;
|
|
} else {
|
|
r0 = item;
|
|
r1 = item3;
|
|
r2 = value3;
|
|
}
|
|
}
|
|
if (!r2) {
|
|
r1.return();
|
|
}
|
|
return r0.discoverable !== false;
|
|
});
|
|
value = value.map(function(a0) {
|
|
var r0;
|
|
var r1;
|
|
var r2;
|
|
var item3;
|
|
var value3;
|
|
var iterator = a0[Symbol.iterator]();
|
|
var iterator2 = iterator.next;
|
|
var item2 = Reflect.apply(iterator2, iterator, []);
|
|
var item = item2.value;
|
|
item2 = item2.done ? undefined : iterator;
|
|
var value = undefined;
|
|
var value2 = item2 === value;
|
|
var r4 = value2 ? value : item;
|
|
if (value2) {
|
|
r0 = value;
|
|
r1 = item2;
|
|
r2 = value2;
|
|
} else {
|
|
item3 = Reflect.apply(iterator2, item2, []);
|
|
item = item3.value;
|
|
item3 = item3.done ? undefined : item2;
|
|
value3 = item3 === value;
|
|
if (value3) {
|
|
r0 = value;
|
|
r1 = item3;
|
|
r2 = value3;
|
|
} else {
|
|
r0 = item;
|
|
r1 = item3;
|
|
r2 = value3;
|
|
}
|
|
}
|
|
if (!r2) {
|
|
r1.return();
|
|
}
|
|
var channelId = r0.channelId;
|
|
value = '';
|
|
return value + r4 + ':' + (channelId ?? value);
|
|
});
|
|
value = value.sort();
|
|
return value.join('|');
|
|
}
|
|
|
|
function getVoiceChannelIdChangedAuthorIds(a0, a1) { // fn#77066, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:10021:14255, offset: 0x01def62b, size: 197 bytes, params: 3, frame: 19
|
|
var r2;
|
|
var value5;
|
|
var get;
|
|
var value6;
|
|
var value7;
|
|
const parseVoiceStateChannelIdSummaryBinding = parseVoiceStateChannelIdSummary;
|
|
const voiceStateChannelIdSummary = parseVoiceStateChannelIdSummaryBinding(a0);
|
|
const voiceStateChannelIdSummary2 = parseVoiceStateChannelIdSummaryBinding(a1);
|
|
let Set = global.Set;
|
|
let set = new Set();
|
|
const _createForOfIteratorHelperLoose_77014Binding = _createForOfIteratorHelperLoose_77014;
|
|
Set = global.Set;
|
|
let value = voiceStateChannelIdSummary.keys();
|
|
const items2 = [];
|
|
value = arraySpread(items2, value, 0, undefined);
|
|
arraySpread(items2, voiceStateChannelIdSummary2.keys(), value, undefined);
|
|
set = new Set(items2);
|
|
set = _createForOfIteratorHelperLoose_77014Binding(set);
|
|
const value4 = set();
|
|
let done = value4.done;
|
|
if (!done) {
|
|
r2 = value4;
|
|
while (true) {
|
|
value5 = r2.value;
|
|
value6 = voiceStateChannelIdSummary.get(value5);
|
|
get = voiceStateChannelIdSummary2.get;
|
|
if (value6 !== Reflect.apply(get, voiceStateChannelIdSummary2, [value5])) {
|
|
set.add(value5);
|
|
}
|
|
value7 = set();
|
|
done = value7.done;
|
|
if (done) {
|
|
break;
|
|
}
|
|
r2 = value7;
|
|
continue;
|
|
}
|
|
}
|
|
return set;
|
|
}
|
|
|
|
function* _fun77024({channel, useReducedMotion, isNearTop, messages, findMessageIndex, scrollToTop, chatRef}) { // fn#77024, original name: ?anon_0_, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:10021:2131, offset: 0x01deda47, size: 395 bytes, params: 2, frame: 24
|
|
var environment;
|
|
var binding;
|
|
var value3;
|
|
var castChannelIdAsMessageId;
|
|
var id;
|
|
var value5;
|
|
var messageIndex;
|
|
var object2;
|
|
var setTimeout;
|
|
var value6;
|
|
var fetchMessages;
|
|
let value = undefined;
|
|
if (false) {
|
|
return value;
|
|
}
|
|
if (channel.isForumPost()) {
|
|
if (isNearTop) {
|
|
return undefined;
|
|
}
|
|
value = environment.__proto__.__proto__;
|
|
binding = env2_26;
|
|
value3 = env2_1(env2_2[34]);
|
|
castChannelIdAsMessageId = value3.castChannelIdAsMessageId;
|
|
id = channel.id;
|
|
if (binding(messages, Reflect.apply(castChannelIdAsMessageId, value3, [id])) == null) {
|
|
value6 = env2_1(env2_2[43]);
|
|
fetchMessages = value6.fetchMessages;
|
|
object2 = {};
|
|
id = channel.id;
|
|
object2.channelId = id;
|
|
id = channel.id;
|
|
object2.jump = {messageId: id, flash: false};
|
|
object2.limit = env2_21;
|
|
yield Reflect.apply(fetchMessages, value6, [object2]);
|
|
if (false) {
|
|
return undefined;
|
|
}
|
|
global.setTimeout(function() {
|
|
return scrollToTop(!useReducedMotion);
|
|
}, 50);
|
|
return undefined;
|
|
}
|
|
binding = env2_1;
|
|
value5 = binding(env2_2[34]);
|
|
castChannelIdAsMessageId = value5.castChannelIdAsMessageId;
|
|
id = channel.id;
|
|
messageIndex = findMessageIndex(Reflect.apply(castChannelIdAsMessageId, value5, [id]));
|
|
if (messageIndex == null) {
|
|
return undefined;
|
|
}
|
|
binding = env2_1;
|
|
value = binding(env2_2[42]);
|
|
value.scrollTo(chatRef.current, messageIndex, {animated: !useReducedMotion});
|
|
setTimeout = global.setTimeout;
|
|
value = 10 * messageIndex;
|
|
setTimeout(_fun77026, value);
|
|
}
|
|
}
|
|
|
|
function _fun77028() { // fn#77028, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:10021:2851, offset: 0x01dedc63, size: 233 bytes, params: 1, frame: 20
|
|
var r1;
|
|
var updateRowsBinding;
|
|
var binding;
|
|
var value3;
|
|
const JumpTypes = (require(4044) /* metro dependency 4044: Client */).JumpTypes;
|
|
var value4;
|
|
var value5;
|
|
var defaultImport;
|
|
const messageIndex = findMessageIndex(env0_0);
|
|
if (messageIndex != null) {
|
|
if (chatRef.current != null) {
|
|
if (env0_4) {
|
|
updateRowsBinding = updateRows;
|
|
binding = env0_0;
|
|
value3 = environment.__proto__;
|
|
value4 = true;
|
|
updateRowsBinding({scrollToMessageId: binding, jumpTargetId: binding, jumpType: env0_5,
|
|
focusTargetId: binding,
|
|
overrideScrollJumpType: JumpTypes.INSTANT, isRescrolling: value4});
|
|
r1 = value4;
|
|
} else {
|
|
r1 = false;
|
|
}
|
|
if (!r1) {
|
|
value5 = environment.__proto__;
|
|
defaultImport = importDefault(9850) /* metro dependency 9850: NativeChatUtils */;
|
|
defaultImport.scrollTo(chatRef.current, messageIndex, {animated: env0_5 === JumpTypes.ANIMATED});
|
|
}
|
|
}
|
|
}
|
|
}
|
|
|
|
function getLongPressSelectedMediaGetEmbedMedia(a0, a1, a2) { // fn#77031, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:10021:4128, owner: getLongPressSelectedMedia.getEmbedMedia, offset: 0x01dee1bd, size: 48 bytes, params: 4, frame: 2
|
|
return {sourceType: 'embed', source: env0_0, mediaType: a0, mediaUrl: a1, contentType: a2};
|
|
}
|
|
|
|
function _fun77061() { // fn#77061, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:10021:12708, offset: 0x01def36e, size: 84 bytes, params: 1, frame: 18
|
|
let value = environment.__proto__;
|
|
value = importDefault(9850) /* metro dependency 9850: NativeChatUtils */;
|
|
value.scrollIntoView(chatRef.current, env0_4, {animated: result, highlight: env0_1 === scrollToMessageId});
|
|
}
|
|
|