// Module ID: 11185 // Function ID: 11186 // Name: onTapMention // Dependencies: [5, 11183, 10033, 8646, 4190, 11146, 8896, 5973, 4445, 11186, 2009, 11, 4166, 1236, 5981, 4193, 4857, 9171, 2] // Module 11185 (onTapMention) import DISCORD_EPOCHDefault from "DISCORD_EPOCH" /* 11 */; import asyncRequireImpl from "asyncRequireImpl" /* 2009 */; import presentAddedFriendToast from "presentAddedFriendToast" /* 4193 */; import ACTION_SHEET_HEIGHT_HALFDefault from "ACTION_SHEET_HEIGHT_HALF" /* 4445 */; import setDefault from "set" /* 4857 */; import QUICK_SWITCHERDefault from "QUICK_SWITCHER" /* 5973 */; import _copy from "_copy" /* 5981 */; import showUserProfileActionSheetDefault from "showUserProfileActionSheet" /* 8896 */; import showLongPressURLActionSheetDefault from "showLongPressURLActionSheet" /* 11183 */; import importDefaultResult from "asyncGeneratorStep" /* 5 */; require = arg1; 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; showLongPressURLActionSheetDefault(obj); } }, onTapAttachmentLink: null, onLongPressAttachmentLink: null, onTapMention: null, onTapTimestamp: null, onTapInlineCode: null, onTapEmoji: null }; let closure_5 = importDefaultResult((arg0) => { closure_0 = arg0; c3 = 0; c4 = 0; const iter = (function*(arg0) { let callback = tmp2; attachmentUrl = attachmentUrl.nativeEvent.data.attachmentUrl; yield "PX_16"; if (1 === tmp5) { if (arg0 === 1) { c4 = 3; throw arg1; } else if (arg0 === 2) { c4 = 3; obj1 = { value: null, done: true }; obj1[0] = arg1; return obj1; } else { if (null != attachmentUrl) { if ("" !== attachmentUrl) { const obj3 = callback2(10033); dependencyMap = 2; 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; const obj = callback(8646); obj.trackLinkClicked(callback); obj1 = callback(4190); obj1.openURL(callback); } return arg1; })(); iter.next(); return iter; }); obj[1] = function() { const self = this; const apply = closure_5.apply; if (typeof apply === "unknown") { let applyArgumentsResult = HermesBuiltin.applyArguments(self); } else { applyArgumentsResult = apply(self, arguments); } return applyArgumentsResult; }; let closure_4 = importDefaultResult((arg0) => { closure_0 = arg0; c3 = 0; c4 = 0; const iter = (function*(arg0) { let callback = tmp2; attachmentUrl = attachmentUrl.nativeEvent.data.attachmentUrl; yield "PX_16"; if (1 === tmp5) { if (arg0 === 1) { c4 = 3; throw arg1; } else if (arg0 === 2) { c4 = 3; obj1 = { value: null, done: true }; obj1[0] = arg1; return obj1; } else { if (null != attachmentUrl) { if ("" !== attachmentUrl) { let obj2 = callback2(10033); dependencyMap = 2; 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; const obj = { urlString: null }; obj[0] = callback; callback(11183)(obj); } return arg1; })(); iter.next(); return iter; }); obj[2] = function() { const self = this; const apply = closure_4.apply; if (typeof apply === "unknown") { let applyArgumentsResult = HermesBuiltin.applyArguments(self); } else { applyArgumentsResult = apply(self, arguments); } return applyArgumentsResult; }; obj[3] = function onTapMention(closure_0) { let obj = parsedUserId(11146); const nativeSyntheticEventData = obj.getNativeSyntheticEventData(closure_0); ({ userId, channelId, roleName, parsedUserId } = nativeSyntheticEventData); ({ roleId, guildId } = nativeSyntheticEventData); if (null != userId) { obj = { userId: null, channelId: null, sourceAnalyticsLocations: null }; obj[0] = userId; obj[1] = channelId; const items = [QUICK_SWITCHERDefault.USER_MENTION]; obj[2] = items; showUserProfileActionSheetDefault(obj); const tmp15 = showUserProfileActionSheetDefault; } else { if (null != roleId) { if (null != guildId) { obj = { guildId: null, roleId: null, channelId: null }; obj[0] = guildId; obj[1] = roleId; obj[2] = channelId; ACTION_SHEET_HEIGHT_HALFDefault.openLazy(tmp(2009)(11186, tmp2.paths), "RoleMembersActionSheet", obj); const obj9 = ACTION_SHEET_HEIGHT_HALFDefault; } } if ("@everyone" === roleName) { if (null != guildId) { obj1 = { guildId: null, roleId: null, channelId: null }; obj1[0] = guildId; const obj6 = ACTION_SHEET_HEIGHT_HALFDefault; const tmp10 = tmp(2009)(11186, tmp2.paths); obj1[1] = DISCORD_EPOCHDefault.castGuildIdAsEveryoneGuildRoleId(guildId); obj1[2] = channelId; obj6.openLazy(tmp10, "RoleMembersActionSheet", obj1); const obj8 = DISCORD_EPOCHDefault; } } if (null == roleName) { const DeveloperMode = tmp(4166).DeveloperMode; if (DeveloperMode.getSetting()) { if (null != parsedUserId) { const obj2 = { secondaryConfirmText: null, onConfirmSecondary: null }; const intl = tmp(1236).intl; obj2[0] = intl.string(tmp(1236).t["/AXYnE"]); obj2[1] = function onConfirmSecondary() { parsedUserId(closure_1_3[14]).copy(parsedUserId); const obj = parsedUserId(closure_1_3[14]); const result = parsedUserId(closure_1_3[15]).presentCopiedToClipboard(); }; let obj4 = obj2; } let obj3 = setDefault; 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); const merged = Object.assign(obj4); obj3.show(obj3); } obj4 = {}; } } }; obj[4] = function onTapTimestamp(nativeEvent) { presentAddedFriendToast.presentTimestamp(nativeEvent.nativeEvent.node.full); }; obj[5] = function onTapInlineCode(nativeEvent) { const node = nativeEvent.nativeEvent.node; if (tmp) { _copy.copy(node.content); const obj = _copy; const result = presentAddedFriendToast.presentCopiedToClipboard(); const obj2 = presentAddedFriendToast; } }; obj[6] = function onTapEmoji(emojiNode) { ACTION_SHEET_HEIGHT_HALFDefault.openLazy(asyncRequireImpl(9171, dependencyMap.paths), "MessageEmojiActionSheet", { emojiNode: emojiNode.nativeEvent.node }); }; let result = require("set").fileFinishedImporting("components_native/chat/contentHandlers.tsx"); export const contentHandlers = obj;