This commit is contained in:
RainLoop Team 2015-03-19 01:26:52 +04:00
parent d8c9f7ec14
commit 16d2f46a31
7 changed files with 51 additions and 38 deletions

View file

@ -47,6 +47,9 @@
this.attachmentsClass = '';
};
/**
* @return {string}
*/
MessageFullModel.prototype.getAttachmentsClass = function ()
{
var sClass = '';
@ -81,23 +84,25 @@
{
var bResult = false;
if (oJson && 'Object/Message' === oJson['@Object'] &&
MessageSimpleModel.prototype.initByJson.call(this, oJson))
if (oJson && 'Object/Message' === oJson['@Object'])
{
this.priority = Utils.pInt(oJson.Priority);
this.priority = Utils.inArray(this.priority, [Enums.MessagePriority.High, Enums.MessagePriority.Low]) ?
this.priority : Enums.MessagePriority.Normal;
if (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.hash = Utils.pString(oJson.Hash);
this.requestHash = Utils.pString(oJson.RequestHash);
this.proxy = !!oJson.ExternalProxy;
this.proxy = !!oJson.ExternalProxy;
this.hasAttachments = !!oJson.HasAttachments;
this.attachmentsMainType = Utils.pString(oJson.AttachmentsMainType);
this.attachmentsClass = this.getAttachmentsClass();
this.hasAttachments = !!oJson.HasAttachments;
this.attachmentsMainType = Utils.pString(oJson.AttachmentsMainType);
this.attachmentsClass = this.getAttachmentsClass();
bResult = true;
bResult = true;
}
}
return bResult;