diff --git a/src/plugins/_api/commands.ts b/src/plugins/_api/commands.ts index 2af65b6f..313daea3 100644 --- a/src/plugins/_api/commands.ts +++ b/src/plugins/_api/commands.ts @@ -55,7 +55,8 @@ export default definePlugin({ { // ...children: p?.name match: /(?<=:(\i)\.displayDescription\}.{0,200}children:).{0,50}\.name(?=\}\))/, - replace: "$1.plugin||($&)" + replace: "$1.plugin||($&)", + noWarn: true // TODO: remove legacy compatibility code in the future }, { match: /children:(?=\i\?\?\i\?\.name)(?<=command:(\i),.+?)/, diff --git a/src/plugins/betterGifPicker/index.ts b/src/plugins/betterGifPicker/index.ts index bc39c6b5..2562a720 100644 --- a/src/plugins/betterGifPicker/index.ts +++ b/src/plugins/betterGifPicker/index.ts @@ -15,10 +15,6 @@ export default definePlugin({ { find: "renderHeaderContent(){", replacement: [ - { - match: /(?<="state",{resultType:)null/, - replace: '"Favorites"' - }, { match: /(?<=state={resultType:)null/, replace: '"Favorites"' diff --git a/src/plugins/consoleJanitor/index.tsx b/src/plugins/consoleJanitor/index.tsx index 067fa270..d30d6ced 100644 --- a/src/plugins/consoleJanitor/index.tsx +++ b/src/plugins/consoleJanitor/index.tsx @@ -148,10 +148,6 @@ export default definePlugin({ { find: "is not a valid locale.", replacement: [ - { - match: /\i\.error(?=\(""\.concat\(\i," is not a valid locale."\)\))/, - replace: "$self.Noop" - }, { match: /\i\.error(?=\(`\$\{\i\} is not a valid locale.`)/, replace: "$self.Noop" @@ -167,16 +163,10 @@ export default definePlugin({ }, { find: "RPCServer:WSS", - replacement: [ - { - match: /\i\.error\("Error: "\.concat\((\i)\.message/, - replace: '!$1.message.includes("EADDRINUSE")&&$&' - }, - { - match: /\i\.error\(`Error: \$\{(\i)\.message\}/, - replace: '!$1.message.includes("EADDRINUSE")&&$&' - } - ] + replacement: { + match: /\i\.error\(`Error: \$\{(\i)\.message\}/, + replace: '!$1.message.includes("EADDRINUSE")&&$&' + } }, { find: "Tried getting Dispatch instance before instantiated", @@ -195,10 +185,6 @@ export default definePlugin({ { find: "failed to send analytics events", replacement: [ - { - match: /console\.error\("\[analytics\] failed to send analytics events query: "\.concat\(\i\)\)/, - replace: "" - }, { match: /console\.error\(`\[analytics\] failed to send analytics events query: \$\{\i\}`\)/, replace: "" diff --git a/src/plugins/disableCallIdle/index.ts b/src/plugins/disableCallIdle/index.ts index 5a1ac84f..216f1218 100644 --- a/src/plugins/disableCallIdle/index.ts +++ b/src/plugins/disableCallIdle/index.ts @@ -25,18 +25,20 @@ export default definePlugin({ authors: [Devs.Nuckyz], patches: [ { - find: "#{intl::BOT_CALL_IDLE_DISCONNECT_2}", + find: "this.idleTimeout.start(", replacement: { - match: /,?(?=\i\(this,"idleTimeout",new \i\.\i\))/, - replace: ";return;" + match: /this\.idleTimeout\.(start|stop)/g, + replace: "$self.noop" } }, { find: "handleIdleUpdate(){", replacement: { - match: /(?<=_initialize\(\){)/, - replace: "return;" + match: "handleIdleUpdate(){", + replace: "handleIdleUpdate(){return;" } } - ] + ], + + noop() { } }); diff --git a/src/plugins/mentionAvatars/index.tsx b/src/plugins/mentionAvatars/index.tsx index 741116c7..4e79da5c 100644 --- a/src/plugins/mentionAvatars/index.tsx +++ b/src/plugins/mentionAvatars/index.tsx @@ -49,16 +49,10 @@ export default definePlugin({ patches: [{ find: ".USER_MENTION)", - replacement: [ - { - match: /children:"@"\.concat\((null!=\i\?\i:\i)\)(?<=\.useName\((\i)\).+?)/, - replace: "children:$self.renderUsername({username:$1,user:$2})" - }, - { - match: /children:`@\$\{(\i\?\?\i)\}`(?<=\.useName\((\i)\).+?)/, - replace: "children:$self.renderUsername({username:$1,user:$2})" - } - ] + replacement: { + match: /children:`@\$\{(\i\?\?\i)\}`(?<=\.useName\((\i)\).+?)/, + replace: "children:$self.renderUsername({username:$1,user:$2})" + } }, { find: ".ROLE_MENTION)", diff --git a/src/plugins/pinDms/components/CreateCategoryModal.tsx b/src/plugins/pinDms/components/CreateCategoryModal.tsx index 4f2df28b..7bd34219 100644 --- a/src/plugins/pinDms/components/CreateCategoryModal.tsx +++ b/src/plugins/pinDms/components/CreateCategoryModal.tsx @@ -24,7 +24,7 @@ interface ColorPickerWithSwatchesProps { const ColorPickerWithSwatches = findComponentByCodeLazy('id:"color-picker"'); -export const requireSettingsMenu = extractAndLoadChunksLazy(['name:"UserSettings"'], /createPromise:.{0,20}(\i\.\i\("?.+?"?\).*?).then\(\i\.bind\(\i,"?(.+?)"?\)\).{0,50}"UserSettings"/); +export const requireSettingsModal = extractAndLoadChunksLazy(['type:"USER_SETTINGS_MODAL_OPEN"']); const cl = classNameFactory("vc-pindms-modal-"); @@ -119,7 +119,7 @@ export function NewCategoryModal({ categoryId, modalProps, initialChannelId }: P export const openCategoryModal = (categoryId: string | null, channelId: string | null) => openModalLazy(async () => { - await requireSettingsMenu(); + await requireSettingsModal(); return modalProps => ; }); diff --git a/src/plugins/pinDms/data.ts b/src/plugins/pinDms/data.ts index 7671b54f..be268ab7 100644 --- a/src/plugins/pinDms/data.ts +++ b/src/plugins/pinDms/data.ts @@ -16,11 +16,6 @@ export interface Category { collapsed?: boolean; } -const CATEGORY_BASE_KEY = "PinDMsCategories-"; -const CATEGORY_MIGRATED_PINDMS_KEY = "PinDMsMigratedPinDMs"; -const CATEGORY_MIGRATED_KEY = "PinDMsMigratedOldCategories"; -const OLD_CATEGORY_KEY = "BetterPinDMsCategories-"; - let forceUpdateDms: (() => void) | undefined = undefined; export let currentUserCategories: Category[] = []; diff --git a/src/plugins/pinDms/index.tsx b/src/plugins/pinDms/index.tsx index 71b863eb..609fbe6b 100644 --- a/src/plugins/pinDms/index.tsx +++ b/src/plugins/pinDms/index.tsx @@ -16,7 +16,7 @@ import { findCssClassesLazy, findStoreLazy } from "@webpack"; import { Clickable, ContextMenuApi, FluxDispatcher, Menu, React } from "@webpack/common"; import { contextMenus } from "./components/contextMenu"; -import { openCategoryModal, requireSettingsMenu } from "./components/CreateCategoryModal"; +import { openCategoryModal, requireSettingsModal } from "./components/CreateCategoryModal"; import { DEFAULT_CHUNK_SIZE } from "./constants"; import { canMoveCategory, canMoveCategoryInDirection, Category, categoryLen, collapseCategory, getAllUncollapsedChannels, getCategoryByIndex, getSections, init, isPinned, moveCategory, removeCategory, usePinnedDms } from "./data"; @@ -173,7 +173,7 @@ export default definePlugin({ categoryLen, getSections, getAllUncollapsedChannels, - requireSettingsMenu, + requireSettingsMenu: requireSettingsModal, makeProps(instance, { sections }: { sections: number[]; }) { this._instance = instance; diff --git a/src/plugins/showHiddenChannels/index.tsx b/src/plugins/showHiddenChannels/index.tsx index f1b08c65..15e7f058 100644 --- a/src/plugins/showHiddenChannels/index.tsx +++ b/src/plugins/showHiddenChannels/index.tsx @@ -329,13 +329,6 @@ export default definePlugin({ match: /\i>0(?=&&!\i&&!\i)/, replace: m => `($self.isHiddenChannel(typeof shcChannel!=="undefined"?shcChannel:void 0,true)?true:${m})` }, - { - // Show only the plus text without overflowed children amount - // if the overflow amount is <= 0 and the component is used inside the HiddenChannelLockScreen - match: /(?<="\+"\.concat\()\i/, - replace: overflowTextAmount => "" + - `$self.isHiddenChannel(typeof shcChannel!=="undefined"?shcChannel:void 0,true)&&(${overflowTextAmount}-1)<=0?"":${overflowTextAmount}` - }, { // Show only the plus text without overflowed children amount // if the overflow amount is <= 0 and the component is used inside the HiddenChannelLockScreen diff --git a/src/plugins/themeAttributes/index.ts b/src/plugins/themeAttributes/index.ts index 25753b39..bc50571e 100644 --- a/src/plugins/themeAttributes/index.ts +++ b/src/plugins/themeAttributes/index.ts @@ -41,10 +41,6 @@ export default definePlugin({ { find: "#{intl::LABEL_WITH_ONLINE_STATUS}", replacement: [ - { - match: /src:null!=\i\?(\i).{1,50}"aria-hidden":!0/, - replace: "$&,style:$self.getAvatarStyles($1)" - }, { match: /src:(\i)\?\?void 0.{1,50}"aria-hidden":!0/, replace: "$&,style:$self.getAvatarStyles($1)" diff --git a/src/plugins/validReply/index.ts b/src/plugins/validReply/index.ts index d5d54195..4c147724 100644 --- a/src/plugins/validReply/index.ts +++ b/src/plugins/validReply/index.ts @@ -47,7 +47,8 @@ export default definePlugin({ replacement: [ { match: /constructor\(\)\{\i\(this,"_channelCaches",new Map\)/, - replace: "$&;$self.setReplyStore(this);" + replace: "$&;$self.setReplyStore(this);", + noWarn: true // TODO: remove legacy compatibility code in the future }, { match: /_channelCaches=new Map;/, diff --git a/src/plugins/viewIcons/index.tsx b/src/plugins/viewIcons/index.tsx index bbcebfaa..0e9c6b7f 100644 --- a/src/plugins/viewIcons/index.tsx +++ b/src/plugins/viewIcons/index.tsx @@ -206,16 +206,10 @@ export default definePlugin({ // Banners { find: 'backgroundColor:"COMPLETE"', - replacement: [ - { - match: /(overflow:"visible",.{0,125}?!1\),)style:{(?=.+?backgroundImage:null!=(\i)\?"url\("\.concat\(\2,)/, - replace: (_, rest, bannerSrc) => `${rest}onClick:()=>${bannerSrc}!=null&&$self.openBanner(${bannerSrc}),style:{cursor:${bannerSrc}!=null?"pointer":void 0,` - }, - { - match: /(overflow:"visible",.{0,125}?!1\),)style:{(?=.+?backgroundImage:null!=(\i)\?`url\(\$\{\2\}\))/, - replace: (_, rest, bannerSrc) => `${rest}onClick:()=>${bannerSrc}!=null&&$self.openBanner(${bannerSrc}),style:{cursor:${bannerSrc}!=null?"pointer":void 0,` - } - ] + replacement: { + match: /(overflow:"visible",.{0,125}?!1\),)style:{(?=.+?backgroundImage:null!=(\i)\?`url\(\$\{\2\}\))/, + replace: (_, rest, bannerSrc) => `${rest}onClick:()=>${bannerSrc}!=null&&$self.openBanner(${bannerSrc}),style:{cursor:${bannerSrc}!=null?"pointer":void 0,` + } }, // Group DMs top small & large icon { diff --git a/src/plugins/webScreenShareFixes.web/index.ts b/src/plugins/webScreenShareFixes.web/index.ts index 8eb2e626..e7fbc178 100644 --- a/src/plugins/webScreenShareFixes.web/index.ts +++ b/src/plugins/webScreenShareFixes.web/index.ts @@ -17,10 +17,6 @@ export default definePlugin({ { find: "x-google-max-bitrate", replacement: [ - { - match: /"x-google-max-bitrate=".concat\(\i\)/, - replace: '"x-google-max-bitrate=".concat("80_000")' - }, { match: /`x-google-max-bitrate=\$\{\i\}`/, replace: '"x-google-max-bitrate=80_000"' @@ -29,10 +25,6 @@ export default definePlugin({ match: ";level-asymmetry-allowed=1", replace: ";b=AS:800000;level-asymmetry-allowed=1" }, - { - match: /;usedtx=".concat\((\i)\?"0":"1"\)/, - replace: '$&.concat($1?";stereo=1;sprop-stereo=1":"")' - }, { match: /;usedtx=\$\{(\i)\?"0":"1"\}/, replace: '$&${$1?";stereo=1;sprop-stereo=1":""}'