-
Notifications
You must be signed in to change notification settings - Fork 52
Individual message per recipient #4284
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
|
I see FES still returns { url } only, so it hasn't been updated yet? |
|
ping @tomholub |
|
Should we merge now or wait until FES is updated to test it again manually? |
|
I'll take a look |
extension/chrome/elements/compose-modules/compose-send-btn-module.ts
Outdated
Show resolved
Hide resolved
|
Sorry for lack of info. Indeed, I suppose we didn't update FES yet. I'll let you know once updated. |
|
We can discuss this one once rebased onto master. Thanks! |
0a4d19d to
215a0e9
Compare
The sending works, now the principal issue is how we should display the sent messages in the thread? |
|
Let's not worry about it in this PR, and then evaluate it in another issue/PR. for new messages: If Gmail classifies it as many threads of one message each, then that's what it is for replies, since we are adding thread ids, several messages will all show up in that one thread, and I suppose they'll look identical except for recipients. In another issue, we could only actually render the first one, and then for all that directly follow and belong to the same "group" we may collapse them somehow. Mobile apps could be more clever about this, since we have full control. |
tomholub
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Just some thoughts.
One thing to think about is format of the sent message. Till now, we were sending both link and encrypted data in attachment in the same message (encrypted data attached directly for any pgp recipients and the sender, and link for non-pgp). But it's not realistic to send that to 20 recipients.. so we will have to rethink that.
extension/chrome/elements/compose-modules/compose-send-btn-module.ts
Outdated
Show resolved
Hide resolved
extension/chrome/elements/compose-modules/formatters/encrypted-mail-msg-formatter.ts
Outdated
Show resolved
Hide resolved
184d6ae to
1b0aeea
Compare
e8cde1d to
6e1c417
Compare
|
@tomholub updated according to your requests, please re-review |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I like all these changes following the review - that looks good. I skipped encrypted-mail-msg-formatter.ts which I still have to look into. Plus need to do some manual testing.
tomholub
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'm filing some comments for "later" and resolving them here in this review.
The ones I leave unresolved should be done still in this PR now.
extension/chrome/elements/compose-modules/formatters/encrypted-mail-msg-formatter.ts
Outdated
Show resolved
Hide resolved
extension/chrome/elements/compose-modules/formatters/encrypted-mail-msg-formatter.ts
Outdated
Show resolved
Hide resolved
| private sendablePwdMsg = async ( | ||
| newMsg: NewMsgData, | ||
| pubs: PubkeyResult[], | ||
| { msgUrl, externalId }: { msgUrl: string, externalId?: string }, | ||
| signingPrv?: Key) => { | ||
| // encoded as: PGP/MIME-like structure but with attachments as external files due to email size limit (encrypted for pubkeys only) | ||
| const msgBody = this.richtext ? { 'text/plain': newMsg.plaintext, 'text/html': newMsg.plainhtml } : { 'text/plain': newMsg.plaintext }; | ||
| const pgpMimeNoAttachments = await Mime.encode(msgBody, { Subject: newMsg.subject }, []); // no attachments, attached to email separately | ||
| const { data: pubEncryptedNoAttachments } = await this.encryptDataArmor(Buf.fromUtfStr(pgpMimeNoAttachments), undefined, pubs, signingPrv); // encrypted only for pubs | ||
| const attachments = this.createPgpMimeAttachments(pubEncryptedNoAttachments). | ||
| concat(await this.view.attachmentsModule.attachment.collectEncryptAttachments(pubs)); // encrypted only for pubs | ||
| const emailIntroAndLinkBody = await this.formatPwdEncryptedMsgBodyLink(msgUrl); | ||
| return await SendableMsg.createPwdMsg(this.acctEmail, this.headers(newMsg), emailIntroAndLinkBody, attachments, { isDraft: this.isDraft, externalId }); | ||
| return await SendableMsg.createPwdMsg(this.acctEmail, this.headers(newMsg), emailIntroAndLinkBody, | ||
| this.createPgpMimeAttachments(pubEncryptedNoAttachments), | ||
| { isDraft: this.isDraft, externalId }); | ||
| }; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
For a refactor in another issue:
- this
sendablePwdMsgmethod could be removed formatSendablePwdMsgscould callconst emailIntroAndLinkBody = await this.formatPwdEncryptedMsgBodyLink(msgUrl);andreturn await SendableMsg.createPwdMsg(this.acctEmail, this.headers(newMsg), emailIntroAndLinkBody, messageBodyAsPgpMimeAttachmentsEncryptedForSender, { isDraft: this.isDraft, externalId });messageBodyAsPgpMimeAttachmentsEncryptedForSendercould be created only once, and reused in each cycle of the loop informatSendablePwdMsgs- to create
messageBodyAsPgpMimeMetaAttachmentsEncryptedForSenderyou could reuse most of existingsendablePwdMsgthat relates to creating this pgpmime attachments, and this new method could be calledencryptMessageBodyAsPgpMimeMetaAttachmentsand only sender pubkeys would be passed into it to createmessageBodyAsPgpMimeMetaAttachmentsEncryptedForSender
The point is that this encryption only needs to happen once per batch, not once per each pwd msg, and it only needs to use pubkeys of sender, not everybody's pubkeys.
tomholub
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks good. I still need to do some manual tests before merging.
| this.view.S.cached('reply_msg_successful').find('div.replied_cc span').text(msg.recipients.cc.join(', ')); | ||
| this.view.S.cached('reply_msg_successful').find('div.replied_to span').text(Str.formatEmailList(recipients.to || [])); | ||
| if (recipients.cc !== undefined && recipients.cc.length > 0) { | ||
| this.view.S.cached('reply_msg_successful').find('div.replied_cc span').text(Str.formatEmailList(recipients.cc)); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
this fixes #4497
close #4348
also this PR correctly stores
threadIdwhen saving sent messagesTests (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):