Skip to content

fix(Draft): We should remove signature+reply+forward when we check if the body is empty#2172

Open
valentinperignon wants to merge 1 commit intomasterfrom
fix/draft-do-not-diff-reply-or-forward
Open

fix(Draft): We should remove signature+reply+forward when we check if the body is empty#2172
valentinperignon wants to merge 1 commit intomasterfrom
fix/draft-do-not-diff-reply-or-forward

Conversation

@valentinperignon
Copy link
Copy Markdown
Member

No description provided.

@sonarqubecloud
Copy link
Copy Markdown

sonarqubecloud Bot commented May 8, 2026

Copy link
Copy Markdown

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This PR updates draft “emptiness” detection so that auto-appended HTML blocks (signature + reply/forward quotes) don’t count as user-entered content when deciding whether a draft is effectively empty.

Changes:

  • Reworked Draft.isEmptyOfUserChanges to remove appended HTML elements (signature/reply/forward quote nodes) before checking for remaining text.
  • Updated Draft.shouldBeSaved to rely on isEmptyOfUserChanges (instead of only stripping the signature).

Comment thread MailCore/Models/Draft.swift
Comment thread MailCore/Models/Draft.swift
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants