71 lines
2.1 KiB
TypeScript
71 lines
2.1 KiB
TypeScript
// Metro module 6722 (f6723).
|
|
import ChannelStore from "../../stores/ChannelStore";
|
|
import UserStore from "../../stores/UserStore";
|
|
import { SafetyToastType } from "./Constants";
|
|
import NicknameUtils from "../../utils/NicknameUtils";
|
|
import UserUtils from "../../utils/UserUtils";
|
|
import { intl, t } from "../../intl/index.native";
|
|
import ReportToMod_messages from "../report_to_mod/ReportToMod.messages";
|
|
export function getSafetyToastTypeContent(a0, a1, a2) {
|
|
const user = UserStore.getUser(a1);
|
|
const channel = ChannelStore.getChannel(a2);
|
|
let username = NicknameUtils.getName(channel?.guild_id, channel?.id, user);
|
|
if (username == null) {
|
|
username = UserUtils.getGlobalName(user);
|
|
}
|
|
if (SafetyToastType.IGNORE_SUCCESS === a0) {
|
|
return intl.formatToPlainString(t["+joqrP"], {
|
|
username
|
|
});
|
|
}
|
|
if (SafetyToastType.UNIGNORE_SUCCESS === a0) {
|
|
return intl.formatToPlainString(t.THExKa, {
|
|
username
|
|
});
|
|
}
|
|
if (SafetyToastType.BLOCK_SUCCESS === a0) {
|
|
return intl.formatToPlainString(t.XXPrIs, {
|
|
username
|
|
});
|
|
}
|
|
if (SafetyToastType.UNBLOCK_SUCCESS === a0) {
|
|
return intl.formatToPlainString(t.uExcGX, {
|
|
username
|
|
});
|
|
}
|
|
if (SafetyToastType.MUTE_SUCCESS === a0) {
|
|
return intl.formatToPlainString(t.X4NtYb, {
|
|
username
|
|
});
|
|
}
|
|
if (SafetyToastType.UNMUTE_SUCCESS === a0) {
|
|
return intl.formatToPlainString(t.tRaBfY, {
|
|
username
|
|
});
|
|
}
|
|
if (SafetyToastType.REPORT_SUCCESS === a0) {
|
|
return intl.formatToPlainString(t.FOptFU, {
|
|
username
|
|
});
|
|
}
|
|
if (SafetyToastType.TIGGER_PAWTECT_ERROR === a0) {
|
|
return intl.string(t.c6kn6F);
|
|
}
|
|
if (SafetyToastType.TIGGER_PAWTECT_VERIFIED === a0) {
|
|
return intl.string(t["7nKAXx"]);
|
|
}
|
|
if (SafetyToastType.GENERIC_ERROR === a0) {
|
|
return intl.string(t.zBpoc7);
|
|
}
|
|
if (SafetyToastType.REPORT_TO_MOD_SUCCESS === a0) {
|
|
return intl.string(ReportToMod_messages.iBypeZ);
|
|
}
|
|
if (SafetyToastType.SAFETY_FEEDBACK_SUCCESS === a0) {
|
|
return intl.string(t.TcFR5k);
|
|
}
|
|
if (SafetyToastType.EXISTING_USER_AGE_GATE_SUCCESS === a0) {
|
|
return intl.string(t["susqq/"]);
|
|
}
|
|
return intl.string(t["+c5xtT"]);
|
|
}
|