(msg)
| 157 | } |
| 158 | |
| 159 | async onEditorOptions(msg) { |
| 160 | this.setState({keyringId: msg.keyringId || await getPreferredKeyringId()}); |
| 161 | this.options = msg.options; |
| 162 | const keyring = await getKeyringById(this.state.keyringId); |
| 163 | const defaultKeyFpr = await keyring.getDefaultKeyFpr(); |
| 164 | const data = { |
| 165 | signMsg: this.options.signMsg || prefs.general.auto_sign_msg, |
| 166 | subject: this.options.subject || '', |
| 167 | defaultKeyFpr |
| 168 | }; |
| 169 | if (msg.options.privKeys) { |
| 170 | data.privKeys = await keyring.getValidSigningKeys(); |
| 171 | } |
| 172 | if (this.options.armoredDraft) { |
| 173 | this.options.keepAttachments = true; |
| 174 | this.scheduleDecrypt(this.options.armoredDraft); |
| 175 | } else { |
| 176 | if (this.options.quotedMail) { |
| 177 | this.scheduleDecrypt(this.options.quotedMail); |
| 178 | } else if (this.options.predefinedText) { |
| 179 | data.text = this.options.predefinedText; |
| 180 | } |
| 181 | } |
| 182 | if (this.options.attachments) { |
| 183 | this.setAttachments(this.options.attachments); |
| 184 | } |
| 185 | triggerSync({keyringId: this.state.keyringId, force: true}); |
| 186 | this.ports.editor.emit('set-init-data', data); |
| 187 | } |
| 188 | |
| 189 | async onEditorClose(option = {cancel: false}) { |
| 190 | const {cancel} = option; |
no test coverage detected