mirror of
https://github.com/inverse-inc/sogo.git
synced 2026-03-24 07:32:44 +00:00
@@ -662,7 +662,7 @@
|
||||
action = 'markMessageUncollapse';
|
||||
|
||||
this.collapsed = !this.collapsed;
|
||||
_this.$mailbox.updateVisibleMessages();
|
||||
this.$mailbox.updateVisibleMessages();
|
||||
|
||||
return Message.$$resource.post(this.$absolutePath(), action).catch(function() {
|
||||
this.collapsed = !this.collapsed;
|
||||
@@ -717,32 +717,33 @@
|
||||
* information parsed from the specified "mailto:" link.
|
||||
*/
|
||||
Message.prototype.$parseMailto = function(mailto) {
|
||||
var to, data, match = /^mailto:([^\?]+)/.exec(mailto);
|
||||
var to, data = {}, match = /^mailto:([^\?]+)/.exec(mailto);
|
||||
if (match) {
|
||||
// Recipients
|
||||
to = _.map(decodeURIComponent(match[1]).split(','), function(email) {
|
||||
return '<' + email.trim() + '>';
|
||||
});
|
||||
data = { to: to };
|
||||
// Subject & body
|
||||
_.forEach(['subject', 'body'], function(param) {
|
||||
var re = new RegExp(param + '=([^&]+)');
|
||||
param = (param == 'body')? 'text' : param;
|
||||
match = re.exec(mailto);
|
||||
if (match)
|
||||
data[param] = decodeURIComponent(match[1]);
|
||||
});
|
||||
// Other Recipients
|
||||
_.forEach(['cc', 'bcc'], function(param) {
|
||||
var re = new RegExp(param + '=([^&]+)');
|
||||
match = re.exec(mailto);
|
||||
if (match)
|
||||
data[param] = _.map(decodeURIComponent(match[1]).split(','), function(email) {
|
||||
return '<' + email.trim() + '>';
|
||||
});
|
||||
});
|
||||
angular.extend(this.editable, data);
|
||||
}
|
||||
// Subject & body
|
||||
_.forEach(['subject', 'body'], function(param) {
|
||||
var re = new RegExp(param + '=([^&]+)');
|
||||
param = (param == 'body')? 'text' : param;
|
||||
match = re.exec(mailto);
|
||||
if (match)
|
||||
data[param] = decodeURIComponent(match[1]);
|
||||
});
|
||||
// Other Recipients
|
||||
_.forEach(['cc', 'bcc'], function(param) {
|
||||
var re = new RegExp(param + '=([^&]+)');
|
||||
match = re.exec(mailto);
|
||||
if (match)
|
||||
data[param] = _.map(decodeURIComponent(match[1]).split(','), function(email) {
|
||||
return '<' + email.trim() + '>';
|
||||
});
|
||||
});
|
||||
if (!_.isEmpty(data))
|
||||
angular.extend(this.editable, data);
|
||||
};
|
||||
|
||||
/**
|
||||
|
||||
Reference in New Issue
Block a user