Skip to content

[PB-6787] feature/Added forward - #593

Open
CandelR wants to merge 2 commits into
feature/PB-6787-forward-1from
feature/PB-6787-forward-2
Open

CandelR wants to merge 2 commits into
feature/PB-6787-forward-1from
feature/PB-6787-forward-2

Conversation

@CandelR

@CandelR CandelR commented Sep 11, 2026

Copy link
Copy Markdown
Contributor

Forward a message of the thread with its attachments

Summary

  • mailCrypto.service.ts: implemented encryptAndSendForward. It checks recipients, delivery mode and Bcc first, then takes the attachments out of the original, encrypts the body and every attachment for the new message, and sends it through sendEmail with inReplyToEmailId so it stays in the thread. The decrypted files are deleted in a finally. The three send functions accept a SendProgress whose onStage reports downloading attachments, uploading attachments and sending.
  • forwardAttachments.ts: materializeForwardedAttachments downloads each attachment of the original one after another, decrypts it with the session key of that message and writes it to a uuid named temporary file. It refuses oversized attachments before downloading, throws ForwardedAttachmentsNotDecryptableError when the attachments are encrypted and the key is not on the device, and throws ForwardedAttachmentUnavailableError naming the file when one fails, deleting whatever was already written. discardMaterializedAttachments removes the files once the send is over
  • forwardBody.ts: forwardedSubject adds the Fwd: prefix unless the subject already has it. buildForwardedQuote quotes the original under an escaped From / Date / Subject / To / Cc header, keeping a markup body sanitised and a plain body with its line breaks, and returns the original text on its own. composeForwardedBody places the user's note above the quote. previewOfForward gives the mailbox list the note, or the original text when there is no note, never the header
  • emailBodyContent.ts: new plainTextFromHtml turns a markup body into the text it displays, used for the preview of a forward.
  • attachmentCrypto.ts: decryptAttachmentData moves here so forwardAttachments.ts and mailAttachment.service.ts share it without importing each other through mailCrypto.service.ts
  • EmailDetailScreen: each message builds the forward params from its resolved body (subject, quote, attachments, whether they are encrypted and who sent it). Reply all is offered only when replying to all would add someone, and Forward is not offered for a message that could not be decrypted
  • ThreadMessageCard.tsx: Forward action next to Reply and Reply all, on the right
  • ComposeEmailScreen: forward mode with the subject prefilled and the inherited attachments listed and removable. Every send shows a status line with its current stage
  • ForwardedQuote.tsx: folded block below the body, "Forwarded message from X", that opens to show the quote exactly as it will be sent, read-only, in a WebView with the same document and content security policy as the message detail
  • errors.ts / sendErrors.ts: forward errors and their user-facing messages
  • types/mail.ts / navigation.ts: ForwardedAttachment, ForwardedQuote, OutgoingForward, ForwardComposeParams, SendStage and SendProgress
  • useEmailBodyHeight moves to src/screens/mail/hooks so the detail and the compose screen share it, and forward, progress and error strings are added to strings.ts in English and Spanish

@CandelR CandelR self-assigned this Sep 11, 2026
@CandelR CandelR added the enhancement New feature or request label Sep 11, 2026
@CandelR
CandelR added this pull request to stack #583 September 11, 2026 13:41
@CandelR
CandelR requested a review from xabg2 September 15, 2026 13:05
@CandelR
CandelR marked this pull request as ready for review September 15, 2026 13:05
@CandelR
CandelR force-pushed the feature/PB-6787-forward-2 branch from ac73409 to 9ec441b Compare September 17, 2026 09:07
@sonarqubecloud

Copy link
Copy Markdown

Quality Gate Failed Quality Gate failed

Failed conditions
4.1% Duplication on New Code (required ≤ 3%)

See analysis details on SonarQube Cloud

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

enhancement New feature or request

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants