WhoReacted: add setting to toggle Avatar clicking (#4580)

This commit is contained in:
thororen 2026-09-05 19:19:26 -04:00 • committed by GitHub
parent f5671d73cd
commit 843657c5cc
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -17,13 +17,14 @@
*/
import { isPluginEnabled } from "@api/PluginManager";
import { definePluginSettings } from "@api/Settings";
import ErrorBoundary from "@components/ErrorBoundary";
import NoBlockedMessagesPlugin from "@plugins/noBlockedMessages";
import { Devs } from "@utils/constants";
import { sleep } from "@utils/misc";
import { Queue } from "@utils/Queue";
import { useForceUpdater } from "@utils/react";
import definePlugin from "@utils/types";
import definePlugin, { OptionType } from "@utils/types";
import { CustomEmoji, Message, ReactionEmoji, User } from "@vencord/discord-types";
import { ChannelStore, Constants, FluxDispatcher, React, RestAPI, useEffect, useLayoutEffect, UserStore, UserSummaryItem } from "@webpack/common";
@ -99,7 +100,11 @@ function ReactionUsers({ message, users }: { message: Message, users: User[]; })
<div
style={{ marginLeft: "0.5em", transform: "scale(0.9)" }}
>
<div onClick={handleClickAvatar} onKeyDown={handleClickAvatar}>
<div
onClick={handleClickAvatar}
onKeyDown={handleClickAvatar}
style={!settings.store.clickableAvatars ? { pointerEvents: "none" } : {}}
>
<UserSummaryItem
users={users}
guildId={ChannelStore.getChannel(message.channel_id)?.guild_id}
@ -113,12 +118,21 @@ function ReactionUsers({ message, users }: { message: Message, users: User[]; })
);
}
const settings = definePluginSettings({
clickableAvatars: {
description: "While this is enabled, clicking a reacting user's avatar will open their profile instead of adding the reaction",
type: OptionType.BOOLEAN,
default: true,
restartNeeded: true
}
});
export default definePlugin({
name: "WhoReacted",
description: "Renders the avatars of users who reacted to a message",
tags: ["Reactions", "Chat", "Appearance"],
authors: [Devs.Ven, Devs.KannaDev, Devs.newwares, Devs.paige],
settings,
patches: [
{
find: ",reactionRef:",