diff --git a/CHANGELOG b/CHANGELOG index 5e78f841c..5ab0b74ec 100644 --- a/CHANGELOG +++ b/CHANGELOG @@ -6,7 +6,7 @@ CHANGELOG Roundcube Webmail - Fix SQL error on logout when using session_storage=php (#1490421) - Update to jQuery 2.1.4 (#1490406) - Fix Compose action in addressbook for results from multiple addressbooks (#1490413) -- Fix bug where some messages in multi-folder search couldn't be opened (#1490426) +- Fix bug where some messages in multi-folder search couldn't be viewed/printed/downloaded (#1490426) - Fix unintentional messages list page change on page switch in compose addressbook (#1490427) - Fix race-condition in saving user preferences and loading plugin config (#1490431) - Fix so plain text signature field uses monospace font (#1490435) diff --git a/plugins/zipdownload/zipdownload.js b/plugins/zipdownload/zipdownload.js index af9136c1d..f9495084c 100644 --- a/plugins/zipdownload/zipdownload.js +++ b/plugins/zipdownload/zipdownload.js @@ -54,7 +54,7 @@ function rcmail_zipdownload(mode) // default .eml download of single message if (mode == 'eml') { var uid = rcmail.get_single_uid(); - rcmail.goto_url('viewsource', {_uid: uid, _mbox: rcmail.get_message_mailbox(uid), _save: 1}); + rcmail.goto_url('viewsource', rcmail.params_from_uid(uid, {_save: 1})); return; } diff --git a/program/js/app.js b/program/js/app.js index ef42e82ce..6dcec92b8 100644 --- a/program/js/app.js +++ b/program/js/app.js @@ -762,7 +762,7 @@ function rcube_webmail() case 'open': if (uid = this.get_single_uid()) { - obj.href = this.url('show', {_mbox: this.get_message_mailbox(uid), _uid: uid}); + obj.href = this.url('show', this.params_from_uid(uid)); return true; } break; @@ -1188,8 +1188,8 @@ function rcube_webmail() this.gui_objects.messagepartframe.contentWindow.print(); } else if (uid = this.get_single_uid()) { - url = '&_action=print&_uid='+uid+'&_mbox='+urlencode(this.get_message_mailbox(uid))+(this.env.safemode ? '&_safe=1' : ''); - if (this.open_window(this.env.comm_path + url, true, true)) { + url = this.url('print', this.params_from_uid(uid, {_safe: this.env.safemode ? 1 : 0})); + if (this.open_window(url, true, true)) { if (this.env.action != 'show') this.mark_message('read', uid); } @@ -1198,7 +1198,7 @@ function rcube_webmail() case 'viewsource': if (uid = this.get_single_uid()) - this.open_window(this.env.comm_path+'&_action=viewsource&_uid='+uid+'&_mbox='+urlencode(this.env.mailbox), true, true); + this.open_window(this.url('viewsource', this.params_from_uid(uid)), true, true); break; case 'download': @@ -1206,7 +1206,7 @@ function rcube_webmail() location.href = location.href.replace(/_frame=/, '_download='); } else if (uid = this.get_single_uid()) { - this.goto_url('viewsource', { _uid: uid, _mbox: this.get_message_mailbox(uid), _save: 1 }); + this.goto_url('viewsource', this.params_from_uid(uid, {_save: 1})); } break; @@ -2233,12 +2233,7 @@ function rcube_webmail() return; var win, target = window, - url = { - _uid: id, - _mbox: this.get_message_mailbox(id), - // add browser capabilities, so we can properly handle attachments - _caps: this.browser_capabilities() - }; + url = this.params_from_uid(id, {_caps: this.browser_capabilities()}); if (preview && (win = this.get_frame_window(this.env.contentframe))) { target = win; @@ -8049,6 +8044,18 @@ function rcube_webmail() return msg.mbox || this.env.mailbox; }; + // build request parameters from single message id (maybe with mailbox name) + this.params_from_uid = function(uid, params) + { + if (!params) + params = {}; + + params._uid = String(uid).split('-')[0]; + params._mbox = this.get_message_mailbox(uid); + + return params; + }; + // gets cursor position this.get_caret_pos = function(obj) {