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

58 lines
2.1 KiB
TypeScript
Raw Normal View History

2026-08-06 08:05:19 +00:00
// Module ID: 13662
// Function ID: 13663
2026-07-20 16:05:17 +00:00
// Name: validateOpenInviteDialog
2026-08-06 08:05:19 +00:00
// Dependencies: [10509, 1891, 3912, 676, 10510, 13651, 10536, 8882, 2]
2026-07-20 16:05:17 +00:00
// Exports: validateOpenInviteDialog
2026-08-06 08:05:19 +00:00
// Module 13662 (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";
2026-08-06 08:05:19 +00:00
import { asLaunched } from "FrameLayoutModes";
2026-07-23 10:11:24 +00:00
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-08-06 08:05:19 +00:00
const tmp = asLaunched(mainFrame.getMainFrame());
if (null != tmp) {
let obj = { frame: null, channel: "r", guild: "channelId" };
obj[0] = tmp;
2026-07-20 16:05:17 +00:00
return obj;
} else {
2026-08-06 08:05:19 +00:00
const obj6 = importDefault(13651)();
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-08-06 08:05:19 +00:00
const tmp22 = new tmp24(10536)(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-08-06 08:05:19 +00:00
let tmp24Result = tmp24(10536);
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)) {
2026-08-05 07:35:12 +00:00
const obj2 = { frame: "r", channel: "Path", guild: "TRANSPARENT" };
2026-07-29 08:29:29 +00:00
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-08-06 08:05:19 +00:00
let tmp2 = tmp24(10536);
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-08-06 08:05:19 +00:00
obj7 = require(8882) /* canViewInviteModal */;
2026-07-20 16:05:17 +00:00
}
}
}
};