Update openpgpjs library

Small changes
This commit is contained in:
RainLoop Team
2014-08-07 13:34:20 +04:00
parent 2d9ac0b53a
commit 86f282f885
11 changed files with 263 additions and 183 deletions

View File

@@ -19,8 +19,12 @@ function MessageModel()
this.proxy = false;
this.fromEmailString = ko.observable('');
this.fromClearEmailString = ko.observable('');
this.toEmailsString = ko.observable('');
this.toClearEmailsString = ko.observable('');
this.senderEmailsString = ko.observable('');
this.senderClearEmailsString = ko.observable('');
this.emails = [];
@@ -165,10 +169,37 @@ MessageModel.emailsToLine = function (aEmail, bFriendlyView, bWrapWithLink)
return aResult.join(', ');
};
/**
* @static
* @param {Array} aEmail
* @return {string}
*/
MessageModel.emailsToLineClear = function (aEmail)
{
var
aResult = [],
iIndex = 0,
iLen = 0
;
if (Utils.isNonEmptyArray(aEmail))
{
for (iIndex = 0, iLen = aEmail.length; iIndex < iLen; iIndex++)
{
if (aEmail[iIndex] && aEmail[iIndex].email && '' !== aEmail[iIndex].name)
{
aResult.push(aEmail[iIndex].email);
}
}
}
return aResult.join(', ');
};
/**
* @static
* @param {?Array} aJsonEmails
* @return {Array}
* @return {Array.<EmailModel>}
*/
MessageModel.initEmailsFromJson = function (aJsonEmails)
{
@@ -236,8 +267,11 @@ MessageModel.prototype.clear = function ()
this.proxy = false;
this.fromEmailString('');
this.fromClearEmailString('');
this.toEmailsString('');
this.toClearEmailsString('');
this.senderEmailsString('');
this.senderClearEmailsString('');
this.emails = [];
@@ -298,6 +332,9 @@ MessageModel.prototype.computeSenderEmail = function ()
this.senderEmailsString(this.folderFullNameRaw === sSent || this.folderFullNameRaw === sDraft ?
this.toEmailsString() : this.fromEmailString());
this.senderClearEmailsString(this.folderFullNameRaw === sSent || this.folderFullNameRaw === sDraft ?
this.toClearEmailsString() : this.fromClearEmailString());
};
/**
@@ -342,7 +379,9 @@ MessageModel.prototype.initByJson = function (oJsonMessage)
this.attachmentsMainType(oJsonMessage.AttachmentsMainType);
this.fromEmailString(MessageModel.emailsToLine(this.from, true));
this.fromClearEmailString(MessageModel.emailsToLineClear(this.from));
this.toEmailsString(MessageModel.emailsToLine(this.to, true));
this.toClearEmailsString(MessageModel.emailsToLineClear(this.to));
this.parentUid(Utils.pInt(oJsonMessage.ParentThread));
this.threads(Utils.isArray(oJsonMessage.Threads) ? oJsonMessage.Threads : []);
@@ -830,7 +869,9 @@ MessageModel.prototype.populateByMessageListItem = function (oMessage)
this.proxy = oMessage.proxy;
this.fromEmailString(oMessage.fromEmailString());
this.fromClearEmailString(oMessage.fromClearEmailString());
this.toEmailsString(oMessage.toEmailsString());
this.toClearEmailsString(oMessage.toClearEmailsString());
this.emails = oMessage.emails;