diff --git a/manifest.json b/manifest.json index 5beaf98..add8237 100644 --- a/manifest.json +++ b/manifest.json @@ -7,7 +7,7 @@ "discordID": "372148345894076416", "github": "SammCheese" }, - "version": "1.2.6", + "version": "1.2.7", "updater": { "type": "github", "id": "SammCheese/invisible-chat" diff --git a/package.json b/package.json index a69bb2f..862b08f 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "invisible-chat", - "version": "1.2.6", + "version": "1.2.7", "description": "Encrypt your Discord Messages", "engines": { "node": ">=14.0.0" diff --git a/src/index.ts b/src/index.ts index fdc1dd5..1311988 100644 --- a/src/index.ts +++ b/src/index.ts @@ -29,6 +29,7 @@ export async function start(): Promise { Indicator, }; } + export function stop(): void { injector.uninjectAll(); } @@ -79,3 +80,7 @@ export async function buildEmbed(message: DiscordMessage, revealed: string): Pro } export { Settings } from "./components/Settings"; + +export { chatbarLock } from "./assets/chatbarLock"; + +export { popoverIcon } from "./assets/popoverIcon"; diff --git a/src/plaintextPatches.ts b/src/plaintextPatches.ts index bf73aa7..c62dd06 100644 --- a/src/plaintextPatches.ts +++ b/src/plaintextPatches.ts @@ -2,12 +2,8 @@ import { types } from "replugged"; const patches: types.PlaintextPatch[] = [ { + find: ".Messages.SOURCE_MESSAGE_DELETED", replacements: [ - { - // Chatbar Lock - match: /(.)\.push.{1,}\(.{1,3},\{.{1,30}\},"gift"\)\)/, - replace: "$&;try{$1.push(window.invisiblechat?.chatbarLock)}catch{}", - }, { // Message Indicator match: /var .,.,.=(.)\.className,.=.\.message,.=.\.children,.=.\.content,.=.\.onUpdate/, @@ -16,6 +12,16 @@ const patches: types.PlaintextPatch[] = [ }, ], }, + { + find: "GIFT_BUTTON).analyticsLocations", + replacements: [ + { + // Chatbar Lock + match: /(.)\.push.{1,}\(.{1,3},\{.{1,30}\},"gift"\)\)/, + replace: "$&;try{$1.push(window.invisiblechat?.chatbarLock)}catch{}", + }, + ], + }, ]; export default patches; diff --git a/src/utils.ts b/src/utils.ts index 1e521a8..4b38b3c 100644 --- a/src/utils.ts +++ b/src/utils.ts @@ -1,7 +1,7 @@ /* eslint-disable no-undefined */ /* eslint-disable @typescript-eslint/naming-convention */ -import { common, settings, webpack } from "replugged"; +import { common, settings } from "replugged"; const EMBED_URL = `/unfurler/embed-urls`; @@ -123,7 +123,7 @@ export async function getEmbed(url: URL): Promise { url: EMBED_URL, body: { urls: [url], - } + }, }) .then((res) => { return res.body.embeds[0];