// Metro module 9891 (f9892). import EditMessageStore from "../../../stores/EditMessageStore"; import UserStore from "../../../stores/UserStore"; import PendingReplyStore from "../PendingReplyStore"; import { AnalyticEvents } from "../../../Constants"; import AnalyticsUtils from "../../../utils/AnalyticsUtils"; import { getContextBarCancelReason } from "../../messages/native/long_press/LongPressMessageActionSheetUtils"; import MessageActionCreators from "../../../actions/MessageActionCreators"; import { deletePendingReply, createPendingReply } from "../PendingReplyActionCreators"; import { collectGuildAnalyticsMetadata, collectChannelAnalyticsMetadata } from "../../app_analytics/AppAnalyticsUtils"; export default function longPressMessageHandleReply({ message, channel, chatInputRef, actionSource, invertible = false }) { const editingMessage = EditMessageStore.getEditingMessage(channel.id); if (editingMessage != null) { const currentUser = UserStore.getCurrentUser(); AnalyticsUtils.track(AnalyticEvents.CHAT_CONTEXT_BAR_ACTION_CANCELED, { message_id: message.id, channel_id: channel.id, guild_id: channel.guild_id, context_action: "edit", reason: getContextBarCancelReason("edit", actionSource), is_own_message: currentUser != null && currentUser.id === editingMessage.author.id }); } L26: { MessageActionCreators.endEditMessage(channel.id); const pendingReply = PendingReplyStore.getPendingReply(channel.id); if (invertible && (actionSource === "message_swipe" && (pendingReply != null && pendingReply.message.id === message.id))) { const currentUser3 = UserStore.getCurrentUser(); AnalyticsUtils.track(AnalyticEvents.CHAT_CONTEXT_BAR_ACTION_CANCELED, { message_id: message.id, channel_id: channel.id, guild_id: channel.guild_id, context_action: "reply", reason: "swipe_reply_undo", is_own_message: currentUser3 != null && currentUser3.id === pendingReply.message.author.id }); deletePendingReply(channel.id); const r116 = chatInputRef == null; let r117 = void 0; if (!r116) { const current2 = chatInputRef.current; r117 = current2 == null ? void 0 : current2.getText(); } if (r117 !== "") { break L26; } if (chatInputRef == null) { break L26; } const current3 = chatInputRef.current; if (current3 == null) { break L26; } current3.dismissKeyboard(); } else { AnalyticsUtils.track(AnalyticEvents.REPLY_MESSAGE_STARTED, { source: actionSource, ...collectGuildAnalyticsMetadata(channel.guild_id), ...collectChannelAnalyticsMetadata(channel) }); const currentUser2 = UserStore.getCurrentUser(); const isDM = channel.isDM(); createPendingReply({ message, channel, shouldMention: (isDM ? !isDM : currentUser2 != null) && message.author.id !== currentUser2.id, source: actionSource }); if (chatInputRef != null) { const current = chatInputRef.current; if (current != null) { current.openSystemKeyboard(); } } } } };