Read Receipt (#41)

This commit is contained in:
RainLoop Team 2014-01-04 04:20:07 +04:00
parent 1dc5a45564
commit b100560cd8
37 changed files with 883 additions and 461 deletions

View file

@ -79,11 +79,6 @@ function MailBoxMessageViewViewModel()
this.viewDate = ko.observable('');
this.viewMoment = ko.observable('');
this.viewLineAsCcc = ko.observable('');
this.viewHasImages = ko.observable(false);
this.viewHasVisibleAttachments = ko.observable(false);
this.viewAttachments = ko.observableArray([]);
this.viewIsHtml = ko.observable(false);
this.viewIsRtl = ko.observable(false);
this.viewViewLink = ko.observable('');
this.viewDownloadLink = ko.observable('');
this.viewUserPic = ko.observable(Consts.DataImages.UserDotPic);
@ -105,11 +100,6 @@ function MailBoxMessageViewViewModel()
this.viewDate(oMessage.fullFormatDateValue());
this.viewMoment(oMessage.momentDate());
this.viewLineAsCcc(oMessage.lineAsCcc());
this.viewHasImages(oMessage.hasImages());
this.viewHasVisibleAttachments(oMessage.hasVisibleAttachments());
this.viewAttachments(oMessage.attachments());
this.viewIsHtml(oMessage.isHtml());
this.viewIsRtl(oMessage.isRtl());
this.viewViewLink(oMessage.viewLink());
this.viewDownloadLink(oMessage.downloadLink());
@ -338,3 +328,22 @@ MailBoxMessageViewViewModel.prototype.showImages = function (oMessage)
oMessage.showExternalImages(true);
}
};
/**
* @param {MessageModel} oMessage
*/
MailBoxMessageViewViewModel.prototype.readReceipt = function (oMessage)
{
if (oMessage && '' !== oMessage.readReceipt())
{
RL.remote().sendReadReceiptMessage(Utils.emptyFunction, oMessage.folderFullNameRaw, oMessage.uid,
oMessage.readReceipt(),
Utils.i18n('READ_RECEIPT/SUBJECT', {'SUBJECT': oMessage.subject()}),
Utils.i18n('READ_RECEIPT/BODY', {'READ-RECEIPT': oMessage.readReceipt()}));
oMessage.isReadReceipt(true);
RL.cache().storeMessageFlagsToCache(oMessage);
RL.reloadFlagsCurrentMessageListAndMessageFromCache();
}
};

View file

@ -38,6 +38,8 @@ function PopupsComposeViewModel()
this.replyTo = ko.observable('');
this.subject = ko.observable('');
this.requestReadReceipt = ko.observable(false);
this.sendError = ko.observable(false);
this.sendSuccessButSaveError = ko.observable(false);
this.savedError = ko.observable(false);
@ -294,7 +296,8 @@ function PopupsComposeViewModel()
this.prepearAttachmentsForSendOrSave(),
this.aDraftInfo,
this.sInReplyTo,
this.sReferences
this.sReferences,
this.requestReadReceipt()
);
}
}
@ -1358,6 +1361,8 @@ PopupsComposeViewModel.prototype.reset = function ()
this.replyTo('');
this.subject('');
this.requestReadReceipt(false);
this.aDraftInfo = null;
this.sInReplyTo = '';
this.bFromDraft = false;