Skip to content

Commit e79a445

Browse files
committed
Fix Minipopover patch (closes #16)
1 parent 047279d commit e79a445

File tree

6 files changed

+7
-8
lines changed

6 files changed

+7
-8
lines changed

manifest.json

+1-1
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@
77
"discordID": "372148345894076416",
88
"github": "SammCheese"
99
},
10-
"version": "1.2.0",
10+
"version": "1.2.1",
1111
"updater": {
1212
"type": "github",
1313
"id": "SammCheese/invisible-chat"

package.json

+2-2
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "invisible-chat",
3-
"version": "1.2.0",
3+
"version": "1.2.1",
44
"description": "Encrypt your Discord Messages",
55
"engines": {
66
"node": ">=14.0.0"
@@ -20,7 +20,7 @@
2020
},
2121
"keywords": [],
2222
"author": "",
23-
"license": "ISC",
23+
"license": "Unlicensed",
2424
"devDependencies": {
2525
"@electron/asar": "^3.2.1",
2626
"@types/node": "^18.11.2",

src/components/Settings.tsx

-1
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,6 @@ const { TextInput, Text, Divider } = components;
66

77
export function Settings() {
88
let [passwords, setPasswords] = React.useState(InvSettings.get("passwords", []));
9-
109
let [defaultSetting, setDefaultSetting] = React.useState(
1110
InvSettings.get("defaultPassword", "password"),
1211
);

src/index.ts

+2-3
Original file line numberDiff line numberDiff line change
@@ -28,13 +28,11 @@ export { Settings } from "./components/Settings";
2828

2929
// Grab the data from the above Plaintext Patches
3030
async function receiver(message: DiscordMessage): Promise<void> {
31+
// if a stored password leads to the decrypted string, skip the modal
3132
await interatePasswords(message).then((res) => {
3233
if (res) return void buildEmbed(message, res);
3334
return void buildDecModal({ message });
3435
});
35-
// if a stored password leads to the decrypted string, skip the modal
36-
// if (passwordCheck) return void buildEmbed(message, passwordCheck);
37-
// return void buildDecModal({ message });
3836
}
3937

4038
export async function buildEmbed(message: DiscordMessage, revealed: string): Promise<void> {
@@ -50,6 +48,7 @@ export async function buildEmbed(message: DiscordMessage, revealed: string): Pro
5048
},
5149
};
5250

51+
// Convert discords existing embeds to sendable ones. Prevents existing embeds from breaking
5352
message.embeds = message.embeds.map((embed: rawDiscordEmbed) => cleanupEmbed(embed));
5453
message.embeds.push(embed);
5554
if (urlCheck?.length) message.embeds.push(await getEmbed(new URL(urlCheck[0])));

src/plaintextPatches.ts

+1-1
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ const patches: types.PlaintextPatch[] = [
66
{
77
// Minipopover Lock
88
match:
9-
/.\?(..)\(\{key:"reply",label:.{1,40},icon:.{1,40},channel:(.{1,3}),message:(.{1,3}),onClick:.{1,5}\}\):null/gm,
9+
/.\?(..)\(\{key:"reply-other",channel:(.{1,5}),message:(.{1,5}),label:.{1,50},icon:.{1,5},onClick:.{1,6}\}\):null/gm,
1010
replace: `$&,$3.content.match(window.invisiblechat?.INV_DETECTION)?$1({key:"decrypt",label:"Decrypt Message",icon:window.invisiblechat.popoverIcon,channel:$2,message:$3,onClick:()=>window.invisiblechat.receiver($3)}):null`,
1111
},
1212
{

src/utils.ts

+1
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,7 @@ export let InvSettings: settings.SettingsManager<
1818
never
1919
>;
2020

21+
// Load
2122
export async function stegInit(): Promise<void> {
2223
StegCloak = (await getStegCloak).default;
2324
steggo = await new StegCloak(true, false);

0 commit comments

Comments
 (0)