// Module ID: 11812 // Function ID: 11813 // Name: replyToMessage // Dependencies: [7783, 1371, 7782, 1074, 1240, 11800, 7559, 11802, 4816, 2] // Exports: default // Module 11812 (replyToMessage) import AnalyticsUtilsDefault from "AnalyticsUtils" /* 1240 */; import AppAnalyticsUtils from "AppAnalyticsUtils" /* 4816 */; import MessageActionCreatorsDefault from "MessageActionCreators" /* 7559 */; import LongPressMessageActionSheetUtils from "LongPressMessageActionSheetUtils" /* 11800 */; import PendingReplyActionCreators from "PendingReplyActionCreators" /* 11802 */; import EditMessageStore from "EditMessageStore" /* 7783 */; import UserStore from "UserStore" /* 1371 */; import PendingReplyStore from "PendingReplyStore" /* 7782 */; require = fn; const AnalyticEvents = fn(1074).AnalyticEvents; const size = fn(2); const result = size.fileFinishedImporting("modules/replies/native/replyToMessage.tsx"); export default function longPressMessageHandleReply(arg0) { ({ message, channel, chatInputRef, actionSource, invertible } = arg0); if (invertible === undefined) { invertible = false; } const editingMessage = EditMessageStore.getEditingMessage(channel.id); if (null != editingMessage) { const currentUser = UserStore.getCurrentUser(); const obj2 = { message_id: message.id, channel_id: null, guild_id: null, context_action: "edit", reason: null, is_own_message: null }; ({ id: obj11.channel_id, guild_id: obj11.guild_id } = channel); const obj10 = AnalyticsUtilsDefault; obj2.reason = LongPressMessageActionSheetUtils.getContextBarCancelReason("edit", actionSource); obj2.is_own_message = null != currentUser && currentUser.id === editingMessage.author.id; obj10.track(AnalyticEvents.CHAT_CONTEXT_BAR_ACTION_CANCELED, obj2); } MessageActionCreatorsDefault.endEditMessage(channel.id); const pendingReply = PendingReplyStore.getPendingReply(channel.id); if (invertible) { if ("message_swipe" === actionSource) { if (null != pendingReply) { if (pendingReply.message.id === message.id) { const currentUser1 = UserStore.getCurrentUser(); const obj3 = { message_id: message.id, channel_id: null, guild_id: null, context_action: "reply", reason: "swipe_reply_undo", is_own_message: null }; ({ id: obj8.channel_id, guild_id: obj8.guild_id } = channel); let tmp18 = null != currentUser1; if (tmp18) { tmp18 = currentUser1.id === pendingReply.message.author.id; } obj3.is_own_message = tmp18; tmp3(1240).track(AnalyticEvents.CHAT_CONTEXT_BAR_ACTION_CANCELED, obj3); const tmp3Result = tmp3(1240); PendingReplyActionCreators.deletePendingReply(channel.id); let text; if (chatInputRef != null) { const current = chatInputRef.current; if (current != null) { text = current.getText(); } } if ("" === text) { if (chatInputRef != null) { const current2 = chatInputRef.current; if (current2 != null) { current2.dismissKeyboard(); } } } } } } } const obj6 = { source: actionSource }; const tmp3Result2 = AnalyticsUtilsDefault; const merged = Object.assign(AppAnalyticsUtils.collectGuildAnalyticsMetadata(channel.guild_id)); const merged1 = Object.assign(AppAnalyticsUtils.collectChannelAnalyticsMetadata(channel)); tmp3Result2.track(AnalyticEvents.REPLY_MESSAGE_STARTED, obj6); const currentUser2 = UserStore.getCurrentUser(); const isDMResult = channel.isDM(); let tmp13 = !isDMResult; if (!isDMResult) { tmp13 = null != currentUser2; } if (tmp13) { tmp13 = message.author.id !== currentUser2.id; } const pendingReply1 = PendingReplyActionCreators.createPendingReply({ message, channel, shouldMention: tmp13, source: actionSource }); if (chatInputRef != null) { const current3 = chatInputRef.current; if (current3 != null) { current3.openSystemKeyboard(); } } };