MCPcopy Create free account
hub / github.com/mailvelope/mailvelope / onPublicKeyUserids

Function onPublicKeyUserids

src/components/editor/editor.js:154–168  ·  view source on GitHub ↗

* Remember the available public keys for later and set the recipients proposal gotten from the webmail ui to the editor * @param {Array} options.keys A list of all available public keys from the local keychain * @param {Array} options.recipients recipients gather from the webmail ui

({keys, to, cc})

Source from the content-addressed store, hash-verified

152 * @param {Array} options.recipients recipients gather from the webmail ui
153 */
154 onPublicKeyUserids({keys, to, cc}) {
155 const markPending = list => list.map(r => r.checkServer ? {...r, lookupPending: true} : r);
156 to = markPending(to);
157 cc = markPending(cc);
158 // initiate key lookup if they aren't found locally
159 // we do it in the editor (not in the controller), because we'd like the UI to be dynamically updated
160 this.keyLookup([...to, ...cc]);
161 this.setState({
162 publicKeys: keys,
163 recipients: to,
164 recipientsCc: cc,
165 showRecipientsCc: cc.length > 0,
166 encryptDisabled: !to.length
167 });
168 }
169
170 onKeyUpdate({keys}) {
171 this.setState({publicKeys: keys});

Callers

nothing calls this directly

Calls 3

markPendingFunction · 0.85
keyLookupMethod · 0.80
setStateMethod · 0.45

Tested by

no test coverage detected