Skip to content

Commit 1be3e97

Browse files
committed
dump dependencies & store
1 parent 8d42ef7 commit 1be3e97

File tree

6 files changed

+57
-51
lines changed

6 files changed

+57
-51
lines changed

README.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,11 +2,11 @@
22

33
Encrypt or Sign your messages with GPG :D
44

5-
# Installation
5+
## Installation
66

77
Just click the button below!
88

9-
[![Install](https://img.shields.io/badge/-Install%20for%20Replugged-blue?style=for-the-badge&logo=none)](https://replugged.dev/install?identifier=SammCheese/RepluggedPGP&source=github)
9+
[![Install](https://img.shields.io/badge/-Install%20for%20Replugged-blue?style=for-the-badge&logo=none)](https://replugged.dev/install?identifier=dev.sammcheese.RepluggedPGP)
1010

1111
## Contributing
1212

manifest.json

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -7,10 +7,10 @@
77
"discordID": "372148345894076416",
88
"github": "SammCheese"
99
},
10-
"version": "1.4.3",
10+
"version": "1.4.4",
1111
"updater": {
12-
"type": "github",
13-
"id": "SammCheese/RepluggedPGP"
12+
"type": "store",
13+
"id": "dev.sammcheese.RepluggedPGP"
1414
},
1515
"license": "Unlicensed",
1616
"type": "replugged-plugin",

package.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "repluggedpgp",
3-
"version": "1.4.3",
3+
"version": "1.4.4",
44
"description": "Encrypt, Sign and Decrypt messages with the power of GPG",
55
"engines": {
66
"node": ">=14.0.0"
@@ -32,7 +32,7 @@
3232
"eslint-plugin-react": "^7.31.10",
3333
"openpgp": "^5.5.0",
3434
"prettier": "^2.8.1",
35-
"replugged": "4.2.6",
35+
"replugged": "4.3.0",
3636
"typescript": "^4.8.4"
3737
},
3838
"dependencies": {

pnpm-lock.yaml

Lines changed: 36 additions & 20 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

src/components/KeyPassword.tsx

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -50,14 +50,18 @@ function PasswordField(props: any) {
5050
<Divider style={{ marginTop: "15px", marginBottom: "15px" }} />
5151
<Flex>
5252
<Switch
53-
style={{ marginTop: "15px", marginBottom: "15px" }}
5453
checked={savePassword}
5554
onChange={(e) => {
5655
setSavePassword(e);
5756
}}
5857
/>
5958
<Text.Eyebrow
60-
style={{ left: "20px", top: "4px", position: "relative", marginBottom: "15px" }}>
59+
style={{
60+
left: "20px",
61+
top: "4px",
62+
position: "relative",
63+
marginBottom: "15px",
64+
}}>
6165
Remember Password for 30 Minutes
6266
</Text.Eyebrow>
6367
</Flex>

src/index.ts

Lines changed: 8 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -21,10 +21,6 @@ import { PGPCONSTS } from "./constants";
2121
import { DiscordMessage, RPGPWindow } from "./repluggedpgp";
2222
import { buildAddKeyModal } from "./components/AddKey";
2323
import { del } from "idb-keyval";
24-
import {
25-
OutgoingMessage,
26-
OutgoingMessageOptions,
27-
} from "replugged/dist/renderer/modules/common/messages";
2824

2925
const { channels, messages } = common;
3026

@@ -105,30 +101,19 @@ async function receiver(message: DiscordMessage): Promise<void> {
105101
}
106102
}
107103

108-
function fetchRecepients(
109-
args: [
110-
channelId: string,
111-
message: OutgoingMessage,
112-
promise?: boolean | undefined,
113-
options?: OutgoingMessageOptions | undefined,
114-
],
115-
): string[] {
116-
let recipients = [];
117-
const DM = channels.getChannel(args[0])?.recipients;
118-
const Reply = args[3]?.messageReference;
119-
if (DM) recipients = DM;
120-
if (Reply?.channel_id && Reply?.message_id)
121-
recipients = [messages.getMessage(Reply.channel_id, Reply.message_id).author.id];
122-
return recipients;
123-
}
124-
125104
// eslint-disable-next-line @typescript-eslint/require-await
126105
async function injectSendMessage(): Promise<void> {
127106
injector.instead(common.messages, "sendMessage", async (args, fn) => {
128107
const { signingActive, encryptionActive, asFile, onlyOnce } = PGPSettings.all();
129108

130109
if (encryptionActive) {
131-
const expectedRecipients = await calculateRecipients(fetchRecepients(args));
110+
let recipients = [];
111+
const DM = channels.getChannel(args[0])?.recipients;
112+
const Reply = args[3]?.messageReference;
113+
if (DM) recipients = DM;
114+
if (Reply?.channel_id && Reply?.message_id)
115+
recipients = [messages.getMessage(Reply.channel_id, Reply.message_id).author.id];
116+
const expectedRecipients = await calculateRecipients(recipients);
132117
args[1].content = await encryptMessage(args[1].content, expectedRecipients, signingActive);
133118
}
134119

@@ -157,6 +142,7 @@ async function injectSendMessage(): Promise<void> {
157142

158143
// eslint-disable-next-line @typescript-eslint/require-await
159144
async function injectPopover(): Promise<void> {
145+
// @ts-expect-error eat a dick
160146
injector.utils.addPopoverButton((message: DiscordMessage) => {
161147
const actionType = {
162148
"Add Key": /BEGIN PGP PUBLIC KEY BLOCK/,

0 commit comments

Comments
 (0)