Skip to content

Commit

Permalink
(js) Fix message initialization in popup window
Browse files Browse the repository at this point in the history
Fixes #3583
  • Loading branch information
cgx committed Mar 15, 2016
1 parent 0af364d commit dec3f94
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 4 deletions.
1 change: 1 addition & 0 deletions NEWS
Expand Up @@ -15,6 +15,7 @@ Bug fixes
- [web] respect super user privileges to create in any calendar and addressbook (#3533)
- [web] properly null-terminate IS8601-formatted dates (#3539)
- [web] display CC/BCC fields in message editor when initialized with values
- [web] fixed message initialization in popup window (#3583)

3.0.2 (2016-03-04)
------------------
Expand Down
2 changes: 1 addition & 1 deletion UI/WebServerResources/js/Mailer/Mailer.popup.js
Expand Up @@ -179,7 +179,7 @@
// Message is available from the parent window
message = new Message(stateMailbox.$account.id,
stateMailbox,
window.opener.$messageController.message.$omit());
window.opener.$messageController.message.$omit({privateAttributes: true}));
return $q.when(message);
}
else {
Expand Down
7 changes: 4 additions & 3 deletions UI/WebServerResources/js/Mailer/Message.service.js
Expand Up @@ -648,10 +648,11 @@
* @desc Return a sanitized object used to send to the server.
* @return an object literal copy of the Message instance
*/
Message.prototype.$omit = function() {
var message = {};
Message.prototype.$omit = function(options) {
var message = {},
privateAttributes = options && options.privateAttributes;
angular.forEach(this, function(value, key) {
if (key != 'constructor' && key[0] != '$') {
if (key != 'constructor' && key[0] != '$' || privateAttributes) {
message[key] = value;
}
});
Expand Down

0 comments on commit dec3f94

Please sign in to comment.