Fixed: Mail content's CipherText resolved in sentMail, replyMail and refreshInbox
This commit is contained in:
Sai Raj 2020-09-02 12:48:33 +05:30 committed by GitHub
parent 3060622535
commit e2421312a4
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -1610,9 +1610,10 @@
content: Crypto.AES.encrypt(content, floGlobals.appendix.AESKey), content: Crypto.AES.encrypt(content, floGlobals.appendix.AESKey),
ref: mail.ref ref: mail.ref
} }
compactIDB.addData("mails", data, `${data.time}`) compactIDB.addData("mails", JSON.parse(JSON.stringify(data)) , `${data.time}`)
compactIDB.addData("mailRef", `${data.time}`, mail.ref) compactIDB.addData("mailRef", `${data.time}`, mail.ref)
result.data = data result.data = data
result.data.content = content;
resolve(result) resolve(result)
}) })
}, },
@ -1639,8 +1640,9 @@
content: Crypto.AES.encrypt(content,floGlobals.appendix.AESKey), content: Crypto.AES.encrypt(content,floGlobals.appendix.AESKey),
ref: mail.ref ref: mail.ref
} }
compactIDB.addData("mails", data, `${data.time}`) compactIDB.addData("mails", JSON.parse(JSON.stringify(data)), `${data.time}`)
compactIDB.addData("mailRef", `${data.time}`, mail.ref) compactIDB.addData("mailRef", `${data.time}`, mail.ref)
data.content = content;
resolve(data) resolve(data)
} catch (error) { } catch (error) {
reject(error) reject(error)
@ -1699,9 +1701,9 @@
//process as message //process as message
data.category = "received" data.category = "received"
data.message = Crypto.AES.encrypt(tmp, floGlobals.appendix.AESKey); data.message = Crypto.AES.encrypt(tmp, floGlobals.appendix.AESKey);
newInbox.messages[vc] = data;
compactIDB.addData("messages", JSON.parse(JSON.stringify(data)), vc) compactIDB.addData("messages", JSON.parse(JSON.stringify(data)), vc)
data.message = tmp; data.message = tmp;
newInbox.messages[vc] = data;
this.addMark(data.floID, "unread") this.addMark(data.floID, "unread")
} else if (typeof tmp === "object") { } else if (typeof tmp === "object") {
//process as mail //process as mail
@ -1713,9 +1715,10 @@
data.category = "replyFrom"; data.category = "replyFrom";
} else } else
data.category = "receivedFrom" data.category = "receivedFrom"
newInbox.mails[vc] = data; compactIDB.addData("mails", JSON.parse(JSON.stringify(data)), vc);
compactIDB.addData("mails", data, vc);
compactIDB.addData("mailRef", vc, data.ref) compactIDB.addData("mailRef", vc, data.ref)
data.content = tmp.content;
newInbox.mails[vc] = data;
this.addMark(data.ref, "unread") this.addMark(data.ref, "unread")
} }
} catch (error) { } catch (error) {
@ -1924,4 +1927,4 @@
</script> </script>
</body> </body>
</html> </html>