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