decord/source/modules/rpc/helpers/validateOpenInviteDialog.tsx

57 lines
2 KiB
TypeScript
Raw Normal View History

2026-07-30 10:14:41 +00:00
// Module ID: 13533
// Function ID: 13534
2026-07-20 16:05:17 +00:00
// Name: validateOpenInviteDialog
2026-07-30 10:14:41 +00:00
// Dependencies: [5686, 1862, 3817, 676, 13522, 10622, 8224, 2]
2026-07-20 16:05:17 +00:00
// Exports: validateOpenInviteDialog
2026-07-30 10:14:41 +00:00
// Module 13533 (validateOpenInviteDialog)
2026-07-29 08:29:29 +00:00
import map from "map";
import createGuildRecordFromRust from "createGuildRecordFromRust";
import getUncachedChannelPermissions from "getUncachedChannelPermissions";
2026-07-23 10:11:24 +00:00
import { RPCErrors } from "ME";
const require = arg1;
2026-07-29 08:29:29 +00:00
const result = require("getUncachedChannelPermissions").fileFinishedImporting("modules/rpc/helpers/validateOpenInviteDialog.tsx");
2026-07-20 16:05:17 +00:00
export const validateOpenInviteDialog = function validateOpenInviteDialog() {
2026-07-23 10:11:24 +00:00
connectedFrame = connectedFrame.getConnectedFrame();
2026-07-20 16:05:17 +00:00
if (null != connectedFrame) {
2026-07-29 08:29:29 +00:00
let obj = { frame: null, channel: "Array", guild: "isArray" };
obj[0] = connectedFrame;
2026-07-20 16:05:17 +00:00
return obj;
} else {
2026-07-30 10:14:41 +00:00
const obj6 = importDefault(13522)();
2026-07-20 16:05:17 +00:00
if (null == obj6) {
2026-07-29 08:29:29 +00:00
obj = { errorCode: null };
obj[0] = RPCErrors.INVALID_CHANNEL;
2026-07-30 10:14:41 +00:00
const tmp22 = new tmp24(10622)(obj, "Invalid channel");
2026-07-29 08:29:29 +00:00
throw tmp22;
2026-07-20 16:05:17 +00:00
} else {
2026-07-23 10:11:24 +00:00
guild = guild.getGuild(obj6.getGuildId());
2026-07-20 16:05:17 +00:00
if (null == guild) {
2026-07-29 08:29:29 +00:00
const obj1 = { errorCode: null };
obj1[0] = RPCErrors.INVALID_CHANNEL;
2026-07-30 10:14:41 +00:00
let tmp24Result = tmp24(10622);
2026-07-20 16:05:17 +00:00
const _HermesInternal2 = HermesInternal;
2026-07-29 08:29:29 +00:00
tmp24Result = new tmp24Result(obj1, "Invalid guild " + obj6.getGuildId());
throw tmp24Result;
2026-07-20 16:05:17 +00:00
} else {
2026-07-29 08:29:29 +00:00
if (obj7.canViewInviteModal(getUncachedChannelPermissions, guild, obj6)) {
const obj2 = { frame: "r", channel: "PX_16", guild: "TRANSPARENT" };
obj2[1] = obj6;
obj2[2] = guild;
2026-07-20 16:05:17 +00:00
return obj2;
} else {
2026-07-29 08:29:29 +00:00
obj = { errorCode: null };
obj[0] = RPCErrors.INVALID_PERMISSIONS;
2026-07-20 16:05:17 +00:00
const _HermesInternal = HermesInternal;
2026-07-30 10:14:41 +00:00
let tmp2 = tmp24(10622);
2026-07-29 08:29:29 +00:00
tmp2 = new tmp2(obj, "No invite permissions for " + obj6.id);
throw tmp2;
2026-07-20 16:05:17 +00:00
}
2026-07-30 10:14:41 +00:00
obj7 = require(8224) /* canViewInviteModal */;
2026-07-20 16:05:17 +00:00
}
}
}
};