mirror of
https://github.com/Equicord/Equicord.git
synced 2025-06-29 08:24:26 -04:00
Patch Fixes
This commit is contained in:
parent
e9f366808a
commit
d94977c04b
6 changed files with 14 additions and 15 deletions
|
@ -26,7 +26,7 @@ export default definePlugin({
|
|||
{
|
||||
find: "inQuote:",
|
||||
replacement: {
|
||||
match: /\|Clyde/,
|
||||
match: /\|here/,
|
||||
replace: "$&|someone"
|
||||
}
|
||||
}
|
||||
|
|
|
@ -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;
|
||||
|
|
|
@ -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];
|
||||
|
|
|
@ -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 },
|
||||
{
|
||||
|
|
|
@ -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; }) => {
|
||||
|
|
|
@ -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
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue