diff --git a/src/equicordplugins/atSomeone/index.ts b/src/equicordplugins/atSomeone/index.ts index 445fe0a6..40902e6c 100644 --- a/src/equicordplugins/atSomeone/index.ts +++ b/src/equicordplugins/atSomeone/index.ts @@ -26,7 +26,7 @@ export default definePlugin({ { find: "inQuote:", replacement: { - match: /\|Clyde/, + match: /\|here/, replace: "$&|someone" } } diff --git a/src/equicordplugins/expandedUserTags/index.tsx b/src/equicordplugins/expandedUserTags/index.tsx index 3948b4a1..32ad4660 100644 --- a/src/equicordplugins/expandedUserTags/index.tsx +++ b/src/equicordplugins/expandedUserTags/index.tsx @@ -128,7 +128,7 @@ export default definePlugin({ message, user, channelId, isChat, channel }: { message?: Message, - user?: User & { isClyde(): boolean; }, + user?: User, channel?: Channel & { isForumPost(): boolean; isMediaPost(): boolean; }, channelId?: string; isChat?: boolean; @@ -137,7 +137,6 @@ export default definePlugin({ if (!user) return null; if (isChat && user.id === "1") return null; - if (user.isClyde()) return null; if (user.bot && settings.dontShowForBots) return null; channel ??= ChannelStore.getChannel(channelId!) as any; diff --git a/src/equicordplugins/holyNotes/NoteHandler.ts b/src/equicordplugins/holyNotes/NoteHandler.ts index 70a005be..2235528e 100644 --- a/src/equicordplugins/holyNotes/NoteHandler.ts +++ b/src/equicordplugins/holyNotes/NoteHandler.ts @@ -4,10 +4,10 @@ * SPDX-License-Identifier: GPL-3.0-or-later */ -import { findByCode } from "@webpack"; import { ChannelStore, lodash, Toasts, UserStore } from "@webpack/common"; import { Channel, Message } from "discord-types/general"; +import { User } from "."; import { Discord, HolyNotes } from "./types"; import { deleteCacheFromDataStore, DeleteEntireStore, saveCacheToDataStore } from "./utils"; @@ -142,8 +142,6 @@ export default new (class NoteHandler { public refreshAvatars = async () => { const notebooks = this.getAllNotes(); - const User = findByCode("tag", "isClyde"); - for (const notebook in notebooks) for (const noteId in notebooks[notebook]) { const note = notebooks[notebook][noteId]; diff --git a/src/equicordplugins/holyNotes/components/modals/RenderMessage.tsx b/src/equicordplugins/holyNotes/components/modals/RenderMessage.tsx index 45edbf7c..feb8fe9e 100644 --- a/src/equicordplugins/holyNotes/components/modals/RenderMessage.tsx +++ b/src/equicordplugins/holyNotes/components/modals/RenderMessage.tsx @@ -4,10 +4,11 @@ * SPDX-License-Identifier: GPL-3.0-or-later */ +import { Channel, cozyMessage, groupStart, message, MessageType, User } from "@equicordplugins/holyNotes"; import { copyToClipboard } from "@utils/clipboard"; import { classes } from "@utils/misc"; import { ModalProps } from "@utils/modal"; -import { findByCode, findByCodeLazy, findByProps, findComponentByCodeLazy } from "@webpack"; +import { findComponentByCodeLazy } from "@webpack"; import { ContextMenuApi, FluxDispatcher, Menu, NavigationRouter, React } from "@webpack/common"; import noteHandler from "../../NoteHandler"; @@ -28,10 +29,6 @@ export const RenderMessage = ({ closeModal?: () => void; }) => { const ChannelMessage = findComponentByCodeLazy("Message must not be a thread"); - const { message, groupStart, cozyMessage } = findByProps("cozyMessage"); - const User = findByCode("isClyde(){"); - const Message = findByCode("isEdited(){"); - const Channel = findByCodeLazy("computeLurkerPermissionsAllowList"); const [isHoldingDelete, setHoldingDelete] = React.useState(false); @@ -90,7 +87,7 @@ export const RenderMessage = ({ // @ts-ignore channel={new Channel({ id: "holy-notes" })} message={ - new Message( + new MessageType( Object.assign( { ...note }, { diff --git a/src/equicordplugins/holyNotes/index.tsx b/src/equicordplugins/holyNotes/index.tsx index 0810d954..d01ba040 100644 --- a/src/equicordplugins/holyNotes/index.tsx +++ b/src/equicordplugins/holyNotes/index.tsx @@ -26,7 +26,7 @@ import { EquicordDevs } from "@utils/constants"; import { classes } from "@utils/misc"; import { openModal } from "@utils/modal"; import definePlugin from "@utils/types"; -import { findByProps, findComponentByCodeLazy } from "@webpack"; +import { findByCodeLazy, findByProps, findByPropsLazy, findComponentByCodeLazy } from "@webpack"; import { ChannelStore, Menu } from "@webpack/common"; import { Message } from "discord-types/general"; @@ -35,6 +35,11 @@ import { NoteModal } from "./components/modals/Notebook"; import noteHandler, { noteHandlerCache } from "./NoteHandler"; import { DataStoreToCache, HolyNoteStore } from "./utils"; +export const User = findByCodeLazy("isSystemUser(){"); +export const { message, groupStart, cozyMessage } = findByPropsLazy("cozyMessage"); +export const MessageType = findByCodeLazy("isEdited(){"); +export const Channel = findByCodeLazy("computeLurkerPermissionsAllowList(){"); + const HeaderBarIcon = findComponentByCodeLazy(".HEADER_BAR_BADGE_TOP:", '.iconBadge,"top"'); const messageContextMenuPatch: NavContextMenuPatchCallback = async (children, { message }: { message: Message; }) => { diff --git a/src/plugins/roleColorEverywhere/index.tsx b/src/plugins/roleColorEverywhere/index.tsx index daafc994..68379753 100644 --- a/src/plugins/roleColorEverywhere/index.tsx +++ b/src/plugins/roleColorEverywhere/index.tsx @@ -85,8 +85,8 @@ export default definePlugin({ find: ".USER_MENTION)", replacement: [ { - match: /(?<=onContextMenu:\i,color:)\i(?<=\.getNickname\((\i),\i,(\i).+?)/, - replace: "$self.getColorInt($2?.id,$1)", + match: /(?<=onContextMenu:\i(?!,children))(?<=\.getNickname\((\i),\i,(\i).+?)/, + replace: ",color:$self.getColorInt($2?.id,$1)", } ], predicate: () => settings.store.chatMentions