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

190 lines
7.8 KiB
TypeScript
Raw Normal View History

2026-08-24 06:08:38 +00:00
// Module ID: 10495
// Function ID: 10496
2026-07-20 16:05:17 +00:00
// Name: handleOutOfSuperReactions
2026-08-24 06:08:38 +00:00
// Dependencies: [1391, 4999, 4201, 1922, 676, 1925, 21, 4035, 4347, 4348, 7549, 4042, 4346, 9354, 2008, 4241, 9335, 7548, 5047, 10496, 10508, 10509, 10510, 7978, 8024, 4832, 1236, 4739, 2]
2026-07-29 08:29:29 +00:00
// Exports: handleAddNewReactions, handleOutOfSuperReactions, handleRemoveAllReactions, handleViewPreviewReactions, handleViewReactions
2026-07-20 16:05:17 +00:00
2026-08-24 06:08:38 +00:00
// Module 10495 (handleOutOfSuperReactions)
import asyncRequireImpl from "asyncRequireImpl" /* 2008 */;
import getPremiumPlanItem from "getPremiumPlanItem" /* 4042 */;
import ACTION_SHEET_HEIGHT_HALFDefault from "ACTION_SHEET_HEIGHT_HALF" /* 4346 */;
import setDefault from "set" /* 4832 */;
import collectGuildAnalyticsMetadataDefault from "collectGuildAnalyticsMetadata" /* 5047 */;
import registerAssetDefault from "registerAsset" /* 10509 */;
import registerAssetDefault2 from "registerAsset" /* 10510 */;
import closure_3 from "ensureGuildLoaded" /* 1391 */;
import closure_4 from "reinjectEphemerals" /* 4999 */;
import closure_5 from "handleConnectionOpen" /* 4201 */;
import closure_6 from "mergeGuildAvatar" /* 1922 */;
import ME from "ME" /* 676 */;
import { EmojiIntention } from "set" /* 1925 */;
import { jsx } from "jsxProd" /* 21 */;
2026-07-23 10:11:24 +00:00
2026-08-24 06:08:38 +00:00
require = arg1;
({ AnalyticEvents: error, AnalyticsPages: closure_8, AnalyticsSections: c9 } = ME);
2026-07-20 16:05:17 +00:00
let obj = {};
2026-08-24 06:08:38 +00:00
obj[require("ReactionTypes").ReactionTypes.NORMAL] = registerAssetDefault;
obj[require("ReactionTypes").ReactionTypes.BURST] = registerAssetDefault2;
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;
2026-08-24 06:08:38 +00:00
let result = require("set").fileFinishedImporting("modules/reactions/native/ReactionUtils.tsx");
2026-07-20 16:05:17 +00:00
2026-07-29 08:29:29 +00:00
export const handleOutOfSuperReactions = function handleOutOfSuperReactions(arg0) {
const currentUser = authStore.getCurrentUser();
if (null != currentUser) {
2026-08-24 06:08:38 +00:00
let obj = getPremiumPlanItem;
2026-07-29 08:29:29 +00:00
let openLazyResult;
if (!obj.isPremium(currentUser)) {
obj = { onDismiss: null };
obj[0] = arg0;
2026-08-24 06:08:38 +00:00
openLazyResult = ACTION_SHEET_HEIGHT_HALFDefault.openLazy(asyncRequireImpl(9354, dependencyMap.paths), "SuperReactionUpsellActionSheet", obj);
const obj2 = ACTION_SHEET_HEIGHT_HALFDefault;
2026-07-29 08:29:29 +00:00
}
return openLazyResult;
}
};
2026-07-20 16:05:17 +00:00
export const handleAddNewReactions = function handleAddNewReactions(channel, id, MESSAGE, burst) {
2026-07-23 10:11:24 +00:00
const _require = channel;
2026-08-24 06:08:38 +00:00
importDefault = 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
}
2026-07-29 08:29:29 +00:00
if (burst != null) {
2026-07-20 16:05:17 +00:00
burst = burst.burst;
}
2026-07-29 08:29:29 +00:00
let tmp10Result = authStore;
2026-07-20 16:05:17 +00:00
const currentUser = authStore.getCurrentUser();
if (null != currentUser) {
2026-07-29 08:29:29 +00:00
let ReactionTypes = MESSAGE;
2026-07-23 10:11:24 +00:00
const isPremiumResult = _require(MESSAGE[11]).isPremium(currentUser);
2026-07-29 08:29:29 +00:00
let tmp4 = tmp12;
if (true === burst) {
tmp4 = !isPremiumResult;
2026-07-20 16:05:17 +00:00
}
2026-07-29 08:29:29 +00:00
if (tmp4) {
const currentUser1 = tmp10Result.getCurrentUser();
if (null != currentUser1) {
let tmp13Result = tmp13(ReactionTypes[11]);
if (!tmp13Result.isPremium(currentUser1)) {
2026-08-15 05:55:55 +00:00
importDefault(ReactionTypes[12]).openLazy(tmp13(ReactionTypes[14])(ReactionTypes[13], ReactionTypes.paths), "SuperReactionUpsellActionSheet", { onDismiss: "r" });
2026-07-29 08:29:29 +00:00
const obj3 = importDefault(ReactionTypes[12]);
}
}
2026-07-20 16:05:17 +00:00
}
2026-07-29 08:29:29 +00:00
tmp13Result = tmp13(ReactionTypes[15]);
const bestActiveInputForChannelId = tmp13Result.getBestActiveInputForChannelId(channel.id);
if (bestActiveInputForChannelId != null) {
2026-07-20 16:05:17 +00:00
bestActiveInputForChannelId.closeCustomKeyboard();
}
2026-07-29 08:29:29 +00:00
_require(ReactionTypes[16]);
tmp10Result = { onPressEmoji: null, channel: null, pickerIntention: null, reactionType: null, analyticsObject: null, messageId: null };
tmp10Result[0] = function onPressEmoji(byName, burst) {
2026-08-24 06:08:38 +00:00
id = channel.id;
2026-07-29 08:29:29 +00:00
const obj = { burst };
if (null != byName) {
const toReactionEmojiResult = channel(MESSAGE[7]).toReactionEmoji(byName);
if (!obj.burst) {
let tmp3Result = tmp3(tmp4[8]);
const result = tmp3Result.triggerHapticFeedback(id(tmp4[9]).IMPACT_LIGHT);
}
tmp3Result = tmp3(tmp4[10]);
tmp3Result.addReaction(id, tmp, toReactionEmojiResult, tmp2, obj);
const obj2 = channel(MESSAGE[7]);
}
2026-07-20 16:05:17 +00:00
};
2026-07-29 08:29:29 +00:00
tmp10Result[1] = channel;
tmp10Result[2] = EmojiIntention.REACTION;
if (true !== burst) {
tmp10Result[3] = tmp13(ReactionTypes[17]).ReactionTypes.NORMAL;
tmp10Result[4] = MESSAGE;
tmp10Result[5] = id;
tmp10Result = tmp10(tmp10Result);
2026-07-20 16:05:17 +00:00
}
2026-07-29 08:29:29 +00:00
ReactionTypes = tmp13(ReactionTypes[17]).ReactionTypes;
const BURST = ReactionTypes.BURST;
const obj7 = _require(MESSAGE[11]);
2026-07-20 16:05:17 +00:00
}
};
export const handleViewReactions = function handleViewReactions(isPoll) {
({ messageId, channelId, location: _location } = isPoll);
if (_location === undefined) {
_location = {};
}
isPoll = isPoll.isPoll;
2026-07-29 08:29:29 +00:00
const merged = Object.assign(isPoll, Object.create(null));
2026-07-23 10:11:24 +00:00
channel = channel.getChannel(channelId);
2026-07-29 08:29:29 +00:00
let isPrivateResult;
if (channel != null) {
isPrivateResult = channel.isPrivate();
}
let isForumLikeChannelResult;
if (channel != null) {
isForumLikeChannelResult = channel.isForumLikeChannel();
}
if (!isForumLikeChannelResult) {
let isForumPostResult;
if (channel != null) {
isForumPostResult = channel.isForumPost();
2026-07-20 16:05:17 +00:00
}
2026-07-29 08:29:29 +00:00
if (!isForumPostResult) {
let FORUM_CHANNEL_POST = constants2.CHANNEL;
}
if (isPoll == null) {
message = message.getMessage(channelId, messageId);
let isPollResult;
if (message != null) {
isPollResult = message.isPoll();
2026-07-20 16:05:17 +00:00
}
2026-07-29 08:29:29 +00:00
isPoll = true === isPollResult;
2026-07-20 16:05:17 +00:00
}
2026-07-29 08:29:29 +00:00
let obj = { guild_id: null, channel_id: null, location_message_id: null, location_message_is_poll: null, location: null };
obj[0] = guildId.getGuildId();
obj[1] = channelId;
obj[2] = messageId;
obj[3] = isPoll;
obj = { page: null, section: null };
obj[0] = tmp4;
obj[1] = FORUM_CHANNEL_POST;
const merged1 = Object.assign(_location);
obj[4] = obj;
2026-08-24 06:08:38 +00:00
collectGuildAnalyticsMetadataDefault.trackWithMetadata(constants.REACTION_ACTION_SHEET_OPENED, obj);
const obj3 = collectGuildAnalyticsMetadataDefault;
obj1 = { messageId: null, channelId: null, emoji: null };
2026-07-29 08:29:29 +00:00
obj1[0] = messageId;
obj1[1] = channelId;
obj1[2] = isPoll.emoji;
2026-08-24 06:08:38 +00:00
const obj6 = ACTION_SHEET_HEIGHT_HALFDefault;
2026-07-29 08:29:29 +00:00
const merged2 = Object.assign(merged);
2026-08-24 06:08:38 +00:00
obj6.openLazy(asyncRequireImpl(10496, dependencyMap.paths), "MessageReactions", obj1);
2026-07-20 16:05:17 +00:00
}
2026-07-29 08:29:29 +00:00
FORUM_CHANNEL_POST = constants2.FORUM_CHANNEL_POST;
2026-07-20 16:05:17 +00:00
};
export const handleViewPreviewReactions = function handleViewPreviewReactions(id2, id, emoji) {
2026-08-24 06:08:38 +00:00
let obj = ACTION_SHEET_HEIGHT_HALFDefault;
2026-07-20 16:05:17 +00:00
obj = { messageId: id2, channelId: id, emoji };
2026-08-24 06:08:38 +00:00
obj.openLazy(asyncRequireImpl(10508, 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-08-24 06:08:38 +00:00
importDefault = arg1;
let obj = setDefault;
2026-07-29 08:29:29 +00:00
obj = { title: null, children: null, cancelText: null, confirmText: null, onConfirm: null };
const intl = _require(1236).intl;
obj[0] = intl.string(_require(1236).t.ZbtGBm);
obj = { variant: "text-md/normal", children: null };
const intl2 = _require(1236).intl;
obj[1] = intl2.string(_require(1236).t.VpjOCo);
2026-08-24 06:08:38 +00:00
obj[1] = jsx(_require(4739).Text, { variant: "text-md/normal", children: null });
2026-07-29 08:29:29 +00:00
const intl3 = _require(1236).intl;
obj[2] = intl3.string(_require(1236).t["ETE/oC"]);
const intl4 = _require(1236).intl;
obj[3] = intl4.string(_require(1236).t.oyYWHE);
obj[4] = function onConfirm() {
2026-08-24 06:08:38 +00:00
return callback(closure_1_2[10]).removeAllReactions(callback, closure_1);
2026-07-20 16:05:17 +00:00
};
obj.show(obj);
};