decord/source/components_native/chat/contentHandlers.tsx

315 lines
9.8 KiB
TypeScript
Raw Normal View History

2026-08-24 06:08:38 +00:00
// Module ID: 10822
// Function ID: 10823
2026-07-29 08:29:29 +00:00
// Name: onTapMention
2026-08-24 06:08:38 +00:00
// Dependencies: [5, 10820, 9122, 8817, 4093, 10778, 8966, 7197, 4346, 10823, 2008, 11, 4069, 1236, 7205, 4096, 4832, 9437, 2]
2026-07-20 16:05:17 +00:00
2026-08-24 06:08:38 +00:00
// Module 10822 (onTapMention)
import DISCORD_EPOCHDefault from "DISCORD_EPOCH" /* 11 */;
import asyncRequireImpl from "asyncRequireImpl" /* 2008 */;
import presentAddedFriendToast from "presentAddedFriendToast" /* 4096 */;
import ACTION_SHEET_HEIGHT_HALFDefault from "ACTION_SHEET_HEIGHT_HALF" /* 4346 */;
import setDefault from "set" /* 4832 */;
import QUICK_SWITCHERDefault from "QUICK_SWITCHER" /* 7197 */;
import _copy from "_copy" /* 7205 */;
import showUserProfileActionSheetDefault from "showUserProfileActionSheet" /* 8966 */;
import showLongPressURLActionSheetDefault from "showLongPressURLActionSheet" /* 10820 */;
import importDefaultResult from "asyncGeneratorStep" /* 5 */;
2026-07-23 10:11:24 +00:00
2026-08-24 06:08:38 +00:00
require = arg1;
2026-07-29 08:29:29 +00:00
let obj = {
onLongPressLink(nativeEvent) {
const url = nativeEvent.nativeEvent.url;
let tmp = null != url;
if (tmp) {
tmp = "" !== url;
}
if (tmp) {
const obj = { urlString: null };
obj[0] = url;
2026-08-24 06:08:38 +00:00
showLongPressURLActionSheetDefault(obj);
2026-07-29 08:29:29 +00:00
}
},
onTapAttachmentLink: null,
onLongPressAttachmentLink: null,
onTapMention: null,
onTapTimestamp: null,
onTapInlineCode: null,
onTapEmoji: null
2026-07-23 10:11:24 +00:00
};
2026-08-24 06:08:38 +00:00
let closure_5 = importDefaultResult((arg0) => {
closure_0 = arg0;
c3 = 0;
c4 = 0;
2026-07-29 08:29:29 +00:00
const iter = (function*(arg0) {
2026-08-12 06:57:52 +00:00
if (c4 === 2) {
c4 = 3;
HermesBuiltin.throwTypeError();
} else if (tmp4 === 3) {
2026-07-29 08:29:29 +00:00
if (arg0 === 1) {
throw arg1;
} else if (arg0 === 2) {
2026-08-12 06:57:52 +00:00
let obj = { value: null, done: true };
obj[0] = arg1;
return obj;
2026-07-29 08:29:29 +00:00
} else {
2026-08-24 06:08:38 +00:00
return { value: "HermesInternal", done: null };
2026-08-12 06:57:52 +00:00
}
} else {
try {
c4 = 2;
2026-08-24 06:08:38 +00:00
if (0 === dependencyMap) {
2026-08-12 06:57:52 +00:00
if (arg0 === 1) {
c4 = 3;
throw arg1;
} else if (arg0 === 2) {
c4 = 3;
obj = { value: null, done: true };
obj[0] = arg1;
return obj;
} else {
2026-08-24 06:08:38 +00:00
const callback2 = tmp5;
2026-08-12 06:57:52 +00:00
let callback = tmp2;
let attachmentUrl;
attachmentUrl = attachmentUrl.nativeEvent.data.attachmentUrl;
callback = undefined;
2026-08-24 06:08:38 +00:00
dependencyMap = 1;
2026-07-29 08:29:29 +00:00
c4 = 1;
2026-08-12 06:57:52 +00:00
return { value: "ct", done: true };
}
} else {
if (1 === tmp5) {
if (arg0 === 1) {
c4 = 3;
throw arg1;
} else if (arg0 === 2) {
c4 = 3;
2026-08-24 06:08:38 +00:00
obj1 = { value: null, done: true };
2026-08-12 06:57:52 +00:00
obj1[0] = arg1;
return obj1;
} else {
if (null != attachmentUrl) {
if ("" !== attachmentUrl) {
2026-08-24 06:08:38 +00:00
let obj3 = callback2(9122);
dependencyMap = 2;
2026-08-12 06:57:52 +00:00
c4 = 1;
const obj2 = { value: null, done: false };
obj2[0] = obj3.maybeRefreshAttachmentUrl(attachmentUrl);
return obj2;
}
}
c4 = 3;
}
} else if (arg0 === 1) {
c4 = 3;
throw arg1;
} else if (arg0 !== 2) {
callback = arg1;
2026-08-24 06:08:38 +00:00
obj = callback(8817);
2026-08-12 06:57:52 +00:00
obj.trackLinkClicked(callback);
2026-08-24 06:08:38 +00:00
obj1 = callback(4093);
2026-08-12 06:57:52 +00:00
obj1.openURL(callback);
2026-07-29 08:29:29 +00:00
}
2026-08-12 06:57:52 +00:00
c4 = 3;
obj3 = { value: null, done: true };
obj3[0] = arg1;
return obj3;
2026-07-29 08:29:29 +00:00
}
2026-08-12 06:57:52 +00:00
} catch (tmp25) {
c4 = tmp;
throw tmp25;
2026-07-29 08:29:29 +00:00
}
}
})();
iter.next();
return iter;
});
obj[1] = function() {
const self = this;
2026-08-24 06:08:38 +00:00
const apply = closure_5.apply;
2026-07-29 08:29:29 +00:00
if (typeof apply === "unknown") {
let applyArgumentsResult = HermesBuiltin.applyArguments(self);
} else {
applyArgumentsResult = apply(self, arguments);
}
return applyArgumentsResult;
2026-07-20 16:05:17 +00:00
};
2026-08-24 06:08:38 +00:00
let closure_4 = importDefaultResult((arg0) => {
closure_0 = arg0;
c3 = 0;
c4 = 0;
2026-07-29 08:29:29 +00:00
const iter = (function*(arg0) {
2026-08-12 06:57:52 +00:00
if (c4 === 2) {
c4 = 3;
HermesBuiltin.throwTypeError();
} else if (tmp4 === 3) {
2026-07-29 08:29:29 +00:00
if (arg0 === 1) {
throw arg1;
} else if (arg0 === 2) {
2026-08-12 06:57:52 +00:00
let obj = { value: null, done: true };
obj[0] = arg1;
return obj;
2026-07-29 08:29:29 +00:00
} else {
2026-08-24 06:08:38 +00:00
return { value: "HermesInternal", done: null };
2026-08-12 06:57:52 +00:00
}
} else {
try {
c4 = 2;
2026-08-24 06:08:38 +00:00
if (0 === dependencyMap) {
2026-08-12 06:57:52 +00:00
if (arg0 === 1) {
c4 = 3;
throw arg1;
} else if (arg0 === 2) {
c4 = 3;
obj = { value: null, done: true };
obj[0] = arg1;
return obj;
} else {
2026-08-24 06:08:38 +00:00
const callback2 = tmp5;
2026-08-12 06:57:52 +00:00
let callback = tmp2;
let attachmentUrl;
attachmentUrl = attachmentUrl.nativeEvent.data.attachmentUrl;
callback = undefined;
2026-08-24 06:08:38 +00:00
dependencyMap = 1;
2026-07-29 08:29:29 +00:00
c4 = 1;
2026-08-12 06:57:52 +00:00
return { value: "ct", done: true };
}
} else {
if (1 === tmp5) {
if (arg0 === 1) {
c4 = 3;
throw arg1;
} else if (arg0 === 2) {
c4 = 3;
2026-08-24 06:08:38 +00:00
obj1 = { value: null, done: true };
2026-08-12 06:57:52 +00:00
obj1[0] = arg1;
return obj1;
} else {
if (null != attachmentUrl) {
if ("" !== attachmentUrl) {
2026-08-24 06:08:38 +00:00
let obj2 = callback2(9122);
dependencyMap = 2;
2026-08-12 06:57:52 +00:00
c4 = 1;
obj2 = { value: null, done: false };
obj2[0] = obj2.maybeRefreshAttachmentUrl(attachmentUrl);
return obj2;
}
}
c4 = 3;
}
} else if (arg0 === 1) {
c4 = 3;
throw arg1;
} else if (arg0 !== 2) {
callback = arg1;
obj = { urlString: null };
obj[0] = callback;
2026-08-24 06:08:38 +00:00
callback(10820)(obj);
2026-07-29 08:29:29 +00:00
}
2026-08-12 06:57:52 +00:00
c4 = 3;
const obj3 = { value: null, done: true };
obj3[0] = arg1;
return obj3;
2026-07-29 08:29:29 +00:00
}
2026-08-12 06:57:52 +00:00
} catch (tmp22) {
c4 = tmp;
throw tmp22;
2026-07-29 08:29:29 +00:00
}
}
})();
iter.next();
return iter;
});
obj[2] = function() {
const self = this;
2026-08-24 06:08:38 +00:00
const apply = closure_4.apply;
2026-07-29 08:29:29 +00:00
if (typeof apply === "unknown") {
let applyArgumentsResult = HermesBuiltin.applyArguments(self);
} else {
applyArgumentsResult = apply(self, arguments);
}
return applyArgumentsResult;
2026-07-20 16:05:17 +00:00
};
2026-07-29 08:29:29 +00:00
obj[3] = function onTapMention(closure_0) {
2026-08-24 06:08:38 +00:00
let obj = parsedUserId(10778);
2026-07-29 08:29:29 +00:00
const nativeSyntheticEventData = obj.getNativeSyntheticEventData(closure_0);
2026-07-20 16:05:17 +00:00
({ userId, channelId, roleName, parsedUserId } = nativeSyntheticEventData);
({ roleId, guildId } = nativeSyntheticEventData);
if (null != userId) {
2026-07-29 08:29:29 +00:00
obj = { userId: null, channelId: null, sourceAnalyticsLocations: null };
obj[0] = userId;
obj[1] = channelId;
2026-08-24 06:08:38 +00:00
const items = [QUICK_SWITCHERDefault.USER_MENTION];
2026-07-29 08:29:29 +00:00
obj[2] = items;
2026-08-24 06:08:38 +00:00
showUserProfileActionSheetDefault(obj);
const tmp15 = showUserProfileActionSheetDefault;
2026-07-20 16:05:17 +00:00
} else {
if (null != roleId) {
if (null != guildId) {
2026-07-29 08:29:29 +00:00
obj = { guildId: null, roleId: null, channelId: null };
obj[0] = guildId;
obj[1] = roleId;
obj[2] = channelId;
2026-08-24 06:08:38 +00:00
ACTION_SHEET_HEIGHT_HALFDefault.openLazy(tmp(2008)(10823, tmp2.paths), "RoleMembersActionSheet", obj);
const obj9 = ACTION_SHEET_HEIGHT_HALFDefault;
2026-07-20 16:05:17 +00:00
}
}
if ("@everyone" === roleName) {
if (null != guildId) {
2026-08-24 06:08:38 +00:00
obj1 = { guildId: null, roleId: null, channelId: null };
2026-07-29 08:29:29 +00:00
obj1[0] = guildId;
2026-08-24 06:08:38 +00:00
const obj6 = ACTION_SHEET_HEIGHT_HALFDefault;
const tmp10 = tmp(2008)(10823, tmp2.paths);
obj1[1] = DISCORD_EPOCHDefault.castGuildIdAsEveryoneGuildRoleId(guildId);
2026-07-29 08:29:29 +00:00
obj1[2] = channelId;
obj6.openLazy(tmp10, "RoleMembersActionSheet", obj1);
2026-08-24 06:08:38 +00:00
const obj8 = DISCORD_EPOCHDefault;
2026-07-20 16:05:17 +00:00
}
}
if (null == roleName) {
2026-08-24 06:08:38 +00:00
const DeveloperMode = tmp(4069).DeveloperMode;
2026-07-20 16:05:17 +00:00
if (DeveloperMode.getSetting()) {
if (null != parsedUserId) {
2026-07-29 08:29:29 +00:00
const obj2 = { secondaryConfirmText: null, onConfirmSecondary: null };
const intl = tmp(1236).intl;
obj2[0] = intl.string(tmp(1236).t["/AXYnE"]);
obj2[1] = function onConfirmSecondary() {
2026-08-24 06:08:38 +00:00
parsedUserId(closure_1_3[14]).copy(parsedUserId);
const obj = parsedUserId(closure_1_3[14]);
const result = parsedUserId(closure_1_3[15]).presentCopiedToClipboard();
2026-07-20 16:05:17 +00:00
};
let obj4 = obj2;
}
2026-08-24 06:08:38 +00:00
let obj3 = setDefault;
2026-07-29 08:29:29 +00:00
obj3 = { title: null, body: null, confirmText: null, isDismissable: true };
const intl2 = tmp(1236).intl;
obj3[0] = intl2.string(tmp(1236).t.r0DLNm);
const intl3 = tmp(1236).intl;
obj3[1] = intl3.string(tmp(1236).t.Fqqbhg);
const intl4 = tmp(1236).intl;
obj3[2] = intl4.string(tmp(1236).t.BddRzS);
2026-07-20 16:05:17 +00:00
const merged = Object.assign(obj4);
obj3.show(obj3);
}
obj4 = {};
}
}
};
2026-07-29 08:29:29 +00:00
obj[4] = function onTapTimestamp(nativeEvent) {
2026-08-24 06:08:38 +00:00
presentAddedFriendToast.presentTimestamp(nativeEvent.nativeEvent.node.full);
2026-07-20 16:05:17 +00:00
};
2026-07-29 08:29:29 +00:00
obj[5] = function onTapInlineCode(nativeEvent) {
2026-07-20 16:05:17 +00:00
const node = nativeEvent.nativeEvent.node;
if (tmp) {
2026-08-24 06:08:38 +00:00
_copy.copy(node.content);
const obj = _copy;
const result = presentAddedFriendToast.presentCopiedToClipboard();
const obj2 = presentAddedFriendToast;
2026-07-20 16:05:17 +00:00
}
};
2026-07-29 08:29:29 +00:00
obj[6] = function onTapEmoji(emojiNode) {
2026-08-24 06:08:38 +00:00
ACTION_SHEET_HEIGHT_HALFDefault.openLazy(asyncRequireImpl(9437, dependencyMap.paths), "MessageEmojiActionSheet", { emojiNode: emojiNode.nativeEvent.node });
2026-07-20 16:05:17 +00:00
};
2026-08-24 06:08:38 +00:00
let result = require("set").fileFinishedImporting("components_native/chat/contentHandlers.tsx");
2026-07-20 16:05:17 +00:00
export const contentHandlers = obj;