mirror of
https://github.com/the-djmaze/snappymail.git
synced 2026-07-13 03:27:39 +03:00
Code refactoring
This commit is contained in:
parent
f817a680a2
commit
d8c9f7ec14
15 changed files with 469 additions and 189 deletions
|
|
@ -90,6 +90,15 @@
|
||||||
return Utils.isNormal(mValue) ? '' + mValue : '';
|
return Utils.isNormal(mValue) ? '' + mValue : '';
|
||||||
};
|
};
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @param {*} mValue
|
||||||
|
* @return {boolean}
|
||||||
|
*/
|
||||||
|
Utils.pBool = function (mValue)
|
||||||
|
{
|
||||||
|
return !!mValue;
|
||||||
|
};
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @param {string} sComponent
|
* @param {string} sComponent
|
||||||
* @return {string}
|
* @return {string}
|
||||||
|
|
|
||||||
123
dev/Helper/Message.js
Normal file
123
dev/Helper/Message.js
Normal file
|
|
@ -0,0 +1,123 @@
|
||||||
|
|
||||||
|
(function () {
|
||||||
|
|
||||||
|
'use strict';
|
||||||
|
|
||||||
|
var
|
||||||
|
Utils = require('Common/Utils'),
|
||||||
|
|
||||||
|
EmailModel = require('Model/Email')
|
||||||
|
;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @constructor
|
||||||
|
*/
|
||||||
|
function MessageHelper() {}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @param {Array.<EmailModel>} aEmail
|
||||||
|
* @param {boolean=} bFriendlyView
|
||||||
|
* @param {boolean=} bWrapWithLink = false
|
||||||
|
* @return {string}
|
||||||
|
*/
|
||||||
|
MessageHelper.prototype.emailArrayToString = function (aEmail, bFriendlyView, bWrapWithLink)
|
||||||
|
{
|
||||||
|
var
|
||||||
|
aResult = [],
|
||||||
|
iIndex = 0,
|
||||||
|
iLen = 0
|
||||||
|
;
|
||||||
|
|
||||||
|
if (Utils.isNonEmptyArray(aEmail))
|
||||||
|
{
|
||||||
|
for (iIndex = 0, iLen = aEmail.length; iIndex < iLen; iIndex++)
|
||||||
|
{
|
||||||
|
aResult.push(aEmail[iIndex].toLine(bFriendlyView, bWrapWithLink));
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
return aResult.join(', ');
|
||||||
|
};
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @param {Array.<EmailModel>} aEmails
|
||||||
|
* @return {string}
|
||||||
|
*/
|
||||||
|
MessageHelper.prototype.emailArrayToStringClear = function (aEmails)
|
||||||
|
{
|
||||||
|
var
|
||||||
|
aResult = [],
|
||||||
|
iIndex = 0,
|
||||||
|
iLen = 0
|
||||||
|
;
|
||||||
|
|
||||||
|
if (Utils.isNonEmptyArray(aEmails))
|
||||||
|
{
|
||||||
|
for (iIndex = 0, iLen = aEmails.length; iIndex < iLen; iIndex++)
|
||||||
|
{
|
||||||
|
if (aEmails[iIndex] && aEmails[iIndex].email && '' !== aEmails[iIndex].name)
|
||||||
|
{
|
||||||
|
aResult.push(aEmails[iIndex].email);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
return aResult.join(', ');
|
||||||
|
};
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @param {?Array} aJson
|
||||||
|
* @return {Array.<EmailModel>}
|
||||||
|
*/
|
||||||
|
MessageHelper.prototype.emailArrayFromJson = function (aJson)
|
||||||
|
{
|
||||||
|
var
|
||||||
|
iIndex = 0,
|
||||||
|
iLen = 0,
|
||||||
|
oEmailModel = null,
|
||||||
|
aResult = []
|
||||||
|
;
|
||||||
|
|
||||||
|
if (Utils.isNonEmptyArray(aJson))
|
||||||
|
{
|
||||||
|
for (iIndex = 0, iLen = aJson.length; iIndex < iLen; iIndex++)
|
||||||
|
{
|
||||||
|
oEmailModel = EmailModel.newInstanceFromJson(aJson[iIndex]);
|
||||||
|
if (oEmailModel)
|
||||||
|
{
|
||||||
|
aResult.push(oEmailModel);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
return aResult;
|
||||||
|
};
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @param {Array.<EmailModel>} aInputEmails
|
||||||
|
* @param {Object} oUnic
|
||||||
|
* @param {Array} aLocalEmails
|
||||||
|
*/
|
||||||
|
MessageHelper.prototype.replyHelper = function (aInputEmails, oUnic, aLocalEmails)
|
||||||
|
{
|
||||||
|
if (aInputEmails && 0 < aInputEmails.length)
|
||||||
|
{
|
||||||
|
var
|
||||||
|
iIndex = 0,
|
||||||
|
iLen = aInputEmails.length
|
||||||
|
;
|
||||||
|
|
||||||
|
for (; iIndex < iLen; iIndex++)
|
||||||
|
{
|
||||||
|
if (Utils.isUnd(oUnic[aInputEmails[iIndex].email]))
|
||||||
|
{
|
||||||
|
oUnic[aInputEmails[iIndex].email] = true;
|
||||||
|
aLocalEmails.push(aInputEmails[iIndex]);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
};
|
||||||
|
|
||||||
|
module.exports = new MessageHelper();
|
||||||
|
|
||||||
|
}());
|
||||||
|
|
@ -16,9 +16,10 @@
|
||||||
|
|
||||||
PgpStore = require('Stores/User/Pgp'),
|
PgpStore = require('Stores/User/Pgp'),
|
||||||
|
|
||||||
EmailModel = require('Model/Email'),
|
|
||||||
AttachmentModel = require('Model/Attachment'),
|
AttachmentModel = require('Model/Attachment'),
|
||||||
|
|
||||||
|
MessageHelper = require('Helper/Message'),
|
||||||
|
|
||||||
AbstractModel = require('Knoin/AbstractModel')
|
AbstractModel = require('Knoin/AbstractModel')
|
||||||
;
|
;
|
||||||
|
|
||||||
|
|
@ -148,114 +149,6 @@
|
||||||
return oMessageModel.initByJson(oJsonMessage) ? oMessageModel : null;
|
return oMessageModel.initByJson(oJsonMessage) ? oMessageModel : null;
|
||||||
};
|
};
|
||||||
|
|
||||||
/**
|
|
||||||
* @static
|
|
||||||
* @param {Array} aEmail
|
|
||||||
* @param {boolean=} bFriendlyView
|
|
||||||
* @param {boolean=} bWrapWithLink = false
|
|
||||||
* @return {string}
|
|
||||||
*/
|
|
||||||
MessageModel.emailsToLine = function (aEmail, bFriendlyView, bWrapWithLink)
|
|
||||||
{
|
|
||||||
var
|
|
||||||
aResult = [],
|
|
||||||
iIndex = 0,
|
|
||||||
iLen = 0
|
|
||||||
;
|
|
||||||
|
|
||||||
if (Utils.isNonEmptyArray(aEmail))
|
|
||||||
{
|
|
||||||
for (iIndex = 0, iLen = aEmail.length; iIndex < iLen; iIndex++)
|
|
||||||
{
|
|
||||||
aResult.push(aEmail[iIndex].toLine(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.<EmailModel>}
|
|
||||||
*/
|
|
||||||
MessageModel.initEmailsFromJson = function (aJsonEmails)
|
|
||||||
{
|
|
||||||
var
|
|
||||||
iIndex = 0,
|
|
||||||
iLen = 0,
|
|
||||||
oEmailModel = null,
|
|
||||||
aResult = []
|
|
||||||
;
|
|
||||||
|
|
||||||
if (Utils.isNonEmptyArray(aJsonEmails))
|
|
||||||
{
|
|
||||||
for (iIndex = 0, iLen = aJsonEmails.length; iIndex < iLen; iIndex++)
|
|
||||||
{
|
|
||||||
oEmailModel = EmailModel.newInstanceFromJson(aJsonEmails[iIndex]);
|
|
||||||
if (oEmailModel)
|
|
||||||
{
|
|
||||||
aResult.push(oEmailModel);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
return aResult;
|
|
||||||
};
|
|
||||||
|
|
||||||
/**
|
|
||||||
* @static
|
|
||||||
* @param {Array.<EmailModel>} aMessageEmails
|
|
||||||
* @param {Object} oLocalUnic
|
|
||||||
* @param {Array} aLocalEmails
|
|
||||||
*/
|
|
||||||
MessageModel.replyHelper = function (aMessageEmails, oLocalUnic, aLocalEmails)
|
|
||||||
{
|
|
||||||
if (aMessageEmails && 0 < aMessageEmails.length)
|
|
||||||
{
|
|
||||||
var
|
|
||||||
iIndex = 0,
|
|
||||||
iLen = aMessageEmails.length
|
|
||||||
;
|
|
||||||
|
|
||||||
for (; iIndex < iLen; iIndex++)
|
|
||||||
{
|
|
||||||
if (Utils.isUnd(oLocalUnic[aMessageEmails[iIndex].email]))
|
|
||||||
{
|
|
||||||
oLocalUnic[aMessageEmails[iIndex].email] = true;
|
|
||||||
aLocalEmails.push(aMessageEmails[iIndex]);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
};
|
|
||||||
|
|
||||||
MessageModel.prototype.clear = function ()
|
MessageModel.prototype.clear = function ()
|
||||||
{
|
{
|
||||||
this.folderFullNameRaw = '';
|
this.folderFullNameRaw = '';
|
||||||
|
|
@ -373,12 +266,12 @@
|
||||||
|
|
||||||
this.size(Utils.pInt(oJsonMessage.Size));
|
this.size(Utils.pInt(oJsonMessage.Size));
|
||||||
|
|
||||||
this.from = MessageModel.initEmailsFromJson(oJsonMessage.From);
|
this.from = MessageHelper.emailArrayFromJson(oJsonMessage.From);
|
||||||
this.to = MessageModel.initEmailsFromJson(oJsonMessage.To);
|
this.to = MessageHelper.emailArrayFromJson(oJsonMessage.To);
|
||||||
this.cc = MessageModel.initEmailsFromJson(oJsonMessage.Cc);
|
this.cc = MessageHelper.emailArrayFromJson(oJsonMessage.Cc);
|
||||||
this.bcc = MessageModel.initEmailsFromJson(oJsonMessage.Bcc);
|
this.bcc = MessageHelper.emailArrayFromJson(oJsonMessage.Bcc);
|
||||||
this.replyTo = MessageModel.initEmailsFromJson(oJsonMessage.ReplyTo);
|
this.replyTo = MessageHelper.emailArrayFromJson(oJsonMessage.ReplyTo);
|
||||||
this.deliveredTo = MessageModel.initEmailsFromJson(oJsonMessage.DeliveredTo);
|
this.deliveredTo = MessageHelper.emailArrayFromJson(oJsonMessage.DeliveredTo);
|
||||||
|
|
||||||
this.subject(oJsonMessage.Subject);
|
this.subject(oJsonMessage.Subject);
|
||||||
if (Utils.isArray(oJsonMessage.SubjectParts))
|
if (Utils.isArray(oJsonMessage.SubjectParts))
|
||||||
|
|
@ -396,10 +289,10 @@
|
||||||
this.hasAttachments(!!oJsonMessage.HasAttachments);
|
this.hasAttachments(!!oJsonMessage.HasAttachments);
|
||||||
this.attachmentsMainType(oJsonMessage.AttachmentsMainType);
|
this.attachmentsMainType(oJsonMessage.AttachmentsMainType);
|
||||||
|
|
||||||
this.fromEmailString(MessageModel.emailsToLine(this.from, true));
|
this.fromEmailString(MessageHelper.emailArrayToString(this.from, true));
|
||||||
this.fromClearEmailString(MessageModel.emailsToLineClear(this.from));
|
this.fromClearEmailString(MessageHelper.emailArrayToStringClear(this.from));
|
||||||
this.toEmailsString(MessageModel.emailsToLine(this.to, true));
|
this.toEmailsString(MessageHelper.emailArrayToString(this.to, true));
|
||||||
this.toClearEmailsString(MessageModel.emailsToLineClear(this.to));
|
this.toClearEmailsString(MessageHelper.emailArrayToStringClear(this.to));
|
||||||
|
|
||||||
this.threads(Utils.isArray(oJsonMessage.Threads) ? oJsonMessage.Threads : []);
|
this.threads(Utils.isArray(oJsonMessage.Threads) ? oJsonMessage.Threads : []);
|
||||||
|
|
||||||
|
|
@ -524,7 +417,7 @@
|
||||||
*/
|
*/
|
||||||
MessageModel.prototype.fromToLine = function (bFriendlyView, bWrapWithLink)
|
MessageModel.prototype.fromToLine = function (bFriendlyView, bWrapWithLink)
|
||||||
{
|
{
|
||||||
return MessageModel.emailsToLine(this.from, bFriendlyView, bWrapWithLink);
|
return MessageHelper.emailArrayToString(this.from, bFriendlyView, bWrapWithLink);
|
||||||
};
|
};
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|
@ -549,7 +442,7 @@
|
||||||
*/
|
*/
|
||||||
MessageModel.prototype.toToLine = function (bFriendlyView, bWrapWithLink)
|
MessageModel.prototype.toToLine = function (bFriendlyView, bWrapWithLink)
|
||||||
{
|
{
|
||||||
return MessageModel.emailsToLine(this.to, bFriendlyView, bWrapWithLink);
|
return MessageHelper.emailArrayToString(this.to, bFriendlyView, bWrapWithLink);
|
||||||
};
|
};
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|
@ -559,7 +452,7 @@
|
||||||
*/
|
*/
|
||||||
MessageModel.prototype.ccToLine = function (bFriendlyView, bWrapWithLink)
|
MessageModel.prototype.ccToLine = function (bFriendlyView, bWrapWithLink)
|
||||||
{
|
{
|
||||||
return MessageModel.emailsToLine(this.cc, bFriendlyView, bWrapWithLink);
|
return MessageHelper.emailArrayToString(this.cc, bFriendlyView, bWrapWithLink);
|
||||||
};
|
};
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|
@ -569,7 +462,7 @@
|
||||||
*/
|
*/
|
||||||
MessageModel.prototype.bccToLine = function (bFriendlyView, bWrapWithLink)
|
MessageModel.prototype.bccToLine = function (bFriendlyView, bWrapWithLink)
|
||||||
{
|
{
|
||||||
return MessageModel.emailsToLine(this.bcc, bFriendlyView, bWrapWithLink);
|
return MessageHelper.emailArrayToString(this.bcc, bFriendlyView, bWrapWithLink);
|
||||||
};
|
};
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|
@ -579,7 +472,7 @@
|
||||||
*/
|
*/
|
||||||
MessageModel.prototype.replyToToLine = function (bFriendlyView, bWrapWithLink)
|
MessageModel.prototype.replyToToLine = function (bFriendlyView, bWrapWithLink)
|
||||||
{
|
{
|
||||||
return MessageModel.emailsToLine(this.replyTo, bFriendlyView, bWrapWithLink);
|
return MessageHelper.emailArrayToString(this.replyTo, bFriendlyView, bWrapWithLink);
|
||||||
};
|
};
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|
@ -778,10 +671,10 @@
|
||||||
oUnic = Utils.isUnd(oExcludeEmails) ? {} : oExcludeEmails
|
oUnic = Utils.isUnd(oExcludeEmails) ? {} : oExcludeEmails
|
||||||
;
|
;
|
||||||
|
|
||||||
MessageModel.replyHelper(this.replyTo, oUnic, aResult);
|
MessageHelper.replyHelper(this.replyTo, oUnic, aResult);
|
||||||
if (0 === aResult.length)
|
if (0 === aResult.length)
|
||||||
{
|
{
|
||||||
MessageModel.replyHelper(this.from, oUnic, aResult);
|
MessageHelper.replyHelper(this.from, oUnic, aResult);
|
||||||
}
|
}
|
||||||
|
|
||||||
return aResult;
|
return aResult;
|
||||||
|
|
@ -799,14 +692,14 @@
|
||||||
oUnic = Utils.isUnd(oExcludeEmails) ? {} : oExcludeEmails
|
oUnic = Utils.isUnd(oExcludeEmails) ? {} : oExcludeEmails
|
||||||
;
|
;
|
||||||
|
|
||||||
MessageModel.replyHelper(this.replyTo, oUnic, aToResult);
|
MessageHelper.replyHelper(this.replyTo, oUnic, aToResult);
|
||||||
if (0 === aToResult.length)
|
if (0 === aToResult.length)
|
||||||
{
|
{
|
||||||
MessageModel.replyHelper(this.from, oUnic, aToResult);
|
MessageHelper.replyHelper(this.from, oUnic, aToResult);
|
||||||
}
|
}
|
||||||
|
|
||||||
MessageModel.replyHelper(this.to, oUnic, aToResult);
|
MessageHelper.replyHelper(this.to, oUnic, aToResult);
|
||||||
MessageModel.replyHelper(this.cc, oUnic, aCcResult);
|
MessageHelper.replyHelper(this.cc, oUnic, aCcResult);
|
||||||
|
|
||||||
return [aToResult, aCcResult];
|
return [aToResult, aCcResult];
|
||||||
};
|
};
|
||||||
|
|
|
||||||
63
dev/Model/MessageDynamic.js
Normal file
63
dev/Model/MessageDynamic.js
Normal file
|
|
@ -0,0 +1,63 @@
|
||||||
|
|
||||||
|
(function () {
|
||||||
|
|
||||||
|
'use strict';
|
||||||
|
|
||||||
|
var
|
||||||
|
_ = require('_'),
|
||||||
|
ko = require('ko'),
|
||||||
|
|
||||||
|
Enums = require('Common/Enums'),
|
||||||
|
Utils = require('Common/Utils'),
|
||||||
|
|
||||||
|
MessageHelper = require('Helper/Message'),
|
||||||
|
|
||||||
|
MessageSimpleModel = require('Model/MessageSimple')
|
||||||
|
;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @constructor
|
||||||
|
*/
|
||||||
|
function MessageDynamicModel()
|
||||||
|
{
|
||||||
|
MessageSimpleModel.call(this, 'MessageDynamicModel');
|
||||||
|
|
||||||
|
this.flags = {};
|
||||||
|
this.states = {};
|
||||||
|
|
||||||
|
this.flags.unseen = ko.observable(false);
|
||||||
|
this.flags.deleted = ko.observable(false);
|
||||||
|
this.flags.flagged = ko.observable(false);
|
||||||
|
this.flags.answered = ko.observable(false);
|
||||||
|
this.flags.forwarded = ko.observable(false);
|
||||||
|
|
||||||
|
this.states.checked = ko.observable(false);
|
||||||
|
this.states.deleted = ko.observable(false);
|
||||||
|
this.states.selected = ko.observable(false);
|
||||||
|
this.states.focused = ko.observable(false);
|
||||||
|
|
||||||
|
this.states.showReadReceipt = ko.observable(false);
|
||||||
|
this.states.showExternalImages = ko.observable(false);
|
||||||
|
|
||||||
|
this.states.hasUnseenSubMessage = ko.observable(false);
|
||||||
|
this.states.hasFlaggedSubMessage = ko.observable(false);
|
||||||
|
|
||||||
|
this.threads = ko.observableArray([]);
|
||||||
|
}
|
||||||
|
|
||||||
|
_.extend(MessageDynamicModel.prototype, MessageSimpleModel.prototype);
|
||||||
|
|
||||||
|
MessageDynamicModel.prototype.clear = function ()
|
||||||
|
{
|
||||||
|
this.flags.unseen(false);
|
||||||
|
this.flags.deleted(false);
|
||||||
|
this.flags.flagged(false);
|
||||||
|
this.flags.answered(false);
|
||||||
|
this.flags.forwarded(false);
|
||||||
|
|
||||||
|
this.threads([]);
|
||||||
|
};
|
||||||
|
|
||||||
|
module.exports = MessageDynamicModel;
|
||||||
|
|
||||||
|
}());
|
||||||
119
dev/Model/MessageFull.js
Normal file
119
dev/Model/MessageFull.js
Normal file
|
|
@ -0,0 +1,119 @@
|
||||||
|
|
||||||
|
(function () {
|
||||||
|
|
||||||
|
'use strict';
|
||||||
|
|
||||||
|
var
|
||||||
|
_ = require('_'),
|
||||||
|
|
||||||
|
Enums = require('Common/Enums'),
|
||||||
|
Utils = require('Common/Utils'),
|
||||||
|
|
||||||
|
// MessageHelper = require('Helper/Message'),
|
||||||
|
|
||||||
|
MessageSimpleModel = require('Model/MessageSimple')
|
||||||
|
;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @constructor
|
||||||
|
*/
|
||||||
|
function MessageFullModel()
|
||||||
|
{
|
||||||
|
MessageSimpleModel.call(this, 'MessageFullModel');
|
||||||
|
}
|
||||||
|
|
||||||
|
_.extend(MessageFullModel.prototype, MessageSimpleModel.prototype);
|
||||||
|
|
||||||
|
MessageFullModel.prototype.priority = 0;
|
||||||
|
MessageFullModel.prototype.hash = '';
|
||||||
|
MessageFullModel.prototype.requestHash = '';
|
||||||
|
MessageFullModel.prototype.proxy = false;
|
||||||
|
MessageFullModel.prototype.hasAttachments = false;
|
||||||
|
MessageFullModel.prototype.attachmentsMainType = '';
|
||||||
|
MessageFullModel.prototype.attachmentsClass = '';
|
||||||
|
|
||||||
|
MessageFullModel.prototype.clear = function ()
|
||||||
|
{
|
||||||
|
MessageSimpleModel.prototype.clear.call(this);
|
||||||
|
|
||||||
|
this.priority = 0;
|
||||||
|
this.hash = '';
|
||||||
|
this.requestHash = '';
|
||||||
|
|
||||||
|
this.proxy = false;
|
||||||
|
|
||||||
|
this.hasAttachments = false;
|
||||||
|
this.attachmentsMainType = '';
|
||||||
|
this.attachmentsClass = '';
|
||||||
|
};
|
||||||
|
|
||||||
|
MessageFullModel.prototype.getAttachmentsClass = function ()
|
||||||
|
{
|
||||||
|
var sClass = '';
|
||||||
|
if (this.hasAttachments)
|
||||||
|
{
|
||||||
|
sClass = 'icon-attachment';
|
||||||
|
switch (this.attachmentsMainType)
|
||||||
|
{
|
||||||
|
case 'image':
|
||||||
|
sClass = 'icon-image';
|
||||||
|
break;
|
||||||
|
case 'archive':
|
||||||
|
sClass = 'icon-file-zip';
|
||||||
|
break;
|
||||||
|
case 'doc':
|
||||||
|
sClass = 'icon-file-text';
|
||||||
|
break;
|
||||||
|
case 'certificate':
|
||||||
|
sClass = 'icon-file-certificate';
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
return sClass;
|
||||||
|
};
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @param {AjaxJsonMessage} oJson
|
||||||
|
* @return {boolean}
|
||||||
|
*/
|
||||||
|
MessageFullModel.prototype.initByJson = function (oJson)
|
||||||
|
{
|
||||||
|
var bResult = false;
|
||||||
|
|
||||||
|
if (oJson && 'Object/Message' === oJson['@Object'] &&
|
||||||
|
MessageSimpleModel.prototype.initByJson.call(this, oJson))
|
||||||
|
{
|
||||||
|
this.priority = Utils.pInt(oJson.Priority);
|
||||||
|
this.priority = Utils.inArray(this.priority, [Enums.MessagePriority.High, Enums.MessagePriority.Low]) ?
|
||||||
|
this.priority : Enums.MessagePriority.Normal;
|
||||||
|
|
||||||
|
this.hash = Utils.pString(oJson.Hash);
|
||||||
|
this.requestHash = Utils.pString(oJson.RequestHash);
|
||||||
|
|
||||||
|
this.proxy = !!oJson.ExternalProxy;
|
||||||
|
|
||||||
|
this.hasAttachments = !!oJson.HasAttachments;
|
||||||
|
this.attachmentsMainType = Utils.pString(oJson.AttachmentsMainType);
|
||||||
|
this.attachmentsClass = this.getAttachmentsClass();
|
||||||
|
|
||||||
|
bResult = true;
|
||||||
|
}
|
||||||
|
|
||||||
|
return bResult;
|
||||||
|
};
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @static
|
||||||
|
* @param {AjaxJsonMessage} oJson
|
||||||
|
* @return {?MessageFullModel}
|
||||||
|
*/
|
||||||
|
MessageFullModel.newInstanceFromJson = function (oJson)
|
||||||
|
{
|
||||||
|
var oItem = oJson ? new MessageFullModel() : null;
|
||||||
|
return oItem && oItem.initByJson(oJson) ? oItem : null;
|
||||||
|
};
|
||||||
|
|
||||||
|
module.exports = MessageFullModel;
|
||||||
|
|
||||||
|
}());
|
||||||
|
|
@ -8,67 +8,109 @@
|
||||||
|
|
||||||
Utils = require('Common/Utils'),
|
Utils = require('Common/Utils'),
|
||||||
|
|
||||||
MessageModel = require('Model/Message'),
|
MessageHelper = require('Helper/Message'),
|
||||||
|
|
||||||
AbstractModel = require('Knoin/AbstractModel')
|
AbstractModel = require('Knoin/AbstractModel')
|
||||||
;
|
;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
* @param {string=} sSuperName
|
||||||
* @constructor
|
* @constructor
|
||||||
*/
|
*/
|
||||||
function MessageSimpleModel()
|
function MessageSimpleModel(sSuperName)
|
||||||
{
|
{
|
||||||
AbstractModel.call(this, 'MessageSimpleModel');
|
AbstractModel.call(this, sSuperName || 'MessageSimpleModel');
|
||||||
|
|
||||||
this.clear();
|
|
||||||
}
|
}
|
||||||
|
|
||||||
_.extend(MessageSimpleModel.prototype, AbstractModel.prototype);
|
_.extend(MessageSimpleModel.prototype, AbstractModel.prototype);
|
||||||
|
|
||||||
MessageSimpleModel.prototype.selected = false;
|
MessageSimpleModel.prototype.folder = '';
|
||||||
MessageSimpleModel.prototype.folderFullNameRaw = '';
|
|
||||||
MessageSimpleModel.prototype.uid = '';
|
MessageSimpleModel.prototype.uid = '';
|
||||||
MessageSimpleModel.prototype.size = 0;
|
|
||||||
MessageSimpleModel.prototype.sender = '';
|
|
||||||
MessageSimpleModel.prototype.subject = '';
|
MessageSimpleModel.prototype.subject = '';
|
||||||
MessageSimpleModel.prototype.dateInUTC = 0;
|
|
||||||
|
MessageSimpleModel.prototype.to = [];
|
||||||
|
MessageSimpleModel.prototype.from = [];
|
||||||
|
MessageSimpleModel.prototype.cc = [];
|
||||||
|
MessageSimpleModel.prototype.bcc = [];
|
||||||
|
MessageSimpleModel.prototype.replyTo = [];
|
||||||
|
MessageSimpleModel.prototype.deliveredTo = [];
|
||||||
|
|
||||||
|
MessageSimpleModel.prototype.fromAsString = '';
|
||||||
|
MessageSimpleModel.prototype.fromAsStringClear = '';
|
||||||
|
MessageSimpleModel.prototype.toAsString = '';
|
||||||
|
MessageSimpleModel.prototype.toAsStringClear = '';
|
||||||
|
MessageSimpleModel.prototype.senderAsString = '';
|
||||||
|
MessageSimpleModel.prototype.senderAsStringClear = '';
|
||||||
|
|
||||||
|
MessageSimpleModel.prototype.size = 0;
|
||||||
|
MessageSimpleModel.prototype.timestamp = 0;
|
||||||
|
|
||||||
MessageSimpleModel.prototype.clear = function ()
|
MessageSimpleModel.prototype.clear = function ()
|
||||||
{
|
{
|
||||||
this.selected = false;
|
this.folder = '';
|
||||||
|
|
||||||
this.folderFullNameRaw = '';
|
|
||||||
this.uid = '';
|
this.uid = '';
|
||||||
this.size = 0;
|
|
||||||
|
|
||||||
this.sender = '';
|
|
||||||
this.subject = '';
|
this.subject = '';
|
||||||
|
|
||||||
this.dateInUTC = 0;
|
this.to = [];
|
||||||
|
this.from = [];
|
||||||
|
this.cc = [];
|
||||||
|
this.bcc = [];
|
||||||
|
this.replyTo = [];
|
||||||
|
this.deliveredTo = [];
|
||||||
|
|
||||||
|
this.fromAsString = '';
|
||||||
|
this.fromAsStringClear = '';
|
||||||
|
this.toAsString = '';
|
||||||
|
this.toAsStringClear = '';
|
||||||
|
this.senderAsString = '';
|
||||||
|
this.senderAsStringClear = '';
|
||||||
|
|
||||||
|
this.size = 0;
|
||||||
|
this.timestamp = 0;
|
||||||
};
|
};
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @param {AjaxJsonMessage} oJsonMessage
|
* @param {AjaxJsonMessage} oJson
|
||||||
* @return {boolean}
|
* @return {boolean}
|
||||||
*/
|
*/
|
||||||
MessageSimpleModel.prototype.initByJson = function (oJsonMessage)
|
MessageSimpleModel.prototype.initByJson = function (oJson)
|
||||||
{
|
{
|
||||||
var bResult = false;
|
var bResult = false;
|
||||||
|
|
||||||
if (oJsonMessage && 'Object/Message' === oJsonMessage['@Object'])
|
if (oJson && 'Object/Message' === oJson['@Object'])
|
||||||
{
|
{
|
||||||
this.selected = false;
|
this.folder = Utils.pString(oJson.Folder);
|
||||||
|
this.uid = Utils.pString(oJson.Uid);
|
||||||
|
|
||||||
this.folderFullNameRaw = oJsonMessage.Folder;
|
this.subject = Utils.pString(oJson.Subject);
|
||||||
this.uid = oJsonMessage.Uid;
|
|
||||||
this.size = Utils.pInt(oJsonMessage.Size);
|
|
||||||
|
|
||||||
this.sender = MessageModel.emailsToLine(
|
this.subjectPrefix = '';
|
||||||
MessageModel.initEmailsFromJson(oJsonMessage.From), true);
|
this.subjectSuffix = this.subject;
|
||||||
|
|
||||||
this.subject = oJsonMessage.Subject;
|
if (Utils.isArray(oJson.SubjectParts))
|
||||||
|
{
|
||||||
|
this.subjectPrefix = Utils.pString(oJson.SubjectParts[0]);
|
||||||
|
this.subjectSuffix = Utils.pString(oJson.SubjectParts[1]);
|
||||||
|
}
|
||||||
|
|
||||||
this.dateInUTC = Utils.pInt(oJsonMessage.DateTimeStampInUTC);
|
this.from = MessageHelper.emailArrayFromJson(oJson.From);
|
||||||
|
this.to = MessageHelper.emailArrayFromJson(oJson.To);
|
||||||
|
this.cc = MessageHelper.emailArrayFromJson(oJson.Cc);
|
||||||
|
this.bcc = MessageHelper.emailArrayFromJson(oJson.Bcc);
|
||||||
|
this.replyTo = MessageHelper.emailArrayFromJson(oJson.ReplyTo);
|
||||||
|
this.deliveredTo = MessageHelper.emailArrayFromJson(oJson.DeliveredTo);
|
||||||
|
|
||||||
|
this.size = Utils.pInt(oJson.Size);
|
||||||
|
this.timestamp = Utils.pInt(oJson.DateTimeStampInUTC);
|
||||||
|
|
||||||
|
this.fromAsString = MessageHelper.emailArrayToString(this.from, true);
|
||||||
|
this.fromAsStringClear = MessageHelper.emailArrayToStringClear(this.from);
|
||||||
|
|
||||||
|
this.toAsString = MessageHelper.emailArrayToString(this.to, true);
|
||||||
|
this.toAsStringClear = MessageHelper.emailArrayToStringClear(this.to);
|
||||||
|
|
||||||
|
this.populateSenderEmail();
|
||||||
|
|
||||||
bResult = true;
|
bResult = true;
|
||||||
}
|
}
|
||||||
|
|
@ -76,15 +118,27 @@
|
||||||
return bResult;
|
return bResult;
|
||||||
};
|
};
|
||||||
|
|
||||||
|
MessageSimpleModel.prototype.populateSenderEmail = function (bDraftOrSentFolder)
|
||||||
|
{
|
||||||
|
this.senderAsString = this.fromAsString;
|
||||||
|
this.senderAsStringClear = this.fromAsStringClear;
|
||||||
|
|
||||||
|
if (bDraftOrSentFolder)
|
||||||
|
{
|
||||||
|
this.senderAsString = this.toAsString;
|
||||||
|
this.senderAsStringClear = this.toAsStringClear;
|
||||||
|
}
|
||||||
|
};
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @static
|
* @static
|
||||||
* @param {AjaxJsonMessage} oJsonMessage
|
* @param {AjaxJsonMessage} oJson
|
||||||
* @return {?MessageSimpleModel}
|
* @return {?MessageSimpleModel}
|
||||||
*/
|
*/
|
||||||
MessageSimpleModel.newInstanceFromJson = function (oJsonMessage)
|
MessageSimpleModel.newInstanceFromJson = function (oJson)
|
||||||
{
|
{
|
||||||
var oMessageModel = new MessageSimpleModel();
|
var oItem = oJson ? new MessageSimpleModel() : null;
|
||||||
return oMessageModel.initByJson(oJsonMessage) ? oMessageModel : null;
|
return oItem && oItem.initByJson(oJson) ? oItem : null;
|
||||||
};
|
};
|
||||||
|
|
||||||
module.exports = MessageSimpleModel;
|
module.exports = MessageSimpleModel;
|
||||||
|
|
|
||||||
|
|
@ -26,7 +26,8 @@
|
||||||
|
|
||||||
Remote = require('Remote/User/Ajax'),
|
Remote = require('Remote/User/Ajax'),
|
||||||
|
|
||||||
MessageModel = require('Model/Message')
|
MessageModel = require('Model/Message'),
|
||||||
|
MessageHelper = require('Helper/Message')
|
||||||
;
|
;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|
@ -299,7 +300,8 @@
|
||||||
{
|
{
|
||||||
NotificationStore.displayDesktopNotification(
|
NotificationStore.displayDesktopNotification(
|
||||||
Links.notificationMailIcon(),
|
Links.notificationMailIcon(),
|
||||||
MessageModel.emailsToLine(MessageModel.initEmailsFromJson(aNewMessages[iIndex].From), false),
|
MessageHelper.emailArrayToString(
|
||||||
|
MessageHelper.emailArrayFromJson(aNewMessages[iIndex].From), false),
|
||||||
aNewMessages[iIndex].Subject
|
aNewMessages[iIndex].Subject
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -716,7 +716,7 @@
|
||||||
})
|
})
|
||||||
.on('click', '.thread-list .thread-list-message', function () {
|
.on('click', '.thread-list .thread-list-message', function () {
|
||||||
var oMessage = ko.dataFor(this);
|
var oMessage = ko.dataFor(this);
|
||||||
if (oMessage && oMessage.folderFullNameRaw && oMessage.uid)
|
if (oMessage && oMessage.folder && oMessage.uid)
|
||||||
{
|
{
|
||||||
self.openThreadMessage(oMessage.uid);
|
self.openThreadMessage(oMessage.uid);
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -1245,6 +1245,17 @@ END;
|
||||||
\str_replace(array('"', '/', '\\', '*', '?', '<', '>', '|', ':'), ' ', $sValue));
|
\str_replace(array('"', '/', '\\', '*', '?', '<', '>', '|', ':'), ' ', $sValue));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @param string $sValue
|
||||||
|
*
|
||||||
|
* @return string
|
||||||
|
*/
|
||||||
|
public static function Trim($sValue)
|
||||||
|
{
|
||||||
|
return \trim(\preg_replace('/^[\x00-\x1F]+/u', '',
|
||||||
|
\preg_replace('/[\x00-\x1F]+$/u', '', \trim($sValue))));
|
||||||
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @param string $sDir
|
* @param string $sDir
|
||||||
*
|
*
|
||||||
|
|
|
||||||
|
|
@ -194,8 +194,8 @@ class ImapClient extends \MailSo\Net\NetClient
|
||||||
\MailSo\Log\Enumerations\Type::ERROR, true);
|
\MailSo\Log\Enumerations\Type::ERROR, true);
|
||||||
}
|
}
|
||||||
|
|
||||||
$sLogin = \trim($sLogin);
|
$sLogin = \MailSo\Base\Utils::IdnToAscii(\MailSo\Base\Utils::Trim($sLogin));
|
||||||
$sLogin = \MailSo\Base\Utils::IdnToAscii($sLogin);
|
|
||||||
$sPassword = $sPassword;
|
$sPassword = $sPassword;
|
||||||
|
|
||||||
$this->sLogginedUser = $sLogin;
|
$this->sLogginedUser = $sLogin;
|
||||||
|
|
@ -326,7 +326,7 @@ class ImapClient extends \MailSo\Net\NetClient
|
||||||
|
|
||||||
try
|
try
|
||||||
{
|
{
|
||||||
$this->SendRequestWithCheck('AUTHENTICATE', array('XOAUTH2', trim($sXOAuth2Token)));
|
$this->SendRequestWithCheck('AUTHENTICATE', array('XOAUTH2', \trim($sXOAuth2Token)));
|
||||||
}
|
}
|
||||||
catch (\MailSo\Imap\Exceptions\NegativeResponseException $oException)
|
catch (\MailSo\Imap\Exceptions\NegativeResponseException $oException)
|
||||||
{
|
{
|
||||||
|
|
|
||||||
|
|
@ -58,9 +58,11 @@ class Email
|
||||||
throw new \MailSo\Base\Exceptions\InvalidArgumentException();
|
throw new \MailSo\Base\Exceptions\InvalidArgumentException();
|
||||||
}
|
}
|
||||||
|
|
||||||
$this->sEmail = \MailSo\Base\Utils::IdnToAscii(\trim($sEmail), true);
|
$this->sEmail = \MailSo\Base\Utils::IdnToAscii(
|
||||||
$this->sDisplayName = \trim($sDisplayName);
|
\MailSo\Base\Utils::Trim($sEmail), true);
|
||||||
$this->sRemark = \trim($sRemark);
|
|
||||||
|
$this->sDisplayName = \MailSo\Base\Utils::Trim($sDisplayName);
|
||||||
|
$this->sRemark = \MailSo\Base\Utils::Trim($sRemark);
|
||||||
|
|
||||||
$this->sDkimStatus = \MailSo\Mime\Enumerations\DkimStatus::NONE;
|
$this->sDkimStatus = \MailSo\Mime\Enumerations\DkimStatus::NONE;
|
||||||
$this->sDkimValue = '';
|
$this->sDkimValue = '';
|
||||||
|
|
@ -88,6 +90,7 @@ class Email
|
||||||
*/
|
*/
|
||||||
public static function Parse($sEmailAddress)
|
public static function Parse($sEmailAddress)
|
||||||
{
|
{
|
||||||
|
$sEmailAddress = \MailSo\Base\Utils::Trim($sEmailAddress);
|
||||||
if (!\MailSo\Base\Validator::NotEmptyString($sEmailAddress, true))
|
if (!\MailSo\Base\Validator::NotEmptyString($sEmailAddress, true))
|
||||||
{
|
{
|
||||||
throw new \MailSo\Base\Exceptions\InvalidArgumentException();
|
throw new \MailSo\Base\Exceptions\InvalidArgumentException();
|
||||||
|
|
|
||||||
|
|
@ -26,6 +26,7 @@ class EmailCollection extends \MailSo\Base\Collection
|
||||||
{
|
{
|
||||||
parent::__construct();
|
parent::__construct();
|
||||||
|
|
||||||
|
$sEmailAddresses = \MailSo\Base\Utils::Trim($sEmailAddresses);
|
||||||
if (0 < \strlen($sEmailAddresses))
|
if (0 < \strlen($sEmailAddresses))
|
||||||
{
|
{
|
||||||
$this->parseEmailAddresses($sEmailAddresses);
|
$this->parseEmailAddresses($sEmailAddresses);
|
||||||
|
|
|
||||||
|
|
@ -186,7 +186,7 @@ class SmtpClient extends \MailSo\Net\NetClient
|
||||||
*/
|
*/
|
||||||
public function Login($sLogin, $sPassword)
|
public function Login($sLogin, $sPassword)
|
||||||
{
|
{
|
||||||
$sLogin = \MailSo\Base\Utils::IdnToAscii($sLogin);
|
$sLogin = \MailSo\Base\Utils::IdnToAscii(\MailSo\Base\Utils::Trim($sLogin));
|
||||||
|
|
||||||
if ($this->IsAuthSupported('LOGIN'))
|
if ($this->IsAuthSupported('LOGIN'))
|
||||||
{
|
{
|
||||||
|
|
@ -283,7 +283,7 @@ class SmtpClient extends \MailSo\Net\NetClient
|
||||||
{
|
{
|
||||||
try
|
try
|
||||||
{
|
{
|
||||||
$this->sendRequestWithCheck('AUTH', 235, 'XOAUTH2 '.trim($sXOAuth2Token));
|
$this->sendRequestWithCheck('AUTH', 235, 'XOAUTH2 '.\trim($sXOAuth2Token));
|
||||||
}
|
}
|
||||||
catch (\MailSo\Smtp\Exceptions\NegativeResponseException $oException)
|
catch (\MailSo\Smtp\Exceptions\NegativeResponseException $oException)
|
||||||
{
|
{
|
||||||
|
|
@ -315,7 +315,9 @@ class SmtpClient extends \MailSo\Net\NetClient
|
||||||
*/
|
*/
|
||||||
public function MailFrom($sFrom, $sSizeIfSupported = '', $bDsn = false)
|
public function MailFrom($sFrom, $sSizeIfSupported = '', $bDsn = false)
|
||||||
{
|
{
|
||||||
$sFrom = \MailSo\Base\Utils::IdnToAscii($sFrom, true);
|
$sFrom = \MailSo\Base\Utils::IdnToAscii(
|
||||||
|
\MailSo\Base\Utils::Trim($sFrom), true);
|
||||||
|
|
||||||
$sCmd = 'FROM:<'.$sFrom.'>';
|
$sCmd = 'FROM:<'.$sFrom.'>';
|
||||||
|
|
||||||
$sSizeIfSupported = (string) $sSizeIfSupported;
|
$sSizeIfSupported = (string) $sSizeIfSupported;
|
||||||
|
|
@ -356,7 +358,9 @@ class SmtpClient extends \MailSo\Net\NetClient
|
||||||
\MailSo\Log\Enumerations\Type::ERROR, true);
|
\MailSo\Log\Enumerations\Type::ERROR, true);
|
||||||
}
|
}
|
||||||
|
|
||||||
$sTo = \MailSo\Base\Utils::IdnToAscii($sTo, true);
|
$sTo = \MailSo\Base\Utils::IdnToAscii(
|
||||||
|
\MailSo\Base\Utils::Trim($sTo), true);
|
||||||
|
|
||||||
$sCmd = 'TO:<'.$sTo.'>';
|
$sCmd = 'TO:<'.$sTo.'>';
|
||||||
|
|
||||||
if ($bDsn && $this->IsSupported('DSN'))
|
if ($bDsn && $this->IsSupported('DSN'))
|
||||||
|
|
@ -495,6 +499,9 @@ class SmtpClient extends \MailSo\Net\NetClient
|
||||||
*/
|
*/
|
||||||
public function Vrfy($sUser)
|
public function Vrfy($sUser)
|
||||||
{
|
{
|
||||||
|
$sUser = \MailSo\Base\Utils::IdnToAscii(
|
||||||
|
\MailSo\Base\Utils::Trim($sUser));
|
||||||
|
|
||||||
$this->sendRequestWithCheck('VRFY', array(250, 251, 252), $sUser);
|
$this->sendRequestWithCheck('VRFY', array(250, 251, 252), $sUser);
|
||||||
|
|
||||||
return $this;
|
return $this;
|
||||||
|
|
|
||||||
|
|
@ -385,12 +385,6 @@ class Actions
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
// $sSubQuerty = \trim(\trim($this->Http()->GetQuery('s', '')), ' /');
|
|
||||||
// $sSubSubQuerty = \trim(\trim($this->Http()->GetQuery('ss', '')), ' /');
|
|
||||||
//
|
|
||||||
// $sQuery .= 0 < \strlen($sSubQuerty) ? '/'.$sSubQuerty : '';
|
|
||||||
// $sQuery .= 0 < \strlen($sSubSubQuerty) ? '/'.$sSubSubQuerty : '';
|
|
||||||
|
|
||||||
if ('' === $this->GetSpecAuthToken())
|
if ('' === $this->GetSpecAuthToken())
|
||||||
{
|
{
|
||||||
$aPaths = \explode('/', $sQuery);
|
$aPaths = \explode('/', $sQuery);
|
||||||
|
|
@ -1632,7 +1626,7 @@ class Actions
|
||||||
$aResult['UserBackgroundHash'] = (string) $oSettings->GetConf('UserBackgroundHash', $aResult['UserBackgroundHash']);
|
$aResult['UserBackgroundHash'] = (string) $oSettings->GetConf('UserBackgroundHash', $aResult['UserBackgroundHash']);
|
||||||
// if (!empty($aResult['UserBackgroundName']) && !empty($aResult['UserBackgroundHash']))
|
// if (!empty($aResult['UserBackgroundName']) && !empty($aResult['UserBackgroundHash']))
|
||||||
// {
|
// {
|
||||||
// $aResult['IncludeBackground'] = './?/Raw/&s=/{{USER}}/UserBackground/&ss=/'.
|
// $aResult['IncludeBackground'] = './?/Raw/&q[]=/{{USER}}/UserBackground/&q[]=/'.
|
||||||
// $aResult['UserBackgroundHash'].'/';
|
// $aResult['UserBackgroundHash'].'/';
|
||||||
// }
|
// }
|
||||||
}
|
}
|
||||||
|
|
@ -1834,7 +1828,8 @@ class Actions
|
||||||
{
|
{
|
||||||
$this->Plugins()->RunHook('filter.login-credentials.step-1', array(&$sEmail, &$sPassword));
|
$this->Plugins()->RunHook('filter.login-credentials.step-1', array(&$sEmail, &$sPassword));
|
||||||
|
|
||||||
$sEmail = \MailSo\Base\Utils::StrToLowerIfAscii($sEmail);
|
$sEmail = \MailSo\Base\Utils::StrToLowerIfAscii(
|
||||||
|
\MailSo\Base\Utils::Trim($sEmail));
|
||||||
|
|
||||||
if (false === \strpos($sEmail, '@'))
|
if (false === \strpos($sEmail, '@'))
|
||||||
{
|
{
|
||||||
|
|
@ -2069,7 +2064,7 @@ class Actions
|
||||||
*/
|
*/
|
||||||
public function DoLogin()
|
public function DoLogin()
|
||||||
{
|
{
|
||||||
$sEmail = \trim($this->GetActionParam('Email', ''));
|
$sEmail = \MailSo\Base\Utils::Trim($this->GetActionParam('Email', ''));
|
||||||
$sPassword = $this->GetActionParam('Password', '');
|
$sPassword = $this->GetActionParam('Password', '');
|
||||||
$sLanguage = $this->GetActionParam('Language', '');
|
$sLanguage = $this->GetActionParam('Language', '');
|
||||||
$bSignMe = '1' === (string) $this->GetActionParam('SignMe', '0');
|
$bSignMe = '1' === (string) $this->GetActionParam('SignMe', '0');
|
||||||
|
|
@ -7707,8 +7702,8 @@ class Actions
|
||||||
\array_shift($aParams);
|
\array_shift($aParams);
|
||||||
$sLast = \array_pop($aParams);
|
$sLast = \array_pop($aParams);
|
||||||
|
|
||||||
$sUrl = $this->Http()->GetFullUrl().'?/Raw/&s=/'.implode('/', $aParams).'/&ss=/'.$sLast;
|
$sUrl = $this->Http()->GetFullUrl().'?/Raw/&q[]=/'.\implode('/', $aParams).'/&q[]=/'.$sLast;
|
||||||
$sFullUrl = 'https://docs.google.com/viewer?embedded=true&url='.urlencode($sUrl);
|
$sFullUrl = 'https://docs.google.com/viewer?embedded=true&url='.\urlencode($sUrl);
|
||||||
|
|
||||||
@\header('Content-Type: text/html; charset=utf-8');
|
@\header('Content-Type: text/html; charset=utf-8');
|
||||||
echo '<html style="height: 100%; width: 100%; margin: 0; padding: 0"><head></head>'.
|
echo '<html style="height: 100%; width: 100%; margin: 0; padding: 0"><head></head>'.
|
||||||
|
|
@ -8725,7 +8720,7 @@ class Actions
|
||||||
*/
|
*/
|
||||||
public function GetActionParam($sKey, $mDefault = null)
|
public function GetActionParam($sKey, $mDefault = null)
|
||||||
{
|
{
|
||||||
return is_array($this->aCurrentActionParams) && isset($this->aCurrentActionParams[$sKey]) ?
|
return \is_array($this->aCurrentActionParams) && isset($this->aCurrentActionParams[$sKey]) ?
|
||||||
$this->aCurrentActionParams[$sKey] : $mDefault;
|
$this->aCurrentActionParams[$sKey] : $mDefault;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -215,9 +215,9 @@
|
||||||
<div data-bind="foreach: viewThreadMessages, visible: !messageListOfThreadsLoading()">
|
<div data-bind="foreach: viewThreadMessages, visible: !messageListOfThreadsLoading()">
|
||||||
<li class="e-item thread-list-message" role="presentation" data-bind="css: {'selected': selected}">
|
<li class="e-item thread-list-message" role="presentation" data-bind="css: {'selected': selected}">
|
||||||
<a class="e-link menuitem" href="#" tabindex="-1" onclick="return false;">
|
<a class="e-link menuitem" href="#" tabindex="-1" onclick="return false;">
|
||||||
<span class="thread-date pull-right" data-moment-format="SHORT" data-bind="moment: dateInUTC"></span>
|
<span class="thread-date pull-right" data-moment-format="SHORT" data-bind="moment: timestamp"></span>
|
||||||
<div style="text-overflow: ellipsis; overflow: hidden;">
|
<div style="text-overflow: ellipsis; overflow: hidden;">
|
||||||
<span class="thread-from" data-bind="text: sender"></span>
|
<span class="thread-from" data-bind="text: fromAsString"></span>
|
||||||
|
|
||||||
</div>
|
</div>
|
||||||
<div style="text-overflow: ellipsis; overflow: hidden;">
|
<div style="text-overflow: ellipsis; overflow: hidden;">
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue