Skipped 1 file(s) >100MB (GitHub limit): source/__polyfill/04xxx/module_4792.js (118.4 MB)
94 lines
4 KiB
TypeScript
94 lines
4 KiB
TypeScript
// Module ID: 11774
|
|
// Function ID: 11775
|
|
// Name: replyToMessage
|
|
// Dependencies: [7754, 1371, 7753, 1074, 1242, 11762, 7530, 11764, 4787, 2]
|
|
// Exports: default
|
|
|
|
// Module 11774 (replyToMessage)
|
|
import AnalyticsUtilsDefault from "AnalyticsUtils" /* 1242 */;
|
|
import AppAnalyticsUtils from "AppAnalyticsUtils" /* 4787 */;
|
|
import MessageActionCreatorsDefault from "MessageActionCreators" /* 7530 */;
|
|
import LongPressMessageActionSheetUtils from "LongPressMessageActionSheetUtils" /* 11762 */;
|
|
import PendingReplyActionCreators from "PendingReplyActionCreators" /* 11764 */;
|
|
import EditMessageStore from "EditMessageStore" /* 7754 */;
|
|
import UserStore from "UserStore" /* 1371 */;
|
|
import PendingReplyStore from "PendingReplyStore" /* 7753 */;
|
|
|
|
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(1242).track(AnalyticEvents.CHAT_CONTEXT_BAR_ACTION_CANCELED, obj3);
|
|
const tmp3Result = tmp3(1242);
|
|
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();
|
|
}
|
|
}
|
|
};
|