2026-08-24 06:08:38 +00:00
|
|
|
// Module ID: 11054
|
|
|
|
|
// Function ID: 11055
|
2026-07-20 16:05:17 +00:00
|
|
|
// Name: canToggleCommunicationDisableOnUser
|
2026-08-24 06:08:38 +00:00
|
|
|
// Dependencies: [1434, 1910, 4024, 1922, 676, 4029, 589, 2]
|
2026-07-20 16:05:17 +00:00
|
|
|
// Exports: default
|
|
|
|
|
|
2026-08-24 06:08:38 +00:00
|
|
|
// Module 11054 (canToggleCommunicationDisableOnUser)
|
|
|
|
|
import set from "set" /* 2 */;
|
|
|
|
|
import ME from "ME" /* 676 */;
|
|
|
|
|
import GuildNSFWContentLevel from "GuildNSFWContentLevel" /* 1434 */;
|
|
|
|
|
import applyOverwritesAll from "applyOverwrites" /* 4029 */;
|
|
|
|
|
import closure_4 from "createGuildRecordFromRust" /* 1910 */;
|
|
|
|
|
import closure_5 from "getUncachedChannelPermissions" /* 4024 */;
|
|
|
|
|
import closure_6 from "mergeGuildAvatar" /* 1922 */;
|
2026-07-23 10:11:24 +00:00
|
|
|
|
2026-07-20 16:05:17 +00:00
|
|
|
function canToggleCommunicationDisableOnUser(id, id2, items) {
|
|
|
|
|
let tmp = items;
|
|
|
|
|
if (items === undefined) {
|
2026-08-24 06:08:38 +00:00
|
|
|
items = [closure_6, closure_4, closure_5];
|
2026-07-20 16:05:17 +00:00
|
|
|
tmp = items;
|
|
|
|
|
}
|
|
|
|
|
[obj, obj2, obj3] = tmp;
|
|
|
|
|
const guild = obj2.getGuild(id);
|
|
|
|
|
const user = obj.getUser(id2);
|
|
|
|
|
let tmp6 = null != guild && null != user;
|
|
|
|
|
if (tmp6) {
|
2026-07-29 08:29:29 +00:00
|
|
|
const isNonUserBotResult = user.isNonUserBot();
|
|
|
|
|
let tmp8 = !isNonUserBotResult;
|
|
|
|
|
if (!isNonUserBotResult) {
|
2026-07-20 16:05:17 +00:00
|
|
|
let canResult = isGuildOwner(guild, user);
|
|
|
|
|
if (!canResult) {
|
2026-07-29 08:29:29 +00:00
|
|
|
obj = { permission: null, user: null, context: null };
|
|
|
|
|
obj[0] = Permissions.ADMINISTRATOR;
|
|
|
|
|
obj[1] = user;
|
|
|
|
|
obj[2] = guild;
|
2026-08-24 06:08:38 +00:00
|
|
|
canResult = applyOverwritesAll.can(obj);
|
|
|
|
|
const obj5 = applyOverwritesAll;
|
2026-07-20 16:05:17 +00:00
|
|
|
}
|
|
|
|
|
let canManageUserResult = !canResult;
|
2026-07-29 08:29:29 +00:00
|
|
|
if (!canResult) {
|
2026-07-20 16:05:17 +00:00
|
|
|
canManageUserResult = obj3.canManageUser(Permissions.MODERATE_MEMBERS, user, guild);
|
|
|
|
|
}
|
2026-07-29 08:29:29 +00:00
|
|
|
tmp8 = canManageUserResult;
|
2026-07-20 16:05:17 +00:00
|
|
|
}
|
2026-07-29 08:29:29 +00:00
|
|
|
tmp6 = tmp8;
|
2026-07-20 16:05:17 +00:00
|
|
|
}
|
|
|
|
|
return tmp6;
|
|
|
|
|
}
|
2026-08-24 06:08:38 +00:00
|
|
|
const isGuildOwner = GuildNSFWContentLevel.isGuildOwner;
|
|
|
|
|
const Permissions = ME.Permissions;
|
|
|
|
|
const result = set.fileFinishedImporting("modules/guild_communication_disabled/useCanToggleCommunicationDisableOnUser.tsx");
|
2026-07-20 16:05:17 +00:00
|
|
|
|
|
|
|
|
export default function useCanToggleCommunicationDisableOnUser(arg0, arg1) {
|
2026-07-23 10:11:24 +00:00
|
|
|
const _require = arg0;
|
2026-08-24 06:08:38 +00:00
|
|
|
closure_1 = arg1;
|
|
|
|
|
let items = [closure_6, closure_4, closure_5];
|
2026-07-20 16:05:17 +00:00
|
|
|
const items1 = [arg0, arg1];
|
2026-07-29 08:29:29 +00:00
|
|
|
return _require(589).useStateFromStores(items, () => {
|
2026-08-24 06:08:38 +00:00
|
|
|
const items = [closure_1_6, closure_1_4, closure_1_5];
|
|
|
|
|
return closure_1_8(closure_0, closure_1, items);
|
2026-07-20 16:05:17 +00:00
|
|
|
}, items1);
|
|
|
|
|
};
|
|
|
|
|
export { canToggleCommunicationDisableOnUser };
|