1
0
mirror of https://github.com/moparisthebest/mail synced 2024-12-22 07:18:49 -05:00

Merge remote-tracking branch 'origin/dev/email-dao-refactoring'

This commit is contained in:
Tankred Hase 2013-12-04 17:56:39 +01:00
commit b6de172777
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