From ba76c43a265957a70171a3ddf98beb0aafc0954e Mon Sep 17 00:00:00 2001 From: Vendicated Date: Thu, 19 Jun 2025 22:50:53 +0200 Subject: [PATCH 1/3] ServerInfo: fix Blocked & Ignored tabs --- src/plugins/serverInfo/GuildInfoModal.tsx | 4 ++-- src/webpack/common/types/stores.d.ts | 18 +++++++++++------- 2 files changed, 13 insertions(+), 9 deletions(-) diff --git a/src/plugins/serverInfo/GuildInfoModal.tsx b/src/plugins/serverInfo/GuildInfoModal.tsx index 8300380d..44f10afa 100644 --- a/src/plugins/serverInfo/GuildInfoModal.tsx +++ b/src/plugins/serverInfo/GuildInfoModal.tsx @@ -220,12 +220,12 @@ function FriendsTab({ guild, setCount }: RelationshipProps) { } function BlockedUsersTab({ guild, setCount }: RelationshipProps) { - const blockedIds = Object.keys(RelationshipStore.getMutableRelationships()).filter(id => RelationshipStore.isBlocked(id)); + const blockedIds = RelationshipStore.getBlockedIDs(); return UserList("blocked", guild, blockedIds, setCount); } function IgnoredUserTab({ guild, setCount }: RelationshipProps) { - const ignoredIds = Object.keys(RelationshipStore.getMutableRelationships()).filter(id => RelationshipStore.isIgnored(id)); + const ignoredIds = RelationshipStore.getIgnoredIDs(); return UserList("ignored", guild, ignoredIds, setCount); } diff --git a/src/webpack/common/types/stores.d.ts b/src/webpack/common/types/stores.d.ts index 497de739..cb06ca4b 100644 --- a/src/webpack/common/types/stores.d.ts +++ b/src/webpack/common/types/stores.d.ts @@ -236,17 +236,21 @@ export type useStateFromStores = ( export class RelationshipStore extends FluxStore { getFriendIDs(): string[]; - /** Related to friend nicknames experiment. */ - getNickname(userId: string): string; + getIgnoredIDs(): string[]; + getBlockedIDs(): string[]; + getPendingCount(): number; getRelationshipCount(): number; + + /** Related to friend nicknames. */ + getNickname(userId: string): string; /** @returns Enum value from constants.RelationshipTypes */ getRelationshipType(userId: string): number; + isFriend(userId: string): boolean; + isBlocked(userId: string): boolean; + isIgnored(userId: string): boolean; + getSince(userId: string): string; + /** @returns Format: [userId: Enum value from constants.RelationshipTypes] */ getMutableRelationships(): Record; - isBlocked(userId: string): boolean; - isFriend(userId: string): boolean; - - getSince(userId: string): string; - isIgnored(userId: string): boolean; } From f6bfd18816de45c6fd9a903b7595cb19d59266c4 Mon Sep 17 00:00:00 2001 From: Vendicated Date: Thu, 19 Jun 2025 23:03:15 +0200 Subject: [PATCH 2/3] ViewIcons: fix viewing animated icons/banners --- src/plugins/viewIcons/index.tsx | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/src/plugins/viewIcons/index.tsx b/src/plugins/viewIcons/index.tsx index 07630a00..2afdb2d5 100644 --- a/src/plugins/viewIcons/index.tsx +++ b/src/plugins/viewIcons/index.tsx @@ -71,9 +71,14 @@ const openAvatar = (url: string) => openImage(url, 512, 512); const openBanner = (url: string) => openImage(url, 1024); function openImage(url: string, width: number, height?: number) { - const format = url.startsWith("/") ? "png" : settings.store.format; - const u = new URL(url, window.location.href); + + const format = url.startsWith("/") + ? "png" + : u.searchParams.get("animated") === "true" + ? "gif" + : settings.store.format; + u.searchParams.set("size", settings.store.imgSize); u.pathname = u.pathname.replace(/\.(png|jpe?g|webp)$/, `.${format}`); url = u.toString(); From 658a62860e40f9411c26f30b8327f61431d3a92e Mon Sep 17 00:00:00 2001 From: sadan4 <117494111+sadan4@users.noreply.github.com> Date: Fri, 20 Jun 2025 12:45:52 -0400 Subject: [PATCH 3/3] BetterFolders: Fix sidebar filter patch (#3498) --- src/plugins/betterFolders/index.tsx | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/plugins/betterFolders/index.tsx b/src/plugins/betterFolders/index.tsx index 3dc812a4..62567f51 100644 --- a/src/plugins/betterFolders/index.tsx +++ b/src/plugins/betterFolders/index.tsx @@ -179,7 +179,7 @@ export default definePlugin({ }, // If we are rendering the Better Folders sidebar, we filter out everything but the Guild List from the Sidebar children { - match: /unreadMentionsFixedFooter\].+?\]/, + match: /unreadMentionsFixedFooter\].+?\}\)\]/, replace: "$&.filter($self.makeGuildsBarSidebarFilter(!!arguments[0]?.isBetterFolders))" } ]