+ {!!getCurrentChannel()?.guild_id && (
+
+ )}
{getCreatedAtDate(friendsSince, locale.getLocale())}
diff --git a/src/plugins/messageLinkEmbeds/index.tsx b/src/plugins/messageLinkEmbeds/index.tsx
index 6ee60be7..2a5f8828 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/mutualGroupDMs/index.tsx b/src/plugins/mutualGroupDMs/index.tsx
index f5e4b614..1753fefb 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 7f9fad53..802f65e5 100644
--- a/src/plugins/noMosaic/index.ts
+++ b/src/plugins/noMosaic/index.ts
@@ -11,21 +11,15 @@ import definePlugin, { OptionType } from "@utils/types";
import style from "./styles.css?managed";
+const MAX_WIDTH = 550;
+const MAX_HEIGHT = 350;
+
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" },
- ]
}
});
@@ -42,7 +36,7 @@ export default definePlugin({
find: ".oneByTwoLayoutThreeGrid",
replacement: [{
match: /mediaLayoutType:\i\.\i\.MOSAIC/,
- replace: "mediaLayoutType:$self.mediaLayoutType()",
+ replace: "mediaLayoutType:'RESPONSIVE'",
},
{
match: /null!==\(\i=\i\.get\(\i\)\)&&void 0!==\i\?\i:"INVALID"/,
@@ -59,15 +53,43 @@ export default definePlugin({
},
{
find: "Messages.REMOVE_ATTACHMENT_TOOLTIP_TEXT",
- replacement: {
+ replacement: [{
match: /\i===\i\.\i\.MOSAIC/,
replace: "true"
+ },
+ {
+ match: /\i!==\i\.\i\.MOSAIC/,
+ replace: "false"
+ }]
+ },
+ {
+ find: ".messageAttachment,",
+ replacement: {
+ match: /\{width:\i,height:\i\}=(\i).*?(?=className:\i\(\)\(\i\.messageAttachment,)/,
+ replace: "$&style:$self.style($1),"
}
}
],
- mediaLayoutType() {
- return settings.store.mediaLayoutType;
+ style({ width, height }) {
+ if (!width || !height) return {};
+
+ if (width > MAX_WIDTH || height > MAX_HEIGHT) {
+ if (width / height > MAX_WIDTH / MAX_HEIGHT) {
+ height = Math.ceil(MAX_WIDTH / (width / height));
+ width = MAX_WIDTH;
+ } else {
+ width = Math.ceil(MAX_HEIGHT * (width / height));
+ height = MAX_HEIGHT;
+ }
+ }
+
+ return {
+ maxWidth: width,
+ width: "100%",
+ aspectRatio: `${width} / ${height}`
+ };
+
},
start() {
diff --git a/src/plugins/noMosaic/styles.css b/src/plugins/noMosaic/styles.css
index 05ea2489..3a8a8e46 100644
--- a/src/plugins/noMosaic/styles.css
+++ b/src/plugins/noMosaic/styles.css
@@ -1,3 +1,8 @@
[class^="nonMediaAttachmentsContainer_"] [class*="messageAttachment_"] {
position: relative;
}
+
+[class^="nonMediaAttachmentsContainer_"],
+[class^="nonMediaAttachmentItem_"]:has([class^="messageAttachment_"][style^="max-width"]) {
+ width: 100%;
+}
diff --git a/src/plugins/pinDms/data.ts b/src/plugins/pinDms/data.ts
index afb6f979..a4e40dde 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 353fc482..010b5506 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/resurrectHome/index.tsx b/src/plugins/resurrectHome/index.tsx
index f48debc7..24cdf2b0 100644
--- a/src/plugins/resurrectHome/index.tsx
+++ b/src/plugins/resurrectHome/index.tsx
@@ -89,8 +89,8 @@ 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()`
}
}
],
diff --git a/src/plugins/reviewDB/settings.tsx b/src/plugins/reviewDB/settings.tsx
index 79cf4174..eeebd0aa 100644
--- a/src/plugins/reviewDB/settings.tsx
+++ b/src/plugins/reviewDB/settings.tsx
@@ -71,7 +71,7 @@ export const settings = definePluginSettings({