fix(js): fix not defined recipients

Romain J 6 months ago
parent 86697143b6
commit e5cefbf48f
No known key found for this signature in database
GPG Key ID: 3227578329C2A3A7
  1. 14
      README.rst
  2. 22
      chat/static/js/project.js
  3. 2
      chat/static/js/project.min.js
  4. 2
      chat/templates/guild/channels/details.html

@ -40,21 +40,13 @@ Running type checking and linter with:
$ make style
Test coverage
Run development
^^^^^^^^^^^^^
To run the tests, check your test coverage, and generate an HTML coverage report::
To run the development server:
$ coverage run -m pytest
$ coverage html
$ open htmlcov/index.html
$ make gulp
Running tests with py.test
~~~~~~~~~~~~~~~~~~~~~~~~~~
::
$ pytest
Live reloading and Sass CSS compilation
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^

@ -5,15 +5,19 @@ function constructKeyPair(keyPair) {
}
function decipher(message, author) {
const sharedKey = nacl.box.before(
nacl.util.decodeBase64(recipients[author]), usableKeyPair.secretKey
);
while (true) {
if (window.hasOwnProperty("recipients")) {
const sharedKey = nacl.box.before(
nacl.util.decodeBase64(recipients[author]), usableKeyPair.secretKey
);
const payload = nacl.box.open.after(
nacl.util.decodeBase64(message.box),
nacl.util.decodeBase64(message.nonce),
sharedKey
);
const payload = nacl.box.open.after(
nacl.util.decodeBase64(message.box),
nacl.util.decodeBase64(message.nonce),
sharedKey
);
return nacl.util.encodeUTF8(payload);
return nacl.util.encodeUTF8(payload);
}
}
}

@ -1 +1 @@
function constructKeyPair(e){return nacl.box.keyPair.fromSecretKey(nacl.util.decodeBase64(e[1]))}function decipher(e,c){const n=nacl.box.before(nacl.util.decodeBase64(recipients[c]),usableKeyPair.secretKey),a=nacl.box.open.after(nacl.util.decodeBase64(e.box),nacl.util.decodeBase64(e.nonce),n);return nacl.util.encodeUTF8(a)}
function constructKeyPair(e){return nacl.box.keyPair.fromSecretKey(nacl.util.decodeBase64(e[1]))}function decipher(e,c){for(;;)if(window.hasOwnProperty("recipients")){const n=nacl.box.before(nacl.util.decodeBase64(recipients[c]),usableKeyPair.secretKey),o=nacl.box.open.after(nacl.util.decodeBase64(e.box),nacl.util.decodeBase64(e.nonce),n);return nacl.util.encodeUTF8(o)}}

@ -90,7 +90,7 @@
nacl.util.decodeUTF8(textarea.value),
nonce,
sharedKey
)
);
const message = {box, nonce};
ws.send(JSON.stringify({

Loading…
Cancel
Save