diff options
| author | Danilo M. <danix@danix.xyz> | 2026-09-14 13:03:35 +0200 |
|---|---|---|
| committer | Danilo M. <danix@danix.xyz> | 2026-09-14 13:03:35 +0200 |
| commit | d714483b6027425923340d1bcfa0263b8e7ac0bc (patch) | |
| tree | b9f0b4851fa5cd00dfda181777f021279e027db6 /src/mainwindow.h | |
| parent | 3ba5e6b68a0f4e91884043fab9a705cf7d15b968 (diff) | |
| download | qtmaildir-d714483b6027425923340d1bcfa0263b8e7ac0bc.tar.gz qtmaildir-d714483b6027425923340d1bcfa0263b8e7ac0bc.zip | |
fix: gate spam like delete, and keep one origin in the model
Diffstat (limited to 'src/mainwindow.h')
| -rw-r--r-- | src/mainwindow.h | 24 |
1 files changed, 20 insertions, 4 deletions
diff --git a/src/mainwindow.h b/src/mainwindow.h index a7fbf26..478de2d 100644 --- a/src/mainwindow.h +++ b/src/mainwindow.h @@ -1107,12 +1107,13 @@ private: SelectionKind selectionKind() const; /// Whether the selection holds a reply row, which is what hides Delete, - /// Restore and Archive (item 177). + /// Restore, Archive and Mark spam: all conversation-level acts, and a + /// single reply cannot be removed from its thread (item 177). /// /// Written by refreshScopedActionLabels() and read by - /// refreshTrashActions(), which runs after it and owns the same two - /// actions' visibility. A flag rather than a second walk over the - /// selection, so the two cannot answer differently. + /// refreshTrashActions(), which runs after it and owns the same actions' + /// visibility. A flag rather than a second walk over the selection, so the + /// two cannot answer differently. bool m_replySelectionHidesDelete = false; /// Hides Delete on mail already in the trash, and Restore on mail that @@ -1393,6 +1394,21 @@ private: /// and a restore stripped a tag that had never been written. QString originTagFor(const QString &dbRelativeFolder) const; + /// The `moved-from:` tags these messages currently carry that a new origin + /// must replace, read from the MODEL. + /// + /// Mirrors the worker's overwrite rule (NotmuchWorker::applyTags): a + /// message carries exactly one origin, so writing a new one strips any + /// other. The worker does it against the database; this does it against + /// the optimistic model, where restoreSelected() reads the origin back and + /// a stale second tag would send the message to the wrong folder. + /// + /// Returns nothing unless `added` is writing a new origin, which is either + /// a resolved `moved-from:` tag or the unresolved placeholder the + /// optimistic update drops before painting. + QStringList originTagsToStrip(const QStringList &messageIds, + const QStringList &added) const; + /// The account whose maildir contains `path`, or an invalid account when /// no configured maildir does. /// |
