Forgot to save stuff. (#8)
This commit is contained in:
parent
0ea5bc2dcc
commit
9f4b0aec6b
|
@ -90,8 +90,6 @@ export default new class E2EE extends BuiltinModule {
|
|||
Settings.getSetting('security', 'e2eedb', 'e2ekvps').addItem({ value: { key: channelId, value: key } });
|
||||
}
|
||||
|
||||
<<<<<<< Updated upstream
|
||||
=======
|
||||
get ecdhStorage() {
|
||||
return this._ecdhStorage || (this._ecdhStorage = {});
|
||||
}
|
||||
|
@ -115,7 +113,6 @@ export default new class E2EE extends BuiltinModule {
|
|||
}
|
||||
}
|
||||
|
||||
>>>>>>> Stashed changes
|
||||
async enabled(e) {
|
||||
seed = Security.randomBytes();
|
||||
// TODO Input modal for key
|
||||
|
|
|
@ -9,11 +9,7 @@
|
|||
*/
|
||||
|
||||
<template>
|
||||
<<<<<<< Updated upstream
|
||||
<div class="bd-e2eeTaContainer" @contextmenu.prevent="channelType === 'DM' && $refs.ee2eLockContextMenu.open()">
|
||||
=======
|
||||
<div class="bd-e2eeTaContainer" @contextmenu.prevent="currentChannel.type === 'DM' && $refs.ee2eLockContextMenu.open()">
|
||||
>>>>>>> Stashed changes
|
||||
<v-popover popoverClass="bd-popover bd-e2eePopover" placement="top">
|
||||
<div v-if="error" class="bd-e2eeTaBtn bd-e2eeLock bd-error">
|
||||
<MiLock v-tooltip="error" />
|
||||
|
@ -53,12 +49,7 @@
|
|||
import { remote } from 'electron';
|
||||
import { E2EE } from 'builtin';
|
||||
import { DiscordApi, Security } from 'modules';
|
||||
<<<<<<< Updated upstream
|
||||
import { MiLock, MiPlus, MiImagePlus } from '../ui/components/common/MaterialIcon';
|
||||
import contextMenu from 'vue-context-menu';
|
||||
=======
|
||||
import { MiLock, MiPlus, MiImagePlus, MiPencil, MiRefresh } from '../ui/components/common/MaterialIcon';
|
||||
>>>>>>> Stashed changes
|
||||
import { Toasts } from 'ui';
|
||||
|
||||
export default {
|
||||
|
@ -68,11 +59,7 @@
|
|||
E2EE,
|
||||
state: 'loading',
|
||||
error: null,
|
||||
<<<<<<< Updated upstream
|
||||
channelType: DiscordApi.currentChannel.type
|
||||
=======
|
||||
currentChannel: DiscordApi.currentChannel
|
||||
>>>>>>> Stashed changes
|
||||
};
|
||||
},
|
||||
methods: {
|
||||
|
@ -105,33 +92,12 @@
|
|||
Toasts.success('New messages will be encrypted');
|
||||
},
|
||||
generatePublicKey() {
|
||||
<<<<<<< Updated upstream
|
||||
const dmChannelID = location.pathname.split("/")[3];
|
||||
=======
|
||||
const dmChannelID = DiscordApi.currentChannel.id;
|
||||
>>>>>>> Stashed changes
|
||||
const publicKeyMessage = `My public key is: \`${E2EE.createKeyExchange(dmChannelID)}\`. Please give me your public key if you haven't done so and add my public key by pasting it in the chat textbox, right clicking the lock icon, and selecting \`Receive Public Key\`.`;
|
||||
const chatInput = document.getElementsByClassName('da-textArea')[0];
|
||||
chatInput.value = publicKeyMessage;
|
||||
const evt = { currentTarget: chatInput };
|
||||
chatInput[Object.keys(chatInput).find(k => k.startsWith('__reactEventHandlers'))].onChange.call(chatInput, evt);
|
||||
<<<<<<< Updated upstream
|
||||
},
|
||||
computeSharedSecret() {
|
||||
try {
|
||||
const dmChannelID = location.pathname.split("/")[3];
|
||||
const chatInput = document.getElementsByClassName('da-textArea')[0];
|
||||
const otherPublicKey = chatInput.value;
|
||||
const secret = E2EE.computeSecret(dmChannelID, otherPublicKey);
|
||||
E2EE.setKey(dmChannelID, secret);
|
||||
chatInput.value = "";
|
||||
const evt = { currentTarget: chatInput };
|
||||
chatInput[Object.keys(chatInput).find(k => k.startsWith('__reactEventHandlers'))].onChange.call(chatInput, evt);
|
||||
Toasts.success("Encryption key has been set for this DM channel.");
|
||||
} catch (e) {
|
||||
Toasts.error("Invalid public key. Please set up a new key exchange.");
|
||||
console.error(e);
|
||||
=======
|
||||
this.$forceUpdate();
|
||||
},
|
||||
receivePublicKey() {
|
||||
|
@ -149,7 +115,6 @@
|
|||
} catch (e) {
|
||||
Toasts.error("Invalid public key. Please set up a new key exchange.");
|
||||
console.error(e);
|
||||
>>>>>>> Stashed changes
|
||||
}
|
||||
}
|
||||
},
|
||||
|
|
|
@ -41,7 +41,7 @@ module.exports = {
|
|||
crypto: 'require("crypto")',
|
||||
request: 'require(require("path").join(require("electron").remote.app.getAppPath(), "node_modules", "request"))',
|
||||
sparkplug: 'require("./sparkplug")',
|
||||
crypto: 'require("crypto")'
|
||||
'node-crypto': 'require("crypto")'
|
||||
},
|
||||
resolve: {
|
||||
alias: {
|
||||
|
|
Loading…
Reference in New Issue