1
0
mirror of https://github.com/moparisthebest/mail synced 2025-02-16 23:20:09 -05:00

cleanup email dao smtp send code

This commit is contained in:
Tankred Hase 2013-08-29 14:28:26 +02:00
parent 675da50453
commit 13a9ac84db

View File

@ -161,11 +161,16 @@ define(function(require) {
}
// public key found... encrypt and send
encrypt(email, receiverPubkey);
self.encryptForUser(email, receiverPubkey, callback);
});
};
function encrypt(email, receiverPubkey) {
var ptItems = [email],
/**
* Encrypt an email asymmetrically for an exisiting user with their public key
*/
EmailDAO.prototype.encryptForUser = function(email, receiverPubkey, callback) {
var self = this,
ptItems = [email],
receiverPubkeys = [receiverPubkey],
to, greeting, ct, i;
@ -206,14 +211,14 @@ define(function(require) {
});
}
send(email);
self.send(email, callback);
});
}
};
EmailDAO.prototype.send = function(email, callback) {
var self = this;
function send(email) {
self._smtpClient.send(email, callback);
}
};
/**