decord/source/modules/reactions/native/ReactionUtils.tsx

168 lines
6.6 KiB
TypeScript
Raw Normal View History

2026-07-25 08:10:48 +00:00
// Module ID: 9244
2026-07-27 11:26:19 +00:00
// Function ID: 72528
2026-07-20 16:05:17 +00:00
// Name: handleOutOfSuperReactions
2026-07-25 08:10:48 +00:00
// Dependencies: [1348, 4350, 3948, 1850, 653, 1853, 33, 3770, 4100, 4101, 6022, 3777, 4099, 9245, 1935, 3990, 9268, 6023, 4325, 9383, 9393, 9394, 9395, 6519, 6567, 4471, 1212, 4127, 2]
2026-07-20 16:05:17 +00:00
// Exports: handleAddNewReactions, handleRemoveAllReactions, handleViewPreviewReactions, handleViewReactions
2026-07-25 08:10:48 +00:00
// Module 9244 (handleOutOfSuperReactions)
2026-07-23 10:11:24 +00:00
import _isNativeReflectConstruct from "_isNativeReflectConstruct";
import closure_4 from "_isNativeReflectConstruct";
import closure_5 from "_isNativeReflectConstruct";
import closure_6 from "_isNativeReflectConstruct";
import ME from "ME";
import { EmojiIntention } from "set";
import { jsx } from "jsxProd";
let closure_7;
let closure_8;
let closure_9;
const require = arg1;
2026-07-20 16:05:17 +00:00
function handleOutOfSuperReactions(onDismiss) {
const currentUser = authStore.getCurrentUser();
if (null != currentUser) {
2026-07-25 08:10:48 +00:00
let obj = require(3777) /* _createForOfIteratorHelperLoose */;
2026-07-20 16:05:17 +00:00
let openLazyResult;
if (!obj.isPremium(currentUser)) {
obj = { onDismiss };
2026-07-25 08:10:48 +00:00
openLazyResult = importDefault(4099).openLazy(require(1935) /* maybeLoadBundle */(9245, dependencyMap.paths), "SuperReactionUpsellActionSheet", obj);
const obj2 = importDefault(4099);
2026-07-20 16:05:17 +00:00
}
return openLazyResult;
}
}
2026-07-23 10:11:24 +00:00
({ AnalyticEvents: closure_7, AnalyticsPages: closure_8, AnalyticsSections: closure_9 } = ME);
2026-07-20 16:05:17 +00:00
let obj = {};
2026-07-23 10:11:24 +00:00
obj[require("ReactionTypes").ReactionTypes.NORMAL] = require("registerAsset");
obj[require("ReactionTypes").ReactionTypes.BURST] = require("registerAsset");
2026-07-20 16:05:17 +00:00
obj = {};
2026-07-23 10:11:24 +00:00
obj[require("ReactionTypes").ReactionTypes.NORMAL] = require("ReactionIcon").ReactionIcon;
obj[require("ReactionTypes").ReactionTypes.BURST] = require("SuperReactionIcon").SuperReactionIcon;
let result = require("_isNativeReflectConstruct").fileFinishedImporting("modules/reactions/native/ReactionUtils.tsx");
2026-07-20 16:05:17 +00:00
export { handleOutOfSuperReactions };
export const handleAddNewReactions = function handleAddNewReactions(channel, id, MESSAGE, burst) {
2026-07-23 10:11:24 +00:00
const _require = channel;
let closure_1 = id;
2026-07-20 16:05:17 +00:00
if (MESSAGE === undefined) {
2026-07-23 10:11:24 +00:00
MESSAGE = _require(MESSAGE[10]).ReactionLocations.MESSAGE;
2026-07-20 16:05:17 +00:00
}
burst = undefined;
if (null != burst) {
burst = burst.burst;
}
const currentUser = authStore.getCurrentUser();
if (null != currentUser) {
2026-07-23 10:11:24 +00:00
const isPremiumResult = _require(MESSAGE[11]).isPremium(currentUser);
2026-07-20 16:05:17 +00:00
let tmp6 = tmp4;
if (tmp4) {
tmp6 = !isPremiumResult;
}
if (tmp6) {
handleOutOfSuperReactions();
}
2026-07-23 10:11:24 +00:00
let tmp15Result = _require(MESSAGE[15]);
2026-07-20 16:05:17 +00:00
const bestActiveInputForChannelId = tmp15Result.getBestActiveInputForChannelId(channel.id);
if (null != bestActiveInputForChannelId) {
bestActiveInputForChannelId.closeCustomKeyboard();
}
2026-07-23 10:11:24 +00:00
_require(MESSAGE[16]);
2026-07-20 16:05:17 +00:00
tmp15Result = {
onPressEmoji(byName, burst) {
2026-07-23 10:11:24 +00:00
const id = channel.id;
2026-07-20 16:05:17 +00:00
const obj = { burst };
if (null != byName) {
2026-07-23 10:11:24 +00:00
const toReactionEmojiResult = channel(MESSAGE[7]).toReactionEmoji(byName);
2026-07-20 16:05:17 +00:00
if (!tmp3) {
2026-07-23 10:11:24 +00:00
const result = channel(MESSAGE[8]).triggerHapticFeedback(id(MESSAGE[9]).IMPACT_LIGHT);
const obj2 = channel(MESSAGE[8]);
2026-07-20 16:05:17 +00:00
}
2026-07-23 10:11:24 +00:00
const obj3 = channel(MESSAGE[10]);
2026-07-20 16:05:17 +00:00
obj3.addReaction(id, tmp, toReactionEmojiResult, tmp2, obj);
2026-07-23 10:11:24 +00:00
const obj4 = channel(MESSAGE[7]);
tmp3 = null != obj && obj.burst;
2026-07-20 16:05:17 +00:00
}
},
channel,
pickerIntention: EmojiIntention.REACTION
};
if (!tmp4) {
2026-07-23 10:11:24 +00:00
tmp15Result.reactionType = _require(MESSAGE[17]).ReactionTypes.NORMAL;
2026-07-20 16:05:17 +00:00
tmp15Result.analyticsObject = MESSAGE;
tmp15Result.messageId = id;
tmp15Result = tmp15(tmp15Result);
}
2026-07-23 10:11:24 +00:00
const BURST = _require(MESSAGE[17]).ReactionTypes.BURST;
let obj4 = _require(MESSAGE[11]);
2026-07-20 16:05:17 +00:00
}
};
export const handleViewReactions = function handleViewReactions(isPoll) {
let _location;
let channelId;
let messageId;
({ messageId, channelId, location: _location } = isPoll);
if (_location === undefined) {
_location = {};
}
isPoll = isPoll.isPoll;
2026-07-23 10:11:24 +00:00
let obj = { messageId: 0, channelId: 0, location: 0, isPoll: 0, emoji: 0 };
2026-07-20 16:05:17 +00:00
Object.setPrototypeOf(null);
const merged = Object.assign(isPoll, obj);
2026-07-23 10:11:24 +00:00
channel = channel.getChannel(channelId);
2026-07-20 16:05:17 +00:00
if (null != channel) {
if (channel.isPrivate()) {
let GUILD_CHANNEL = constants2.DM_CHANNEL;
}
if (null == channel) {
if (null != channel) {
if (null == isPoll) {
2026-07-23 10:11:24 +00:00
message = message.getMessage(channelId, messageId);
2026-07-20 16:05:17 +00:00
let isPollResult;
if (null != message) {
isPollResult = message.isPoll();
}
isPoll = true === isPollResult;
}
obj = { guild_id: guildId.getGuildId(), channel_id: channelId, location_message_id: messageId, location_message_is_poll: isPoll };
obj = { page: GUILD_CHANNEL, section: constants3.CHANNEL };
const merged1 = Object.assign(_location);
obj.location = obj;
2026-07-25 08:10:48 +00:00
importDefault(4325).trackWithMetadata(constants.REACTION_ACTION_SHEET_OPENED, obj);
const obj4 = importDefault(4325);
2026-07-20 16:05:17 +00:00
const obj1 = { messageId, channelId, emoji: isPoll.emoji };
2026-07-25 08:10:48 +00:00
const obj7 = importDefault(4099);
2026-07-20 16:05:17 +00:00
const merged2 = Object.assign(merged);
2026-07-25 08:10:48 +00:00
obj7.openLazy(require(1935) /* maybeLoadBundle */(9383, dependencyMap.paths), "MessageReactions", obj1);
2026-07-20 16:05:17 +00:00
}
}
const FORUM_CHANNEL_POST = constants3.FORUM_CHANNEL_POST;
}
GUILD_CHANNEL = constants2.GUILD_CHANNEL;
};
export const handleViewPreviewReactions = function handleViewPreviewReactions(id2, id, emoji) {
2026-07-25 08:10:48 +00:00
let obj = importDefault(4099);
2026-07-20 16:05:17 +00:00
obj = { messageId: id2, channelId: id, emoji };
2026-07-25 08:10:48 +00:00
obj.openLazy(require(1935) /* maybeLoadBundle */(9393, dependencyMap.paths), "MessagePreviewReactions", obj);
2026-07-20 16:05:17 +00:00
};
export const ADD_REACTION_ICONS = obj;
export const ADD_REACTION_ICON_COMPONENTS = obj;
export const handleRemoveAllReactions = function handleRemoveAllReactions(arg0, arg1) {
2026-07-23 10:11:24 +00:00
const _require = arg0;
2026-07-20 16:05:17 +00:00
const importDefault = arg1;
2026-07-25 08:10:48 +00:00
let obj = importDefault(4471);
2026-07-20 16:05:17 +00:00
obj = {};
2026-07-23 10:11:24 +00:00
const intl = _require(1212).intl;
obj.title = intl.string(_require(1212).t.ZbtGBm);
2026-07-20 16:05:17 +00:00
obj = { variant: "text-md/normal" };
2026-07-23 10:11:24 +00:00
const intl2 = _require(1212).intl;
obj.children = intl2.string(_require(1212).t.VpjOCo);
2026-07-25 08:10:48 +00:00
obj.children = jsx(_require(4127).Text, { variant: "text-md/normal" });
2026-07-23 10:11:24 +00:00
const intl3 = _require(1212).intl;
obj.cancelText = intl3.string(_require(1212).t["ETE/oC"]);
const intl4 = _require(1212).intl;
obj.confirmText = intl4.string(_require(1212).t.oyYWHE);
2026-07-20 16:05:17 +00:00
obj.onConfirm = function onConfirm() {
2026-07-23 10:11:24 +00:00
return callback(outer1_2[10]).removeAllReactions(callback, closure_1);
2026-07-20 16:05:17 +00:00
};
obj.show(obj);
};