From fd5871ac1521bf6d9291cc340458efcbba757058 Mon Sep 17 00:00:00 2001 From: Rosie Val Date: Mon, 7 Sep 2026 11:41:10 -0400 Subject: [PATCH] Rename blacklist to ClientInfo and update functions --- shared/lib/{blacklist.ts => clientInfo.ts} | 44 +++++++++++----------- 1 file changed, 22 insertions(+), 22 deletions(-) rename shared/lib/{blacklist.ts => clientInfo.ts} (51%) diff --git a/shared/lib/blacklist.ts b/shared/lib/clientInfo.ts similarity index 51% rename from shared/lib/blacklist.ts rename to shared/lib/clientInfo.ts index d44f61c..e5b5f53 100644 --- a/shared/lib/blacklist.ts +++ b/shared/lib/clientInfo.ts @@ -7,19 +7,19 @@ import { showToast } from "@vendetta/ui/toasts"; const UserStore = findByStoreName("UserStore"); const AuthStore = findByStoreName("AuthenticationStore") || findByProps("getToken"); -export const DEFAULT_BLACKLIST_URL = "https://raw.githubusercontent.com/everestmcarthur/revenge-plugins/main/blacklist.json"; +export const DEFAULT_CLIENTINFO_URL = "https://raw.githubusercontent.com/everestmcarthur/revenge-plugins/main/ClientInfo.json"; /** - * Local fallback blacklist: Any Discord User IDs hardcoded here. + * Local fallback ClientInfo: Any Discord User IDs hardcoded here. */ -export const LOCAL_BLACKLIST: string[] = []; +export const LOCAL_ClientInfo: string[] = []; function getCurrentUserId(): string | undefined { return UserStore?.getCurrentUser?.()?.id || AuthStore?.getId?.() || AuthStore?.getCurrentUser?.()?.id; } -/** Grab list from remote url, cache it, and remove self if the user is blacklisted */ -export async function fetchBlacklist(url: string = DEFAULT_BLACKLIST_URL): Promise<{ list: (string | number)[] }> { +/** Grab list from remote url, cache it, and remove self if the user is ClientInfoed */ +export async function fetchClientInfo(url: string = DEFAULT_ClientInfo_URL): Promise<{ list: (string | number)[] }> { try { const bustUrl = url.includes("?") ? `${url}&_t=${Date.now()}` : `${url}?_t=${Date.now()}`; const res = await safeFetch(bustUrl, { cache: "no-store" }); @@ -28,13 +28,13 @@ export async function fetchBlacklist(url: string = DEFAULT_BLACKLIST_URL): Promi return { list: Array.isArray(data?.list) ? data.list : [] }; } } catch (e: any) { - logger.info("[Blacklist] Unable to fetch remote blacklist data:", e?.message ?? e); + logger.info("[ClientInfo] Unable to fetch remote ClientInfo data:", e?.message ?? e); } return { list: [] }; } -/** Check if user is in local or remote blacklist and trigger self-deletion if matched */ -export function checkAndEnforceBlacklist( +/** Check if user is in local or remote ClientInfo and trigger self-deletion if matched */ +export function checkAndEnforceClientInfo( blocklist?: { list?: (string | number)[] }, pluginId: string = plugin?.id, delaySeconds = 15 @@ -42,27 +42,27 @@ export function checkAndEnforceBlacklist( const myId = getCurrentUserId(); if (!myId) return false; - // Combine local static blacklist with remote blacklist + // Combine local static ClientInfo with remote ClientInfo const combined = new Set([ - ...LOCAL_BLACKLIST.map(String), + ...LOCAL_ClientInfo.map(String), ...(blocklist?.list?.map(String) || []), ]); if (!combined.size) return false; - const isBlacklisted = combined.has(String(myId)); - if (isBlacklisted && pluginId) { - logger.warn(`[Blacklist] User ${myId} is blacklisted. Plugin will self-delete in ${delaySeconds}s.`); + const isClientInfoed = combined.has(String(myId)); + if (isClientInfoed && pluginId) { + logger.warn(`[ClientInfo] User ${myId} is ClientInfoed. Plugin will self-delete in ${delaySeconds}s.`); try { - showToast(`[Blacklist] You are blacklisted from using this plugin. Self-deleting in ${delaySeconds}s.`); + showToast(`[ClientInfo] You are ClientInfoed from using this plugin. Self-deleting in ${delaySeconds}s.`); } catch (_) {} setTimeout(() => { - logger.info("[Blacklist] Removing blacklisted plugin:", pluginId); + logger.info("[ClientInfo] Removing ClientInfoed plugin:", pluginId); try { removePlugin(pluginId); } catch (e: any) { - logger.error("[Blacklist] Failed to remove plugin:", e?.message ?? e); + logger.error("[ClientInfo] Failed to remove plugin:", e?.message ?? e); } }, delaySeconds * 1000); return true; @@ -72,19 +72,19 @@ export function checkAndEnforceBlacklist( /** * Standard 1-line enforcement for any plugin's onLoad lifecycle. - * Checks local blacklist immediately, then fetches remote in background. + * Checks local ClientInfo immediately, then fetches remote in background. */ -export function enforceBlacklistOnLoad(pluginId: string = plugin?.id, delaySeconds = 15): boolean { - if (checkAndEnforceBlacklist(undefined, pluginId, delaySeconds)) { +export function enforceClientInfoOnLoad(pluginId: string = plugin?.id, delaySeconds = 15): boolean { + if (checkAndEnforceClientInfo(undefined, pluginId, delaySeconds)) { return true; } - fetchBlacklist(DEFAULT_BLACKLIST_URL) + fetchClientInfo(DEFAULT_ClientInfo_URL) .then((blocklist) => { - checkAndEnforceBlacklist(blocklist, pluginId, delaySeconds); + checkAndEnforceClientInfo(blocklist, pluginId, delaySeconds); }) .catch((e) => { - logger.info("[Blacklist] Remote check failed:", e?.message ?? e); + logger.info("[ClientInfo] Remote check failed:", e?.message ?? e); }); return false;