decord/beta/source/modules/replies/native/replyToMessage.tsx
github-actions 19e52f659f chore: update source for beta 347.11
Skipped 1 file(s) >100MB (GitHub limit): source/__polyfill/04xxx/module_4973.js (118.4 MB)
2026-09-26 17:57:22 +00:00

94 lines
4 KiB
TypeScript

// Module ID: 11960
// Function ID: 11961
// Name: replyToMessage
// Dependencies: [7949, 1372, 7948, 1074, 1241, 11947, 7730, 11949, 4968, 2]
// Exports: default
// Module 11960 (replyToMessage)
import AnalyticsUtilsDefault from "AnalyticsUtils" /* 1241 */;
import AppAnalyticsUtils from "AppAnalyticsUtils" /* 4968 */;
import MessageActionCreatorsDefault from "MessageActionCreators" /* 7730 */;
import LongPressMessageActionSheetUtils from "LongPressMessageActionSheetUtils" /* 11947 */;
import PendingReplyActionCreators from "PendingReplyActionCreators" /* 11949 */;
import EditMessageStore from "EditMessageStore" /* 7949 */;
import UserStore from "UserStore" /* 1372 */;
import PendingReplyStore from "PendingReplyStore" /* 7948 */;
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(1241).track(AnalyticEvents.CHAT_CONTEXT_BAR_ACTION_CANCELED, obj3);
const tmp3Result = tmp3(1241);
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();
}
}
};