Files
discord-decomp/sources/utils/InviteErrorUtils.tsx
T
2026-07-27 16:20:00 +03:00

91 lines
4.4 KiB
TypeScript

/* Metro module 10545; source: utils/InviteErrorUtils.tsx; dependencies: [1878, 661, 3802, 1244, 1948, 2] */
function _fun81318(global, require, importDefault, importAll, module, exports, dependencyMap) { // fn#81318, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:10731:6, offset: 0x01eca1d8, size: 183 bytes, params: 8, frame: 19
const env0_0 = require;
const Object = global.Object;
Object.defineProperty(exports, '__esModule', {value: true});
const userStore = importDefault(1878) /* metro dependency 1878: UserStore */;
const constantsModule = require(661) /* metro dependency 661: Constants */;
const env0_4 = constantsModule.AbortCodes;
const env0_5 = constantsModule.HelpdeskArticles;
const env0_6 = constantsModule.MAX_USER_GUILDS;
const env0_7 = constantsModule.MAX_USER_GUILDS_PREMIUM;
(require(2) /* metro dependency 2 */).fileFinishedImporting('utils/InviteErrorUtils.tsx');
exports.getDescriptiveInviteError = getDescriptiveInviteError;
exports.getInviteError = getInviteError;
}
function getDescriptiveInviteError(a0) { // fn#81319, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:10731:288, offset: 0x01eca28f, size: 618 bytes, params: 2, frame: 19
var object2;
const intl = (require(1244) /* metro dependency 1244: indexNative */).intl;
const t = (require(1244) /* metro dependency 1244: indexNative */).t;
var currentUser;
var value3;
var defaultImport;
const TOO_MANY_USER_GUILDS = AbortCodes.TOO_MANY_USER_GUILDS;
if (TOO_MANY_USER_GUILDS === a0) {
currentUser = UserStore.getCurrentUser();
value3 = undefined;
defaultImport = importDefault(3802) /* metro dependency 3802: PremiumUtils */;
return {title: intl.formatToPlainString(t['ttJ/hj'],
{quantity: defaultImport.canUseIncreasedGuildCap(currentUser) || (currentUser == null ? value3 : currentUser.isStaff()) ? MAX_USER_GUILDS_PREMIUM : MAX_USER_GUILDS}),
description: intl.string(t.iLyuDO)};
}
const GUILD_AT_CAPACITY = AbortCodes.GUILD_AT_CAPACITY;
if (GUILD_AT_CAPACITY === a0) {
object2 = {};
object2.title = intl.string(t.ZZlox4);
object2.description = intl.string(t.ZUEGFn);
return object2;
}
const GUILD_JOIN_INVITE_LIMITED_ACCESS = AbortCodes.GUILD_JOIN_INVITE_LIMITED_ACCESS;
if (GUILD_JOIN_INVITE_LIMITED_ACCESS === a0) {
object2 = {};
object2.title = intl.string(t.kJwpBW);
object2.description = intl.string(t.ZUEGFn);
return object2;
}
const USER_GUILD_JOIN_LARGE_GUILD_UNDERAGE_DISALLOWED = AbortCodes.USER_GUILD_JOIN_LARGE_GUILD_UNDERAGE_DISALLOWED;
if (USER_GUILD_JOIN_LARGE_GUILD_UNDERAGE_DISALLOWED === a0) {
object2 = {};
object2.title = intl.string(t['u/xsK9']);
object2.description = intl.string(t.SxY4IW);
return object2;
}
return null;
}
function getInviteError(a0) { // fn#81320, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:10731:1059, offset: 0x01eca4f9, size: 495 bytes, params: 2, frame: 18
const intl = (require(1244) /* metro dependency 1244: indexNative */).intl;
const t = (require(1244) /* metro dependency 1244: indexNative */).t;
var format;
var RXSeLl;
var defaultImport;
const TOO_MANY_USER_GUILDS = AbortCodes.TOO_MANY_USER_GUILDS;
if (TOO_MANY_USER_GUILDS === a0) {
return intl.string(t.iLyuDO);
}
const GUILD_AT_CAPACITY = AbortCodes.GUILD_AT_CAPACITY;
if (GUILD_AT_CAPACITY === a0) {
return intl.string(t.M6unNJ);
}
const INVALID_COUNTRY_CODE = AbortCodes.INVALID_COUNTRY_CODE;
if (INVALID_COUNTRY_CODE === a0) {
return intl.string(t.sRJGR1);
}
const INVALID_CANNOT_FRIEND_SELF = AbortCodes.INVALID_CANNOT_FRIEND_SELF;
if (INVALID_CANNOT_FRIEND_SELF === a0) {
return intl.string(t['mY2R+F']);
}
const INVITES_DISABLED = AbortCodes.INVITES_DISABLED;
if (INVITES_DISABLED === a0) {
format = intl.format;
RXSeLl = t.RXSeLl;
defaultImport = importDefault(1948) /* metro dependency 1948: HelpdeskUtils */;
return Reflect.apply(format, intl, [RXSeLl,
{articleLink: defaultImport.getArticleURL(HelpdeskArticles.INVITE_DISABLED)}]);
}
return intl.string(t.dDZRdy);
}