fix multiple events fired on multiple body parts

This commit is contained in:
Tankred Hase 2013-08-29 16:01:40 +02:00
parent 13a9ac84db
commit a8d49a632c
1 changed files with 12 additions and 0 deletions

View File

@ -165,6 +165,13 @@ define(function(require) {
});
};
/**
* Encrypt an email symmetrically
*/
// EmailDAO.prototype.encryptForNewUser = function(email, callback) {
// };
/**
* Encrypt an email asymmetrically for an exisiting user with their public key
*/
@ -288,6 +295,11 @@ define(function(require) {
// remember how many items should be fetched before the callback fires
expectedItems = (message.attachments instanceof Array) ? message.attachments.length + 1 : 1;
// TODO: remove once attachments work again
if (itemCounter > 1) {
return;
}
// decrypt Message body
if (message.body.indexOf(PREFIX) !== -1 && message.body.indexOf(SUFFIX) !== -1) {
decryptMessageBody(message, function(err, ptMessage) {