summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorAnton L. Šijanec <sijanecantonluka@gmail.com>2020-05-14 20:33:51 +0200
committerAnton L. Šijanec <sijanecantonluka@gmail.com>2020-05-14 20:33:51 +0200
commitde50bacada6c5604b4d0293ee3be9dea3c14fb1e (patch)
tree4589cd28e0ac363f7646cc400fe7f41fc3773fb2
parentMerge branch 'dev' of github.com:beziapp/beziapp.github.io into dev (diff)
downloadbeziapp-de50bacada6c5604b4d0293ee3be9dea3c14fb1e.tar
beziapp-de50bacada6c5604b4d0293ee3be9dea3c14fb1e.tar.gz
beziapp-de50bacada6c5604b4d0293ee3be9dea3c14fb1e.tar.bz2
beziapp-de50bacada6c5604b4d0293ee3be9dea3c14fb1e.tar.lz
beziapp-de50bacada6c5604b4d0293ee3be9dea3c14fb1e.tar.xz
beziapp-de50bacada6c5604b4d0293ee3be9dea3c14fb1e.tar.zst
beziapp-de50bacada6c5604b4d0293ee3be9dea3c14fb1e.zip
-rw-r--r--js/messaging.js3
1 files changed, 2 insertions, 1 deletions
diff --git a/js/messaging.js b/js/messaging.js
index 3ac9e99..a057bb4 100644
--- a/js/messaging.js
+++ b/js/messaging.js
@@ -509,12 +509,13 @@ function setupEventListeners() {
This message was encrypted by BežiApp.
<input type="password" autocomplete="new-password" id="beziapp-msg-e2ee-password-${randomencdivid}" placeholder="Enter password ...">
<input type="button" value="Decrypt" onclick="
+ const ENCRYPTED_MESSAGE_REGEX = /<!-- beziapp-e2eemsg-(\d{4}) -->(\S+?)<!-- end-msg -->/g;
try {
console.log($('beziapp-msg-e2ee-content-${randomencdivid}').text());
$('#beziapp-msg-e2ee-content-${randomencdivid}').html(
sjcl.decrypt(
$('#beziapp-msg-e2ee-password-${randomencdivid}').val(),
- $('beziapp-msg-e2ee-content-${randomencdivid}').text()
+ ENCRYPTED_MESSAGE_REGEX.exec($('beziapp-msg-e2ee-content-${randomencdivid}').text())[2];
)
);
$('#beziapp-msg-e2ee-content-${randomencdivid}').show();