(rl => { // if (rl.settings.get('Nextcloud')) addEventListener('rl-view-model.create', e => { if ('MailMessageList' === e.detail.viewModelTemplateID) { let view = e.detail; view.nextcloudSaveMsgs = () => { view.messageList.hasChecked() && rl.ncFiles.selectFolder().then(folder => { folder && view.messageList.forEach(msg => { msg.checked() && rl.pluginRemoteRequest( (iError, data) => { console.dir({ iError:iError, data:data }); }, 'NextcloudSaveMsg', { 'msgHash': msg.requestHash, 'folder': folder, 'filename': msg.subject() } ); }); }); }; } }); let template = document.getElementById('MailMessageList'); const msgMenu = template.content.querySelector('#more-list-dropdown-id + menu [data-bind*="forwardCommand"]'); if (msgMenu) { msgMenu.after(Element.fromHTML('
  • ' + '' + '
  • ')); } })(window.rl);