mirror of
https://github.com/the-djmaze/snappymail.git
synced 2026-07-13 03:27:39 +03:00
Fix incorrect mailto format #1521
This commit is contained in:
parent
71718db8f0
commit
90a3d2b62a
5 changed files with 42 additions and 9 deletions
|
|
@ -1542,9 +1542,34 @@ export function mailToHelper(mailToUrl, PopupComposeViewModel)
|
||||||
query = mailToUrl.replace(/^[^\?]*\?/, ''),
|
query = mailToUrl.replace(/^[^\?]*\?/, ''),
|
||||||
EmailModel = require('Model/Email').default;
|
EmailModel = require('Model/Email').default;
|
||||||
|
|
||||||
to = EmailModel.parseEmailLine(email);
|
|
||||||
params = simpleQueryParser(query);
|
params = simpleQueryParser(query);
|
||||||
|
|
||||||
|
if (!isUnd(params.to))
|
||||||
|
{
|
||||||
|
to = EmailModel.parseEmailLine(decodeURIComponent(email + ',' + params.to));
|
||||||
|
to = _.values(to.reduce((result, value) => {
|
||||||
|
if (value)
|
||||||
|
{
|
||||||
|
if (result[value.email])
|
||||||
|
{
|
||||||
|
if (!result[value.email].name)
|
||||||
|
{
|
||||||
|
result[value.email] = value;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
result[value.email] = value;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
return result;
|
||||||
|
}, {}));
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
to = EmailModel.parseEmailLine(email);
|
||||||
|
}
|
||||||
|
|
||||||
if (!isUnd(params.cc))
|
if (!isUnd(params.cc))
|
||||||
{
|
{
|
||||||
cc = EmailModel.parseEmailLine(decodeURIComponent(params.cc));
|
cc = EmailModel.parseEmailLine(decodeURIComponent(params.cc));
|
||||||
|
|
|
||||||
|
|
@ -112,8 +112,10 @@ class EmailModel
|
||||||
{
|
{
|
||||||
if (friendlyView && '' !== this.name)
|
if (friendlyView && '' !== this.name)
|
||||||
{
|
{
|
||||||
result = wrapWithLink ? '<a href="mailto:' + encodeHtml('"' + this.name + '" <' + this.email + '>') +
|
result = wrapWithLink ? '<a href="mailto:' + encodeHtml(this.email) + '?to=' + encodeHtml('"' + this.name + '" <' + this.email + '>') +
|
||||||
'" target="_blank" tabindex="-1">' + encodeHtml(this.name) + '</a>' : (useEncodeHtml ? encodeHtml(this.name) : this.name);
|
'" target="_blank" tabindex="-1">' + encodeHtml(this.name) + '</a>' : (useEncodeHtml ? encodeHtml(this.name) : this.name);
|
||||||
|
// result = wrapWithLink ? '<a href="mailto:' + encodeHtml('"' + this.name + '" <' + this.email + '>') +
|
||||||
|
// '" target="_blank" tabindex="-1">' + encodeHtml(this.name) + '</a>' : (useEncodeHtml ? encodeHtml(this.name) : this.name);
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
|
|
@ -123,11 +125,17 @@ class EmailModel
|
||||||
if (wrapWithLink)
|
if (wrapWithLink)
|
||||||
{
|
{
|
||||||
result = encodeHtml('"' + this.name + '" <') + '<a href="mailto:' +
|
result = encodeHtml('"' + this.name + '" <') + '<a href="mailto:' +
|
||||||
encodeHtml('"' + this.name + '" <' + this.email + '>') +
|
encodeHtml(this.email) + '?to=' + encodeHtml('"' + this.name + '" <' + this.email + '>') +
|
||||||
'" target="_blank" tabindex="-1">' +
|
'" target="_blank" tabindex="-1">' +
|
||||||
encodeHtml(result) +
|
encodeHtml(result) +
|
||||||
'</a>' +
|
'</a>' +
|
||||||
encodeHtml('>');
|
encodeHtml('>');
|
||||||
|
// result = encodeHtml('"' + this.name + '" <') + '<a href="mailto:' +
|
||||||
|
// encodeHtml('"' + this.name + '" <' + this.email + '>') +
|
||||||
|
// '" target="_blank" tabindex="-1">' +
|
||||||
|
// encodeHtml(result) +
|
||||||
|
// '</a>' +
|
||||||
|
// encodeHtml('>');
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
|
|
|
||||||
|
|
@ -1,4 +1,6 @@
|
||||||
|
|
||||||
|
import window from 'window';
|
||||||
|
import $ from '$';
|
||||||
import ko from 'ko';
|
import ko from 'ko';
|
||||||
import {settingsGet} from 'Storage/Settings';
|
import {settingsGet} from 'Storage/Settings';
|
||||||
import {AbstractAppStore} from 'Stores/AbstractApp';
|
import {AbstractAppStore} from 'Stores/AbstractApp';
|
||||||
|
|
@ -27,13 +29,9 @@ class AppAdminStore extends AbstractAppStore
|
||||||
this.useLocalProxyForExternalImages(!!settingsGet('UseLocalProxyForExternalImages'));
|
this.useLocalProxyForExternalImages(!!settingsGet('UseLocalProxyForExternalImages'));
|
||||||
|
|
||||||
if (settingsGet('Auth')) {
|
if (settingsGet('Auth')) {
|
||||||
this.checkDataFolder();
|
$.get('./data/VERSION?' + window.Math.random()).then(() => this.dataFolderAccess(true));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
checkDataFolder() {
|
|
||||||
$.get('./data/VERSION?' + window.Math.random()).then((value) => this.dataFolderAccess(true));
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
export default new AppAdminStore();
|
export default new AppAdminStore();
|
||||||
|
|
|
||||||
|
|
@ -640,6 +640,7 @@ gulp.task('watch', ['css:main', 'js:validate'], function() {
|
||||||
});
|
});
|
||||||
|
|
||||||
// aliases
|
// aliases
|
||||||
|
gulp.task('lint', ['js:eslint']);
|
||||||
gulp.task('build', ['rainloop']);
|
gulp.task('build', ['rainloop']);
|
||||||
|
|
||||||
gulp.task('all', function(callback) {
|
gulp.task('all', function(callback) {
|
||||||
|
|
|
||||||
|
|
@ -12,7 +12,8 @@
|
||||||
<br />
|
<br />
|
||||||
<span data-i18n="TAB_GENERAL/ALERT_DATA_ACCESS"></span>
|
<span data-i18n="TAB_GENERAL/ALERT_DATA_ACCESS"></span>
|
||||||
|
|
||||||
<strong><a href="https://rainloop.net/docs/installation/#notice">https://rainloop.net/docs/installation</a></strong>
|
<a href="https://www.rainloop.net/docs/installation/#notice"
|
||||||
|
target="_blank"><strong>https://www.rainloop.net/docs/installation</strong></a>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
<div class="form-horizontal">
|
<div class="form-horizontal">
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue