decord/source/modules/guild_automod/AutomodQuarantineUtils.tsx

134 lines
5.3 KiB
TypeScript
Raw Normal View History

2026-08-24 06:08:38 +00:00
// Module ID: 11090
// Function ID: 11091
2026-07-20 16:05:17 +00:00
// Name: useCurrentUserHasAutomodQuarantinedProfile
2026-08-24 06:08:38 +00:00
// Dependencies: [19, 9574, 1218, 1991, 1910, 4024, 4201, 676, 4012, 685, 647, 4030, 1236, 9575, 9576, 7398, 2]
2026-07-20 16:05:17 +00:00
// Exports: useCurrentUserHasAutomodQuarantinedProfile, useGuildAutomodProfileQuarantineErrors, useOpenFixQuarantinedProfileModal
2026-08-24 06:08:38 +00:00
// Module 11090 (useCurrentUserHasAutomodQuarantinedProfile)
import closure_2 from "noop" /* 19 */;
import closure_3 from "zustandStore" /* 9574 */;
import closure_4 from "fetchFingerprint" /* 1218 */;
import closure_5 from "trackCommunicationDisabled" /* 1991 */;
import closure_6 from "createGuildRecordFromRust" /* 1910 */;
import closure_7 from "getUncachedChannelPermissions" /* 4024 */;
import closure_8 from "handleConnectionOpen" /* 4201 */;
import ME from "ME" /* 676 */;
import { GuildMemberFlags } from "GuildMemberFlags" /* 4012 */;
import { ProfileCustomizationSubsection as closure_12 } from "MAX_FAVORITES" /* 685 */;
2026-07-23 10:11:24 +00:00
const require = arg1;
2026-07-29 08:29:29 +00:00
({ Permissions: c9, UserSettingsSections: c10 } = ME);
2026-08-24 06:08:38 +00:00
const result = require("set").fileFinishedImporting("modules/guild_automod/AutomodQuarantineUtils.tsx");
2026-07-20 16:05:17 +00:00
export const useCurrentUserHasAutomodQuarantinedProfile = function useCurrentUserHasAutomodQuarantinedProfile(arg0) {
2026-07-23 10:11:24 +00:00
const _require = arg0;
2026-08-24 06:08:38 +00:00
const items = [closure_4, closure_5];
2026-07-20 16:05:17 +00:00
const items1 = [arg0];
2026-07-29 08:29:29 +00:00
return _require(647).useStateFromStores(items, () => {
2026-07-23 10:11:24 +00:00
if (null == callback) {
2026-07-20 16:05:17 +00:00
return false;
} else {
2026-08-24 06:08:38 +00:00
const id = closure_1_4.getId();
return callback(closure_1_1[11]).hasAutomodQuarantinedProfile(closure_1_5.getMember(tmp, id));
2026-07-20 16:05:17 +00:00
}
}, items1);
};
export const useGuildAutomodProfileQuarantineErrors = function useGuildAutomodProfileQuarantineErrors(id) {
2026-07-23 10:11:24 +00:00
const _require = id;
2026-08-24 06:08:38 +00:00
let items = [closure_4, closure_5, closure_8, closure_6];
2026-07-23 10:11:24 +00:00
let items1 = [id];
2026-07-29 08:29:29 +00:00
return _require(647).useStateFromStoresObject(items, () => {
let guildId = id;
if (id == null) {
2026-08-24 06:08:38 +00:00
guildId = closure_1_8.getGuildId();
2026-07-20 16:05:17 +00:00
}
2026-08-24 06:08:38 +00:00
let obj = { nick: "Array", bio: "ct" };
let guild = closure_1_6.getGuild(guildId);
2026-07-29 08:29:29 +00:00
if (null != guild) {
if (null != guildId) {
2026-08-24 06:08:38 +00:00
const member = closure_1_5.getMember(guildId, closure_1_4.getId());
2026-07-20 16:05:17 +00:00
let flags;
2026-07-29 08:29:29 +00:00
if (member != null) {
2026-07-20 16:05:17 +00:00
flags = member.flags;
}
2026-08-24 06:08:38 +00:00
const automodQuarantinedProfileFlags = id(closure_1_1[11]).getAutomodQuarantinedProfileFlags(flags);
2026-07-29 08:29:29 +00:00
if (0 !== automodQuarantinedProfileFlags.size) {
2026-08-24 06:08:38 +00:00
if (!automodQuarantinedProfileFlags.has(closure_1_11.AUTOMOD_QUARANTINED_USERNAME_OR_GUILD_NICKNAME)) {
2026-07-29 08:29:29 +00:00
if (automodQuarantinedProfileFlags.has(tmp9.AUTOMOD_QUARANTINED_BIO)) {
const intl3 = tmp7(tmp8[12]).intl;
const items = [intl3.string(tmp7(tmp8[12]).t.dZh1vz)];
obj.bio = items;
2026-07-20 16:05:17 +00:00
}
} else {
2026-07-29 08:29:29 +00:00
if (null == id) {
const intl2 = tmp7(tmp8[12]).intl;
let str = guild.name;
if (str == null) {
str = "";
}
obj = { guildName: null };
obj[0] = str;
guild = [intl2.formatToPlainString(tmp7(tmp8[12]).t.WBUh3O, obj)];
let items1 = guild;
} else {
const intl = tmp7(tmp8[12]).intl;
items1 = [intl.string(tmp7(tmp8[12]).t.EPZCrM)];
}
obj.nick = items1;
2026-07-20 16:05:17 +00:00
}
2026-08-24 06:08:38 +00:00
tmp9 = closure_1_11;
2026-07-20 16:05:17 +00:00
}
2026-07-29 08:29:29 +00:00
return obj;
2026-07-20 16:05:17 +00:00
}
}
return obj;
}, items1);
};
export const useOpenFixQuarantinedProfileModal = function useOpenFixQuarantinedProfileModal(guildId) {
guildId = guildId.guildId;
const scrollPosition = guildId.scrollPosition;
2026-07-29 08:29:29 +00:00
let stateFromStores;
let stateFromStores1;
2026-08-24 06:08:38 +00:00
const items = [closure_6];
2026-07-20 16:05:17 +00:00
const items1 = [guildId];
2026-08-24 06:08:38 +00:00
stateFromStores = guildId(scrollPosition[10]).useStateFromStores(items, () => closure_1_6.getGuild(guildId), items1);
2026-07-23 10:11:24 +00:00
let obj = guildId(scrollPosition[10]);
2026-08-24 06:08:38 +00:00
const items2 = [closure_7];
2026-07-20 16:05:17 +00:00
const items3 = [stateFromStores];
2026-07-29 08:29:29 +00:00
stateFromStores1 = guildId(scrollPosition[10]).useStateFromStores(items2, () => {
2026-07-20 16:05:17 +00:00
let canResult = null != stateFromStores;
if (canResult) {
2026-08-24 06:08:38 +00:00
canResult = closure_1_7.can(closure_1_9.CHANGE_NICKNAME, tmp);
2026-07-20 16:05:17 +00:00
}
return canResult;
}, items3);
2026-07-23 10:11:24 +00:00
const obj2 = guildId(scrollPosition[10]);
const items4 = [stateFromStores1, scrollPosition, guildId.analyticsLocations, stateFromStores, guildId(scrollPosition[13]).useIsEligibleForUserProfileWYSIWYGEditing("AutomodQuarantineUtils")];
2026-07-20 16:05:17 +00:00
const items5 = [
2026-07-23 10:11:24 +00:00
stateFromStores.useCallback(() => {
2026-07-29 08:29:29 +00:00
let setState = stateFromStores;
2026-07-20 16:05:17 +00:00
if (null != stateFromStores) {
2026-08-24 06:08:38 +00:00
let openUserSettings = closure_1_12.GUILD;
2026-07-20 16:05:17 +00:00
if (stateFromStores1) {
let obj = guildId(scrollPosition[14]);
2026-07-29 08:29:29 +00:00
const guildIdentitySettings = obj.initGuildIdentitySettings(setState.id);
2026-07-20 16:05:17 +00:00
let USER_PROFILE = openUserSettings;
} else {
2026-07-29 08:29:29 +00:00
USER_PROFILE = tmp11.USER_PROFILE;
2026-07-20 16:05:17 +00:00
}
openUserSettings = guildId(scrollPosition[15]).openUserSettings;
2026-07-29 08:29:29 +00:00
setState = stateFromStores1.setState;
obj = { subsection: null, scrollPosition: null };
obj[0] = USER_PROFILE;
obj[1] = scrollPosition;
setState(obj);
obj = { screen: null };
2026-08-24 06:08:38 +00:00
obj[0] = closure_1_10.PROFILE_CUSTOMIZATION;
2026-07-20 16:05:17 +00:00
openUserSettings(obj);
}
}, items4),
stateFromStores1
];
return items5;
};