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

Show error msg in message list

This commit is contained in:
Tankred Hase 2013-11-21 17:44:03 +01:00
parent 9d3bc51fcf
commit 0c6d279e82
3 changed files with 13 additions and 10 deletions

View File

@ -47,8 +47,8 @@ define(function(require) {
app.string = { app.string = {
subjectPrefix: '[whiteout] ', subjectPrefix: '[whiteout] ',
invitationSubject: 'Invitation to a private conversation', invitationSubject: 'Invitation to a private conversation',
invitationMessage: 'I would like to invite you to a private conversation. To read my encrypted messages, simply install Whiteout Mail for Chrome. The app is really easy to use and automatically encrypts sent emails, so that only the two of us can read them: https://chrome.google.com/webstore/detail/jjgghafhamholjigjoghcfcekhkonijg', invitationMessage: 'I would like to invite you to a private conversation. To read my encrypted messages, simply install Whiteout Mail for Chrome. The app is really easy to use and automatically encrypts sent emails, so that only the two of us can read them.\n\nOpen Whiteout Mail: https://chrome.google.com/webstore/detail/jjgghafhamholjigjoghcfcekhkonijg',
message: 'this is a private conversation. To read my encrypted message below, simply install Whiteout Mail for Chrome. The app is really easy to use and automatically encrypts sent emails, so that only the two of us can read them: https://chrome.google.com/webstore/detail/jjgghafhamholjigjoghcfcekhkonijg', message: 'this is a private conversation. To read my encrypted message below, simply install Whiteout Mail for Chrome. The app is really easy to use and automatically encrypts sent emails, so that only the two of us can read them.\n\nOpen Whiteout Mail: https://chrome.google.com/webstore/detail/jjgghafhamholjigjoghcfcekhkonijg',
cryptPrefix: '-----BEGIN PGP MESSAGE-----', cryptPrefix: '-----BEGIN PGP MESSAGE-----',
cryptSuffix: '-----END PGP MESSAGE-----', cryptSuffix: '-----END PGP MESSAGE-----',
signature: 'Sent securely from whiteout mail', signature: 'Sent securely from whiteout mail',

View File

@ -295,9 +295,7 @@ define(function(require) {
if (!senderPubkey) { if (!senderPubkey) {
// this should only happen if a mail from another channel is in the inbox // this should only happen if a mail from another channel is in the inbox
callback({ setBodyAndContinue('Public key for sender not found!');
errMsg: 'No public key for the sender'
});
return; return;
} }
@ -307,11 +305,15 @@ define(function(require) {
decrypted = err.errMsg; decrypted = err.errMsg;
} }
email.body = decrypted; setBodyAndContinue(decrypted);
cleartextList.push(email);
localCallback();
}); });
}); });
function setBodyAndContinue(text) {
email.body = text;
cleartextList.push(email);
localCallback();
}
} }
function verify(email, localCallback) { function verify(email, localCallback) {

View File

@ -608,8 +608,9 @@ define(function(require) {
offset: 0, offset: 0,
num: 1 num: 1
}, function(err, emails) { }, function(err, emails) {
expect(err).to.exist; expect(err).to.not.exist;
expect(emails).to.not.exist; expect(emails).to.exist;
expect(emails[0].body).to.equal('Public key for sender not found!');
expect(devicestorageStub.listItems.calledOnce).to.be.true; expect(devicestorageStub.listItems.calledOnce).to.be.true;
expect(keychainStub.getReceiverPublicKey.calledOnce).to.be.true; expect(keychainStub.getReceiverPublicKey.calledOnce).to.be.true;
done(); done();