This commit is contained in:
janisslsm committed 2026-11-01 12:12:55 +02:00
1 parent 1781d25a15
commit 732c0ad767
33051 files changed
+2591613 -3019689

No files matched your search

@@ -0,0 +1,36 @@
// Metro module 7742 (f7743).
import { THREAD_CHANNEL_TYPES } from "../../../../../records/ChannelRecord";
import ChannelStore from "../../../../../stores/ChannelStore";
import UserStore from "../../../../../stores/UserStore";
import { getMessageAuthorWithProcessedColor, getUserAuthorWithProcessedColor } from "./useAuthorWithProcessedColor";
import formatUsernameOnClick from "./formatUsernameOnClick";
import { intl, t } from "../../../../../intl/index.native";
import createCommonMessage from "./createCommonMessage";
export function createAddRecipientSystemMessage(a0) {
const { message, roleStyle } = a0;
const userId = message.mentions[0];
const user = UserStore.getUser(userId);
const channel = ChannelStore.getChannel(message.channel_id);
const r19 = channel != null && THREAD_CHANNEL_TYPES.has(channel.type);
const messageAuthorWithProcessedColor = getMessageAuthorWithProcessedColor(message);
const userAuthorWithProcessedColor = getUserAuthorWithProcessedColor(user, channel);
const r32 = {
username: messageAuthorWithProcessedColor.nick,
usernameOnClick: formatUsernameOnClick({
message,
author: messageAuthorWithProcessedColor,
roleStyle
}),
otherUsername: userAuthorWithProcessedColor.nick,
otherUsernameOnClick: formatUsernameOnClick({
userId,
message,
author: userAuthorWithProcessedColor,
roleStyle
})
};
return {
content: r19 ? intl.formatToParts(t.Vej1Nw, r32) : intl.formatToParts(t["7/Xl0S"], r32),
...createCommonMessage(a0)
};
}
@@ -0,0 +1,30 @@
// Metro module 7791 (f7792).
import { MessageTypes } from "../../../../../Constants";
import { COMMAND_SENTINEL } from "../../../../channel_autocomplete/ChannelAutocompleteConstants";
import { getApplicationCommand } from "../../../ApplicationCommands";
import { getMessageAuthorWithProcessedColor } from "./useAuthorWithProcessedColor";
import { intl, t } from "../../../../../intl/index.native";
import formatUsernameOnClick from "./formatUsernameOnClick";
import createCommonMessage from "./createCommonMessage";
export function createApplicationCommandSourceSystemMessage(a0) {
const { message, roleStyle } = a0;
const applicationCommand = getApplicationCommand(message.content);
const name = message.application?.name;
if (applicationCommand != null && name != null) {
const messageAuthorWithProcessedColor = getMessageAuthorWithProcessedColor(message);
return {
content: intl.formatToParts(t["1Zm+zw"], {
username: messageAuthorWithProcessedColor.nick,
usernameOnClick: formatUsernameOnClick({
message,
author: messageAuthorWithProcessedColor,
roleStyle
}),
commandName: message.type === MessageTypes.CHAT_INPUT_COMMAND ? `${COMMAND_SENTINEL}${applicationCommand.name}` : applicationCommand.name,
applicationName: name
}),
...createCommonMessage(a0)
};
}
return null;
}
@@ -0,0 +1,21 @@
// Metro module 7812 (f7813).
import { getMessageAuthorWithProcessedColor } from "./useAuthorWithProcessedColor";
import { getApplicationSubscriptionSystemMessageASTContent } from "../../../../premium_apps/ApplicationSubscriptionSystemMessageUtils";
import formatUsernameOnClick from "./formatUsernameOnClick";
import createCommonMessage from "./createCommonMessage";
export function createApplicationSubscriptionPurchaseSystemMessage(a0) {
const { message, roleStyle } = a0;
const messageAuthorWithProcessedColor = getMessageAuthorWithProcessedColor(message);
return {
content: getApplicationSubscriptionSystemMessageASTContent({
application: message.application,
username: messageAuthorWithProcessedColor.nick,
usernameOnClick: formatUsernameOnClick({
message,
author: messageAuthorWithProcessedColor,
roleStyle
})
}),
...createCommonMessage(a0)
};
}
@@ -0,0 +1,247 @@
// Metro module 7795 (f7796).
import { Image as Image2, processColor } from "react-native";
import ChannelStore from "../../../../../stores/ChannelStore";
import GuildMemberStore from "../../../../../stores/GuildMemberStore";
import PermissionStore from "../../../../../stores/PermissionStore";
import RelationshipStore from "../../../../../stores/RelationshipStore";
import UserStore from "../../../../../stores/UserStore";
import { Permissions } from "../../../../../Constants";
import { memoize } from "../../../../../_bundle/Module12";
import { isThemeDark } from "../../../../../design/shared";
import Module712 from "../../../../../_bundle/Module712";
import { processColorOrThrow } from "../RowGeneratorStyleSheet";
import * as _AutomodMessageUtils from "../../../../guild_automod/AutomodMessageUtils";
import { isAutomodMessageRecord, extractAutomodMessageFields, getActionHeaderTextMobile, extractAutomodNotificationFields, IS_BACKWARDS_COMPAT_RAID_TYPE, getUserIdOfAutomodAction, getRaidAlertResolveCTAText, getQuarantineReasonString } from "../../../../guild_automod/AutomodMessageUtils";
import { getMessageAuthor } from "../../../useMessageAuthor";
import { intl, t } from "../../../../../intl/index.native";
import { AutomodNotificationEmbedTypeKeys } from "../../../../../_bundle/Module7772";
import Module3771 from "../../../../../_bundle/Module3771";
import { AutomodRaidAlertTypes } from "../../../../../_bundle/Module7796";
import { DATE_CONFIG } from "../../../../guild_antiraid/GuildAntiRaidUtils";
import { makeSource, getGuildMemberAvatarSource } from "../../../../../utils/AvatarUtils";
import Module7800 from "../../../../../_bundle/Module7800";
import Module6732 from "../../../../../_bundle/Module6732";
import { ensureAvatarSource, getAutomodAvatarURL } from "../../../../../utils/native/AvatarUtils";
import Module7801 from "../../../../../_bundle/Module7801";
import { getRoleIcon } from "../../../../guild_boosting/native/RoleIconUtils";
import createCommonMessage from "./createCommonMessage";
import { computeChannelName } from "../../../../channel/useChannelName";
import { isMemberCommunicationDisabled } from "../../../../guild_communication_disabled/CommunicationDisabledUtils";
import { accessibilityLabelCalendarFormat } from "../../../../../utils/DateUtils";
import Module7802 from "../../../../../_bundle/Module7802";
import Module7803 from "../../../../../_bundle/Module7803";
let c4914_11 = memoize((a0) => ({
defaultUsernameColor: processColorOrThrow(isThemeDark(a0) ? Module712.unsafe_rawColors.WHITE : Module712.unsafe_rawColors.PRIMARY_630)
}));
export function createAutoModerationActionSystemMessage(a0) {
let r27, author, colorString, feedbackText, guildMemberAvatar, headerText, iconRoleId, isAutomodNotification, nick, notification;
const { message, theme, roleStyle } = a0;
const defaultUsernameColor = c4914_11(theme).defaultUsernameColor;
if (isAutomodMessageRecord(message)) {
const r54 = extractAutomodMessageFields(message);
const { ruleName, keyword, embedChannel, content } = r54;
let flaggedMessageId = r54.flaggedMessageId;
const { embedChannelId, quarantineType, interactionUserId } = r54;
const channel = ChannelStore.getChannel(message.getChannelId());
const guildId = channel == null ? void 0 : channel.getGuildId();
L49: {
const messageAuthor = getMessageAuthor(message);
nick = messageAuthor.nick;
guildMemberAvatar = messageAuthor.guildMemberAvatar;
colorString = messageAuthor.colorString;
iconRoleId = messageAuthor.iconRoleId;
author = message.author;
r27 = PermissionStore.can(Permissions.VIEW_CHANNEL, embedChannel);
headerText = getActionHeaderTextMobile(message, author, interactionUserId);
const r15 = intl.string(t["94JbM3"]);
isAutomodNotification = _AutomodMessageUtils.isAutomodNotification(message);
notification = null;
feedbackText = r15;
if (isAutomodNotification) {
const r88 = extractAutomodNotificationFields(message);
const notificationType = r88.notificationType;
if (IS_BACKWARDS_COMPAT_RAID_TYPE !== notificationType && AutomodNotificationEmbedTypeKeys.RAID !== notificationType) {
if (AutomodNotificationEmbedTypeKeys.MENTION_RAID === notificationType) {
const r271 = {
subtitleLeft: r88.raidDatetime != null ? Module3771(r88.raidDatetime).fromNow() : void 0,
header: intl.string(t.C2uIXE),
headerColor: processColorOrThrow(Module712.internal.resolveSemanticColor(theme, Module712.colors.TEXT_FEEDBACK_CRITICAL)),
headerIconURL: Image2.resolveAssetSource(makeSource(Module6732)).uri,
headerIconColor: processColorOrThrow(Module712.internal.resolveSemanticColor(theme, Module712.colors.TEXT_FEEDBACK_CRITICAL)),
body: intl.string(t.SWIWEV),
shouldShowActions: false
};
headerText = "";
notification = r271;
feedbackText = r15;
break L49;
}
if (AutomodNotificationEmbedTypeKeys.ACTIVITY_ALERTS_ENABLED === notificationType) {
const userIdOfAutomodAction = getUserIdOfAutomodAction(message);
const user = UserStore.getUser(userIdOfAutomodAction);
const r163 = userIdOfAutomodAction != null ? guildId != null ? GuildMemberStore.getMember(guildId, userIdOfAutomodAction) : null : null;
let enabledByUsername = r163?.nick;
if (enabledByUsername == null) {
enabledByUsername = user?.username;
}
const r184 = ensureAvatarSource(r163?.avatar != null && guildId != null ? getGuildMemberAvatarSource({
userId: author.id,
avatar: r163?.avatar,
guildId
}, author) : author.getAvatarSource(void 0, false, 16));
const r194 = {
header: intl.string(t.lVLiFp),
headerColor: processColorOrThrow(Module712.internal.resolveSemanticColor(theme, Module712.colors.TEXT_FEEDBACK_POSITIVE)),
headerIconURL: Image2.resolveAssetSource(makeSource(Module7801)).uri,
headerIconColor: processColorOrThrow(Module712.internal.resolveSemanticColor(theme, Module712.colors.TEXT_FEEDBACK_POSITIVE)),
body: intl.string(t["QV/8u5"]),
shouldShowActions: false,
subtitleRight: Module3771(message.timestamp).fromNow(),
subtitleLeft: intl.string(t.qlFrXW),
enabledByAvatarURL: r184.uri,
enabledByUsername,
enabledByColor: r163?.colorString != null ? processColor(r163.colorString) : void 0
};
headerText = "";
notification = r194;
feedbackText = r15;
break L49;
}
const r111 = {
header: intl.string(t.VdZCcC),
headerColor: processColorOrThrow(Module712.internal.resolveSemanticColor(theme, Module712.colors.TEXT_SUBTLE)),
headerIconURL: Image2.resolveAssetSource(makeSource(Module6732)).uri,
headerIconColor: processColorOrThrow(Module712.internal.resolveSemanticColor(theme, Module712.colors.TEXT_SUBTLE)),
body: intl.string(t["NxHYX/"]),
shouldShowActions: false
};
headerText = "";
notification = r111;
feedbackText = r15;
break L49;
}
const subtitleRight = r88.raidDatetime != null ? Module3771(r88.raidDatetime).fromNow() : void 0;
const raidType = r88.raidType;
const DM_RAID = AutomodRaidAlertTypes.DM_RAID;
const dateTime = r88.raidDatetime != null ? new Date(r88.raidDatetime).toLocaleString(intl.currentLocale, DATE_CONFIG) : "";
const r357 = raidType === DM_RAID;
const subtitleLeft = r357 ? intl.formatToPlainString(t["5C8Mh3"], {
dmsSent: r88.dmsSent
}) : intl.formatToPlainString(t["4ylIiu"], {
joinCount: r88.joinAttempts
});
const r372 = {
subtitleLeft,
severity: subtitleLeft,
subtitleRight,
startTime: subtitleRight,
header: r357 ? intl.string(t["8+lHUb"]) : intl.string(t.xMwcwV),
headerColor: processColorOrThrow(Module712.internal.resolveSemanticColor(theme, Module712.colors.TEXT_FEEDBACK_CRITICAL)),
headerIconURL: Image2.resolveAssetSource(makeSource(r357 ? Module7800 : Module6732)).uri,
headerIconColor: processColorOrThrow(Module712.internal.resolveSemanticColor(theme, Module712.colors.TEXT_FEEDBACK_CRITICAL)),
body: intl.formatToPlainString(t["4QIIZl"], {
dateTime
}),
shouldShowActions: true
};
headerText = intl.string(t.ufawcw);
feedbackText = getRaidAlertResolveCTAText(r88.resolvedReason);
notification = r372;
}
}
const avatarURL = guildId != null ? ensureAvatarSource(guildMemberAvatar != null && guildId != null ? getGuildMemberAvatarSource({
userId: author.id,
avatar: guildMemberAvatar,
guildId
}, author) : author.getAvatarSource(void 0)).uri : null;
const r456 = guildId != null ? GuildMemberStore.getMember(guildId, author.id) : null;
const roleIcon = iconRoleId != null ? guildId != null ? getRoleIcon({
guildId,
roleId: iconRoleId,
size: 18
}) : void 0 : void 0;
const r467 = {
...createCommonMessage(a0),
roleIcon,
authorId: author.id,
username: intl.string(t.hG1StD),
avatarURL: ensureAvatarSource(makeSource(getAutomodAvatarURL())).uri,
colorString: processColor(colorString == null ? void 0 : colorString)
};
const autoModerationContext = {
headerText,
headerBadgeText: intl.string(t["70CJbT"]),
keywordDisplayText: keyword != null ? intl.formatToPlainString(t.SYIUTR, {
keyword
}) : "",
message: null,
notification: null,
ruleDisplayText: null,
reasonDisplayText: null,
actionsIconURL: null,
actionsText: null,
feedbackText: null
};
if (flaggedMessageId == null) {
flaggedMessageId = message.id;
}
let channelId = embedChannel?.id;
if (channelId == null) {
channelId = embedChannelId;
}
if (channelId == null) {
channelId = message.channel_id;
}
const channelName = r27 ? quarantineType == null ? embedChannel != null ? computeChannelName(embedChannel, UserStore, RelationshipStore) : void 0 : void 0 : void 0;
let usernameColor = defaultUsernameColor;
if (roleStyle === "username") {
let r535 = processColor(colorString == null ? void 0 : colorString);
if (r535 == null) {
r535 = defaultUsernameColor;
}
usernameColor = r535;
}
const message2 = {
id: flaggedMessageId,
channelId,
guildId,
userId: author.id,
channelName,
username: nick,
usernameColor,
roleColor: processColor(colorString == null ? void 0 : colorString),
shouldShowRoleDot: roleStyle === "dot" && colorString != null,
colorString: null,
avatarURL: null,
content: null,
communicationDisabled: null,
timestamp: null
};
if (colorString == null) {
colorString = void 0;
}
let colorString2 = processColor(colorString);
if (colorString2 == null) {
colorString2 = defaultUsernameColor;
}
message2.colorString = colorString2;
message2.avatarURL = avatarURL;
message2.content = content;
message2.communicationDisabled = isMemberCommunicationDisabled(r456);
message2.timestamp = accessibilityLabelCalendarFormat(message.timestamp);
autoModerationContext.message = message2;
autoModerationContext.notification = notification;
autoModerationContext.ruleDisplayText = intl.formatToPlainString(t.ZoOyKB, {
ruleName
});
autoModerationContext.reasonDisplayText = quarantineType != null ? intl.formatToPlainString(t["26bB2M"], {
reason: getQuarantineReasonString(quarantineType)
}) : null;
autoModerationContext.actionsIconURL = Image2.resolveAssetSource(makeSource(isAutomodNotification ? Module7802 : Module7803)).uri;
autoModerationContext.actionsText = isAutomodNotification ? intl.string(t.UgXhdn) : intl.string(t.DEoVWZ);
autoModerationContext.feedbackText = feedbackText;
r467.autoModerationContext = autoModerationContext;
return r467;
}
return null;
}
@@ -0,0 +1,58 @@
// Metro module 7760 (f7761).
import ChannelRTCStore from "../../../../calls/ChannelRTCStore";
import AuthenticationStore from "../../../../../stores/AuthenticationStore";
import VoiceStateStore from "../../../../../stores/VoiceStateStore";
import { ME } from "../../../../../Constants";
import { ParticipantTypes } from "../../../../calls/CallConstants";
import getHumanizedCallDuration from "../../../getHumanizedCallDuration";
import { checkIsCallActive } from "../../../../calls/mobile/useIsCallActive";
import { intl, t } from "../../../../../intl/index.native";
import { ensureAvatarSource } from "../../../../../utils/native/AvatarUtils";
import { calendarFormat } from "../../../../../utils/DateUtils";
import createCommonMessage from "./createCommonMessage";
export function createCallSystemMessage(a0) {
let r76, r78, avatarURLs, description, title;
const message = a0.message;
const id = AuthenticationStore.getId();
const channelId = message.getChannelId();
const call = message.call;
const userVoiceChannelId = VoiceStateStore.getUserVoiceChannelId(ME, id);
const humanizedCallDuration = getHumanizedCallDuration(message);
const participants = ChannelRTCStore.getParticipants(channelId);
const isCallActive = checkIsCallActive(channelId, message.id);
const missed = (isCallActive ? !isCallActive : call != null) && call.participants.indexOf(id) === -1;
if (isCallActive) {
L16: {
r76 = intl.string(t["NGg/fm"]);
r78 = "";
if (isCallActive) {
if (userVoiceChannelId != null) {
r78 = "";
if (userVoiceChannelId === channelId) {
break L16;
}
}
r78 = intl.string(t.DqA3mi);
}
}
avatarURLs = participants.filter((participant) => participant.type === ParticipantTypes.USER && !participant.ringing).map((item) => ensureAvatarSource(item.user.getAvatarSource(void 0)).uri);
description = r78;
title = r76;
} else {
title = missed ? intl.string(t["2CnhoI"]) : intl.string(t.v05Xd6);
description = humanizedCallDuration != null ? intl.formatToPlainString(t.SBDnp1, {
duration: humanizedCallDuration,
timestamp: calendarFormat(message.timestamp)
}) : calendarFormat(message.timestamp);
avatarURLs = [ensureAvatarSource(message.author.getAvatarSource(void 0)).uri];
}
return {
title,
description,
isCallActive,
missed,
avatarURLs,
rawMilliseconds: message.timestamp.valueOf(),
...createCommonMessage(a0)
};
}
@@ -0,0 +1,61 @@
// Metro module 7764 (f7765).
import ChannelStore from "../../../../../stores/ChannelStore";
import resolveMessageContentColors from "../resolveMessageContentColors";
import { getMessageAuthorWithProcessedColor } from "./useAuthorWithProcessedColor";
import formatUsernameOnClick from "./formatUsernameOnClick";
import createCommonMessage from "./createCommonMessage";
import { intl, t } from "../../../../../intl/index.native";
import { MessageAccessibilityAction } from "../../MessageAccessibilityActions";
import { HermesBuiltin } from "../../../../../_hermes/prelude";
export function createChangeChannelIconSystemMessage(a0) {
const { message, theme, roleStyle } = a0;
const r13 = resolveMessageContentColors(theme);
const messageAuthorWithProcessedColor = getMessageAuthorWithProcessedColor(message);
const usernameOnClick = formatUsernameOnClick({
message,
author: messageAuthorWithProcessedColor,
roleStyle
});
const channel = ChannelStore.getChannel(message.channel_id);
const r3 = channel == null;
let r32 = void 0;
if (!r3) {
const isGroupDM = channel.isGroupDM;
r32 = isGroupDM == null ? void 0 : isGroupDM.call(channel);
}
if (r32 == null) {
r32 = false;
}
const commonMessage = createCommonMessage(a0);
const r54 = {
content: r32 ? intl.formatToParts(t.hfeYXC, {
username: messageAuthorWithProcessedColor.nick,
usernameOnClick,
onEditGroup: {
action: "bindOpenGdmCustomizeActionSheet",
linkColor: r13?.linkColor,
messageChannelId: message.channel_id,
medium: true
}
}) : intl.formatToParts(t.wypJZ0, {
username: messageAuthorWithProcessedColor.nick,
usernameOnClick
}),
...commonMessage
};
let r56 = void 0;
if (r32) {
let accessibilityActions = commonMessage.accessibilityActions;
if (accessibilityActions == null) {
accessibilityActions = [];
}
r56 = {
accessibilityActions: [...accessibilityActions, {
label: intl.string(t["5Q9+/L"]),
name: MessageAccessibilityAction.EDIT_GDM
}]
};
}
HermesBuiltin.copyDataProperties(r54, r56);
return r54;
}
@@ -0,0 +1,63 @@
// Metro module 7763 (f7764).
import ChannelStore from "../../../../../stores/ChannelStore";
import resolveMessageContentColors from "../resolveMessageContentColors";
import { getMessageAuthorWithProcessedColor } from "./useAuthorWithProcessedColor";
import formatUsernameOnClick from "./formatUsernameOnClick";
import { t, intl } from "../../../../../intl/index.native";
import createCommonMessage from "./createCommonMessage";
import { MessageAccessibilityAction } from "../../MessageAccessibilityActions";
import { HermesBuiltin } from "../../../../../_hermes/prelude";
export function createChangeChannelNameSystemMessage(a0) {
const { message, theme, roleStyle } = a0;
const r13 = resolveMessageContentColors(theme);
const messageAuthorWithProcessedColor = getMessageAuthorWithProcessedColor(message);
const usernameOnClick = formatUsernameOnClick({
message,
author: messageAuthorWithProcessedColor,
roleStyle
});
const channel = ChannelStore.getChannel(message.channel_id);
const r3 = channel == null;
let r32 = void 0;
if (!r3) {
const isGroupDM = channel.isGroupDM;
r32 = isGroupDM == null ? void 0 : isGroupDM.call(channel);
}
if (r32 == null) {
r32 = false;
}
const r12 = message.content === "" ? t.hToFyf : t.rk0be9;
const commonMessage = createCommonMessage(a0);
const r65 = {
content: r32 ? intl.formatToParts(r12, {
username: messageAuthorWithProcessedColor.nick,
usernameOnClick,
channelName: message.content,
onEditGroup: {
action: "bindOpenGdmCustomizeActionSheet",
linkColor: r13?.linkColor,
messageChannelId: message.channel_id
}
}) : intl.formatToParts(a0.isForumPost ? t["qa0e/n"] : t.XCPMEG, {
username: messageAuthorWithProcessedColor.nick,
usernameOnClick,
channelName: message.content
}),
...commonMessage
};
let r67 = void 0;
if (r32) {
let accessibilityActions = commonMessage.accessibilityActions;
if (accessibilityActions == null) {
accessibilityActions = [];
}
r67 = {
accessibilityActions: [...accessibilityActions, {
label: intl.string(t["5Q9+/L"]),
name: MessageAccessibilityAction.EDIT_GDM
}]
};
}
HermesBuiltin.copyDataProperties(r65, r67);
return r65;
}
@@ -0,0 +1,26 @@
// Metro module 7788 (f7789).
import { getMessageAuthorWithProcessedColor } from "./useAuthorWithProcessedColor";
import { intl, t } from "../../../../../intl/index.native";
import formatUsernameOnClick from "./formatUsernameOnClick";
import createCommonMessage from "./createCommonMessage";
export function createChannelFollowAddSystemMessage(a0) {
const { message, roleStyle } = a0;
const messageAuthorWithProcessedColor = getMessageAuthorWithProcessedColor(message);
return {
content: intl.formatToParts(t.xH8qGO, {
username: messageAuthorWithProcessedColor.nick,
usernameOnClick: formatUsernameOnClick({
message,
author: messageAuthorWithProcessedColor,
roleStyle
}),
webhookName: message.content,
webhookNameOnClick: {
action: "bindGuildMenu",
messageReference: message.messageReference,
medium: true
}
}),
...createCommonMessage(a0)
};
}
@@ -0,0 +1,44 @@
// Metro module 7825 (f7826).
import ApplicationStore from "../../../../applications/ApplicationStore";
import { HelpdeskArticles } from "../../../../../Constants";
import resolveMessageContentColors from "../resolveMessageContentColors";
import { getMessageAuthorWithProcessedColor } from "./useAuthorWithProcessedColor";
import formatUsernameOnClick from "./formatUsernameOnClick";
import HelpdeskUtils from "../../../../../utils/HelpdeskUtils";
import { intl, t } from "../../../../../intl/index.native";
import createCommonMessage from "./createCommonMessage";
export function createChannelLinkedToLobbySystemMessage(a0) {
const { message, roleStyle } = a0;
const r18 = resolveMessageContentColors(a0.theme);
let applicationId = message.applicationId;
if (applicationId == null) {
applicationId = "";
}
const application = ApplicationStore.getApplication(applicationId);
if (application == null) {
return null;
}
const messageAuthorWithProcessedColor = getMessageAuthorWithProcessedColor(message);
return {
content: intl.formatToParts(t.gZfhOw, {
username: messageAuthorWithProcessedColor.nick,
usernameOnClick: formatUsernameOnClick({
message,
author: messageAuthorWithProcessedColor,
roleStyle
}),
applicationName: application.name,
applicationNameOnClick: {
linkColor: r18.defaultUsernameColor,
medium: true
},
urlOnClick: {
action: "bindOpenUrl",
url: HelpdeskUtils.getArticleURL(HelpdeskArticles.LINKED_LOBBIES),
linkColor: r18.linkColor,
medium: true
}
}),
...createCommonMessage(a0)
};
}
@@ -0,0 +1,54 @@
// Metro module 7765 (f7766).
import { getMessageAuthorWithProcessedColor } from "./useAuthorWithProcessedColor";
import formatUsernameOnClick from "./formatUsernameOnClick";
import { intl, t } from "../../../../../intl/index.native";
import createCommonMessage from "./createCommonMessage";
import { MessageAccessibilityAction } from "../../MessageAccessibilityActions";
export function createChannelPinnedMessageSystemMessage(a0) {
const { message, roleStyle } = a0;
const messageAuthorWithProcessedColor = getMessageAuthorWithProcessedColor(message);
const r13 = {
username: messageAuthorWithProcessedColor.nick,
usernameOnClick: formatUsernameOnClick({
message,
author: messageAuthorWithProcessedColor,
roleStyle
}),
pinsOnClick: {
action: "bindOpenPins",
messageChannelId: message.channel_id,
medium: true
}
};
const messageReference = message.messageReference;
const content = messageReference != null ? intl.formatToParts(t["7mvRNF"], {
...r13,
messageOnClick: {
action: "bindJumpToMessage",
targetChannelId: messageReference.channel_id,
targetMessageId: messageReference.message_id,
medium: true
}
}) : intl.formatToParts(t["6TrHq2"], r13);
const commonMessage = createCommonMessage(a0);
let accessibilityActions = commonMessage.accessibilityActions;
if (accessibilityActions == null) {
accessibilityActions = [];
}
const accessibilityActions2 = [...accessibilityActions];
accessibilityActions2.push({
label: intl.string(t["mp1N/2"]),
name: MessageAccessibilityAction.OPEN_PINS
});
if (messageReference != null) {
accessibilityActions2.push({
label: intl.string(t["+TSRGD"]),
name: MessageAccessibilityAction.JUMP_TO_MESSAGE
});
}
return {
content,
...commonMessage,
accessibilityActions: accessibilityActions2
};
}
@@ -0,0 +1,65 @@
// Metro module 7849 (f7850).
import ChannelStore from "../../../../../stores/ChannelStore";
import UserStore from "../../../../../stores/UserStore";
import { getUserAuthorWithProcessedColor } from "./useAuthorWithProcessedColor";
import formatUsernameOnClick from "./formatUsernameOnClick";
import { createNativeStyleProperties } from "../../../../../design/components/Styles/native/createStyles";
import Module712 from "../../../../../_bundle/Module712";
import { intl, t } from "../../../../../intl/index.native";
import { getAssetUriForEmbed } from "../EmbedUtils";
import Module7850 from "../../../../../_bundle/Module7850";
import createCommonMessage from "./createCommonMessage";
export function createFriendRequestAcceptedSystemMessage(a0) {
let content2, textColor;
const { message, roleStyle } = a0;
const channel = ChannelStore.getChannel(message.channel_id);
if (channel != null && channel.isDM()) {
const recipientId = channel.getRecipientId();
const user = UserStore.getUser(recipientId);
const currentUser = UserStore.getCurrentUser();
if (user != null && currentUser != null) {
const userAuthorWithProcessedColor = getUserAuthorWithProcessedColor(user, channel);
const r17 = {
username: userAuthorWithProcessedColor.nick,
usernameOnClick: formatUsernameOnClick({
userId: recipientId,
message,
author: userAuthorWithProcessedColor,
roleStyle
})
};
const r1 = message.author.id === currentUser.id;
const content = message.content;
if (content != null && content !== "") {
const baseTextColor = createNativeStyleProperties({
baseTextColor: Module712.colors.TEXT_SUBTLE
})(a0.theme).baseTextColor;
content2 = r1 ? intl.formatToParts(t["6pQebO"], {
...r17,
note: content,
formattedNote: {
colorString: userAuthorWithProcessedColor.colorString
}
}) : intl.formatToParts(t.bNrwDM, {
...r17,
note: content,
formattedNote: {
colorString: userAuthorWithProcessedColor.colorString
}
});
textColor = baseTextColor;
} else {
content2 = r1 ? intl.formatToParts(t.REfFZs, r17) : intl.formatToParts(t.hyPOTm, r17);
textColor = void 0;
}
return {
content: content2,
iconUrl: getAssetUriForEmbed(Module7850),
textColor,
...createCommonMessage(a0)
};
}
return null;
}
return null;
}
@@ -0,0 +1,28 @@
// Metro module 7851 (f7852).
import { createNativeStyleProperties } from "../../../../../design/components/Styles/native/createStyles";
import Module712 from "../../../../../_bundle/Module712";
import { createGiftIntentEmbed } from "../row_data/embeds/GiftIntentEmbed";
import createCommonMessage from "./createCommonMessage";
import { createEphemeralIndication } from "../row_data/EphemeralIndication";
import { getAssetUriForEmbed } from "../EmbedUtils";
import Module7732 from "../../../../../_bundle/Module7732";
const nativeStyleProperties = createNativeStyleProperties({
iconTintColor: Module712.colors.BACKGROUND_BRAND,
iconDividerColor: Module712.colors.ICON_STRONG
});
export function createGiftIntentSystemMessage(a0) {
const { message, theme } = a0;
const giftIntentEmbed = createGiftIntentEmbed(message, theme);
if (giftIntentEmbed == null) {
return null;
}
const r16 = nativeStyleProperties(theme);
return {
...createCommonMessage(a0),
giftIntentInfo: giftIntentEmbed,
ephemeralIndication: createEphemeralIndication(message),
iconUrl: getAssetUriForEmbed(Module7732),
iconTintColor: r16.iconTintColor,
iconDividerColor: r16.iconDividerColor
};
}
@@ -0,0 +1,86 @@
// Metro module 7814 (f7815).
import ChannelStore from "../../../../../stores/ChannelStore";
import { createNativeStyleProperties } from "../../../../../design/components/Styles/native/createStyles";
import Module712 from "../../../../../_bundle/Module712";
import resolveMessageContentColors from "../resolveMessageContentColors";
import { getMessageAuthorWithProcessedColor } from "./useAuthorWithProcessedColor";
import formatUsernameOnClick from "./formatUsernameOnClick";
import { intl, t } from "../../../../../intl/index.native";
import getTagProperties from "../getTagProperties";
import createCommonMessage from "./createCommonMessage";
import { ensureAvatarSource, getAutomodAvatarURL } from "../../../../../utils/native/AvatarUtils";
import { makeSource } from "../../../../../utils/AvatarUtils";
import { HermesBuiltin } from "../../../../../_hermes/prelude";
const nativeStyleProperties = createNativeStyleProperties({
automodUsernameColor: Module712.colors.TEXT_BRAND
});
export { nativeStyleProperties as resolveAlertModeColors };
export function createGuildAlertModeEnabledSystemMessage(a0) {
const { message, roleStyle, theme } = a0;
const colors = resolveMessageContentColors(theme);
const channel = ChannelStore.getChannel(message.channel_id);
const messageAuthorWithProcessedColor = getMessageAuthorWithProcessedColor(message);
let automodUsernameColor = nativeStyleProperties(theme).automodUsernameColor;
const r29 = {
username: messageAuthorWithProcessedColor.nick,
usernameOnClick: formatUsernameOnClick({
message,
author: messageAuthorWithProcessedColor,
roleStyle
}),
time: message.content !== "" ? new Date(message.content).toLocaleString(intl.currentLocale, {
hour: "numeric",
minute: "2-digit"
}) : ""
};
const tagProperties = getTagProperties({
message,
channel,
isSystemDM: true,
colors
});
const r50 = {
...createCommonMessage(a0),
content: intl.formatToParts(t.ig55n6, r29),
username: intl.string(t.hG1StD)
};
if (automodUsernameColor == null) {
automodUsernameColor = null;
}
r50.usernameColor = automodUsernameColor;
r50.avatarURL = ensureAvatarSource(makeSource(getAutomodAvatarURL())).uri;
HermesBuiltin.copyDataProperties(r50, tagProperties);
return r50;
}
export function createGuildAlertModeDisabledSystemMessage(a0) {
const { message, roleStyle, theme } = a0;
const colors = resolveMessageContentColors(theme);
let automodUsernameColor = nativeStyleProperties(theme).automodUsernameColor;
const messageAuthorWithProcessedColor = getMessageAuthorWithProcessedColor(message);
const r10 = {
username: messageAuthorWithProcessedColor.nick,
usernameOnClick: formatUsernameOnClick({
message,
author: messageAuthorWithProcessedColor,
roleStyle
})
};
const tagProperties = getTagProperties({
message,
channel: void 0,
isSystemDM: true,
colors
});
const r32 = {
...createCommonMessage(a0),
content: intl.formatToParts(t.cyq2WA, r10),
username: intl.string(t.hG1StD)
};
if (automodUsernameColor == null) {
automodUsernameColor = null;
}
r32.usernameColor = automodUsernameColor;
r32.avatarURL = ensureAvatarSource(makeSource(getAutomodAvatarURL())).uri;
HermesBuiltin.copyDataProperties(r32, tagProperties);
return r32;
}
@@ -0,0 +1,27 @@
// Metro module 7790 (f7791).
import { intl, t } from "../../../../../intl/index.native";
import createCommonMessage from "./createCommonMessage";
export function createGuildDiscoveryDisqualifiedSystemMessage(a0) {
return {
content: intl.string(t.NxS3hY),
...createCommonMessage(a0)
};
}
export function createGuildDiscoveryRequalifiedSystemMessage(a0) {
return {
content: intl.string(t.tu6tOR),
...createCommonMessage(a0)
};
}
export function createGuildDiscoveryGracePeriodInitialWarningSystemMessage(a0) {
return {
content: intl.string(t.BoiiWz),
...createCommonMessage(a0)
};
}
export function createGuildDiscoveryGracePeriodFinalWarningSystemMessage(a0) {
return {
content: intl.string(t.ED4mGc),
...createCommonMessage(a0)
};
}
@@ -0,0 +1,52 @@
// Metro module 7806 (f7807).
import MessageRecord from "../../../../../records/MessageRecord";
import ChannelStore from "../../../../../stores/ChannelStore";
import { MessageTypes } from "../../../../../Constants";
import { getMessageAuthor } from "../../../useMessageAuthor";
import { getMessageAuthorWithProcessedColor } from "./useAuthorWithProcessedColor";
import { ensureAvatarSource } from "../../../../../utils/native/AvatarUtils";
import { getGuildMemberAvatarSource } from "../../../../../utils/AvatarUtils";
import { getGuildProductPurchaseSystemMessageContentMobile } from "../../../../guild_products/GuildProductSystemMessageUtils";
import formatUsernameOnClick from "./formatUsernameOnClick";
import { intl, t } from "../../../../../intl/index.native";
import createCommonMessage from "./createCommonMessage";
export function createGuildProductPurchaseSystemMessage(a0) {
const r5 = {
...a0,
message: new MessageRecord(a0.message)
};
r5.message.type = MessageTypes.ROLE_SUBSCRIPTION_PURCHASE;
const purchaseNotification = r5.message.purchaseNotification;
const productName = purchaseNotification == null ? void 0 : purchaseNotification.guild_product_purchase?.product_name;
if (productName == null) {
return null;
}
const message = r5.message;
const roleStyle = a0.roleStyle;
const author = message.author;
const channel = ChannelStore.getChannel(message.getChannelId());
const guildId = channel == null ? void 0 : channel.getGuildId();
const guildMemberAvatar = getMessageAuthor(message).guildMemberAvatar;
const messageAuthorWithProcessedColor = getMessageAuthorWithProcessedColor(message);
const r55 = ensureAvatarSource(guildMemberAvatar != null && guildId != null ? getGuildMemberAvatarSource({
userId: author.id,
avatar: guildMemberAvatar,
guildId
}, author) : author.getAvatarSource(void 0));
return {
content: getGuildProductPurchaseSystemMessageContentMobile({
username: messageAuthorWithProcessedColor.nick,
usernameOnClickHandler: formatUsernameOnClick({
message,
author: messageAuthorWithProcessedColor,
roleStyle
}),
productName
}),
totalMonthsSubscribed: 0,
username: messageAuthorWithProcessedColor.nick,
avatarURL: r55.uri,
welcomeLabel: intl.string(t.s2N5HS),
...createCommonMessage(r5)
};
}
@@ -0,0 +1,45 @@
// Metro module 7822 (f7823).
import ChannelStore from "../../../../../stores/ChannelStore";
import resolveMessageContentColors from "../resolveMessageContentColors";
import { getMessageAuthorWithProcessedColor } from "./useAuthorWithProcessedColor";
import { resolveAlertModeColors } from "./GuildAlertModeSystemMessage";
import formatUsernameOnClick from "./formatUsernameOnClick";
import getTagProperties from "../getTagProperties";
import createCommonMessage from "./createCommonMessage";
import { intl, t } from "../../../../../intl/index.native";
import { ensureAvatarSource, getAutomodAvatarURL } from "../../../../../utils/native/AvatarUtils";
import { makeSource } from "../../../../../utils/AvatarUtils";
import { HermesBuiltin } from "../../../../../_hermes/prelude";
export function createGuildReportFalseAlarmSystemMessage(a0) {
const { message, roleStyle, theme } = a0;
const colors = resolveMessageContentColors(theme);
const channel = ChannelStore.getChannel(message.channel_id);
const messageAuthorWithProcessedColor = getMessageAuthorWithProcessedColor(message);
let automodUsernameColor = resolveAlertModeColors(theme).automodUsernameColor;
const r29 = {
username: messageAuthorWithProcessedColor.nick,
usernameOnClick: formatUsernameOnClick({
message,
author: messageAuthorWithProcessedColor,
roleStyle
})
};
const tagProperties = getTagProperties({
message,
channel,
isSystemDM: true,
colors
});
const r38 = {
...createCommonMessage(a0),
content: intl.formatToParts(t["21+uW4"], r29),
username: intl.string(t.hG1StD)
};
if (automodUsernameColor == null) {
automodUsernameColor = null;
}
r38.usernameColor = automodUsernameColor;
r38.avatarURL = ensureAvatarSource(makeSource(getAutomodAvatarURL())).uri;
HermesBuiltin.copyDataProperties(r38, tagProperties);
return r38;
}
@@ -0,0 +1,53 @@
// Metro module 7821 (f7822).
import ChannelStore from "../../../../../stores/ChannelStore";
import GuildStore from "../../../../../stores/GuildStore";
import resolveMessageContentColors from "../resolveMessageContentColors";
import { getMessageAuthorWithProcessedColor } from "./useAuthorWithProcessedColor";
import { resolveAlertModeColors } from "./GuildAlertModeSystemMessage";
import formatUsernameOnClick from "./formatUsernameOnClick";
import getTagProperties from "../getTagProperties";
import createCommonMessage from "./createCommonMessage";
import { intl, t } from "../../../../../intl/index.native";
import { ensureAvatarSource, getAutomodAvatarURL } from "../../../../../utils/native/AvatarUtils";
import { makeSource } from "../../../../../utils/AvatarUtils";
import { HermesBuiltin } from "../../../../../_hermes/prelude";
export function createGuildReportRaidSystemMessage(a0) {
const { message, roleStyle, theme } = a0;
const colors = resolveMessageContentColors(theme);
const channel = ChannelStore.getChannel(message.channel_id);
const guild = GuildStore.getGuild(channel?.guild_id);
const messageAuthorWithProcessedColor = getMessageAuthorWithProcessedColor(message);
let automodUsernameColor = resolveAlertModeColors(theme).automodUsernameColor;
const r35 = {
username: messageAuthorWithProcessedColor.nick,
usernameOnClick: formatUsernameOnClick({
message,
author: messageAuthorWithProcessedColor,
roleStyle
}),
guildName: null
};
let guildName = guild?.name;
if (guildName == null) {
guildName = "";
}
r35.guildName = guildName;
const tagProperties = getTagProperties({
message,
channel,
isSystemDM: true,
colors
});
const r45 = {
...createCommonMessage(a0),
content: intl.formatToParts(t["MTmH+u"], r35),
username: intl.string(t.hG1StD)
};
if (automodUsernameColor == null) {
automodUsernameColor = null;
}
r45.usernameColor = automodUsernameColor;
r45.avatarURL = ensureAvatarSource(makeSource(getAutomodAvatarURL())).uri;
HermesBuiltin.copyDataProperties(r45, tagProperties);
return r45;
}
@@ -0,0 +1,47 @@
// Metro module 7789 (f7790).
import { StreamTypes } from "../../../../go_live/Constants";
import getHumanizedCallDuration from "../../../getHumanizedCallDuration";
import { getMessageAuthorWithProcessedColor } from "./useAuthorWithProcessedColor";
import formatUsernameOnClick from "./formatUsernameOnClick";
import { intl, t } from "../../../../../intl/index.native";
import createCommonMessage from "./createCommonMessage";
export function createGuildStreamSystemMessage(a0) {
const { message, roleStyle } = a0;
const author = message.author;
let messageReference = message.messageReference;
if (messageReference == null) {
messageReference = {};
}
const { channel_id, guild_id } = messageReference;
const humanizedCallDuration = getHumanizedCallDuration(message);
const ended = humanizedCallDuration != null;
const messageAuthorWithProcessedColor = getMessageAuthorWithProcessedColor(message);
const r25 = {
username: messageAuthorWithProcessedColor.nick,
usernameOnClick: formatUsernameOnClick({
message,
author: messageAuthorWithProcessedColor,
roleStyle
})
};
const onJoinStream = {
action: "bindJoinStream",
stream: {
streamType: StreamTypes.GUILD,
channelId: channel_id,
ownerId: author.id,
guildId: guild_id
}
};
return {
ended,
content: ended ? intl.formatToParts(t.FP7rUI, {
...r25,
duration: humanizedCallDuration
}) : intl.formatToParts(t.dMmbGk, {
...r25,
onJoinStream
}),
...createCommonMessage(a0)
};
}
@@ -0,0 +1,40 @@
// Metro module 7826 (f7827).
import ApplicationStore from "../../../../applications/ApplicationStore";
import { HelpdeskArticles } from "../../../../../Constants";
import resolveMessageContentColors from "../resolveMessageContentColors";
import { getMessageAuthorWithProcessedColor } from "./useAuthorWithProcessedColor";
import formatUsernameOnClick from "./formatUsernameOnClick";
import HelpdeskUtils from "../../../../../utils/HelpdeskUtils";
import { intl, t } from "../../../../../intl/index.native";
import createCommonMessage from "./createCommonMessage";
export function createInGameMessageNuxSystemMessage(a0) {
const { message, theme, roleStyle } = a0;
const r18 = resolveMessageContentColors(theme);
let applicationId = message.applicationId;
if (applicationId == null) {
applicationId = "";
}
const application = ApplicationStore.getApplication(applicationId);
if (application == null) {
return null;
}
const messageAuthorWithProcessedColor = getMessageAuthorWithProcessedColor(message);
return {
content: intl.formatToParts(t["92erOB"], {
username: messageAuthorWithProcessedColor.nick,
usernameOnClick: formatUsernameOnClick({
message,
author: messageAuthorWithProcessedColor,
roleStyle
}),
gameName: application.name,
urlOnClick: {
action: "bindOpenUrl",
url: HelpdeskUtils.getArticleURL(HelpdeskArticles.SOCIAL_LAYER_CONNECTIONS),
linkColor: r18.linkColor,
medium: true
}
}),
...createCommonMessage(a0)
};
}
@@ -0,0 +1,41 @@
// Metro module 7827 (f7828).
import GuildJoinRequestStore from "../../../../guild_member_verification/GuildJoinRequestStore";
import UserGuildJoinRequestStore from "../../../../guild_member_verification/UserGuildJoinRequestStore";
import GuildStore from "../../../../../stores/GuildStore";
import UserStore from "../../../../../stores/UserStore";
import { MessageTypes } from "../../../../../Constants";
import { intl, t } from "../../../../../intl/index.native";
import SnowflakeUtils from "../../../../../utils/SnowflakeUtils";
import createCommonMessage from "./createCommonMessage";
export function createJoinRequestNotificationSystemMessage(a0) {
const message = a0.message;
const request = GuildJoinRequestStore.getRequest(SnowflakeUtils.cast(message.channel_id));
const r2 = request == null;
let r22 = void 0;
if (!r2) {
let r24 = GuildStore.getGuild(request.guildId);
if (r24 == null) {
r24 = UserGuildJoinRequestStore.getJoinRequestGuild(request.guildId);
}
r22 = r24;
}
let username = UserStore.getUser(request?.userId)?.username;
if (username == null) {
username = request == null ? void 0 : request.user?.username;
}
const type = message.type;
const name = r22?.name;
return {
content: MessageTypes.GUILD_JOIN_REQUEST_ACCEPT_NOTIFICATION === type ? username != null && name != null ? intl.formatToParts(t.EloBG4, {
username,
guildName: name
}) : intl.string(t["2VLV0d"]) : MessageTypes.GUILD_JOIN_REQUEST_REJECT_NOTIFICATION === type ? username != null && name != null ? intl.formatToParts(t["UGN/Yy"], {
username,
guildName: name
}) : intl.string(t.FVF6qU) : MessageTypes.GUILD_JOIN_REQUEST_WITHDRAWN_NOTIFICATION === type ? username != null && name != null ? intl.formatToParts(t.u4movT, {
username,
guildName: name
}) : intl.string(t.BMlbE7) : "",
...createCommonMessage(a0)
};
}
@@ -0,0 +1,31 @@
// Metro module 7793 (f7794).
import ChannelStore from "../../../../../stores/ChannelStore";
import RelationshipStore from "../../../../../stores/RelationshipStore";
import UserStore from "../../../../../stores/UserStore";
import { getMessageAuthorWithProcessedColor } from "./useAuthorWithProcessedColor";
import { intl, t } from "../../../../../intl/index.native";
import formatUsernameOnClick from "./formatUsernameOnClick";
import { computeChannelName } from "../../../../channel/useChannelName";
import createCommonMessage from "./createCommonMessage";
export function createNewThreadSystemMessage(a0) {
const { message, roleStyle } = a0;
const messageAuthorWithProcessedColor = getMessageAuthorWithProcessedColor(message);
const channel = ChannelStore.getChannel(message.messageReference?.channel_id);
return {
content: intl.formatToParts(t.veX9jq, {
actorName: messageAuthorWithProcessedColor.nick,
actorHook: formatUsernameOnClick({
message,
author: messageAuthorWithProcessedColor,
roleStyle
}),
threadName: channel != null ? computeChannelName(channel, UserStore, RelationshipStore) : message.content,
threadOnClick: {
action: "bindOpenThreadChannel",
threadId: message.messageReference?.channel_id,
medium: true
}
}),
...createCommonMessage(a0)
};
}
@@ -0,0 +1,114 @@
// Metro module 7823 (f7824).
import { EMOJI_URL_BASE_SIZE } from "../../../../emojis/EmojiConstants";
import { getMessageAuthorWithProcessedColor } from "./useAuthorWithProcessedColor";
import formatUsernameOnClick from "./formatUsernameOnClick";
import { t, intl } from "../../../../../intl/index.native";
import AvatarUtils from "../../../../../utils/AvatarUtils";
import UnicodeEmojis from "../../../../emojis/UnicodeEmojis";
import parsePollResultSystemMessageEmbed from "../../../../polls/parsePollResultSystemMessageEmbed";
import createCommonMessage from "./createCommonMessage";
function $mk79304($env) {
return () => $env[0];
}
export function createPollResultSystemMessage(a0) {
let content2;
const r10 = parsePollResultSystemMessageEmbed(a0.message.embeds[0]);
if (r10 == null) {
return null;
}
if (a0.message.messageReference == null) {
return null;
}
const { message, roleStyle } = a0;
const messageAuthorWithProcessedColor = getMessageAuthorWithProcessedColor(message);
const r12 = {
username: messageAuthorWithProcessedColor.nick,
usernameOnClick: formatUsernameOnClick({
message,
author: messageAuthorWithProcessedColor,
roleStyle
}),
title: r10.questionText,
titleOnClick: {
action: "bindJumpToMessage",
targetChannelId: message.messageReference.channel_id,
targetMessageId: message.messageReference.message_id,
medium: true
}
};
if (r10.totalVotes === 0) {
let env16029;
const r124 = t["9dPxsm"];
const r129 = env16029 = {};
env16029[0] = {
type: "emoji",
content: "frowning",
surrogate: "😦"
};
content2 = intl.formatToParts(r124, {
...r12,
sadEmojiHook: $mk79304(r129)
});
} else {
const percentage = `${Math.round(r10.victorAnswerVotes / r10.totalVotes * 100)}%`;
if (r10.victorAnswerId == null) {
content2 = intl.formatToParts(t.dqftZ2, {
...r12,
percentage
});
} else {
const content = [];
const victorEmoji = r10.victorEmoji;
if (victorEmoji != null) {
if (victorEmoji.id != null) {
content.push({
id: victorEmoji.id,
type: "customEmoji",
alt: victorEmoji.name,
src: AvatarUtils.getEmojiURL({
id: victorEmoji.id,
animated: victorEmoji.animated,
size: EMOJI_URL_BASE_SIZE
}),
frozenSrc: AvatarUtils.getEmojiURL({
id: victorEmoji.id,
animated: false,
size: EMOJI_URL_BASE_SIZE
})
});
} else {
content.push({
type: "emoji",
content: UnicodeEmojis.convertSurrogateToName(victorEmoji.name, false),
surrogate: victorEmoji.name
});
}
content.push({
type: "text",
content: " "
});
}
let env16028;
content.push({
type: "text",
content: r10.victorAnswerText
});
const zFwIxC = t.zFwIxC;
const r101 = {
type: "strong",
content
};
const r102 = env16028 = {};
env16028[0] = r101;
content2 = intl.formatToParts(zFwIxC, {
...r12,
answerHook: $mk79304(r102),
percentage
});
}
}
return {
...createCommonMessage(a0),
content: content2
};
}
@@ -0,0 +1,29 @@
// Metro module 7828 (f7829).
import AuthenticationStore from "../../../../../stores/AuthenticationStore";
import ChannelStore from "../../../../../stores/ChannelStore";
import { createNativeStyleProperties } from "../../../../../design/components/Styles/native/createStyles";
import Module712 from "../../../../../_bundle/Module712";
import { createPremiumGroupInviteEmbed } from "../row_data/embeds/PremiumGroupInviteEmbed";
import createCommonMessage from "./createCommonMessage";
import { getAssetUriForEmbed } from "../EmbedUtils";
import Module6628 from "../../../../../_bundle/Module6628";
const nativeStyleProperties = createNativeStyleProperties({
iconTintColor: Module712.colors.ICON_STRONG,
iconDividerColor: Module712.colors.ICON_STRONG
});
export function createPremiumGroupInviteSystemMessage(a0) {
const { message, theme } = a0;
const channel = ChannelStore.getChannel(message.getChannelId());
const premiumGroupInviteEmbed = createPremiumGroupInviteEmbed(message, theme, AuthenticationStore.getId(), channel);
if (premiumGroupInviteEmbed == null) {
return null;
}
const r26 = nativeStyleProperties(theme);
return {
...createCommonMessage(a0),
premiumGroupInviteInfo: premiumGroupInviteEmbed,
iconUrl: getAssetUriForEmbed(Module6628),
iconTintColor: r26.iconTintColor,
iconDividerColor: r26.iconDividerColor
};
}
@@ -0,0 +1,36 @@
// Metro module 7813 (f7814).
import { MessageTypes } from "../../../../../Constants";
import { getMessageAuthorWithProcessedColor } from "./useAuthorWithProcessedColor";
import formatUsernameOnClick from "./formatUsernameOnClick";
import { getPrivateChannelIntegrationAddedSystemMessageASTContent, getPrivateChannelIntegrationRemovedSystemMessageASTContent } from "../../../../private_channel_integrations/PrivateChannelIntegrationSystemMessageUtils";
import createCommonMessage from "./createCommonMessage";
export function createPrivateChannelIntegrationSystemMessage(a0, a1) {
const { message, roleStyle } = a0;
const messageAuthorWithProcessedColor = getMessageAuthorWithProcessedColor(message);
const usernameOnClick = formatUsernameOnClick({
message,
author: messageAuthorWithProcessedColor,
roleStyle
});
const application = message.application;
const applicationNameOnClick = application?.bot != null ? {
action: "bindUserMenu",
userId: application.bot.id,
messageChannelId: message.channel_id,
medium: true
} : void 0;
return {
content: a1 === MessageTypes.PRIVATE_CHANNEL_INTEGRATION_ADDED ? getPrivateChannelIntegrationAddedSystemMessageASTContent({
application,
username: messageAuthorWithProcessedColor.nick,
usernameOnClick,
applicationNameOnClick
}) : getPrivateChannelIntegrationRemovedSystemMessageASTContent({
application,
username: messageAuthorWithProcessedColor.nick,
usernameOnClick,
applicationNameOnClick
}),
...createCommonMessage(a0)
};
}
@@ -0,0 +1,6 @@
// Metro module 7805 (f7806).
import { PurchaseNotificationType } from "../../../../../flow/Server";
import { createGuildProductPurchaseSystemMessage } from "./GuildProductPurchaseSystemMessage";
export function createPurchaseNotificationSystemMessage(a0) {
return a0.message.purchaseNotification?.type === PurchaseNotificationType.GUILD_PRODUCT ? createGuildProductPurchaseSystemMessage(a0) : null;
}
@@ -0,0 +1,50 @@
// Metro module 7833 (f7834).
import ReferralTrialStore from "../../../../premium/ReferralTrialStore";
import AuthenticationStore from "../../../../../stores/AuthenticationStore";
import { createNativeStyleProperties } from "../../../../../design/components/Styles/native/createStyles";
import Module712 from "../../../../../_bundle/Module712";
import { createReferralTrialEmbedRedesign } from "../row_data/embeds/ReferralTrialEmbedRedesign";
import createCommonMessage from "./createCommonMessage";
import { getAssetUriForEmbed } from "../EmbedUtils";
import Module6628 from "../../../../../_bundle/Module6628";
import { createReferralTrialEmbedRedeemable } from "../row_data/embeds/ReferralTrialEmbed";
const nativeStyleProperties = createNativeStyleProperties({
iconTintColor: Module712.colors.ICON_STRONG,
iconDividerColor: Module712.colors.ICON_STRONG
});
export function createReferralSystemMessage(a0) {
const { message, theme } = a0;
const id = AuthenticationStore.getId();
const referralTrialOfferId = message.referralTrialOfferId;
if (referralTrialOfferId == null) {
return null;
}
const relevantUserTrialOffer = ReferralTrialStore.getRelevantUserTrialOffer(referralTrialOfferId);
if (relevantUserTrialOffer?.referrer_id === id) {
const referralTrialEmbedRedeemable = createReferralTrialEmbedRedeemable(message, theme, id, relevantUserTrialOffer);
if (referralTrialEmbedRedeemable == null) {
return null;
}
const r55 = nativeStyleProperties(theme);
return {
...createCommonMessage(a0),
referralTrialOfferInfo: referralTrialEmbedRedeemable,
iconUrl: getAssetUriForEmbed(Module6628),
iconTintColor: r55.iconTintColor,
iconDividerColor: r55.iconDividerColor
};
}
const referralTrialEmbedRedesign = createReferralTrialEmbedRedesign(message, theme, id, relevantUserTrialOffer);
if (referralTrialEmbedRedesign == null) {
return null;
}
const r29 = nativeStyleProperties(theme);
return {
...createCommonMessage(a0),
referralTrialOfferInfoRedesign: referralTrialEmbedRedesign,
iconUrl: getAssetUriForEmbed(Module6628),
iconTintColor: r29.iconTintColor,
iconDividerColor: r29.iconDividerColor,
timestamp: void 0
};
}
@@ -0,0 +1,45 @@
// Metro module 7759 (f7760).
import { THREAD_CHANNEL_TYPES } from "../../../../../records/ChannelRecord";
import ChannelStore from "../../../../../stores/ChannelStore";
import UserStore from "../../../../../stores/UserStore";
import { getMessageAuthorWithProcessedColor, getUserAuthorWithProcessedColor } from "./useAuthorWithProcessedColor";
import formatUsernameOnClick from "./formatUsernameOnClick";
import { intl, t } from "../../../../../intl/index.native";
import createCommonMessage from "./createCommonMessage";
export function createRemoveRecipientSystemMessage(a0) {
const { message, roleStyle } = a0;
const author = message.author;
const userId = message.mentions[0];
const channel = ChannelStore.getChannel(message.channel_id);
const r19 = channel != null && THREAD_CHANNEL_TYPES.has(channel.type);
const messageAuthorWithProcessedColor = getMessageAuthorWithProcessedColor(message);
const r28 = {
username: messageAuthorWithProcessedColor.nick,
usernameOnClick: formatUsernameOnClick({
message,
author: messageAuthorWithProcessedColor,
roleStyle
})
};
if (author.id === userId) {
return {
content: r19 ? intl.formatToParts(t.uHmblj, r28) : intl.formatToParts(t["Qn5+Lf"], r28),
...createCommonMessage(a0)
};
}
const userAuthorWithProcessedColor = getUserAuthorWithProcessedColor(UserStore.getUser(userId), channel);
const r40 = {
...r28,
otherUsername: userAuthorWithProcessedColor.nick,
otherUsernameOnClick: formatUsernameOnClick({
userId,
message,
author: userAuthorWithProcessedColor,
roleStyle
})
};
return {
content: r19 ? intl.formatToParts(t.KBrM5t, r40) : intl.formatToParts(t.QtZ0RD, r40),
...createCommonMessage(a0)
};
}
@@ -0,0 +1,64 @@
// Metro module 7804 (f7805).
import ChannelStore from "../../../../../stores/ChannelStore";
import GuildStore from "../../../../../stores/GuildStore";
import { SystemChannelFlags } from "../../../../../Constants";
import { getMessageAuthor } from "../../../useMessageAuthor";
import { getMessageAuthorWithProcessedColor } from "./useAuthorWithProcessedColor";
import { computeIsStickerReplyEnabled } from "./useIsStickerReplyEnabled";
import { transformSticker } from "./transformSticker";
import { pickRoleSubscriptionPurchaseSticker, getRoleSubscriptionPurchaseSystemMessageContentMobile, getRoleSubscriptionPurchaseStickerCTA } from "../../../../guild_role_subscriptions/GuildRoleSubscriptionSystemMessageUtils";
import { ensureAvatarSource } from "../../../../../utils/native/AvatarUtils";
import { getGuildMemberAvatarSource } from "../../../../../utils/AvatarUtils";
import formatUsernameOnClick from "./formatUsernameOnClick";
import { intl, t } from "../../../../../intl/index.native";
import createCommonMessage from "./createCommonMessage";
export function createRoleSubscriptionPurchaseSystemMessage(a0) {
const { message, roleStyle } = a0;
const roleSubscriptionData = message.roleSubscriptionData;
if (roleSubscriptionData == null) {
return null;
}
const author = message.author;
const channel = ChannelStore.getChannel(message.getChannelId());
const guildId = channel == null ? void 0 : channel.getGuildId();
const guild = GuildStore.getGuild(guildId);
const guildMemberAvatar = getMessageAuthor(message).guildMemberAvatar;
const messageAuthorWithProcessedColor = getMessageAuthorWithProcessedColor(message);
const sticker = guildId != null ? channel != null ? computeIsStickerReplyEnabled(guildId, channel, message, guild != null && !(guild.systemChannelFlags & SystemChannelFlags.SUPPRESS_ROLE_SUBSCRIPTION_PURCHASE_NOTIFICATION_REPLIES)) ? transformSticker(pickRoleSubscriptionPurchaseSticker(message.id)) : void 0 : void 0 : void 0;
const r66 = ensureAvatarSource(guildMemberAvatar != null && guildId != null ? getGuildMemberAvatarSource({
userId: author.id,
avatar: guildMemberAvatar,
guildId
}, author) : author.getAvatarSource(void 0));
const roleSubscriptionOnClickHandler = {
action: "bindOpenRoleSubscriptionOverview",
guildId,
messageId: message.id,
channelId: channel?.id,
roleSubscriptionListingId: message.roleSubscriptionData?.role_subscription_listing_id
};
let guildId2 = guildId;
if (guildId2 == null) {
guildId2 = void 0;
}
return {
content: getRoleSubscriptionPurchaseSystemMessageContentMobile({
username: messageAuthorWithProcessedColor.nick,
guildId: guildId2,
usernameOnClickHandler: formatUsernameOnClick({
message,
author: messageAuthorWithProcessedColor,
roleStyle
}),
roleSubscriptionOnClickHandler,
roleSubscriptionData
}),
totalMonthsSubscribed: roleSubscriptionData.total_months_subscribed,
username: messageAuthorWithProcessedColor.nick,
avatarURL: r66.uri,
sticker,
stickerLabel: getRoleSubscriptionPurchaseStickerCTA(message.id, false),
welcomeLabel: intl.string(t.piPHvY),
...createCommonMessage(a0)
};
}
@@ -0,0 +1,21 @@
// Metro module 7808 (f7809).
import { getMessageAuthorWithProcessedColor } from "./useAuthorWithProcessedColor";
import { intl, t } from "../../../../../intl/index.native";
import formatUsernameOnClick from "./formatUsernameOnClick";
import createCommonMessage from "./createCommonMessage";
export function createStageEndSystemMessage(a0) {
const { message, roleStyle } = a0;
const messageAuthorWithProcessedColor = getMessageAuthorWithProcessedColor(message);
return {
content: intl.formatToParts(t.vMJhvG, {
username: messageAuthorWithProcessedColor.nick,
usernameOnClick: formatUsernameOnClick({
message,
author: messageAuthorWithProcessedColor,
roleStyle
}),
topic: message.content
}),
...createCommonMessage(a0)
};
}
@@ -0,0 +1,54 @@
// Metro module 7811 (f7812).
import StageChannelParticipantStore from "../../../../stage_channels/StageChannelParticipantStore";
import ChannelStore from "../../../../../stores/ChannelStore";
import PermissionStore from "../../../../../stores/PermissionStore";
import { HelpdeskArticles, MessageFlags, MessageTypes, Permissions } from "../../../../../Constants";
import { intl, t } from "../../../../../intl/index.native";
import HelpdeskUtils from "../../../../../utils/HelpdeskUtils";
import { getMessageAuthorWithProcessedColor } from "./useAuthorWithProcessedColor";
import SnowflakeUtils from "../../../../../utils/SnowflakeUtils";
import { RequestToSpeakStates } from "../../../../stage_channels/useAudienceRequestToSpeakState";
import formatUsernameOnClick from "./formatUsernameOnClick";
import createCommonMessage from "./createCommonMessage";
export function createStageRaiseHandSystemMessage(a0) {
const { message, roleStyle } = a0;
const messageAuthorWithProcessedColor = getMessageAuthorWithProcessedColor(message);
let showInviteToSpeakButton = PermissionStore.can(Permissions.MUTE_MEMBERS, ChannelStore.getChannel(message.channel_id));
const participant = StageChannelParticipantStore.getParticipant(message.channel_id, message.author.id);
const r44 = new Date(SnowflakeUtils.extractTimestamp(message.id)).toISOString();
const r45 = Date;
let r46 = participant == null ? void 0 : participant.voiceState?.requestToSpeakTimestamp;
if (r46 == null) {
r46 = 0;
}
const r55 = new r45(r46).toISOString();
if (showInviteToSpeakButton) {
showInviteToSpeakButton = participant?.rtsState === RequestToSpeakStates.REQUESTED_TO_SPEAK;
}
if (showInviteToSpeakButton) {
showInviteToSpeakButton = r44 === r55;
}
return {
content: intl.formatToParts(t.M87x7Y, {
username: messageAuthorWithProcessedColor.nick,
usernameOnClick: formatUsernameOnClick({
message,
author: messageAuthorWithProcessedColor,
roleStyle
})
}),
showInviteToSpeakButton,
buttonLabel: intl.string(t.f0T7hI),
ephemeralIndication: message.hasFlag(MessageFlags.EPHEMERAL) ? message.type === MessageTypes.STAGE_RAISE_HAND ? {
content: intl.formatToParts(t["qDAX++"], {
handleDelete: {
action: "bindDismissMessage",
message
}
}),
helpArticleLink: HelpdeskUtils.getArticleURL(HelpdeskArticles.EPHEMERAL_MESSAGES),
helpButtonAccessibilityLabel: intl.string(t.htHOrp)
} : void 0 : void 0,
...createCommonMessage(a0)
};
}
@@ -0,0 +1,20 @@
// Metro module 7810 (f7811).
import { getMessageAuthorWithProcessedColor } from "./useAuthorWithProcessedColor";
import { intl, t } from "../../../../../intl/index.native";
import formatUsernameOnClick from "./formatUsernameOnClick";
import createCommonMessage from "./createCommonMessage";
export function createStageSpeakerSystemMessage(a0) {
const { message, roleStyle } = a0;
const messageAuthorWithProcessedColor = getMessageAuthorWithProcessedColor(message);
return {
content: intl.formatToParts(t.V4uCm4, {
username: messageAuthorWithProcessedColor.nick,
usernameOnClick: formatUsernameOnClick({
message,
author: messageAuthorWithProcessedColor,
roleStyle
})
}),
...createCommonMessage(a0)
};
}
@@ -0,0 +1,21 @@
// Metro module 7807 (f7808).
import { getMessageAuthorWithProcessedColor } from "./useAuthorWithProcessedColor";
import { intl, t } from "../../../../../intl/index.native";
import formatUsernameOnClick from "./formatUsernameOnClick";
import createCommonMessage from "./createCommonMessage";
export function createStageStartSystemMessage(a0) {
const { message, roleStyle } = a0;
const messageAuthorWithProcessedColor = getMessageAuthorWithProcessedColor(message);
return {
content: intl.formatToParts(t.aZtRW8, {
username: messageAuthorWithProcessedColor.nick,
usernameOnClick: formatUsernameOnClick({
message,
author: messageAuthorWithProcessedColor,
roleStyle
}),
topic: message.content
}),
...createCommonMessage(a0)
};
}
@@ -0,0 +1,21 @@
// Metro module 7809 (f7810).
import { getMessageAuthorWithProcessedColor } from "./useAuthorWithProcessedColor";
import { intl, t } from "../../../../../intl/index.native";
import formatUsernameOnClick from "./formatUsernameOnClick";
import createCommonMessage from "./createCommonMessage";
export function createStageTopicSystemMessage(a0) {
const { message, roleStyle } = a0;
const messageAuthorWithProcessedColor = getMessageAuthorWithProcessedColor(message);
return {
content: intl.formatToParts(t.ro3RM0, {
username: messageAuthorWithProcessedColor.nick,
usernameOnClick: formatUsernameOnClick({
message,
author: messageAuthorWithProcessedColor,
roleStyle
}),
topic: message.content
}),
...createCommonMessage(a0)
};
}
@@ -0,0 +1,175 @@
// Metro module 7741 (f7742).
import { BoostedGuildTiers, MessageTypes } from "../../../../../Constants";
import { createAddRecipientSystemMessage } from "./AddRecipientSystemMessage";
import { createRemoveRecipientSystemMessage } from "./RemoveRecipientSystemMessage";
import { createCallSystemMessage } from "./CallSystemMessage";
import { createChangeChannelNameSystemMessage } from "./ChangeChannelNameSystemMessage";
import { createChangeChannelIconSystemMessage } from "./ChangeChannelIconSystemMessage";
import { createChannelPinnedMessageSystemMessage } from "./ChannelPinnedMessageSystemMessage";
import { createUserJoinSystemMessage } from "./UserJoinSystemMessage";
import { createUserPremiumGuildSubscriptionSystemMessage } from "./UserPremiumGuildSubscriptionSystemMessage";
import { createUserPremiumGuildSubscriptionTierAchievedSystemMessage } from "./UserPremiumGuildSubscriptionTierAchievedSystemMessage";
import { createChannelFollowAddSystemMessage } from "./ChannelFollowAddSystemMessage";
import { createGuildStreamSystemMessage } from "./GuildStreamSystemMessage";
import { createGuildDiscoveryDisqualifiedSystemMessage, createGuildDiscoveryRequalifiedSystemMessage, createGuildDiscoveryGracePeriodInitialWarningSystemMessage, createGuildDiscoveryGracePeriodFinalWarningSystemMessage } from "./GuildDiscoverySystemMessage";
import { createApplicationCommandSourceSystemMessage } from "./ApplicationCommandSourceSystemMessage";
import { createNewThreadSystemMessage } from "./NewThreadSystemMessage";
import { createThreadStarterSystemMessage } from "./ThreadStarterSystemMessage";
import { createAutoModerationActionSystemMessage } from "./AutoModerationActionSystemMessage";
import { createRoleSubscriptionPurchaseSystemMessage } from "./RoleSubscriptionPurchaseSystemMessage";
import { createPurchaseNotificationSystemMessage } from "./PurchaseNotificationSystemMessage";
import { createStageStartSystemMessage } from "./StageStartSystemMessage";
import { createStageEndSystemMessage } from "./StageEndSystemMessage";
import { createStageTopicSystemMessage } from "./StageTopicSystemMessage";
import { createStageSpeakerSystemMessage } from "./StageSpeakerSystemMessage";
import { createStageRaiseHandSystemMessage } from "./StageRaiseHandSystemMessage";
import { createApplicationSubscriptionPurchaseSystemMessage } from "./ApplicationSubscriptionPurchaseSystemMessage";
import { createPrivateChannelIntegrationSystemMessage } from "./PrivateChannelIntegrationSystemMessage";
import { createGuildAlertModeEnabledSystemMessage, createGuildAlertModeDisabledSystemMessage } from "./GuildAlertModeSystemMessage";
import { createGuildReportRaidSystemMessage } from "./GuildReportRaidSystemMessage";
import { createGuildReportFalseAlarmSystemMessage } from "./GuildReportFalseAlarmSystemMessage";
import { createPollResultSystemMessage } from "./PollResultSystemMessage";
import { createChannelLinkedToLobbySystemMessage } from "./ChannelLinkedToLobbySystemMessage";
import { createInGameMessageNuxSystemMessage } from "./InGameMessageNuxSystemMessage";
import { createJoinRequestNotificationSystemMessage } from "./JoinRequestNotificationSystemMessage";
import { createPremiumGroupInviteSystemMessage } from "./PremiumGroupInviteSystemMessage";
import { createReferralSystemMessage } from "./ReferralSystemMessage";
import { createVoiceSessionSystemMessage } from "./VoiceSessionSystemMessage";
import { createFriendRequestAcceptedSystemMessage } from "./FriendRequestAcceptedSystemMessage";
import { createGiftIntentSystemMessage } from "./GiftIntentSystemMessage";
export function createSystemMessageContent(a0) {
const type = a0.message.type;
if (MessageTypes.RECIPIENT_ADD === type) {
return createAddRecipientSystemMessage(a0);
}
if (MessageTypes.RECIPIENT_REMOVE === type) {
return createRemoveRecipientSystemMessage(a0);
}
if (MessageTypes.CALL === type) {
return createCallSystemMessage(a0);
}
if (MessageTypes.CHANNEL_NAME_CHANGE === type) {
return createChangeChannelNameSystemMessage(a0);
}
if (MessageTypes.CHANNEL_ICON_CHANGE === type) {
return createChangeChannelIconSystemMessage(a0);
}
if (MessageTypes.CHANNEL_PINNED_MESSAGE === type) {
return createChannelPinnedMessageSystemMessage(a0);
}
if (MessageTypes.USER_JOIN === type) {
return createUserJoinSystemMessage(a0);
}
if (MessageTypes.GUILD_BOOST === type) {
return createUserPremiumGuildSubscriptionSystemMessage(a0);
}
if (MessageTypes.GUILD_BOOST_TIER_1 === type) {
return createUserPremiumGuildSubscriptionTierAchievedSystemMessage(a0, BoostedGuildTiers.TIER_1);
}
if (MessageTypes.GUILD_BOOST_TIER_2 === type) {
return createUserPremiumGuildSubscriptionTierAchievedSystemMessage(a0, BoostedGuildTiers.TIER_2);
}
if (MessageTypes.GUILD_BOOST_TIER_3 === type) {
return createUserPremiumGuildSubscriptionTierAchievedSystemMessage(a0, BoostedGuildTiers.TIER_3);
}
if (MessageTypes.CHANNEL_FOLLOW_ADD === type) {
return createChannelFollowAddSystemMessage(a0);
}
if (MessageTypes.GUILD_STREAM === type) {
return createGuildStreamSystemMessage(a0);
}
if (MessageTypes.GUILD_DISCOVERY_DISQUALIFIED === type) {
return createGuildDiscoveryDisqualifiedSystemMessage(a0);
}
if (MessageTypes.GUILD_DISCOVERY_REQUALIFIED === type) {
return createGuildDiscoveryRequalifiedSystemMessage(a0);
}
if (MessageTypes.GUILD_DISCOVERY_GRACE_PERIOD_INITIAL_WARNING === type) {
return createGuildDiscoveryGracePeriodInitialWarningSystemMessage(a0);
}
if (MessageTypes.GUILD_DISCOVERY_GRACE_PERIOD_FINAL_WARNING === type) {
return createGuildDiscoveryGracePeriodFinalWarningSystemMessage(a0);
}
if (MessageTypes.CHAT_INPUT_COMMAND !== type && MessageTypes.CONTEXT_MENU_COMMAND !== type) {
if (MessageTypes.GUILD_INVITE_REMINDER === type) {
return null;
}
if (MessageTypes.THREAD_CREATED === type) {
return createNewThreadSystemMessage(a0);
}
if (MessageTypes.THREAD_STARTER_MESSAGE === type) {
return createThreadStarterSystemMessage(a0);
}
if (MessageTypes.AUTO_MODERATION_ACTION === type) {
return createAutoModerationActionSystemMessage(a0);
}
if (MessageTypes.ROLE_SUBSCRIPTION_PURCHASE === type) {
return createRoleSubscriptionPurchaseSystemMessage(a0);
}
if (MessageTypes.PURCHASE_NOTIFICATION === type) {
return createPurchaseNotificationSystemMessage(a0);
}
if (MessageTypes.STAGE_START === type) {
return createStageStartSystemMessage(a0);
}
if (MessageTypes.STAGE_END === type) {
return createStageEndSystemMessage(a0);
}
if (MessageTypes.STAGE_TOPIC === type) {
return createStageTopicSystemMessage(a0);
}
if (MessageTypes.STAGE_SPEAKER === type) {
return createStageSpeakerSystemMessage(a0);
}
if (MessageTypes.STAGE_RAISE_HAND === type) {
return createStageRaiseHandSystemMessage(a0);
}
if (MessageTypes.GUILD_APPLICATION_PREMIUM_SUBSCRIPTION === type) {
return createApplicationSubscriptionPurchaseSystemMessage(a0);
}
if (MessageTypes.PRIVATE_CHANNEL_INTEGRATION_ADDED !== type && MessageTypes.PRIVATE_CHANNEL_INTEGRATION_REMOVED !== type) {
if (MessageTypes.GUILD_INCIDENT_ALERT_MODE_ENABLED === type) {
return createGuildAlertModeEnabledSystemMessage(a0);
}
if (MessageTypes.GUILD_INCIDENT_ALERT_MODE_DISABLED === type) {
return createGuildAlertModeDisabledSystemMessage(a0);
}
if (MessageTypes.GUILD_INCIDENT_REPORT_RAID === type) {
return createGuildReportRaidSystemMessage(a0);
}
if (MessageTypes.GUILD_INCIDENT_REPORT_FALSE_ALARM === type) {
return createGuildReportFalseAlarmSystemMessage(a0);
}
if (MessageTypes.POLL_RESULT === type) {
return createPollResultSystemMessage(a0);
}
if (MessageTypes.CHANNEL_LINKED_TO_LOBBY === type) {
return createChannelLinkedToLobbySystemMessage(a0);
}
if (MessageTypes.IN_GAME_MESSAGE_NUX === type) {
return createInGameMessageNuxSystemMessage(a0);
}
if (MessageTypes.GUILD_JOIN_REQUEST_ACCEPT_NOTIFICATION !== type && MessageTypes.GUILD_JOIN_REQUEST_REJECT_NOTIFICATION !== type && MessageTypes.GUILD_JOIN_REQUEST_WITHDRAWN_NOTIFICATION !== type) {
if (MessageTypes.PREMIUM_GROUP_INVITE === type) {
return createPremiumGroupInviteSystemMessage(a0);
}
if (MessageTypes.PREMIUM_REFERRAL === type) {
return createReferralSystemMessage(a0);
}
if (MessageTypes.VOICE_SESSION === type) {
return createVoiceSessionSystemMessage(a0);
}
if (MessageTypes.FRIEND_REQUEST_ACCEPTED === type) {
return createFriendRequestAcceptedSystemMessage(a0);
}
if (MessageTypes.GIFTING_PROMPT === type) {
return createGiftIntentSystemMessage(a0);
}
return null;
}
return createJoinRequestNotificationSystemMessage(a0);
}
return createPrivateChannelIntegrationSystemMessage(a0, a0.message.type);
}
return createApplicationCommandSourceSystemMessage(a0);
}
@@ -0,0 +1,15 @@
// Metro module 7794 (f7795).
import ReferencedMessageStore, { ReferencedMessageState } from "../../../../replies/ReferencedMessageStore";
import { MessageTypes } from "../../../../../Constants";
import Module38 from "../../../../../_bundle/Module38";
import { intl, t } from "../../../../../intl/index.native";
import createCommonMessage from "./createCommonMessage";
export function createThreadStarterSystemMessage(a0) {
const message = a0.message;
const { messageReference, type } = message;
Module38(type === MessageTypes.THREAD_STARTER_MESSAGE, `cannot call createThreadStarterSystemMessage on a message of type ${type}`);
return ReferencedMessageStore.getMessageByReference(messageReference).state !== ReferencedMessageState.LOADED ? {
content: intl.string(t.OCs36J),
...createCommonMessage(a0)
} : null;
}
@@ -0,0 +1,42 @@
// Metro module 7766 (f7767).
import ChannelStore from "../../../../../stores/ChannelStore";
import GuildStore from "../../../../../stores/GuildStore";
import { SystemChannelFlags } from "../../../../../Constants";
import { getMessageAuthorWithProcessedColor } from "./useAuthorWithProcessedColor";
import SystemMessageUtils from "../../../../../utils/SystemMessageUtils";
import { computeIsStickerReplyEnabled } from "./useIsStickerReplyEnabled";
import { transformSticker } from "./transformSticker";
import { pickWelcomeSticker } from "../../../../welcome_cta/WelcomeCTAUtils";
import { intl, t } from "../../../../../intl/index.native";
import formatUsernameOnClick from "./formatUsernameOnClick";
import createCommonMessage from "./createCommonMessage";
export function createUserJoinSystemMessage(a0) {
const { message, roleStyle } = a0;
const messageAuthorWithProcessedColor = getMessageAuthorWithProcessedColor(message);
const channel = ChannelStore.getChannel(message.getChannelId());
const systemMessageUserJoinMobile = SystemMessageUtils.getSystemMessageUserJoinMobile(message.id);
const r31 = channel == null ? void 0 : channel.getGuildId();
const r33 = r31 != null;
let sticker = void 0;
if (r33) {
const r35 = channel != null;
sticker = void 0;
if (r35) {
const guild = GuildStore.getGuild(r31);
sticker = computeIsStickerReplyEnabled(r31, channel, message, guild != null && !(guild.systemChannelFlags & SystemChannelFlags.SUPPRESS_JOIN_NOTIFICATION_REPLIES)) ? transformSticker(pickWelcomeSticker(message.id)) : void 0;
}
}
return {
content: intl.formatToParts(systemMessageUserJoinMobile, {
username: messageAuthorWithProcessedColor.nick,
usernameOnClick: formatUsernameOnClick({
message,
author: messageAuthorWithProcessedColor,
roleStyle
})
}),
sticker,
stickerLabel: intl.string(t["7Tj6HT"]),
...createCommonMessage(a0)
};
}
@@ -0,0 +1,27 @@
// Metro module 7785 (f7786).
import getNumSubscriptionsPurchasedFromSystemMessage from "../../../../premium/getNumSubscriptionsPurchasedFromSystemMessage";
import { getMessageAuthorWithProcessedColor } from "./useAuthorWithProcessedColor";
import formatUsernameOnClick from "./formatUsernameOnClick";
import { intl, t } from "../../../../../intl/index.native";
import createCommonMessage from "./createCommonMessage";
export function createUserPremiumGuildSubscriptionSystemMessage(a0) {
const { message, roleStyle } = a0;
const numSubscriptionsPurchasedFromSystemMessage = getNumSubscriptionsPurchasedFromSystemMessage(message);
const messageAuthorWithProcessedColor = getMessageAuthorWithProcessedColor(message);
const usernameOnClick = formatUsernameOnClick({
message,
author: messageAuthorWithProcessedColor,
roleStyle
});
return {
content: numSubscriptionsPurchasedFromSystemMessage > 1 ? intl.formatToParts(t.rbj006, {
username: messageAuthorWithProcessedColor.nick,
usernameOnClick,
numSubscriptions: numSubscriptionsPurchasedFromSystemMessage
}) : intl.formatToParts(t.ihxM9x, {
username: messageAuthorWithProcessedColor.nick,
usernameOnClick
}),
...createCommonMessage(a0)
};
}
@@ -0,0 +1,43 @@
// Metro module 7787 (f7788).
import ChannelStore from "../../../../../stores/ChannelStore";
import GuildStore from "../../../../../stores/GuildStore";
import { createUserPremiumGuildSubscriptionSystemMessage } from "./UserPremiumGuildSubscriptionSystemMessage";
import getNumSubscriptionsPurchasedFromSystemMessage from "../../../../premium/getNumSubscriptionsPurchasedFromSystemMessage";
import { getMessageAuthorWithProcessedColor } from "./useAuthorWithProcessedColor";
import formatUsernameOnClick from "./formatUsernameOnClick";
import { intl, t } from "../../../../../intl/index.native";
import { getTierName } from "../../../../../utils/GuildBoostingUtils";
import createCommonMessage from "./createCommonMessage";
export function createUserPremiumGuildSubscriptionTierAchievedSystemMessage(a0, a1) {
const { message, roleStyle } = a0;
const channel = ChannelStore.getChannel(message.getChannelId());
if (channel == null) {
return createUserPremiumGuildSubscriptionSystemMessage(a0);
}
const guild = GuildStore.getGuild(channel.getGuildId());
if (guild == null) {
return createUserPremiumGuildSubscriptionSystemMessage(a0);
}
const numSubscriptionsPurchasedFromSystemMessage = getNumSubscriptionsPurchasedFromSystemMessage(message);
const messageAuthorWithProcessedColor = getMessageAuthorWithProcessedColor(message);
const usernameOnClick = formatUsernameOnClick({
message,
author: messageAuthorWithProcessedColor,
roleStyle
});
return {
content: numSubscriptionsPurchasedFromSystemMessage > 1 ? intl.formatToParts(t.GjNvr7, {
username: messageAuthorWithProcessedColor.nick,
usernameOnClick,
guildName: guild.name,
newTierName: getTierName(a1),
numSubscriptions: numSubscriptionsPurchasedFromSystemMessage
}) : intl.formatToParts(t.oAYAP7, {
username: messageAuthorWithProcessedColor.nick,
usernameOnClick,
guildName: guild.name,
newTierName: getTierName(a1)
}),
...createCommonMessage(a0)
};
}
@@ -0,0 +1,69 @@
// Metro module 7845 (f7846).
import ChannelStore from "../../../../../stores/ChannelStore";
import getHumanizedCallDuration from "../../../getHumanizedCallDuration";
import { getMessageAuthorWithProcessedColor, getUserAuthorWithProcessedColor } from "./useAuthorWithProcessedColor";
import { getSortedVoiceSessionParticipants } from "../../../VoiceSessionUtils";
import { intl, t } from "../../../../../intl/index.native";
import formatUsernameOnClick from "./formatUsernameOnClick";
import createCommonMessage from "./createCommonMessage";
export function createVoiceSessionSystemMessage(a0) {
let content;
const { message, roleStyle } = a0;
const channel = ChannelStore.getChannel(message.channel_id);
const humanizedCallDuration = getHumanizedCallDuration(message);
const messageAuthorWithProcessedColor = getMessageAuthorWithProcessedColor(message);
const r13 = getSortedVoiceSessionParticipants(message).map((item) => ({
user: item,
messageAuthor: getUserAuthorWithProcessedColor(item, channel)
}));
if (humanizedCallDuration == null) {
content = intl.formatToParts(t.HzBfIN, {
username: messageAuthorWithProcessedColor.nick,
usernameOnClick: formatUsernameOnClick({
message,
author: messageAuthorWithProcessedColor,
roleStyle
})
});
} else {
const atbXuX = t.atbXuX;
const r45 = {
userCount: r13.length + 1,
username: messageAuthorWithProcessedColor.nick,
usernameOnClick: formatUsernameOnClick({
message,
author: messageAuthorWithProcessedColor,
roleStyle
}),
username2: null,
username2OnClick: null,
username3: null,
username3OnClick: null,
otherCount: null,
duration: null
};
const r50 = r13[0];
r45.username2 = r50 == null ? void 0 : r50.messageAuthor.nick;
r45.username2OnClick = r13[0] != null ? formatUsernameOnClick({
userId: r13[0].user.id,
message,
author: r13[0].messageAuthor,
roleStyle
}) : void 0;
const r62 = r13[1];
r45.username3 = r62 == null ? void 0 : r62.messageAuthor.nick;
r45.username3OnClick = r13[1] != null ? formatUsernameOnClick({
userId: r13[1].user.id,
message,
author: r13[1].messageAuthor,
roleStyle
}) : void 0;
r45.otherCount = r13.length - 1;
r45.duration = humanizedCallDuration;
content = intl.formatToParts(atbXuX, r45);
}
return {
content,
...createCommonMessage(a0)
};
}
@@ -0,0 +1,33 @@
// Metro module 7746 (f7747).
import ChannelStore from "../../../../../stores/ChannelStore";
import { createNativeStyleProperties, experimental_createToken } from "../../../../../design/components/Styles/native/createStyles";
import { isThemeDark } from "../../../../../design/shared";
import { hexWithOpacity } from "../../../../../utils/ColorUtils";
import Module712 from "../../../../../_bundle/Module712";
import { calendarFormat } from "../../../../../utils/DateUtils";
import { getAssetUriForEmbed } from "../EmbedUtils";
import Module7747 from "../../../../../_bundle/Module7747";
import Module7748 from "../../../../../_bundle/Module7748";
import { createMessageAccessibilityActions } from "../../MessageAccessibilityActions";
const nativeStyleProperties = createNativeStyleProperties({
timestampColor: Module712.colors.TEXT_MUTED,
highlightColor: experimental_createToken((a0) => isThemeDark(a0.theme) ? hexWithOpacity(Module712.unsafe_rawColors.WHITE, 0.1) : "rgba(201,210,240,0.6)")
});
export default function createCommonMessage({ message, theme, reactions }) {
const r9 = nativeStyleProperties(theme);
const channel = ChannelStore.getChannel(message.channel_id);
return {
id: message.id,
channelId: message.channel_id,
type: message.type,
mentioned: message.mentioned,
timestamp: calendarFormat(message.timestamp, true),
timestampColor: r9.timestampColor,
dark: isThemeDark(theme),
highlightColor: r9.highlightColor,
reactions,
swipeToReplyIconUrl: getAssetUriForEmbed(Module7747),
swipeToEditIconUrl: getAssetUriForEmbed(Module7748),
accessibilityActions: createMessageAccessibilityActions(message, channel)
};
};
@@ -0,0 +1,27 @@
// Metro module 7745 (f7746).
import { isNativeMessageEligibleForEnhancedRoleColors } from "../../../../premium/enhanced_role_colors/native/EnhancedRoleColorUtils";
export default function formatUsernameOnClick(a0) {
let userId = a0.userId;
const { message, author, roleStyle } = a0;
let messageChannelId = a0.messageChannelId;
const { colorString, colorStrings, guildId } = author;
if (userId == null) {
userId = message.author.id;
}
const linkColor = roleStyle === "username" ? colorString : null;
const roleColors = isNativeMessageEligibleForEnhancedRoleColors(guildId, userId) ? colorStrings : null;
const shouldShowRoleDot = roleStyle === "dot" && colorString != null;
if (messageChannelId == null) {
messageChannelId = message.channel_id;
}
return {
action: "bindUserMenu",
userId,
linkColor,
roleColor: colorString,
roleColors,
shouldShowRoleDot,
messageChannelId,
medium: true
};
};
@@ -0,0 +1,39 @@
// Metro module 7780 (f7781).
import { useMemo } from "react";
import { StickerAnimationSettings } from "../../../../stickers/StickersConstants";
import { getStickerAssetUrl } from "../../../../stickers/StickersUtils";
import { NativeLottieRenderMode } from "../../../../stickers/native/NativeLottieView";
import { intl, t } from "../../../../../intl/index.native";
import { AnimateStickers } from "../../../../user_settings/UserSettings";
import * as _AccessibilityLabelOptimizationExperiment from "../../../../a11y/native/AccessibilityLabelOptimizationExperiment";
const transform = function transform(sticker, a1, shouldSkipAccessibilityLabels) {
let id = sticker.id;
if (id == null) {
id = "";
}
let url = getStickerAssetUrl(sticker, {
isPreview: !a1
});
if (url == null) {
url = "";
}
return {
...sticker,
asset: id,
url,
renderMode: a1 ? NativeLottieRenderMode.LOOP : NativeLottieRenderMode.STILL,
accessibilityLabel: shouldSkipAccessibilityLabels ? intl.string(t["fT+Yjp"]) : intl.formatToPlainString(t.rk6pOw, {
stickerName: sticker.name
}),
accessibilityHint: intl.string(t.GCEruV)
};
};
export default function useTransformedSticker({ sticker, isStickerReplyEnabled }) {
const r1 = AnimateStickers.useSetting() === StickerAnimationSettings.ALWAYS_ANIMATE;
let c16025_2 = r1;
const shouldSkipAccessibilityLabels = _AccessibilityLabelOptimizationExperiment.shouldSkipAccessibilityLabels();
return useMemo(() => isStickerReplyEnabled ? transform(sticker, c16025_2, shouldSkipAccessibilityLabels) : void 0, [r1, isStickerReplyEnabled, shouldSkipAccessibilityLabels, sticker]);
};
export function transformSticker(a0) {
return transform(a0, AnimateStickers.getSetting() === StickerAnimationSettings.ALWAYS_ANIMATE, _AccessibilityLabelOptimizationExperiment.shouldSkipAccessibilityLabels());
}
@@ -0,0 +1,24 @@
// Metro module 7743 (f7744).
import { processColor } from "react-native";
import { getMessageAuthor, getUserAuthor } from "../../../useMessageAuthor";
import { processColorStrings } from "../../../../premium/enhanced_role_colors/native/EnhancedRoleColorUtils";
export function getMessageAuthorWithProcessedColor(a0) {
const messageAuthor = getMessageAuthor(a0);
const { nick, colorString, colorStrings, guildId } = messageAuthor;
return {
nick,
colorString: colorString != null ? processColor(colorString) : void 0,
colorStrings: processColorStrings(colorStrings),
guildId
};
}
export function getUserAuthorWithProcessedColor(a0, a1) {
const userAuthor = getUserAuthor(a0, a1);
const { nick, colorString, colorStrings, guildId } = userAuthor;
return {
nick,
colorString: colorString != null ? processColor(colorString) : void 0,
colorStrings: processColorStrings(colorStrings),
guildId
};
}
@@ -0,0 +1,26 @@
// Metro module 7779 (f7780).
import GuildMemberStore from "../../../../../stores/GuildMemberStore";
import PermissionStore from "../../../../../stores/PermissionStore";
import UserStore from "../../../../../stores/UserStore";
import { Permissions } from "../../../../../Constants";
import { computeIsReadOnlyThread } from "../../../../threads/ThreadHooks";
export function computeIsStickerReplyEnabled(a0, a1, a2, a3) {
const currentUser = UserStore.getCurrentUser();
const r9 = currentUser != null && GuildMemberStore.getMember(a0, currentUser.id)?.isPending;
const r21 = computeIsReadOnlyThread(a1);
let r26 = PermissionStore.can(Permissions.SEND_MESSAGES, a1);
const bot = a2.author.bot;
if (r26) {
r26 = !r21;
}
if (r26) {
r26 = !r9;
}
if (r26) {
r26 = !bot;
}
if (r26) {
r26 = a3;
}
return r26;
}