+ {!!getCurrentChannel()?.guild_id && (
+
+ )}
{getCreatedAtDate(friendsSince, locale.getLocale())}
diff --git a/src/plugins/messageLinkEmbeds/index.tsx b/src/plugins/messageLinkEmbeds/index.tsx
index 6ee60be71..2a5f88282 100644
--- a/src/plugins/messageLinkEmbeds/index.tsx
+++ b/src/plugins/messageLinkEmbeds/index.tsx
@@ -16,7 +16,7 @@
* along with this program. If not, see
.
*/
-import { addAccessory } from "@api/MessageAccessories";
+import { addAccessory, removeAccessory } from "@api/MessageAccessories";
import { definePluginSettings } from "@api/Settings";
import ErrorBoundary from "@components/ErrorBoundary";
import { Devs } from "@utils/constants.js";
@@ -389,4 +389,8 @@ export default definePlugin({
);
}, 4 /* just above rich embeds */);
},
+
+ stop() {
+ removeAccessory("messageLinkEmbed");
+ }
});
diff --git a/src/plugins/messageLogger/index.tsx b/src/plugins/messageLogger/index.tsx
index 8a1e23912..c8b464391 100644
--- a/src/plugins/messageLogger/index.tsx
+++ b/src/plugins/messageLogger/index.tsx
@@ -337,12 +337,12 @@ export default definePlugin({
{
// Attachment renderer
// Module 96063
- find: ".removeAttachmentHoverButton",
+ find: ".removeMosaicItemHoverButton",
group: true,
replacement: [
{
- match: /(className:\i,attachment:\i),/,
- replace: "$1,attachment: {deleted},"
+ match: /(className:\i,item:\i),/,
+ replace: "$1,item: deleted,"
},
{
match: /\[\i\.obscured\]:.+?,/,
diff --git a/src/plugins/mutualGroupDMs/index.tsx b/src/plugins/mutualGroupDMs/index.tsx
index f5e4b6149..1753fefbc 100644
--- a/src/plugins/mutualGroupDMs/index.tsx
+++ b/src/plugins/mutualGroupDMs/index.tsx
@@ -45,7 +45,7 @@ export default definePlugin({
patches: [
{
- find: ".Messages.USER_PROFILE_MODAL", // Note: the module is lazy-loaded
+ find: ".Messages.MUTUAL_GUILDS_WITH_END_COUNT", // Note: the module is lazy-loaded
replacement: {
match: /(?<=\.tabBarItem.{0,50}MUTUAL_GUILDS.+?}\),)(?=.+?(\(0,\i\.jsxs?\)\(.{0,100}id:))/,
replace: '(arguments[0].user.bot||arguments[0].isCurrentUser)?null:$1"MUTUAL_GDMS",children:"Mutual Groups"}),'
diff --git a/src/plugins/noMosaic/index.ts b/src/plugins/noMosaic/index.ts
index 7f9fad53c..4715bde5c 100644
--- a/src/plugins/noMosaic/index.ts
+++ b/src/plugins/noMosaic/index.ts
@@ -5,27 +5,15 @@
*/
import { definePluginSettings } from "@api/Settings";
-import { disableStyle, enableStyle } from "@api/Styles";
import { Devs } from "@utils/constants";
import definePlugin, { OptionType } from "@utils/types";
-import style from "./styles.css?managed";
-
const settings = definePluginSettings({
inlineVideo: {
description: "Play videos without carousel modal",
type: OptionType.BOOLEAN,
default: true,
restartNeeded: true
- },
- mediaLayoutType: {
- description: "Choose media layout type",
- type: OptionType.SELECT,
- restartNeeded: true,
- options: [
- { label: "STATIC, render loading image but image isn't resposive, no problem unless discord window width is too small", value: "STATIC", default: true },
- { label: "RESPONSIVE, image is responsive but not render loading image, cause messages shift when loaded", value: "RESPONSIVE" },
- ]
}
});
@@ -39,15 +27,11 @@ export default definePlugin({
patches: [
{
- find: ".oneByTwoLayoutThreeGrid",
- replacement: [{
- match: /mediaLayoutType:\i\.\i\.MOSAIC/,
- replace: "mediaLayoutType:$self.mediaLayoutType()",
- },
- {
- match: /null!==\(\i=\i\.get\(\i\)\)&&void 0!==\i\?\i:"INVALID"/,
- replace: '"INVALID"',
- }]
+ find: "isGroupableMedia:function()",
+ replacement: {
+ match: /=>"IMAGE"===\i\|\|"VIDEO"===\i;/,
+ replace: "=>false;"
+ }
},
{
find: "renderAttachments(",
@@ -57,24 +41,5 @@ export default definePlugin({
replace: "$&$1.content_type?.startsWith('image/')&&"
}
},
- {
- find: "Messages.REMOVE_ATTACHMENT_TOOLTIP_TEXT",
- replacement: {
- match: /\i===\i\.\i\.MOSAIC/,
- replace: "true"
- }
- }
- ],
-
- mediaLayoutType() {
- return settings.store.mediaLayoutType;
- },
-
- start() {
- enableStyle(style);
- },
-
- stop() {
- disableStyle(style);
- }
+ ]
});
diff --git a/src/plugins/noMosaic/styles.css b/src/plugins/noMosaic/styles.css
deleted file mode 100644
index 05ea24899..000000000
--- a/src/plugins/noMosaic/styles.css
+++ /dev/null
@@ -1,3 +0,0 @@
-[class^="nonMediaAttachmentsContainer_"] [class*="messageAttachment_"] {
- position: relative;
-}
diff --git a/src/plugins/pictureInPicture/index.tsx b/src/plugins/pictureInPicture/index.tsx
index ca766affc..0a22f06db 100644
--- a/src/plugins/pictureInPicture/index.tsx
+++ b/src/plugins/pictureInPicture/index.tsx
@@ -10,7 +10,7 @@ import { definePluginSettings } from "@api/Settings";
import ErrorBoundary from "@components/ErrorBoundary";
import { Devs } from "@utils/constants";
import definePlugin, { OptionType } from "@utils/types";
-import { React, Tooltip } from "@webpack/common";
+import { Tooltip } from "@webpack/common";
const settings = definePluginSettings({
loop: {
@@ -28,9 +28,9 @@ export default definePlugin({
settings,
patches: [
{
- find: ".nonMediaAttachment]",
+ find: ".nonMediaMosaicItem]",
replacement: {
- match: /\.nonMediaAttachment\]:!(\i).{0,10}children:\[(\S)/,
+ match: /\.nonMediaMosaicItem\]:!(\i).{0,10}children:\[(\S)/,
replace: "$&,$1&&$2&&$self.renderPiPButton(),"
},
},
diff --git a/src/plugins/pinDms/data.ts b/src/plugins/pinDms/data.ts
index afb6f9795..a4e40dde0 100644
--- a/src/plugins/pinDms/data.ts
+++ b/src/plugins/pinDms/data.ts
@@ -9,7 +9,7 @@ import { Settings } from "@api/Settings";
import { UserStore } from "@webpack/common";
import { DEFAULT_COLOR } from "./constants";
-import { forceUpdate } from "./index";
+import { forceUpdate, PinOrder, PrivateChannelSortStore, settings } from "./index";
export interface Category {
id: string;
@@ -106,7 +106,12 @@ export function categoryLen() {
}
export function getAllUncollapsedChannels() {
- return categories.filter(c => !c.collapsed).map(c => c.channels).flat();
+ if (settings.store.pinOrder === PinOrder.LastMessage) {
+ const sortedChannels = PrivateChannelSortStore.getPrivateChannelIds();
+ return categories.filter(c => !c.collapsed).flatMap(c => sortedChannels.filter(channel => c.channels.includes(channel)));
+ }
+
+ return categories.filter(c => !c.collapsed).flatMap(c => c.channels);
}
export function getSections() {
diff --git a/src/plugins/pinDms/index.tsx b/src/plugins/pinDms/index.tsx
index 353fc482a..010b5506c 100644
--- a/src/plugins/pinDms/index.tsx
+++ b/src/plugins/pinDms/index.tsx
@@ -29,7 +29,7 @@ interface ChannelComponentProps {
const headerClasses = findByPropsLazy("privateChannelsHeaderContainer");
-const PrivateChannelSortStore = findStoreLazy("PrivateChannelSortStore") as { getPrivateChannelIds: () => string[]; };
+export const PrivateChannelSortStore = findStoreLazy("PrivateChannelSortStore") as { getPrivateChannelIds: () => string[]; };
export let instance: any;
export const forceUpdate = () => instance?.props?._forceUpdate?.();
@@ -236,7 +236,7 @@ export default definePlugin({
const category = categories[categoryIndex - 1];
if (!category) return false;
- return category.collapsed && this.instance.props.selectedChannelId !== category.channels[channelIndex];
+ return category.collapsed && this.instance.props.selectedChannelId !== this.getCategoryChannels(category)[channelIndex];
},
getScrollOffset(channelId: string, rowHeight: number, padding: number, preRenderedChildren: number, originalOffset: number) {
diff --git a/src/plugins/pronoundb/index.ts b/src/plugins/pronoundb/index.ts
index b1e74158b..61edd191e 100644
--- a/src/plugins/pronoundb/index.ts
+++ b/src/plugins/pronoundb/index.ts
@@ -36,25 +36,24 @@ export default definePlugin({
authors: [Devs.Tyman, Devs.TheKodeToad, Devs.Ven],
description: "Adds pronouns to user messages using pronoundb",
patches: [
- // Add next to username (compact mode)
{
find: "showCommunicationDisabledStyles",
- replacement: {
- match: /("span",{id:\i,className:\i,children:\i}\))/,
- replace: "$1, $self.CompactPronounsChatComponentWrapper(arguments[0])"
- }
- },
- // Patch the chat timestamp element (normal mode)
- {
- find: "showCommunicationDisabledStyles",
- replacement: {
- match: /(?<=return\s*\(0,\i\.jsxs?\)\(.+!\i&&)(\(0,\i.jsxs?\)\(.+?\{.+?\}\))/,
- replace: "[$1, $self.PronounsChatComponentWrapper(arguments[0])]"
- }
+ replacement: [
+ // Add next to username (compact mode)
+ {
+ match: /("span",{id:\i,className:\i,children:\i}\))/,
+ replace: "$1, $self.CompactPronounsChatComponentWrapper(arguments[0])"
+ },
+ // Patch the chat timestamp element (normal mode)
+ {
+ match: /(?<=return\s*\(0,\i\.jsxs?\)\(.+!\i&&)(\(0,\i.jsxs?\)\(.+?\{.+?\}\))/,
+ replace: "[$1, $self.PronounsChatComponentWrapper(arguments[0])]"
+ }
+ ]
},
// Patch the profile popout username header to use our pronoun hook instead of Discord's pronouns
{
- find: ".userTagNoNickname",
+ find: ".pronouns,children",
replacement: [
{
match: /{user:(\i),[^}]*,pronouns:(\i),[^}]*}=\i;/,
diff --git a/src/plugins/resurrectHome/index.tsx b/src/plugins/resurrectHome/index.tsx
index f48debc76..980629126 100644
--- a/src/plugins/resurrectHome/index.tsx
+++ b/src/plugins/resurrectHome/index.tsx
@@ -18,9 +18,68 @@
import { findGroupChildrenByChildId } from "@api/ContextMenu";
import { definePluginSettings } from "@api/Settings";
+import ErrorBoundary from "@components/ErrorBoundary";
import { Devs } from "@utils/constants";
import definePlugin, { OptionType } from "@utils/types";
-import { Menu } from "@webpack/common";
+import { findByPropsLazy } from "@webpack";
+import { Button, Menu, Tooltip, useEffect, useState } from "@webpack/common";
+
+const ChannelRowClasses = findByPropsLazy("modeConnected", "modeLocked", "icon");
+
+let currentShouldViewServerHome = false;
+const shouldViewServerHomeStates = new Set
>>();
+
+function ViewServerHomeButton() {
+ return (
+
+ {tooltipProps => (
+
+ )}
+
+ );
+}
+
+function useForceServerHome() {
+ const { forceServerHome } = settings.use(["forceServerHome"]);
+ const [shouldViewServerHome, setShouldViewServerHome] = useState(currentShouldViewServerHome);
+
+ useEffect(() => {
+ shouldViewServerHomeStates.add(setShouldViewServerHome);
+
+ return () => {
+ shouldViewServerHomeStates.delete(setShouldViewServerHome);
+ };
+ }, []);
+
+ return shouldViewServerHome || forceServerHome;
+}
+
+function useDisableViewServerHome() {
+ useEffect(() => () => {
+ currentShouldViewServerHome = false;
+ for (const setState of shouldViewServerHomeStates) {
+ setState(false);
+ }
+ }, []);
+}
const settings = definePluginSettings({
forceServerHome: {
@@ -30,12 +89,6 @@ const settings = definePluginSettings({
}
});
-function useForceServerHome() {
- const { forceServerHome } = settings.use(["forceServerHome"]);
-
- return forceServerHome;
-}
-
export default definePlugin({
name: "ResurrectHome",
description: "Re-enables the Server Home tab when there isn't a Server Guide. Also has an option to force the Server Home over the Server Guide, which is accessible through right-clicking the Server Guide.",
@@ -89,17 +142,40 @@ export default definePlugin({
{
find: "61eef9_2",
replacement: {
- match: /(?<=getMutableGuildChannelsForGuild\(\i\)\);)(?=if\(null==\i\|\|)/,
- replace: "if($self.useForceServerHome())return false;"
+ match: /getMutableGuildChannelsForGuild\(\i\);return\(0,\i\.useStateFromStores\).+?\]\)(?=}function)/,
+ replace: m => `${m}&&!$self.useForceServerHome()`
+ }
+ },
+ // Add View Server Home Button to Server Guide
+ {
+ find: "487e85_1",
+ replacement: {
+ match: /(?<=text:(\i)\?\i\.\i\.Messages\.SERVER_GUIDE:\i\.\i\.Messages\.GUILD_HOME,)/,
+ replace: "badge:$self.ViewServerHomeButton({serverGuide:$1}),"
+ }
+ },
+ // Disable view Server Home override when the Server Home is unmouted
+ {
+ find: "69386d_5",
+ replacement: {
+ match: /location:"69386d_5".+?;/,
+ replace: "$&$self.useDisableViewServerHome();"
}
}
],
+ ViewServerHomeButton: ErrorBoundary.wrap(({ serverGuide }: { serverGuide?: boolean; }) => {
+ if (serverGuide !== true) return null;
+
+ return ;
+ }),
+
useForceServerHome,
+ useDisableViewServerHome,
contextMenus: {
"guild-context"(children, props) {
- const forceServerHome = useForceServerHome();
+ const { forceServerHome } = settings.use(["forceServerHome"]);
if (!props?.guild) return;
diff --git a/src/plugins/reviewDB/settings.tsx b/src/plugins/reviewDB/settings.tsx
index 79cf4174e..eeebd0aa1 100644
--- a/src/plugins/reviewDB/settings.tsx
+++ b/src/plugins/reviewDB/settings.tsx
@@ -71,7 +71,7 @@ export const settings = definePluginSettings({