MessagePeek: fix emoji render, add group-dm support (#760)

* MessagePeek: fix emoji render, add group-dm support

* bleh
This commit is contained in:
prism 2026-02-11 22:23:22 +01:00 • committed by GitHub
parent 88bb5897b9
commit 6ce8a8654b
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
2 changed files with 11 additions and 12 deletions

View file

@ -17,7 +17,7 @@ import definePlugin from "@utils/types";
import { Activity, ApplicationStream, Channel, Message, OnlineStatus, User } from "@vencord/discord-types";
import { MessageFlags } from "@vencord/discord-types/enums";
import { findByCodeLazy, findByPropsLazy, findComponentByCodeLazy, findCssClassesLazy, findExportedComponentLazy, findLazy } from "@webpack";
import { ChannelStore, MessageStore, RelationshipStore, SnowflakeUtils, UserStore, useStateFromStores } from "@webpack/common";
import { ChannelStore, MessageStore, Parser, RelationshipStore, SnowflakeUtils, UserStore, useStateFromStores } from "@webpack/common";
const cl = classNameFactory("vc-message-peek-");
@ -70,7 +70,7 @@ interface PrivateChannelProps extends ActivityCheckProps {
}
interface MessageContent {
text: string;
text: React.ReactNode;
icon?: IconType;
}
@ -115,7 +115,7 @@ function getMessageContent(message: Message): MessageContent | null {
if (/https?:\/\/(\S+\.gif|tenor\.com|giphy\.com|klipy\.com)/i.test(message.content)) {
return { text: "sent a GIF", icon: "gif" };
}
return { text: message.content };
return { text: Parser.parseInlineReply(message.content) };
}
if (message.flags & MessageFlags.IS_VOICE_MESSAGE) {
@ -151,14 +151,13 @@ function MessagePreviewContent({ channel, user }: { channel: Channel; user: User
return <>Official Discord Message</>;
}
if (channel.isMultiUserDM()) {
return <>{channel.recipients.length + 1} Members</>;
const smynName = isPluginEnabled(showMeYourName.name) ? showMeYourName.getMemberListProfilesReactionsVoiceNameText({ user: user ?? lastMessage?.author, type: "membersList" }) : null;
if (!lastMessage) {
if (channel.isMultiUserDM()) return <>{channel.recipients.length + 1} Members</>;
return null;
}
const smynName = (isPluginEnabled(showMeYourName.name) && showMeYourName.getMemberListProfilesReactionsVoiceNameText({ user: user ?? lastMessage?.author, type: "membersList" }));
if (!lastMessage) return null;
const content = getMessageContent(lastMessage);
if (!content) return null;

View file

@ -44,10 +44,10 @@
gap: 4px;
}
.vc-message-peek-activity-row > [class*="textXs"] {
.vc-message-peek-activity-row>[class*="textXs"] {
min-width: 0;
}
.vc-message-peek-activity-row > [class*="vc-bactivities-row"] {
.vc-message-peek-activity-row>[class*="vc-bactivities-row"] {
flex-shrink: 0;
}
}