1
0
mirror of https://github.com/moparisthebest/mail synced 2024-11-26 02:42:17 -05:00

remove [whiteout] tag from plain text messages

This commit is contained in:
Felix Hammerl 2013-12-04 17:35:44 +01:00
parent 9e41626182
commit f9c196e2ee
2 changed files with 9 additions and 3 deletions

View File

@ -490,6 +490,8 @@ define(function(require) {
}
function handleMessage(message, localCallback) {
message.subject = message.subject.split(str.subjectPrefix)[1];
if (containsArmoredCiphertext(message)) {
decrypt(message, localCallback);
return;
@ -679,7 +681,7 @@ define(function(require) {
// build encrypted text body
email.body = greeting + message + ct + signature;
email.subject = email.subject;
email.subject = str.subjectPrefix + email.subject;
}
};
@ -860,6 +862,7 @@ define(function(require) {
mails.forEach(function(mail) {
mail.body = str.cryptPrefix + mail.body.split(str.cryptPrefix)[1].split(str.cryptSuffix)[0] + str.cryptSuffix;
mail.subject = mail.subject.split(str.subjectPrefix)[1];
self._crypto.decrypt(mail.body, ownKeys.publicKeyArmored, function(err, decrypted) {
mail.body = err ? err.errMsg : decrypted;
after();

View File

@ -54,7 +54,7 @@ define(function(require) {
to: [{
address: 'qwe@qwe.de'
}],
subject: '[whiteout] qweasd',
subject: 'qweasd',
body: 'asd'
};
nonWhitelistedMail = {
@ -592,7 +592,10 @@ define(function(require) {
pgpStub.decrypt.withArgs(dummyEncryptedMail.body, mockKeyPair.publicKey).yields(null, dummyDecryptedMail.body);
imapListStub = sinon.stub(dao, '_imapListMessages').withArgs({
folder: folder
}).yields(null, [dummyEncryptedMail]);
}).yields(null, [{
uid: dummyEncryptedMail.uid,
subject: '[whiteout] ' + dummyEncryptedMail // the object has already been manipulated as a side-effect...
}]);
dao.sync({
folder: folder