2026-08-24 06:08:38 +00:00
|
|
|
// Module ID: 4035
|
|
|
|
|
// Function ID: 4036
|
2026-07-29 08:29:29 +00:00
|
|
|
// Name: MAX_REACTIONS
|
2026-08-24 06:08:38 +00:00
|
|
|
// Dependencies: [1218, 676, 4036, 4037, 1236, 7548, 4069, 698, 2]
|
2026-08-03 11:20:01 +00:00
|
|
|
// Exports: emojiEquals, getAccessibleEmojiDisplayName, getBurstAnalyticsSection, getReactionEmojiName, isCustomReactionEmojiId, isMeReaction, shouldApplyReaction, toReactionEmoji, updateReactionNotificationsSetting
|
2026-07-20 16:05:17 +00:00
|
|
|
|
2026-08-24 06:08:38 +00:00
|
|
|
// Module 4035 (MAX_REACTIONS)
|
|
|
|
|
import expandEventPropertiesDefault from "expandEventProperties" /* 698 */;
|
|
|
|
|
import getSystemLocale from "getSystemLocale" /* 1236 */;
|
|
|
|
|
import parseRawEmojiObjectDefault from "parseRawEmojiObject" /* 4037 */;
|
|
|
|
|
import explicitContentFromProto from "explicitContentFromProto" /* 4069 */;
|
|
|
|
|
import ReactionTypes from "ReactionTypes" /* 7548 */;
|
|
|
|
|
import closure_3 from "fetchFingerprint" /* 1218 */;
|
|
|
|
|
import ME from "ME" /* 676 */;
|
|
|
|
|
import { NotificationSettingsUpdateType as closure_6 } from "AccountNotificationFlags" /* 4036 */;
|
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
|
|
|
({ AnalyticsSections: c4, AnalyticEvents: c5 } = ME);
|
2026-08-24 06:08:38 +00:00
|
|
|
let result = require("set").fileFinishedImporting("modules/reactions/ReactionUtils.tsx");
|
2026-07-29 08:29:29 +00:00
|
|
|
|
|
|
|
|
export const MAX_REACTIONS = 20;
|
|
|
|
|
export const getReactionEmojiName = function getReactionEmojiName(emoji) {
|
2026-07-20 16:05:17 +00:00
|
|
|
if (null == emoji.id) {
|
2026-08-24 06:08:38 +00:00
|
|
|
let result = parseRawEmojiObjectDefault.convertSurrogateToName(emoji.name);
|
|
|
|
|
const obj = parseRawEmojiObjectDefault;
|
2026-07-20 16:05:17 +00:00
|
|
|
} else {
|
|
|
|
|
const _HermesInternal = HermesInternal;
|
|
|
|
|
result = ":" + emoji.name + ":";
|
|
|
|
|
}
|
|
|
|
|
return result;
|
2026-07-29 08:29:29 +00:00
|
|
|
};
|
2026-07-20 16:05:17 +00:00
|
|
|
export const getAccessibleEmojiDisplayName = function getAccessibleEmojiDisplayName(me, count, emoji, arg3) {
|
2026-08-24 06:08:38 +00:00
|
|
|
const t = getSystemLocale.t;
|
2026-07-29 08:29:29 +00:00
|
|
|
if (arg3) {
|
|
|
|
|
if (me) {
|
|
|
|
|
Z_l_qu = t.i9DXqM;
|
|
|
|
|
let tmp6 = tmp2;
|
|
|
|
|
let tmp7 = tmp2;
|
|
|
|
|
let tmp8 = tmp;
|
|
|
|
|
} else {
|
|
|
|
|
Z_l_qu = t["Z/l+qu"];
|
|
|
|
|
tmp6 = tmp2;
|
|
|
|
|
tmp7 = tmp2;
|
|
|
|
|
tmp8 = tmp;
|
|
|
|
|
}
|
|
|
|
|
} else {
|
|
|
|
|
if (me) {
|
|
|
|
|
let PirBBE = t.CLuzw5;
|
|
|
|
|
let tmp5 = tmp;
|
|
|
|
|
} else {
|
|
|
|
|
PirBBE = t.PirBBE;
|
|
|
|
|
tmp5 = tmp;
|
|
|
|
|
}
|
|
|
|
|
const intl = tmp5(1236).intl;
|
|
|
|
|
const obj = { reactions: null, emojiName: null };
|
|
|
|
|
obj[0] = count;
|
|
|
|
|
if (null == emoji.id) {
|
2026-08-24 06:08:38 +00:00
|
|
|
let str2 = parseRawEmojiObjectDefault.convertSurrogateToName(emoji.name);
|
|
|
|
|
const obj2 = parseRawEmojiObjectDefault;
|
2026-07-29 08:29:29 +00:00
|
|
|
} else {
|
|
|
|
|
const _HermesInternal = HermesInternal;
|
|
|
|
|
str2 = ":" + emoji.name + ":";
|
|
|
|
|
}
|
|
|
|
|
let str3;
|
|
|
|
|
if (str2 != null) {
|
|
|
|
|
const str5 = str2.replace(/[:_]/g, " ");
|
|
|
|
|
if (str5 != null) {
|
|
|
|
|
str3 = str5.trim();
|
2026-07-20 16:05:17 +00:00
|
|
|
}
|
|
|
|
|
}
|
2026-07-29 08:29:29 +00:00
|
|
|
if (str3 == null) {
|
|
|
|
|
str3 = "";
|
2026-07-20 16:05:17 +00:00
|
|
|
}
|
2026-07-29 08:29:29 +00:00
|
|
|
obj[1] = str3;
|
|
|
|
|
return intl.formatToPlainString(PirBBE, obj);
|
2026-07-20 16:05:17 +00:00
|
|
|
}
|
|
|
|
|
};
|
2026-08-03 11:20:01 +00:00
|
|
|
export const isMeReaction = function isMeReaction(me, me_burst, arg2) {
|
2026-08-24 06:08:38 +00:00
|
|
|
let tmp3 = arg2 === ReactionTypes.ReactionTypes.BURST;
|
2026-08-03 11:20:01 +00:00
|
|
|
if (tmp3) {
|
|
|
|
|
tmp3 = true === me_burst;
|
|
|
|
|
}
|
|
|
|
|
if (!tmp3) {
|
2026-08-24 06:08:38 +00:00
|
|
|
let tmp5 = arg2 === ReactionTypes.ReactionTypes.NORMAL;
|
2026-08-03 11:20:01 +00:00
|
|
|
if (tmp5) {
|
|
|
|
|
tmp5 = true === me;
|
|
|
|
|
}
|
|
|
|
|
tmp3 = tmp5;
|
|
|
|
|
}
|
|
|
|
|
return tmp3;
|
|
|
|
|
};
|
2026-07-20 16:05:17 +00:00
|
|
|
export const toReactionEmoji = function toReactionEmoji(byName) {
|
2026-07-29 08:29:29 +00:00
|
|
|
let id = byName.id;
|
|
|
|
|
if (id == null) {
|
|
|
|
|
id = null;
|
2026-07-20 16:05:17 +00:00
|
|
|
}
|
2026-07-29 08:29:29 +00:00
|
|
|
const obj = { id, name: null, animated: null };
|
|
|
|
|
let str = null != byName.id ? byName.name : byName.optionallyDiverseSequence;
|
|
|
|
|
if (str == null) {
|
|
|
|
|
str = byName.name;
|
2026-07-20 16:05:17 +00:00
|
|
|
}
|
2026-07-29 08:29:29 +00:00
|
|
|
if (str == null) {
|
|
|
|
|
str = "";
|
2026-07-20 16:05:17 +00:00
|
|
|
}
|
2026-07-29 08:29:29 +00:00
|
|
|
obj[1] = str;
|
|
|
|
|
obj[2] = Boolean(byName.animated);
|
2026-07-20 16:05:17 +00:00
|
|
|
return obj;
|
|
|
|
|
};
|
|
|
|
|
export const isCustomReactionEmojiId = function isCustomReactionEmojiId(emojiId) {
|
|
|
|
|
let tmp = null != emojiId;
|
|
|
|
|
if (tmp) {
|
|
|
|
|
tmp = "" !== emojiId;
|
|
|
|
|
}
|
|
|
|
|
if (!tmp) {
|
|
|
|
|
return tmp;
|
2026-08-04 21:03:28 +00:00
|
|
|
} else if (typeof emojiId === "number") {
|
2026-07-29 08:29:29 +00:00
|
|
|
let tmp2 = 0 !== emojiId;
|
2026-07-20 16:05:17 +00:00
|
|
|
} else {
|
|
|
|
|
const _String = String;
|
2026-07-29 08:29:29 +00:00
|
|
|
tmp2 = "0" !== String(emojiId);
|
2026-07-20 16:05:17 +00:00
|
|
|
}
|
|
|
|
|
};
|
2026-07-23 10:11:24 +00:00
|
|
|
export const emojiEquals = function emojiEquals(emoji, closure_0) {
|
|
|
|
|
if (null != closure_0.id) {
|
2026-07-20 16:05:17 +00:00
|
|
|
if (null != emoji.id) {
|
|
|
|
|
const _HermesInternal = HermesInternal;
|
|
|
|
|
let id = "" + emoji.id;
|
|
|
|
|
} else {
|
|
|
|
|
id = emoji.id;
|
|
|
|
|
}
|
|
|
|
|
const _HermesInternal2 = HermesInternal;
|
2026-07-23 10:11:24 +00:00
|
|
|
return "" + closure_0.id === id;
|
2026-07-20 16:05:17 +00:00
|
|
|
} else {
|
2026-07-23 10:11:24 +00:00
|
|
|
return null == emoji.id && closure_0.name === emoji.name;
|
2026-07-20 16:05:17 +00:00
|
|
|
}
|
|
|
|
|
};
|
|
|
|
|
export const getBurstAnalyticsSection = function getBurstAnalyticsSection(isThread) {
|
|
|
|
|
if (isThread.isThread()) {
|
|
|
|
|
let FORUM_CHANNEL_TEXT_AREA = constants.THREAD_TEXT_AREA;
|
|
|
|
|
} else if (isThread.isForumPost()) {
|
|
|
|
|
FORUM_CHANNEL_TEXT_AREA = constants.FORUM_CHANNEL_TEXT_AREA;
|
|
|
|
|
} else {
|
|
|
|
|
FORUM_CHANNEL_TEXT_AREA = isThread.isGuildVocal() ? tmp.TEXT_IN_VOICE : tmp.CHANNEL_TEXT_AREA;
|
|
|
|
|
}
|
|
|
|
|
return FORUM_CHANNEL_TEXT_AREA;
|
|
|
|
|
};
|
|
|
|
|
export const shouldApplyReaction = function shouldApplyReaction(optimistic) {
|
|
|
|
|
optimistic = optimistic.optimistic;
|
|
|
|
|
if (optimistic) {
|
|
|
|
|
optimistic = id.getId() !== optimistic.userId;
|
|
|
|
|
}
|
|
|
|
|
return !optimistic;
|
|
|
|
|
};
|
|
|
|
|
export const updateReactionNotificationsSetting = function updateReactionNotificationsSetting(NumberResult, setting) {
|
2026-08-24 06:08:38 +00:00
|
|
|
const ReactionNotifications = explicitContentFromProto.ReactionNotifications;
|
2026-07-20 16:05:17 +00:00
|
|
|
ReactionNotifications.updateSetting(NumberResult);
|
2026-08-24 06:08:38 +00:00
|
|
|
let obj = expandEventPropertiesDefault;
|
2026-07-20 16:05:17 +00:00
|
|
|
obj = { update_type: constants3.ACCOUNT, reaction_notifications: NumberResult, reaction_notifications_old: setting };
|
|
|
|
|
obj.track(constants2.NOTIFICATION_SETTINGS_UPDATED, obj);
|
|
|
|
|
};
|