766 lines
48 KiB
TypeScript
766 lines
48 KiB
TypeScript
/* Metro module 15182; source: components_native/common/ChatPreview.tsx; dependencies: [6, 7, 15, 17, 18, 31, 27, 4502, 3849, 1379, 1878, 9590, 661, 8178, 33, 4501, 697, 11342, 8177, 11519, 3826, 1244, 9849, 9850, 22, 4601, 9874, 9862, 9834, 9835, 4633, 1848, 11401, 9837, 11348, 11349, 11379, 15038, 11982, 11984, 9869, 6618, 5278, 4573, 3868, 3829, 566, 1478, 5087, 5072, 2] */
|
|
import ClassCallCheck from '../../by-id/module-00006-ClassCallCheck.js'; /* Metro dependency 6 */
|
|
import CreateClass from '../../by-id/module-00007-CreateClass.js'; /* Metro dependency 7 */
|
|
import PossibleConstructorReturn from '../../by-id/module-00015-PossibleConstructorReturn.js'; /* Metro dependency 15 */
|
|
import Module00017 from '../../by-id/module-00017.js'; /* Metro dependency 17 */
|
|
import Inherits from '../../by-id/module-00018-Inherits.js'; /* Metro dependency 18 */
|
|
import Native from '../../external/discord_common/js/packages/tokens/native.tsx'; /* Metro dependency 697 */
|
|
import ChannelStore from '../../stores/ChannelStore.tsx'; /* Metro dependency 1379 */
|
|
import UseWindowDimensionsNative from '../../modules/screen/useWindowDimensions.native.tsx'; /* Metro dependency 1478 */
|
|
import UserStore from '../../stores/UserStore.tsx'; /* Metro dependency 1878 */
|
|
import ActionSheetStore from '../../modules/action_sheet/native/ActionSheetStore.tsx'; /* Metro dependency 3849 */
|
|
import AccessibilityStore from '../../modules/a11y/AccessibilityStore.tsx'; /* Metro dependency 4502 */
|
|
import RowGenerator from '../../modules/messages/native/renderer/RowGenerator.tsx'; /* Metro dependency 8177 */
|
|
import MessagePreviewStore from '../../stores/native/MessagePreviewStore.tsx'; /* Metro dependency 9590 */
|
|
import ChatManager from '../../modules/messages/native/renderer/ChatManager.tsx'; /* Metro dependency 11342 */
|
|
import * as FileImportTrackerModule from '../../by-id/module-00002-FileImportTracker.js'; /* Metro dependency 2 */
|
|
import * as ReactNativeModule from '../../by-id/module-00027-ReactNative.js'; /* Metro dependency 27 */
|
|
import * as ReactModule from '../../by-id/module-00031-React.js'; /* Metro dependency 31 */
|
|
import * as JsxRuntimeModule from '../../by-id/module-00033-JsxRuntime.js'; /* Metro dependency 33 */
|
|
import * as ConstantsModule from '../../Constants.tsx'; /* Metro dependency 661 */
|
|
import * as IndexNativeModule from '../../intl/index.native.tsx'; /* Metro dependency 1244 */
|
|
import * as UserSettingsModule from '../../modules/user_settings/UserSettings.tsx'; /* Metro dependency 3829 */
|
|
import * as NativeModule from '../../external/discord_common/js/packages/design/native.tsx'; /* Metro dependency 3868 */
|
|
import * as CreateStylesModule from '../../design/components/Styles/native/createStyles.tsx'; /* Metro dependency 4501 */
|
|
import * as TextModule from '../../design/components/Text/native/Text.tsx'; /* Metro dependency 4573 */
|
|
import * as AgeGateUtilsModule from '../../modules/age_gate/AgeGateUtils.tsx'; /* Metro dependency 5072 */
|
|
import * as SpoilerChannelUtilsModule from '../../modules/spoiler_channels/SpoilerChannelUtils.tsx'; /* Metro dependency 5087 */
|
|
import * as PressablesModule from '../../design/void/Pressables/native/Pressables.tsx'; /* Metro dependency 5278 */
|
|
import * as SafeAreaViewModule from './SafeAreaView.tsx'; /* Metro dependency 6618 */
|
|
import * as RowGeneratorConstantsModule from '../../modules/messages/native/renderer/RowGeneratorConstants.tsx'; /* Metro dependency 8178 */
|
|
import * as MessageDataSnowflakeUtilsModule from '../../modules/messages/native/snowflake/MessageDataSnowflakeUtils.tsx'; /* Metro dependency 9834 */
|
|
import * as HandleMessagesTapChannelModule from '../../modules/messages/native/handlers/handleMessagesTapChannel.tsx'; /* Metro dependency 11349 */
|
|
|
|
function _fun115962(global, require, importDefault, importAll, module, exports, dependencyMap) { // fn#115962, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:15379:6, offset: 0x02475f02, size: 674 bytes, params: 8, frame: 26
|
|
const env0_0 = require;
|
|
const Object = global.Object;
|
|
Object.defineProperty(exports, '__esModule', {value: true});
|
|
let value = ReactModule;
|
|
const StyleSheet = ReactNativeModule.StyleSheet;
|
|
const createLegacyClassComponentStyles = CreateStylesModule.createLegacyClassComponentStyles;
|
|
object = {chat: {'flex': 1, 'overflow': 'hidden'}};
|
|
const BACKGROUND_BASE_LOW = (Native).colors.BACKGROUND_BASE_LOW;
|
|
object.containerInner = {flex: 1, backgroundColor: BACKGROUND_BASE_LOW};
|
|
const BACKGROUND_SURFACE_HIGH = (Native).colors.BACKGROUND_SURFACE_HIGH;
|
|
object.jumpToChatButtonContainer = {flexShrink: 0, backgroundColor: BACKGROUND_SURFACE_HIGH};
|
|
const object4 = {height: 44};
|
|
object4.borderTopWidth = StyleSheet.hairlineWidth;
|
|
const BORDER_SUBTLE = (Native).colors.BORDER_SUBTLE;
|
|
object4.borderTopColor = BORDER_SUBTLE;
|
|
object.jumpToChatButton = object4;
|
|
object.jumpToChatText = {'textAlign': 'center', 'flex': 1, 'lineHeight': 44};
|
|
const env0_23 = Reflect.apply(createLegacyClassComponentStyles, CreateStylesModule, [object]);
|
|
const PureComponent = value.PureComponent;
|
|
value = _fun115966(PureComponent);
|
|
const ThemeContext = (NativeModule).ThemeContext;
|
|
value.contextType = ThemeContext;
|
|
value.defaultProps = {withSafeArea: true};
|
|
(FileImportTrackerModule).fileFinishedImporting('components_native/common/ChatPreview.tsx');
|
|
exports.default = ChatPreviewConnected;
|
|
function _isNativeReflectConstruct_115963() { // fn#115963, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:15379:403, offset: 0x024761a4, size: 98 bytes, params: 1, frame: 18
|
|
var Boolean;
|
|
var prototype;
|
|
var valueOf;
|
|
var call;
|
|
var Reflect;
|
|
var construct;
|
|
var closure;
|
|
var value;
|
|
var error;
|
|
try {
|
|
Boolean = global.Boolean;
|
|
prototype = Boolean.prototype;
|
|
valueOf = prototype.valueOf;
|
|
call = valueOf.call;
|
|
Reflect = global.Reflect;
|
|
construct = Reflect.construct;
|
|
Boolean = global.Boolean;
|
|
closure = function() {
|
|
};
|
|
value = Reflect.apply(construct, Reflect, [Boolean, [], closure]);
|
|
value = Reflect.apply(call, valueOf, [value]);
|
|
var result = !value;
|
|
} catch (error) {
|
|
}
|
|
return (_isNativeReflectConstruct_115963_isNativeReflectConstruct = function() {
|
|
return !!result;
|
|
})();
|
|
}
|
|
|
|
function _fun115966(a0) { // fn#115966, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:15379:1022, offset: 0x02476206, size: 147 bytes, params: 2, frame: 16
|
|
const ChatPreview_1159672 = ChatPreview_115967;
|
|
Inherits(ChatPreview_1159672, a0);
|
|
return CreateClass(ChatPreview_1159672, [{key: 'componentDidMount', value: function() {
|
|
if (this.props.messages != null && this.props.canAccessChannel !== false) {
|
|
this.setup();
|
|
}
|
|
}}, {key: 'componentWillUnmount', value: value_115988}, {key: 'componentDidUpdate', value: value_115989},
|
|
{key: 'render', value: value_115990}]);
|
|
function ChatPreview_115967(a0) { // fn#115967, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:15379:1034, offset: 0x02476299, size: 379 bytes, params: 2, frame: 21
|
|
var r0;
|
|
var Reflect;
|
|
let value = copyRestArgs(0, undefined);
|
|
let binding = env1_4;
|
|
binding(this, ChatPreview_115967);
|
|
const items2 = [];
|
|
arraySpread(items2, value, 0, items2);
|
|
value = env1_7(ChatPreview_115967);
|
|
binding = env1_6;
|
|
if (_isNativeReflectConstruct_115963()) {
|
|
Reflect = global.Reflect;
|
|
value = Reflect.construct(value, items2, env1_7(this).constructor);
|
|
r0 = value;
|
|
} else {
|
|
value = value.apply(this, items2);
|
|
r0 = value;
|
|
}
|
|
value = binding(this, r0);
|
|
const defaultImport = ChatManager;
|
|
const value4 = Object.create(defaultImport.prototype, {constructor: {value: defaultImport}});
|
|
const defaultImport3 = new defaultImport();
|
|
value.chatManager = defaultImport3 instanceof Object ? defaultImport3 : value4;
|
|
const defaultImport2 = RowGenerator;
|
|
const value7 = Object.create(defaultImport2.prototype, {constructor: {value: defaultImport2}});
|
|
const defaultImport22 = new defaultImport2();
|
|
value.rowGenerator = defaultImport22 instanceof Object ? defaultImport22 : value7;
|
|
value.chatRef = env1_9.createRef();
|
|
value.setup = setup_115968;
|
|
value.updateContent = updateContent;
|
|
value.getMessage = getMessage_115975;
|
|
value.handleJumpToChat = handleJumpToChat;
|
|
value.handleTapLink = handleTapLink_115979;
|
|
value.handleLongPressLink = handleLongPressLink_115981;
|
|
value.handleLongPressMessage = handleLongPressMessage_115982;
|
|
value.handleLongPressReaction = handleLongPressReaction_115983;
|
|
value.handleTapImage = handleTapImage_115984;
|
|
value.handleTapChannel = handleTapChannel_115985;
|
|
value.handleLongPressChannel = handleLongPressChannel_115986;
|
|
return value;
|
|
function ChatPreview_115967Setup() { // fn#115968, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:15379:1346, owner: ChatPreview_115967.setup, offset: 0x02476414, size: 446 bytes, params: 1, frame: 23
|
|
var environment;
|
|
var r4;
|
|
var binding;
|
|
var rowGenerator;
|
|
var setOptions;
|
|
var object;
|
|
var width;
|
|
var chatManager;
|
|
var setup;
|
|
var value2;
|
|
var NOOP;
|
|
var UPDATE;
|
|
var forEach;
|
|
var items2;
|
|
var length;
|
|
var value3;
|
|
var property;
|
|
var createRow;
|
|
var generate;
|
|
var value4;
|
|
var createChangeset;
|
|
var defaultImport;
|
|
var getPreviousRows;
|
|
var value5;
|
|
var updateContent;
|
|
let value = a0;
|
|
reducibleJoin2: while (true) {
|
|
if (value !== undefined) {
|
|
r4 = value;
|
|
break reducibleJoin2;
|
|
}
|
|
value = false;
|
|
r4 = value;
|
|
break reducibleJoin2;
|
|
}
|
|
let env0_0 = undefined;
|
|
var env0_3;
|
|
var env0_4;
|
|
var env0_5;
|
|
value = environment;
|
|
let props = env0_0.props;
|
|
env0_0 = props.channel;
|
|
const messages = props.messages;
|
|
const env0_2 = props.roleStyle;
|
|
const jumpTargetId = props.jumpTargetId;
|
|
reducibleJoin9: while (true) {
|
|
if (messages == null) {
|
|
break reducibleJoin9;
|
|
}
|
|
binding = env0_0;
|
|
rowGenerator = binding.rowGenerator;
|
|
setOptions = rowGenerator.setOptions;
|
|
object = {renderEmbeds: props.renderEmbeds, inlineEmbedMedia: props.inlineEmbedMedia,
|
|
inlineAttachmentMedia: props.inlineAttachmentMedia};
|
|
props = binding.props;
|
|
width = props.width;
|
|
object.constrainedWidth = width;
|
|
Reflect.apply(setOptions, rowGenerator, [object]);
|
|
chatManager = binding.chatManager;
|
|
setup = chatManager.setup;
|
|
Reflect.apply(setup, chatManager, [messages]);
|
|
value2 = environment.__proto__.__proto__;
|
|
if (r4) {
|
|
UPDATE = Changeset.UPDATE;
|
|
r4 = UPDATE;
|
|
} else {
|
|
NOOP = Changeset.NOOP;
|
|
r4 = NOOP;
|
|
}
|
|
env0_3 = r4;
|
|
object = [];
|
|
env0_4 = object;
|
|
forEach = messages.forEach;
|
|
Reflect.apply(forEach, messages, [_fun115969]);
|
|
items2 = [];
|
|
env0_5 = items2;
|
|
forEach = object.forEach;
|
|
Reflect.apply(forEach, object, [_fun115970]);
|
|
length = items2.length;
|
|
value3 = 0;
|
|
if (value3 < length) {
|
|
r4 = value3;
|
|
reducibleLoop7: while (true) {
|
|
property = items2[r4];
|
|
binding = env0_0;
|
|
chatManager = binding.chatManager;
|
|
createRow = chatManager.createRow;
|
|
rowGenerator = binding.rowGenerator;
|
|
generate = rowGenerator.generate;
|
|
Reflect.apply(createRow, chatManager, [Reflect.apply(generate, rowGenerator, [property])]);
|
|
value4 = typeof r4 === 'bigint' ? r4 + 1n : +r4 + 1;
|
|
length = items2.length;
|
|
if (value4 < length) {
|
|
r4 = value4;
|
|
continue reducibleLoop7;
|
|
}
|
|
break reducibleLoop7;
|
|
}
|
|
}
|
|
binding = env0_0;
|
|
chatManager = binding.chatManager;
|
|
createChangeset = chatManager.createChangeset;
|
|
value = Reflect.apply(createChangeset, chatManager, []);
|
|
defaultImport = importDefault(9849) /* metro dependency 9849: computeScrollData */;
|
|
chatManager = binding.chatManager;
|
|
getPreviousRows = chatManager.getPreviousRows;
|
|
value5 = defaultImport({rows: Reflect.apply(getPreviousRows, chatManager, []), scrollToMessageId: jumpTargetId,
|
|
jumpTargetId: jumpTargetId, jumpType: undefined, shouldInitialScroll: false, animated: false,
|
|
scrollPosition: undefined, focusTargetId: null});
|
|
updateContent = binding.updateContent;
|
|
Reflect.apply(updateContent, binding, [value, value5]);
|
|
break reducibleJoin9;
|
|
}
|
|
function _fun115969(a0) { // fn#115969, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:15379:1682, offset: 0x024765d2, size: 142 bytes, params: 2, frame: 17
|
|
var property2;
|
|
var value2;
|
|
const property = env0_4[0];
|
|
if (property != null) {
|
|
property2 = property[property.length - 1];
|
|
value2 = environment.__proto__.__proto__.__proto__;
|
|
if ((importDefault(11519) /* metro dependency 11519: isNewMessageGroup */)(channel, property2, a0)) {
|
|
env0_4.unshift([a0]);
|
|
} else {
|
|
property.unshift(a0);
|
|
}
|
|
} else {
|
|
env0_4.unshift([a0]);
|
|
}
|
|
}
|
|
|
|
function _fun115970(a0, a1) { // fn#115970, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:15379:1818, offset: 0x02476660, size: 734 bytes, params: 3, frame: 24
|
|
var environment;
|
|
var r9;
|
|
var r2;
|
|
var value6;
|
|
var moduleValue;
|
|
var object;
|
|
var push;
|
|
const intl = (IndexNativeModule).intl;
|
|
const t = (IndexNativeModule).t;
|
|
var object2;
|
|
const env0_0 = a0;
|
|
const property = a0[a0.length - 1];
|
|
var value;
|
|
let binding = env0_4;
|
|
const value2 = binding[binding.length - 1] === a0;
|
|
const value3 = false;
|
|
const value4 = null;
|
|
const timestamp = value2 ? value4 : env0_4[a1 + 1][0].timestamp;
|
|
let r1 = value2 || value4 == timestamp;
|
|
if (!r1) {
|
|
value6 = environment.__proto__.__proto__.__proto__;
|
|
moduleValue = require(3826) /* metro dependency 3826: DateUtils */;
|
|
r1 = moduleValue.isSameDay(property.timestamp, timestamp);
|
|
}
|
|
const r0 = !r1 || value3;
|
|
const processHiddenMessageRow_1159712 = processHiddenMessageRow_115971;
|
|
binding = env0_5;
|
|
const property2 = binding[binding.length - 1];
|
|
let object3 = {};
|
|
object3.roleStyle = roleStyle;
|
|
const BLOCKED_GROUP = RowType.BLOCKED_GROUP;
|
|
object3.rowType = BLOCKED_GROUP;
|
|
object3.changeType = env0_3;
|
|
object3.message = property;
|
|
object3.isFirst = true;
|
|
object3.content = [];
|
|
object3.text = '';
|
|
object3.revealed = value3;
|
|
if (property.blocked) {
|
|
if (value4 != property2 && property2.rowType === RowType.BLOCKED_GROUP) {
|
|
r2 = property2;
|
|
} else {
|
|
object2 = {};
|
|
copyDataProperties(object2, object3, undefined);
|
|
object2['rowType'] = RowType.BLOCKED_GROUP;
|
|
env0_5.push(object2);
|
|
r2 = object2;
|
|
}
|
|
processHiddenMessageRow_1159712(r2);
|
|
r2.text = intl.formatToPlainString(t['+FcYM/'], {count: r2.content.length});
|
|
} else if (property.ignored) {
|
|
if (value4 != property2 && property2.rowType === RowType.IGNORED_GROUP) {
|
|
r9 = property2;
|
|
} else {
|
|
object = {};
|
|
copyDataProperties(object, object3, undefined);
|
|
object['rowType'] = RowType.IGNORED_GROUP;
|
|
env0_5.push(object);
|
|
r9 = object;
|
|
}
|
|
processHiddenMessageRow_1159712(r9);
|
|
r9.text = intl.formatToPlainString(t['VFWjc+'], {count: r9.content.length});
|
|
} else {
|
|
a0.forEach(_fun115973);
|
|
}
|
|
if (r0) {
|
|
binding = env0_5;
|
|
push = binding.push;
|
|
object3 = {};
|
|
object3.roleStyle = roleStyle;
|
|
object3.rowType = SeparatorType.DAY;
|
|
object3.changeType = env0_3;
|
|
value = require(3826) /* metro dependency 3826: DateUtils */;
|
|
object3.text = value.dateFormat(property.timestamp, 'LL');
|
|
Reflect.apply(push, binding, [object3]);
|
|
}
|
|
function processHiddenMessageRow_115971(a0) { // fn#115971, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:15379:1982, offset: 0x0247693e, size: 78 bytes, params: 2, frame: 13
|
|
let binding = a0;
|
|
binding.forEach(_fun115972);
|
|
binding = env0_1;
|
|
a0.revealed = binding.id === messages.revealedMessageId;
|
|
a0.context = binding.id;
|
|
return a0;
|
|
function _fun115972(a0) { // fn#115972, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:15379:2012, offset: 0x0247698c, size: 97 bytes, params: 2, frame: 14
|
|
const content = env0_0.content;
|
|
const unshift = content.unshift;
|
|
const MESSAGE = RowType.MESSAGE;
|
|
const NOOP = Changeset.NOOP;
|
|
Reflect.apply(unshift, content, [{rowType: MESSAGE, changeType: NOOP, roleStyle: roleStyle, message: a0,
|
|
isFirst: a0 === env1_1}]);
|
|
}
|
|
|
|
}
|
|
|
|
function _fun115973(a0) { // fn#115973, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:15379:2746, offset: 0x024769ed, size: 108 bytes, params: 2, frame: 15
|
|
const binding = env1_5;
|
|
const push = binding.push;
|
|
const MESSAGE = RowType.MESSAGE;
|
|
const binding2 = env0_1;
|
|
Reflect.apply(push, binding, [{roleStyle: roleStyle, rowType: MESSAGE, changeType: env1_3, message: a0,
|
|
isFirst: a0 === binding2, isEditing: false, separatorBefore: !(a0 !== binding2) && env0_2}]);
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
function updateContent(a0, a1) { // fn#115974, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:15379:3321, owner: ChatPreview_115967.updateContent, offset: 0x02476a59, size: 90 bytes, params: 3, frame: 14
|
|
var value;
|
|
const current = env0_0.chatRef.current;
|
|
if (current != null) {
|
|
value = environment.__proto__.__proto__;
|
|
value = importDefault(9850) /* metro dependency 9850: NativeChatUtils */;
|
|
value.updateRows(current, {rows: a0, isLoadingAtTop: false, scrollData: a1});
|
|
}
|
|
}
|
|
|
|
function ChatPreview_115967GetMessage(a0) { // fn#115975, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:15379:3441, owner: ChatPreview_115967.getMessage, offset: 0x02476ab3, size: 73 bytes, params: 2, frame: 13
|
|
var environment;
|
|
const env0_0 = a0;
|
|
let value = environment.__proto__.__proto__;
|
|
value = importDefault(22) /* metro dependency 22 */;
|
|
return value.find(env0_0.props.messages, _fun115976);
|
|
function _fun115976({id, nonce}) { // fn#115976, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:15379:3478, offset: 0x01da3f3d, size: 38 bytes, params: 2, frame: 4
|
|
return id === env0_0 || nonce === env0_0;
|
|
}
|
|
|
|
}
|
|
|
|
function handleJumpToChat() { // fn#115977, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:15379:3530, owner: ChatPreview_115967.handleJumpToChat, offset: 0x02476afc, size: 115 bytes, params: 1, frame: 13
|
|
let props = channelId.props;
|
|
if (props.onBeforeJumpToMessage != null) {
|
|
channelId.props.onBeforeJumpToMessage();
|
|
}
|
|
props = channelId.props;
|
|
var channelId = props.channelId;
|
|
if (props.jumpTargetId != null) {
|
|
global.Promise.resolve().then(_fun115978);
|
|
}
|
|
function _fun115978() { // fn#115978, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:15379:3682, offset: 0x02476b6f, size: 60 bytes, params: 1, frame: 17
|
|
let value = environment.__proto__.__proto__.__proto__;
|
|
value = require(4601) /* metro dependency 4601: transitionToChannel */;
|
|
value.transitionToMessage(channelId, jumpTargetId, {navigationReplace: true});
|
|
}
|
|
|
|
}
|
|
|
|
function ChatPreview_115967HandleTapLink({nativeEvent}) { // fn#115979, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:15379:3764, owner: ChatPreview_115967.handleTapLink, offset: 0x02476bab, size: 294 bytes, params: 2, frame: 20
|
|
var environment;
|
|
var value;
|
|
var value2;
|
|
var moduleValue;
|
|
var handleMessagesTapLink;
|
|
var messagePreviewStoreBinding;
|
|
const data = nativeEvent.data;
|
|
if (data.action === 'bindJumpToMessage') {
|
|
if (data.targetChannelId == null) {
|
|
value = environment.__proto__.__proto__;
|
|
value2 = undefined;
|
|
moduleValue = require(9874) /* metro dependency 9874: handleMessagesTapLink */;
|
|
handleMessagesTapLink = moduleValue.handleMessagesTapLink;
|
|
messagePreviewStoreBinding = MessagePreviewStore;
|
|
Reflect.apply(handleMessagesTapLink, moduleValue, [{allowWithinModal: true, chatInputRef: value2,
|
|
handleTransitionToThread: handleTransitionToThread_115980,
|
|
message: messagePreviewStoreBinding.getMessage(data.messageId),
|
|
messageChannel: env0_0.props.channel ?? value2,
|
|
selectedChannelId: value2, tapLinkData: nativeEvent}]);
|
|
return value2;
|
|
}
|
|
if (data.targetMessageId != null) {
|
|
if (env0_0.props.onBeforeJumpToMessage != null) {
|
|
env0_0.props.onBeforeJumpToMessage();
|
|
}
|
|
value = environment.__proto__.__proto__;
|
|
value = require(4601) /* metro dependency 4601: transitionToChannel */;
|
|
value.transitionToMessage(data.targetChannelId, data.targetMessageId, {navigationReplace: true});
|
|
return undefined;
|
|
}
|
|
}
|
|
value = environment.__proto__.__proto__;
|
|
value2 = undefined;
|
|
moduleValue = require(9874) /* metro dependency 9874: handleMessagesTapLink */;
|
|
handleMessagesTapLink = moduleValue.handleMessagesTapLink;
|
|
messagePreviewStoreBinding = MessagePreviewStore;
|
|
const getMessage = messagePreviewStoreBinding.getMessage;
|
|
Reflect.apply(handleMessagesTapLink, moduleValue, [{allowWithinModal: true, chatInputRef: value2,
|
|
handleTransitionToThread: handleTransitionToThread_115980, message: Reflect.apply(getMessage,
|
|
messagePreviewStoreBinding, [data.messageId]), messageChannel: env0_0.props.channel ?? value2,
|
|
selectedChannelId: value2, tapLinkData: nativeEvent}]);
|
|
return value2;
|
|
function handleTapLinkHandleTransitionToThread(a0, a1, a2) { // fn#115980, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:15379:4154, owner: ChatPreview_115967.handleTapLink.handleTransitionToThread, offset: 0x02476cd1, size: 121 bytes, params: 4, frame: 14
|
|
let value = environment.__proto__;
|
|
if (env1_0.props.onBeforeJumpToMessage != null) {
|
|
env1_0.props.onBeforeJumpToMessage();
|
|
}
|
|
value = environment.__proto__.__proto__.__proto__;
|
|
const channel = ChannelStore.getChannel(a1);
|
|
if (channel != null) {
|
|
(require(4601) /* metro dependency 4601: transitionToChannel */).transitionToThread(channel, {source: a2,
|
|
navigationReplace: true});
|
|
}
|
|
}
|
|
|
|
}
|
|
|
|
function ChatPreview_115967HandleLongPressLink({nativeEvent}) { // fn#115981, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:15379:4476, owner: ChatPreview_115967.handleLongPressLink, offset: 0x02476d4a, size: 96 bytes, params: 2, frame: 12
|
|
const url = nativeEvent.url;
|
|
var value;
|
|
let r0 = env0_0.props.hasActionSheetOpen || url == null;
|
|
r0 = !r0 ? url === '' : r0;
|
|
if (!r0) {
|
|
value = environment.__proto__.__proto__;
|
|
value = importDefault(9862) /* metro dependency 9862: showLongPressURLActionSheet */;
|
|
value({urlString: url});
|
|
}
|
|
}
|
|
|
|
function ChatPreview_115967HandleLongPressMessage(a0) { // fn#115982, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:15379:4599, owner: ChatPreview_115967.handleLongPressMessage, offset: 0x02476daa, size: 354 bytes, params: 2, frame: 28
|
|
var message;
|
|
var userStoreBinding;
|
|
var value6;
|
|
var moduleValue2;
|
|
var getLongPressSelectedMedia;
|
|
var moduleValue3;
|
|
var value7;
|
|
var moduleValue5;
|
|
var showLongPressMessageActionSheet;
|
|
var object2;
|
|
var CHANNEL_SEARCH;
|
|
const value2 = undefined;
|
|
const {messageId, mediaIndex, mediaType, componentId,
|
|
componentMediaIndex} = (MessageDataSnowflakeUtilsModule).getNativeSyntheticEventData(a0);
|
|
const props = env0_0.props;
|
|
if (!props.hasActionSheetOpen) {
|
|
message = MessagePreviewStore.getMessage(messageId);
|
|
if (message != null) {
|
|
userStoreBinding = UserStore;
|
|
value6 = userStoreBinding.getUser(message.author.id);
|
|
if (value6 != null) {
|
|
moduleValue2 = require(9835) /* metro dependency 9835: MessagesUtils */;
|
|
getLongPressSelectedMedia = moduleValue2.getLongPressSelectedMedia;
|
|
moduleValue3 = require(4633) /* metro dependency 4633: InteractionComponentTypes */;
|
|
value7 = Reflect.apply(getLongPressSelectedMedia, moduleValue2, [message, mediaIndex, mediaType,
|
|
moduleValue3.asComponentId(componentId), componentMediaIndex]);
|
|
(importAll(1848) /* metro dependency 1848: KeyboardManagerUtils */).dismissGlobalKeyboard();
|
|
moduleValue5 = require(11401) /* metro dependency 11401: showLongPressMessageActionSheet */;
|
|
showLongPressMessageActionSheet = moduleValue5.showLongPressMessageActionSheet;
|
|
object2 = {};
|
|
CHANNEL_SEARCH = AnalyticsSections.CHANNEL_SEARCH;
|
|
object2.section = CHANNEL_SEARCH;
|
|
CHANNEL_SEARCH = AnalyticsObjects.CHANNEL_SEARCH;
|
|
object2.object = CHANNEL_SEARCH;
|
|
Reflect.apply(showLongPressMessageActionSheet, moduleValue5, [{'actionSheetSource': 'Preview',
|
|
'analyticsLocation': null, 'canAddNewReactions': false, analyticsLocation: object2,
|
|
channel: props.channel,
|
|
message: message, selectedMedia: value7 ?? value2, user: value6}]);
|
|
}
|
|
}
|
|
}
|
|
return value2;
|
|
}
|
|
|
|
function ChatPreview_115967HandleLongPressReaction(a0) { // fn#115983, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:15379:5215, owner: ChatPreview_115967.handleLongPressReaction, offset: 0x02476f0c, size: 128 bytes, params: 2, frame: 18
|
|
let value = environment.__proto__.__proto__;
|
|
const value2 = undefined;
|
|
const nativeSyntheticEventData = (MessageDataSnowflakeUtilsModule).getNativeSyntheticEventData(a0);
|
|
const reaction = nativeSyntheticEventData.reaction;
|
|
if (!env0_0.props.hasActionSheetOpen) {
|
|
value = require(9837) /* metro dependency 9837: ReactionUtils */;
|
|
value.handleViewPreviewReactions(nativeSyntheticEventData.messageId, nativeSyntheticEventData.channelId,
|
|
reaction != null ? reaction.emoji : value2);
|
|
}
|
|
return value2;
|
|
}
|
|
|
|
function ChatPreview_115967HandleTapImage({nativeEvent}) { // fn#115984, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:15379:5416, owner: ChatPreview_115967.handleTapImage, offset: 0x02476f8c, size: 139 bytes, params: 2, frame: 16
|
|
var value2;
|
|
var channelStoreBinding;
|
|
var value3;
|
|
var moduleValue;
|
|
const message = env0_0.getMessage(nativeEvent.id);
|
|
if (message != null) {
|
|
value2 = environment.__proto__.__proto__;
|
|
channelStoreBinding = ChannelStore;
|
|
value3 = channelStoreBinding.getChannel(message.getChannelId());
|
|
if (value3 != null) {
|
|
moduleValue = require(11348) /* metro dependency 11348: handleMessagesTapImage */;
|
|
moduleValue.handleMessagesTapImage({tapImageData: nativeEvent, allowWithinModal: true, message: message,
|
|
messageChannel: value3, selectedChannelId: undefined, showContextName: true});
|
|
}
|
|
}
|
|
}
|
|
|
|
function ChatPreview_115967HandleTapChannel(a0) { // fn#115985, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:15379:5681, owner: ChatPreview_115967.handleTapChannel, offset: 0x02477017, size: 105 bytes, params: 2, frame: 14
|
|
let value = environment.__proto__.__proto__;
|
|
value = require(9834) /* metro dependency 9834: MessageDataSnowflakeUtils */;
|
|
const getNativeSyntheticEventData = value.getNativeSyntheticEventData;
|
|
(HandleMessagesTapChannelModule).handleMessagesTapChannel({data: Reflect.apply(getNativeSyntheticEventData,
|
|
value, [a0]).data, navigationReplace: true, onBeforeNavigate: env0_0.props.onBeforeJumpToMessage});
|
|
}
|
|
|
|
function ChatPreview_115967HandleLongPressChannel(a0) { // fn#115986, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:15379:5874, owner: ChatPreview_115967.handleLongPressChannel, offset: 0x02477080, size: 104 bytes, params: 2, frame: 13
|
|
let value = environment.__proto__.__proto__;
|
|
const getNativeSyntheticEventData = MessageDataSnowflakeUtilsModule.getNativeSyntheticEventData;
|
|
if (!env0_0.props.hasActionSheetOpen) {
|
|
value = require(11379) /* metro dependency 11379: handleMessagesLongPressChannel */;
|
|
value.handleMessagesLongPressChannel({data: Reflect.apply(getNativeSyntheticEventData,
|
|
MessageDataSnowflakeUtilsModule, [a0]).data});
|
|
}
|
|
}
|
|
|
|
}
|
|
|
|
function value_115988() { // fn#115988, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:15379:6201, offset: 0x02477121, size: 75 bytes, params: 1, frame: 11
|
|
var value;
|
|
if (this.chatRef.current != null) {
|
|
this.chatManager.clear();
|
|
value = environment.__proto__;
|
|
value = importDefault(15038) /* metro dependency 15038: MessagePreviewActionCreators */;
|
|
value.clearMessages();
|
|
}
|
|
}
|
|
|
|
function value_115990() { // fn#115990, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:15379:6582, offset: 0x0247720a, size: 597 bytes, params: 1, frame: 26
|
|
var r5;
|
|
var r6;
|
|
var value4;
|
|
const SafeAreaPaddingView = (SafeAreaViewModule).SafeAreaPaddingView;
|
|
const PressableOpacity = (PressablesModule).PressableOpacity;
|
|
const Text = (TextModule).Text;
|
|
const intl = (require(1244) /* metro dependency 1244: indexNative */).intl;
|
|
var value6;
|
|
var value7;
|
|
const binding = env1_23;
|
|
const context = this.context;
|
|
const value2 = undefined;
|
|
const value3 = binding(context);
|
|
const {channel, isNSFWHidden, isSpoilerHidden} = this.props;
|
|
if (isNSFWHidden) {
|
|
if ((channel == null ? value2 : channel.guild_id) != null) {
|
|
value7 = ((Component) => <Component guildId={channel.guild_id} channelId={channel.id} />)(importDefault(11982) /* metro dependency 11982: GuildNSFW */);
|
|
r5 = value2;
|
|
r6 = value7;
|
|
} else if (isSpoilerHidden) {
|
|
if ((channel == null ? value2 : channel.guild_id) != null) {
|
|
value6 = ((Component) => <Component guildId={channel.guild_id} channelId={channel.id} />)(importDefault(11984) /* metro dependency 11984: ChannelSpoiler */);
|
|
r5 = value2;
|
|
r6 = value6;
|
|
} else {
|
|
value4 = ((Component) => <Component ref={this.chatRef} style={value3.chat} inverted onTapLink={this.handleTapLink} onTapChannel={this.handleTapChannel} onLongPressChannel={this.handleLongPressChannel} onLongPressLink={this.handleLongPressLink} onLongPressMessage={this.handleLongPressMessage} onLongPressReaction={this.handleLongPressReaction} onTapImage={this.handleTapImage} />)(importDefault(9869) /* metro dependency 9869: ChatAndroid */);
|
|
r5 = (
|
|
<SafeAreaPaddingView bottom style={value3.jumpToChatButtonContainer}>
|
|
<PressableOpacity
|
|
accessibilityRole="button"
|
|
style={value3.jumpToChatButton}
|
|
onPress={this.handleJumpToChat}
|
|
>
|
|
<Text
|
|
style={value3.jumpToChatText}
|
|
variant="text-md/medium"
|
|
color="interactive-text-default"
|
|
>
|
|
{intl.string((require(1244) /* metro dependency 1244: indexNative */).t['+TSRGD'])}
|
|
</Text>
|
|
</PressableOpacity>
|
|
</SafeAreaPaddingView>
|
|
);
|
|
r6 = value4;
|
|
}
|
|
} else {
|
|
value4 = ((Component) => <Component ref={this.chatRef} style={value3.chat} inverted onTapLink={this.handleTapLink} onTapChannel={this.handleTapChannel} onLongPressChannel={this.handleLongPressChannel} onLongPressLink={this.handleLongPressLink} onLongPressMessage={this.handleLongPressMessage} onLongPressReaction={this.handleLongPressReaction} onTapImage={this.handleTapImage} />)(importDefault(9869) /* metro dependency 9869: ChatAndroid */);
|
|
r5 = (
|
|
<SafeAreaPaddingView bottom style={value3.jumpToChatButtonContainer}>
|
|
<PressableOpacity
|
|
accessibilityRole="button"
|
|
style={value3.jumpToChatButton}
|
|
onPress={this.handleJumpToChat}
|
|
>
|
|
<Text
|
|
style={value3.jumpToChatText}
|
|
variant="text-md/medium"
|
|
color="interactive-text-default"
|
|
>
|
|
{intl.string((require(1244) /* metro dependency 1244: indexNative */).t['+TSRGD'])}
|
|
</Text>
|
|
</PressableOpacity>
|
|
</SafeAreaPaddingView>
|
|
);
|
|
r6 = value4;
|
|
}
|
|
} else if (isSpoilerHidden) {
|
|
if ((channel == null ? value2 : channel.guild_id) != null) {
|
|
value6 = ((Component) => <Component guildId={channel.guild_id} channelId={channel.id} />)(importDefault(11984) /* metro dependency 11984: ChannelSpoiler */);
|
|
r5 = value2;
|
|
r6 = value6;
|
|
} else {
|
|
value4 = ((Component) => <Component ref={this.chatRef} style={value3.chat} inverted onTapLink={this.handleTapLink} onTapChannel={this.handleTapChannel} onLongPressChannel={this.handleLongPressChannel} onLongPressLink={this.handleLongPressLink} onLongPressMessage={this.handleLongPressMessage} onLongPressReaction={this.handleLongPressReaction} onTapImage={this.handleTapImage} />)(importDefault(9869) /* metro dependency 9869: ChatAndroid */);
|
|
r5 = (
|
|
<SafeAreaPaddingView bottom style={value3.jumpToChatButtonContainer}>
|
|
<PressableOpacity
|
|
accessibilityRole="button"
|
|
style={value3.jumpToChatButton}
|
|
onPress={this.handleJumpToChat}
|
|
>
|
|
<Text
|
|
style={value3.jumpToChatText}
|
|
variant="text-md/medium"
|
|
color="interactive-text-default"
|
|
>
|
|
{intl.string((require(1244) /* metro dependency 1244: indexNative */).t['+TSRGD'])}
|
|
</Text>
|
|
</PressableOpacity>
|
|
</SafeAreaPaddingView>
|
|
);
|
|
r6 = value4;
|
|
}
|
|
} else {
|
|
value4 = ((Component) => <Component ref={this.chatRef} style={value3.chat} inverted onTapLink={this.handleTapLink} onTapChannel={this.handleTapChannel} onLongPressChannel={this.handleLongPressChannel} onLongPressLink={this.handleLongPressLink} onLongPressMessage={this.handleLongPressMessage} onLongPressReaction={this.handleLongPressReaction} onTapImage={this.handleTapImage} />)(importDefault(9869) /* metro dependency 9869: ChatAndroid */);
|
|
r5 = (
|
|
<SafeAreaPaddingView bottom style={value3.jumpToChatButtonContainer}>
|
|
<PressableOpacity
|
|
accessibilityRole="button"
|
|
style={value3.jumpToChatButton}
|
|
onPress={this.handleJumpToChat}
|
|
>
|
|
<Text
|
|
style={value3.jumpToChatText}
|
|
variant="text-md/medium"
|
|
color="interactive-text-default"
|
|
>
|
|
{intl.string((require(1244) /* metro dependency 1244: indexNative */).t['+TSRGD'])}
|
|
</Text>
|
|
</PressableOpacity>
|
|
</SafeAreaPaddingView>
|
|
);
|
|
r6 = value4;
|
|
}
|
|
return (
|
|
<View style={value3.containerInner}>
|
|
{r6}
|
|
{r5}
|
|
</View>
|
|
);
|
|
}
|
|
|
|
}
|
|
|
|
function ChatPreviewConnected(a0) { // fn#115991, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:15379:7792, offset: 0x0247745f, size: 497 bytes, params: 2, frame: 27
|
|
const env0_0 = a0.channelId;
|
|
const InlineAttachmentMedia = (UserSettingsModule).InlineAttachmentMedia;
|
|
const value2 = InlineAttachmentMedia.useSetting();
|
|
const InlineEmbedMedia = (UserSettingsModule).InlineEmbedMedia;
|
|
const value3 = InlineEmbedMedia.useSetting();
|
|
const RenderEmbeds = (UserSettingsModule).RenderEmbeds;
|
|
const value4 = RenderEmbeds.useSetting();
|
|
const {messages,
|
|
jumpTargetId} = (require(566) /* metro dependency 566: flux */).useStateFromStoresObject([MessagePreviewStore],
|
|
function() {
|
|
var messagePreviewStoreBinding = MessagePreviewStore;
|
|
return {messages: messagePreviewStoreBinding.messages, jumpTargetId: messagePreviewStoreBinding.jumpTargetId};
|
|
});
|
|
const roleStyle = (require(566) /* metro dependency 566: flux */).useStateFromStores([AccessibilityStore],
|
|
function() {
|
|
return AccessibilityStore.roleStyle;
|
|
});
|
|
const channel = (require(566) /* metro dependency 566: flux */).useStateFromStores([ChannelStore], function() {
|
|
return ChannelStore.getChannel(channelId);
|
|
});
|
|
const width = (UseWindowDimensionsNative)().width;
|
|
const value6 = (SpoilerChannelUtilsModule).useIsChannelSpoilerGated(channel);
|
|
const value7 = (AgeGateUtilsModule).useIsChannelContentGated(channel);
|
|
return ((Component) => <Component {...a0} {...{['inlineAttachmentMedia']: value2}} {...{['inlineEmbedMedia']: value3}} {...{['renderEmbeds']: value4}} {...{['roleStyle']: roleStyle}} {...{['messages']: messages}} {...{['jumpTargetId']: jumpTargetId}} {...{['channel']: channel}} {...{['width']: width}} {...{['isSpoilerHidden']: value6}} {...{['isNSFWHidden']: value7}} {...{['canAccessChannel']: !value6 && !value7}} {...{['hasActionSheetOpen']: (require(566) /* metro dependency 566: flux */).useStateFromStores([ActionSheetStore],
|
|
_fun115995)}} />)(env0_24);
|
|
function _fun115995() { // fn#115995, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:15379:8340, offset: 0x02477680, size: 25 bytes, params: 1, frame: 9
|
|
const value = environment.__proto__;
|
|
return ActionSheetStore.getContent() != null;
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
function value_115989(a0) { // fn#115989, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:15379:6328, offset: 0x0247716c, size: 158 bytes, params: 2, frame: 13
|
|
if (!(a0.messages === this.props.messages && a0.width === this.props.width)) {
|
|
this.setup(a0.width !== this.props.width);
|
|
}
|
|
if (a0.canAccessChannel !== this.props.canAccessChannel && this.props.messages != null) {
|
|
this.setup(!!this.props.canAccessChannel);
|
|
}
|
|
}
|
|
|
|
global.__d(_fun115962, 15182, [6, 7, 15, 17, 18, 31, 27, 4502, 3849, 1379, 1878, 9590, 661, 8178, 33, 4501, 697,
|
|
11342, 8177, 11519, 3826, 1244, 9849, 9850, 22, 4601, 9874, 9862, 9834, 9835, 4633, 1848, 11401, 9837, 11348,
|
|
11349, 11379, 15038, 11982, 11984, 9869, 6618, 5278, 4573, 3868, 3829, 566, 1478, 5087, 5072,
|
|
2]) /* metro module 15182, dependencies: [6, 7, 15, 17, 18, 31, 27, 4502, 3849, 1379, 1878, 9590, 661, 8178, 33, 4501, 697, 11342, 8177, 11519, 3826, 1244, 9849, 9850, 22, 4601, 9874, 9862, 9834, 9835, 4633, 1848, 11401, 9837, 11348, 11349, 11379, 15038, 11982, 11984, 9869, 6618, 5278, 4573, 3868, 3829, 566, 1478, 5087, 5072, 2] */;
|