mirror of
https://github.com/the-djmaze/snappymail.git
synced 2026-08-28 19:49:20 +03:00
Check "Delivered-To" for identities (Closes #160)
This commit is contained in:
parent
fed896776f
commit
2f074433a2
7 changed files with 105 additions and 80 deletions
|
|
@ -25,6 +25,7 @@ function MessageModel()
|
|||
this.cc = [];
|
||||
this.bcc = [];
|
||||
this.replyTo = [];
|
||||
this.deliveredTo = [];
|
||||
|
||||
this.newForAnimation = ko.observable(false);
|
||||
|
||||
|
|
@ -66,7 +67,7 @@ function MessageModel()
|
|||
}
|
||||
return sClass;
|
||||
}, this);
|
||||
|
||||
|
||||
this.fullFormatDateValue = ko.computed(function () {
|
||||
return MessageModel.calculateFullFromatDateValue(this.dateTimeStampInUTC());
|
||||
}, this);
|
||||
|
|
@ -102,7 +103,7 @@ function MessageModel()
|
|||
this.sMessageId = '';
|
||||
this.sInReplyTo = '';
|
||||
this.sReferences = '';
|
||||
|
||||
|
||||
this.parentUid = ko.observable(0);
|
||||
this.threads = ko.observableArray([]);
|
||||
this.threadsLen = ko.observable(0);
|
||||
|
|
@ -111,7 +112,7 @@ function MessageModel()
|
|||
|
||||
this.lastInCollapsedThread = ko.observable(false);
|
||||
this.lastInCollapsedThreadLoading = ko.observable(false);
|
||||
|
||||
|
||||
this.threadsLenResult = ko.computed(function () {
|
||||
var iCount = this.threadsLen();
|
||||
return 0 === this.parentUid() && 0 < iCount ? iCount + 1 : '';
|
||||
|
|
@ -242,6 +243,7 @@ MessageModel.prototype.clear = function ()
|
|||
this.cc = [];
|
||||
this.bcc = [];
|
||||
this.replyTo = [];
|
||||
this.deliveredTo = [];
|
||||
|
||||
this.newForAnimation(false);
|
||||
|
||||
|
|
@ -262,7 +264,7 @@ MessageModel.prototype.clear = function ()
|
|||
this.isHtml(false);
|
||||
this.hasImages(false);
|
||||
this.attachments([]);
|
||||
|
||||
|
||||
this.isPgpSigned(false);
|
||||
this.isPgpEncrypted(false);
|
||||
this.pgpSignedVerifyStatus(Enums.SignedVerifyStatus.None);
|
||||
|
|
@ -309,7 +311,7 @@ MessageModel.prototype.initByJson = function (oJsonMessage)
|
|||
this.uid = oJsonMessage.Uid;
|
||||
this.hash = oJsonMessage.Hash;
|
||||
this.requestHash = oJsonMessage.RequestHash;
|
||||
|
||||
|
||||
this.size(Utils.pInt(oJsonMessage.Size));
|
||||
|
||||
this.from = MessageModel.initEmailsFromJson(oJsonMessage.From);
|
||||
|
|
@ -317,6 +319,7 @@ MessageModel.prototype.initByJson = function (oJsonMessage)
|
|||
this.cc = MessageModel.initEmailsFromJson(oJsonMessage.Cc);
|
||||
this.bcc = MessageModel.initEmailsFromJson(oJsonMessage.Bcc);
|
||||
this.replyTo = MessageModel.initEmailsFromJson(oJsonMessage.ReplyTo);
|
||||
this.deliveredTo = MessageModel.initEmailsFromJson(oJsonMessage.DeliveredTo);
|
||||
|
||||
this.subject(oJsonMessage.Subject);
|
||||
this.dateTimeStampInUTC(Utils.pInt(oJsonMessage.DateTimeStampInUTC));
|
||||
|
|
@ -332,7 +335,7 @@ MessageModel.prototype.initByJson = function (oJsonMessage)
|
|||
|
||||
this.initFlagsByJson(oJsonMessage);
|
||||
this.computeSenderEmail();
|
||||
|
||||
|
||||
bResult = true;
|
||||
}
|
||||
|
||||
|
|
@ -814,6 +817,7 @@ MessageModel.prototype.populateByMessageListItem = function (oMessage)
|
|||
this.cc = oMessage.cc;
|
||||
this.bcc = oMessage.bcc;
|
||||
this.replyTo = oMessage.replyTo;
|
||||
this.deliveredTo = oMessage.deliveredTo;
|
||||
|
||||
this.unseen(oMessage.unseen());
|
||||
this.flagged(oMessage.flagged());
|
||||
|
|
@ -907,7 +911,7 @@ MessageModel.prototype.showInternalImages = function (bLazy)
|
|||
bLazy = Utils.isUnd(bLazy) ? false : bLazy;
|
||||
|
||||
var self = this;
|
||||
|
||||
|
||||
$('[data-x-src-cid]', this.body).each(function () {
|
||||
|
||||
var oAttachment = self.findAttachmentByCid($(this).attr('data-x-src-cid'));
|
||||
|
|
@ -925,7 +929,7 @@ MessageModel.prototype.showInternalImages = function (bLazy)
|
|||
}
|
||||
}
|
||||
});
|
||||
|
||||
|
||||
$('[data-x-src-location]', this.body).each(function () {
|
||||
|
||||
var oAttachment = self.findAttachmentByContentLocation($(this).attr('data-x-src-location'));
|
||||
|
|
@ -933,7 +937,7 @@ MessageModel.prototype.showInternalImages = function (bLazy)
|
|||
{
|
||||
oAttachment = self.findAttachmentByCid($(this).attr('data-x-src-location'));
|
||||
}
|
||||
|
||||
|
||||
if (oAttachment && oAttachment.download)
|
||||
{
|
||||
if (bLazy && $(this).is('img'))
|
||||
|
|
@ -1023,7 +1027,7 @@ MessageModel.prototype.fetchDataToDom = function ()
|
|||
this.isRtl(!!this.body.data('rl-is-rtl'));
|
||||
this.isHtml(!!this.body.data('rl-is-html'));
|
||||
this.hasImages(!!this.body.data('rl-has-images'));
|
||||
|
||||
|
||||
this.plainRaw = Utils.pString(this.body.data('rl-plain-raw'));
|
||||
|
||||
if (RL.data().capaOpenPGP())
|
||||
|
|
@ -1081,7 +1085,7 @@ MessageModel.prototype.verifyPgpSignedClearMessage = function ()
|
|||
if (oValidSysKey)
|
||||
{
|
||||
sPlain = mPgpMessage.getText();
|
||||
|
||||
|
||||
this.pgpSignedVerifyStatus(Enums.SignedVerifyStatus.Success);
|
||||
this.pgpSignedVerifyUser(oValidSysKey.user);
|
||||
|
||||
|
|
|
|||
|
|
@ -93,12 +93,12 @@ function PopupsComposeViewModel()
|
|||
this.identities = RL.data().identities;
|
||||
|
||||
this.currentIdentityID = ko.observable('');
|
||||
|
||||
|
||||
this.currentIdentityString = ko.observable('');
|
||||
this.currentIdentityResultEmail = ko.observable('');
|
||||
|
||||
this.identitiesOptions = ko.computed(function () {
|
||||
|
||||
|
||||
var aList = [{
|
||||
'optValue': oRainLoopData.accountEmail(),
|
||||
'optText': this.formattedFrom(false)
|
||||
|
|
@ -112,11 +112,11 @@ function PopupsComposeViewModel()
|
|||
});
|
||||
|
||||
return aList;
|
||||
|
||||
|
||||
}, this);
|
||||
|
||||
|
||||
ko.computed(function () {
|
||||
|
||||
|
||||
var
|
||||
sResult = '',
|
||||
sResultEmail = '',
|
||||
|
|
@ -149,7 +149,7 @@ function PopupsComposeViewModel()
|
|||
|
||||
this.currentIdentityString(sResult);
|
||||
this.currentIdentityResultEmail(sResultEmail);
|
||||
|
||||
|
||||
return sResult;
|
||||
|
||||
}, this);
|
||||
|
|
@ -166,7 +166,7 @@ function PopupsComposeViewModel()
|
|||
this.resizer.subscribe(function () {
|
||||
this.editorResizeThrottle();
|
||||
}, this);
|
||||
|
||||
|
||||
this.canBeSended = ko.computed(function () {
|
||||
return !this.sending() &&
|
||||
!this.saving() &&
|
||||
|
|
@ -180,10 +180,10 @@ function PopupsComposeViewModel()
|
|||
}, this);
|
||||
|
||||
this.deleteCommand = Utils.createCommand(this, function () {
|
||||
|
||||
|
||||
RL.deleteMessagesFromFolderWithoutCheck(this.draftFolder(), [this.draftUid()]);
|
||||
kn.hideScreenPopup(PopupsComposeViewModel);
|
||||
|
||||
|
||||
}, function () {
|
||||
return this.isDraftFolderMessage();
|
||||
});
|
||||
|
|
@ -336,13 +336,13 @@ function PopupsComposeViewModel()
|
|||
'multiselect': false
|
||||
});
|
||||
}
|
||||
|
||||
|
||||
return true;
|
||||
|
||||
}, function () {
|
||||
return this.dropboxEnabled();
|
||||
});
|
||||
|
||||
|
||||
this.driveEnabled = ko.observable(false);
|
||||
|
||||
this.driveCommand = Utils.createCommand(this, function () {
|
||||
|
|
@ -358,7 +358,7 @@ function PopupsComposeViewModel()
|
|||
|
||||
this.bDisabeCloseOnEsc = true;
|
||||
this.sDefaultKeyScope = Enums.KeyState.Compose;
|
||||
|
||||
|
||||
Knoin.constructorEnd(this);
|
||||
}
|
||||
|
||||
|
|
@ -423,7 +423,7 @@ PopupsComposeViewModel.prototype.findIdentityIdByMessage = function (sComposeTyp
|
|||
oIDs[oItem.email()] = oItem['id'];
|
||||
});
|
||||
}
|
||||
|
||||
|
||||
oIDs[RL.data().accountEmail()] = RL.data().accountEmail();
|
||||
|
||||
if (oMessage)
|
||||
|
|
@ -437,7 +437,7 @@ PopupsComposeViewModel.prototype.findIdentityIdByMessage = function (sComposeTyp
|
|||
case Enums.ComposeType.ReplyAll:
|
||||
case Enums.ComposeType.Forward:
|
||||
case Enums.ComposeType.ForwardAsAttachment:
|
||||
_.find(_.union(oMessage.to, oMessage.cc, oMessage.bcc), fFindHelper);
|
||||
_.find(_.union(oMessage.to, oMessage.cc, oMessage.bcc, oMessage.deliveredTo), fFindHelper);
|
||||
break;
|
||||
case Enums.ComposeType.Draft:
|
||||
_.find(_.union(oMessage.from, oMessage.replyTo), fFindHelper);
|
||||
|
|
@ -481,7 +481,7 @@ PopupsComposeViewModel.prototype.formattedFrom = function (bHeaderResult)
|
|||
|
||||
PopupsComposeViewModel.prototype.sendMessageResponse = function (sResult, oData)
|
||||
{
|
||||
var
|
||||
var
|
||||
bResult = false,
|
||||
sMessage = ''
|
||||
;
|
||||
|
|
@ -496,7 +496,7 @@ PopupsComposeViewModel.prototype.sendMessageResponse = function (sResult, oData)
|
|||
Utils.delegateRun(this, 'closeCommand');
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
if (this.modalVisibility() && !bResult)
|
||||
{
|
||||
if (oData && Enums.Notification.CantSaveMessage === oData.ErrorCode)
|
||||
|
|
@ -645,7 +645,7 @@ PopupsComposeViewModel.prototype.editor = function (fOnInit)
|
|||
PopupsComposeViewModel.prototype.onShow = function (sType, oMessageOrArray, aToEmails)
|
||||
{
|
||||
kn.routeOff();
|
||||
|
||||
|
||||
var
|
||||
self = this,
|
||||
sFrom = '',
|
||||
|
|
@ -716,7 +716,7 @@ PopupsComposeViewModel.prototype.onShow = function (sType, oMessageOrArray, aToE
|
|||
{
|
||||
case Enums.ComposeType.Empty:
|
||||
break;
|
||||
|
||||
|
||||
case Enums.ComposeType.Reply:
|
||||
this.to(fEmailArrayToStringLineHelper(oMessage.replyEmails(oExcludeEmail)));
|
||||
this.subject(Utils.replySubjectAdd('Re', sSubject));
|
||||
|
|
@ -897,7 +897,7 @@ PopupsComposeViewModel.prototype.onFocus = function ()
|
|||
{
|
||||
this.oEditor.focus();
|
||||
}
|
||||
|
||||
|
||||
this.triggerForResize();
|
||||
};
|
||||
|
||||
|
|
@ -924,7 +924,7 @@ PopupsComposeViewModel.prototype.onBuild = function ()
|
|||
{
|
||||
this.initUploader();
|
||||
|
||||
var
|
||||
var
|
||||
self = this,
|
||||
oScript = null
|
||||
;
|
||||
|
|
@ -943,7 +943,7 @@ PopupsComposeViewModel.prototype.onBuild = function ()
|
|||
self.sendCommand();
|
||||
return false;
|
||||
});
|
||||
|
||||
|
||||
key('esc', Enums.KeyState.Compose, function () {
|
||||
self.tryToClosePopup();
|
||||
return false;
|
||||
|
|
@ -959,7 +959,7 @@ PopupsComposeViewModel.prototype.onBuild = function ()
|
|||
oScript.type = 'text/javascript';
|
||||
oScript.src = 'https://www.dropbox.com/static/api/1/dropins.js';
|
||||
$(oScript).attr('id', 'dropboxjs').attr('data-app-key', RL.settingsGet('DropboxApiKey'));
|
||||
|
||||
|
||||
document.body.appendChild(oScript);
|
||||
}
|
||||
|
||||
|
|
@ -1302,7 +1302,7 @@ PopupsComposeViewModel.prototype.addDropboxAttachment = function (oDropboxFile)
|
|||
|
||||
var bResult = false;
|
||||
oAttachment.uploading(false);
|
||||
|
||||
|
||||
if (Enums.StorageResultType.Success === sResult && oData && oData.Result)
|
||||
{
|
||||
if (oData.Result[oAttachment.id])
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue