108 lines
3.3 KiB
TypeScript
108 lines
3.3 KiB
TypeScript
// Metro module 7749 (f7750).
|
|
import GuildVerificationStore from "../../../stores/GuildVerificationStore";
|
|
import PermissionStore from "../../../stores/PermissionStore";
|
|
import { Permissions } from "../../../Constants";
|
|
import { DoubleTapReactionEmoji } from "../../user_settings/UserSettings";
|
|
import { disambiguatedEmojiFromSettingsValue } from "../../double_tap_to_react/native/DoubleTapToReactUtils";
|
|
import { intl, t } from "../../../intl/index.native";
|
|
import { canReplyToMessage } from "../../replies/canReplyToMessage";
|
|
let c4876_5 = {
|
|
VIEW_PROFILE: "view_profile",
|
|
ADD_REACTION: "add_reaction",
|
|
ADD_QUICK_REACTION: "add_quick_reaction",
|
|
REPLY: "reply",
|
|
MESSAGE_ACTIONS_MENU: "message_actions_menu",
|
|
EDIT_GDM: "edit_gdm",
|
|
OPEN_PINS: "open_pins",
|
|
JUMP_TO_MESSAGE: "jump_to_message"
|
|
};
|
|
export { c4876_5 as MessageAccessibilityAction };
|
|
export function getMessageAccessibilityActionFromLabel(a0) {
|
|
let r87;
|
|
const r4 = {};
|
|
r4[intl.string(t.iXAna6)] = c4876_5.VIEW_PROFILE;
|
|
r4[intl.string(t.lfIHs4)] = c4876_5.ADD_REACTION;
|
|
r4[intl.string(t["5IEsGx"])] = c4876_5.REPLY;
|
|
r4[intl.string(t.ChPNkN)] = c4876_5.MESSAGE_ACTIONS_MENU;
|
|
r4[intl.string(t["5Q9+/L"])] = c4876_5.EDIT_GDM;
|
|
r4[intl.string(t["mp1N/2"])] = c4876_5.OPEN_PINS;
|
|
r4[intl.string(t["+TSRGD"])] = c4876_5.JUMP_TO_MESSAGE;
|
|
const setting = DoubleTapReactionEmoji.getSetting();
|
|
const disableDoubleTap = setting?.disableDoubleTap;
|
|
L7: {
|
|
r87 = null;
|
|
if (disableDoubleTap !== true) {
|
|
if (setting != null) {
|
|
const r91 = disambiguatedEmojiFromSettingsValue(setting);
|
|
if (r91 != null) {
|
|
r87 = intl.formatToPlainString(t.eQIttH, {
|
|
emojiName: r91.name
|
|
});
|
|
break L7;
|
|
}
|
|
}
|
|
r87 = intl.formatToPlainString(t.eQIttH, {
|
|
emojiName: "heart"
|
|
});
|
|
}
|
|
}
|
|
if (r87 != null) {
|
|
r4[r87] = c4876_5.ADD_QUICK_REACTION;
|
|
}
|
|
return r4[a0];
|
|
}
|
|
export function createMessageAccessibilityActions(a0, a1) {
|
|
let label;
|
|
if (a1 == null) {
|
|
return [];
|
|
}
|
|
const guildId = a1.getGuildId();
|
|
const r14 = guildId != null && GuildVerificationStore.canChatInGuild(guildId) && PermissionStore.can(Permissions.ADD_REACTIONS, a1) || a1.isPrivate();
|
|
const r31 = [{
|
|
label: intl.string(t.iXAna6),
|
|
name: c4876_5.VIEW_PROFILE
|
|
}];
|
|
if (r14) {
|
|
r31.push({
|
|
label: intl.string(t.lfIHs4),
|
|
name: c4876_5.ADD_REACTION
|
|
});
|
|
const setting = DoubleTapReactionEmoji.getSetting();
|
|
const disableDoubleTap = setting?.disableDoubleTap;
|
|
L15: {
|
|
label = null;
|
|
if (disableDoubleTap !== true) {
|
|
if (setting != null) {
|
|
const r13 = disambiguatedEmojiFromSettingsValue(setting);
|
|
if (r13 != null) {
|
|
label = intl.formatToPlainString(t.eQIttH, {
|
|
emojiName: r13.name
|
|
});
|
|
break L15;
|
|
}
|
|
}
|
|
label = intl.formatToPlainString(t.eQIttH, {
|
|
emojiName: "heart"
|
|
});
|
|
}
|
|
}
|
|
if (label != null) {
|
|
r31.push({
|
|
label,
|
|
name: c4876_5.ADD_QUICK_REACTION
|
|
});
|
|
}
|
|
}
|
|
if (canReplyToMessage(a1, a0)) {
|
|
r31.push({
|
|
label: intl.string(t["5IEsGx"]),
|
|
name: c4876_5.REPLY
|
|
});
|
|
}
|
|
r31.push({
|
|
label: intl.string(t.ChPNkN),
|
|
name: c4876_5.MESSAGE_ACTIONS_MENU
|
|
});
|
|
return r31;
|
|
}
|