This commit is contained in:
janisslsm committed 2026-11-01 12:12:55 +02:00
1 parent 1781d25a15
commit 732c0ad767
33051 files changed
+2591613 -3019689

No files matched your search

@@ -0,0 +1,12 @@
// Metro module 2323 (f2324).
import { loadJsonAsset } from "../asset_json/native/AssetJsonUtils";
import * as _Module2324 from "../../_bundle/Module2324";
import { createLoader, makeMessagesProxy } from "../../_bundle/Module1274";
const loader = createLoader({
"en-US": () => loadJsonAsset(_Module2324).then((result) => ({
default: result
}))
}, "en-US");
const r21 = makeMessagesProxy(loader);
export default r21;
export { loader as messagesLoader };
@@ -0,0 +1,52 @@
// Metro module 11865 (f11866).
import { create } from "../../_bundle/Module644";
import { persist, createJSONStorage } from "../../_bundle/createJSONStorage";
import { batchUpdates } from "../../_bundle/Module705";
import LocalStorageWrapper from "../zustand/LocalStorageWrapper";
let c8135_3 = create(persist((c19235_0, c19235_1) => ({
channelShowResolvedFlags: {},
setShowResolvedFlags: (c27198_0, c27198_1) => batchUpdates(() => {
c19235_0((a0) => {
const channelShowResolvedFlags = {
...a0.channelShowResolvedFlags
};
channelShowResolvedFlags[c27198_0] = c27198_1;
return {
channelShowResolvedFlags
};
});
}),
getShowResolvedFlags: (a0) => {
let r6 = c19235_1().channelShowResolvedFlags[a0];
if (r6 == null) {
r6 = true;
}
return r6;
}
}), {
name: "report-to-mod-channel-storage",
storage: createJSONStorage(() => LocalStorageWrapper)
}));
export { c8135_3 as useReportToModChannelFiltersStore };
export function useShouldShowResolvedFlagsForChannel(a0) {
let r10;
let c19236_0 = a0;
const r4 = c8135_3();
let c19236_1 = r4;
if (a0 == null) {
r10 = {
showResolvedFlags: true,
setShowResolvedFlags: () => {}
};
} else {
let showResolvedFlags = r4.getShowResolvedFlags(a0);
if (showResolvedFlags == null) {
showResolvedFlags = true;
}
r10 = {
showResolvedFlags,
setShowResolvedFlags: (a0) => c19236_1.setShowResolvedFlags(c19236_0, a0)
};
}
return r10;
}
@@ -0,0 +1,5 @@
// Metro module 6060 (f6061).
import { Permissions } from "../../Constants";
import { combine } from "../../_bundle/HighLow";
const r22 = combine(Permissions.ADMINISTRATOR, Permissions.BAN_MEMBERS, Permissions.KICK_MEMBERS, Permissions.MODERATE_MEMBERS);
export { r22 as ReportToModPermissions };
+118
View File
@@ -0,0 +1,118 @@
// Metro module 9552 (f9553).
import SelectedGuildStore from "../../stores/SelectedGuildStore";
import Module589 from "../../_bundle/Module589";
import Dispatcher from "../../Dispatcher";
let c6298_1, c6298_2, c6298_3;
const handleSelectedGuildChange = function handleSelectedGuildChange() {
let r4 = SelectedGuildStore.getLastSelectedGuildId();
if (r4 !== c6298_1) {
c6298_2 = null;
if (r4 == null) {
r4 = null;
}
c6298_1 = r4;
}
};
c6298_1 = null;
c6298_2 = null;
c6298_3 = {
reportedMessages: {}
};
class ReportToModStore extends Module589.PersistedStore {
static displayName = "ReportToModStore";
static persistKey = "ReportToModStore";
static migrations = [(a0) => {
let reportedMessages = a0?.reportedMessages;
if (reportedMessages == null) {
reportedMessages = {};
}
return {
reportedMessages
};
}];
initialize(a0) {
if (a0 != null) {
c6298_3.reportedMessages = Object.fromEntries(Object.entries(a0.reportedMessages).map((item) => {
const [r22, r23] = item;
return [r22, new Set(r23)];
}));
}
this.syncWith([SelectedGuildStore], handleSelectedGuildChange);
}
getState() {
return c6298_3;
}
isUserBanned(a0) {
let r6 = c6298_2 == null ? void 0 : c6298_2.get(a0);
if (r6 == null) {
r6 = null;
}
return r6;
}
getReportedMessages() {
return c6298_3.reportedMessages;
}
hasReportedMessage(a0, a1) {
const r5 = c6298_3.reportedMessages[a0];
let r8 = r5 == null ? void 0 : r5.has(a1);
if (r8 == null) {
r8 = false;
}
return r8;
}
}
const reportToModStore = new ReportToModStore(Dispatcher, {
REPORT_TO_MOD_REPORT_MESSAGE_SUCCESS: function handleMessageReportSuccess({ channelId, messageId }) {
if (c6298_3.reportedMessages[channelId] == null) {
c6298_3.reportedMessages[channelId] = new Set();
}
c6298_3.reportedMessages[channelId].add(messageId);
},
GUILD_BAN_ADD: function handleGuildBanAdd(a0) {
const user = a0.user;
if (a0.guildId === c6298_1 && c6298_2 != null) {
c6298_2.set(user.id, true);
}
},
GUILD_BAN_REMOVE: function handleGuildBanRemove(a0) {
const user = a0.user;
if (a0.guildId === c6298_1 && c6298_2 != null) {
c6298_2.set(user.id, false);
}
},
GUILD_SETTINGS_LOADED_BANS_BATCH: function handleGuildBansLoaded(a0) {
let c17287_0;
const { bans, guildId } = a0;
let userIds = a0.userIds;
c17287_0 = void 0;
if (guildId === c6298_1) {
const set = new Set(bans.map((ban) => ban.user?.id));
c17287_0 = set;
const r19 = Array;
const r21 = Set;
if (userIds == null) {
userIds = [];
}
const r29 = r19.from(new r21(userIds)).filter((item) => !c17287_0.has(item));
if (c6298_2 == null) {
c6298_2 = new Map();
}
set.forEach((item) => {
if (c6298_2 != null) {
c6298_2.set(item, true);
}
});
r29.forEach((item) => {
if (c6298_2 != null) {
c6298_2.set(item, false);
}
});
}
},
LOGOUT: function handleLogout() {
c6298_1 = null;
c6298_2 = null;
c6298_3.reportedMessages = {};
}
});
export default reportToModStore;
+119
View File
@@ -0,0 +1,119 @@
// Metro module 6052 (f6053).
import ForumPostMessagesStore from "../forums/ForumPostMessagesStore";
import ChannelStore from "../../stores/ChannelStore";
import GuildStore from "../../stores/GuildStore";
import MessageStore from "../../stores/MessageStore";
import UserStore from "../../stores/UserStore";
import { ReportToModPermissions } from "./ReportToModConstants";
import { canReportUser } from "../../utils/ReportUtils";
import getGuildModeratorReportingEnabled from "./getGuildModeratorReportingEnabled";
import getGuildModeratorReportChannelId from "./getGuildModeratorReportChannelId";
import { getContextForPermission } from "../guild_mod_dash_member_safety/MemberSafetyPermissionsUtils";
import { hasAny } from "../../_bundle/HighLow";
import { computePermissions } from "../../utils/PermissionUtils";
import { isCurrentUserTeen } from "../self_mod/SelfModUtils";
import { messageHasObscurableMediaForBitmask } from "../explicit_media_redaction/ObscuredMediaUtils";
import { ContentHarmTypeBitMask } from "../explicit_media_redaction/HarmTypeConfiguration";
import { ReservedTagIds } from "../forums/ForumChannelTypes";
export function canReportMessageToMods(a0) {
if (canReportUser(a0.author)) {
const channel = ChannelStore.getChannel(a0.channel_id);
if (channel == null) {
return false;
}
const guild = GuildStore.getGuild(channel.guild_id);
if (guild == null) {
return false;
}
let r23 = getGuildModeratorReportingEnabled(guild);
const guildModeratorReportChannelId = getGuildModeratorReportChannelId(guild);
if (r23) {
r23 = guildModeratorReportChannelId != null;
}
return r23;
}
return false;
}
export function canAccessReportsChannel(a0, r9 = [GuildStore, UserStore]) {
const contextForPermission = getContextForPermission(a0, r9);
if (contextForPermission == null) {
return false;
}
const { user, guild } = contextForPermission;
const r0 = guild == null || !getGuildModeratorReportingEnabled(guild) || getGuildModeratorReportChannelId(guild) == null;
return r0 ? !r0 : hasAny(computePermissions({
user,
context: guild,
checkElevated: false
}), ReportToModPermissions);
}
export function getReportToModChannelId(a0) {
const guild = GuildStore.getGuild(a0);
return guild != null ? getGuildModeratorReportChannelId(guild) : null;
}
export function isModeratorReportOrPostChannelId(a0) {
const channel = ChannelStore.getChannel(a0);
return channel != null && (channel != null && (channel.isModeratorReportChannel() && channel.isForumChannel()) || channel != null && (channel.isModeratorReportChannel() && channel.isForumPost()));
}
export function isModeratorReportChannelId(a0) {
const channel = ChannelStore.getChannel(a0);
return channel != null && (channel.isModeratorReportChannel() && channel.isForumChannel());
}
export function isModeratorReportChannel(a0) {
return a0 != null && (a0.isModeratorReportChannel() && a0.isForumChannel());
}
export function isModeratorReportPostChannelId(a0) {
const channel = ChannelStore.getChannel(a0);
return channel != null && (channel.isModeratorReportChannel() && channel.isForumPost());
}
export function isModeratorReportPostChannel(a0) {
return a0 != null && (a0.isModeratorReportChannel() && a0.isForumPost());
}
export function isModeratorReportOrPostChannel(a0) {
return a0 != null && (a0 != null && (a0.isModeratorReportChannel() && a0.isForumChannel()) || a0 != null && (a0.isModeratorReportChannel() && a0.isForumPost()));
}
export function isSafeToTransitionToReportForCurrentUser(a0) {
if (a0 == null) {
return true;
}
if (isCurrentUserTeen()) {
const channel = ChannelStore.getChannel(a0);
if (channel != null && (channel != null && (channel.isModeratorReportChannel() && channel.isForumChannel()) || channel != null && (channel.isModeratorReportChannel() && channel.isForumPost()))) {
const message = ForumPostMessagesStore.getMessage(a0);
const { loaded, firstMessage } = message;
return (loaded ? firstMessage == null : !loaded) || !messageHasObscurableMediaForBitmask(firstMessage, ContentHarmTypeBitMask.EXPLICIT);
}
return true;
}
return true;
}
export function isModeratorReportThreadStarterMessage(a0, a1) {
const isFirstMessageInForumPost = a0.isFirstMessageInForumPost(a1);
const r0 = isFirstMessageInForumPost ? !a0.isSystemDM() : !isFirstMessageInForumPost;
return r0 ? !r0 : a1 != null && (a1.isModeratorReportChannel() && a1.isForumPost());
}
export function sortedModeratorReportTags(a0) {
return a0.sort((a, b) => a.id == ReservedTagIds.MULTIPLE_REPORTS ? -1 : b.id == ReservedTagIds.MULTIPLE_REPORTS ? 1 : 0);
}
export function isModeratorReportMessage(a0) {
return a0.messageSnapshots.some((messageSnapshot) => messageSnapshot.moderatorReport != null);
}
export function isUserAuthorOfReportedMessage(a0, a1) {
const channel = ChannelStore.getChannel(a0);
if (channel != null && channel.isModeratorReportChannel()) {
const r14 = MessageStore.getMessages(a0).first();
const r2 = r14 == null;
let r15 = void 0;
if (!r2) {
const messageSnapshots = r14.messageSnapshots;
const r17 = messageSnapshots == null;
r15 = void 0;
if (!r17) {
const r18 = messageSnapshots[0];
r15 = r18 == null ? void 0 : r18.moderatorReport?.reported_user_id;
}
}
return r15 === a1;
}
return false;
}
@@ -0,0 +1,8 @@
// Metro module 5790 (f5791).
export default function getGuildModeratorReportChannelId(a0) {
let r4 = a0.moderatorReporting?.moderatorReportChannelId;
if (r4 == null) {
r4 = null;
}
return r4;
};
@@ -0,0 +1,8 @@
// Metro module 5791 (f5792).
export default function getGuildModeratorReportingEnabled(a0) {
let r4 = a0.moderatorReporting?.moderatorReportingEnabled;
if (r4 == null) {
r4 = false;
}
return r4;
};
@@ -0,0 +1,65 @@
// Metro module 9562 (f9563).
import { useEffect } from "react";
import GuildStore from "../../../stores/GuildStore";
import MessageStore from "../../../stores/MessageStore";
import { useStateFromStores } from "../../../_bundle/Module589";
import getGuildModeratorReportingEnabled from "../getGuildModeratorReportingEnabled";
import getGuildModeratorReportChannelId from "../getGuildModeratorReportChannelId";
import { isModeratorReportOrPostChannel, isModeratorReportPostChannel } from "../ReportToModUtils";
import MessageActionCreators from "../../../actions/MessageActionCreators";
import { getUser } from "../../../actions/UserActionCreators";
export function useIsReportToModEnabled(c17290_0) {
return useStateFromStores([GuildStore], () => {
if (c17290_0 == null) {
return false;
}
const guild = GuildStore.getGuild(c17290_0);
return guild != null && (getGuildModeratorReportingEnabled(guild) && getGuildModeratorReportChannelId(guild) != null);
});
}
export function useReportToModChannelId(c17291_0) {
return useStateFromStores([GuildStore], () => {
const r4 = c17291_0 != null ? GuildStore.getGuild(c17291_0) : null;
const r8 = r4 == null;
let r9 = null;
if (!r8) {
let r16 = getGuildModeratorReportChannelId(r4);
if (r16 == null) {
r16 = null;
}
r9 = r16;
}
return r9;
});
}
export function useIsModeratorReportOrPostChannel(a0) {
return isModeratorReportOrPostChannel(a0);
}
export function useIsModeratorReportPostChannel(a0) {
return isModeratorReportPostChannel(a0);
}
export function useLoadReportedMessage({ messageReference }) {
const stateFromStores = useStateFromStores([MessageStore], () => messageReference != null ? MessageStore.getMessage(messageReference.channel_id, messageReference.message_id) : null);
useEffect(() => {
if (stateFromStores == null && messageReference != null) {
MessageActionCreators.fetchMessages({
channelId: messageReference.channel_id,
jump: {
messageId: messageReference.message_id
},
limit: 10
});
}
}, [stateFromStores, messageReference]);
}
export function loadOriginalAuthorFromSnapshot(a0) {
const r2 = a0 == null;
let r5 = void 0;
if (!r2) {
const r7 = a0.messageSnapshots[0];
r5 = r7 == null ? void 0 : r7.moderatorReport?.reported_user_id;
}
if (r5 != null) {
getUser(r5);
}
}