// Module ID: 13538 // Function ID: 13539 // Name: validateOpenInviteDialog // Dependencies: [5686, 1862, 3817, 676, 13527, 10626, 8227, 2] // Exports: validateOpenInviteDialog // Module 13538 (validateOpenInviteDialog) import map from "map"; import createGuildRecordFromRust from "createGuildRecordFromRust"; import getUncachedChannelPermissions from "getUncachedChannelPermissions"; import { RPCErrors } from "ME"; const require = arg1; const result = require("getUncachedChannelPermissions").fileFinishedImporting("modules/rpc/helpers/validateOpenInviteDialog.tsx"); export const validateOpenInviteDialog = function validateOpenInviteDialog() { connectedFrame = connectedFrame.getConnectedFrame(); if (null != connectedFrame) { let obj = { frame: null, channel: "Array", guild: "isArray" }; obj[0] = connectedFrame; return obj; } else { const obj6 = importDefault(13527)(); if (null == obj6) { obj = { errorCode: null }; obj[0] = RPCErrors.INVALID_CHANNEL; const tmp22 = new tmp24(10626)(obj, "Invalid channel"); throw tmp22; } else { guild = guild.getGuild(obj6.getGuildId()); if (null == guild) { const obj1 = { errorCode: null }; obj1[0] = RPCErrors.INVALID_CHANNEL; let tmp24Result = tmp24(10626); const _HermesInternal2 = HermesInternal; tmp24Result = new tmp24Result(obj1, "Invalid guild " + obj6.getGuildId()); throw tmp24Result; } else { if (obj7.canViewInviteModal(getUncachedChannelPermissions, guild, obj6)) { const obj2 = { frame: "r", channel: "PX_16", guild: "TRANSPARENT" }; obj2[1] = obj6; obj2[2] = guild; return obj2; } else { obj = { errorCode: null }; obj[0] = RPCErrors.INVALID_PERMISSIONS; const _HermesInternal = HermesInternal; let tmp2 = tmp24(10626); tmp2 = new tmp2(obj, "No invite permissions for " + obj6.id); throw tmp2; } obj7 = require(8227) /* canViewInviteModal */; } } } };