use contact name in RecipientElement for sending#4275
Conversation
|
There are 3 places in the code to actually display names in recipient boxes. I can do this in this PR or later. |
|
Hi @tomholub |
|
ping @tomholub |
I'll take a look. As for the screenshots, they look good except the bolded part should have smaller weight. So instead of |
| }; | ||
|
|
||
| private addNamesToMsg = async (msg: SendableMsg): Promise<void> => { | ||
| private addNameToEmail = async (email: string): Promise<string> => { |
There was a problem hiding this comment.
Let's call this formatSenderEmailAsMimeString (is that what it does?)
| const signedData = await MsgUtil.sign(signingPrv, newMsg.plaintext); | ||
| const allContacts = [...newMsg.recipients.to || [], ...newMsg.recipients.cc || [], ...newMsg.recipients.bcc || []]; | ||
| ContactStore.update(undefined, allContacts, { lastUse: Date.now() }).catch(Catch.reportErr); | ||
| const recipients = Value.arr.unique(Object.values(newMsg.recipients).reduce((a, b) => a.concat(b), []).map(x => x.email)); |
There was a problem hiding this comment.
Since this line Value.arr.unique(Object.values(newMsg.recipients).reduce((a, b) => a.concat(b), []).map(x => x.email)); repeats a few times across the files, we could give it a name and make a method to describe what it does. I suppose getUniqueRecipientEmails ?
There was a problem hiding this comment.
that's right, I was thinking about this, but the type ParsedRecipients is too specific so any of the existing common/helper modules are not suitable. Perhaps, I should place the method to compose-types.ts?
There was a problem hiding this comment.
You could try compose-recipients-module.ts as a public method, then access it in other modules as this.view.recipientsModule.uniqueRecipientEmails(newMsg.recipients) or similar.
There was a problem hiding this comment.
Ok, let me fix it...
There was a problem hiding this comment.
oh no... looks like recipientsModule isn't available from formatters
|
Better 👍 |



This PR loads names to be added to email into RecipientElement
close #4268
Tests (delete all except exactly one):
To be filled by reviewers
I have reviewed that this PR... (tick whichever items you personally focused on during this review):