From a7d12f9608d1105e5f3d6da6ad6c9f3fa4d9b458 Mon Sep 17 00:00:00 2001 From: "Danilo M." Date: Sat, 31 Oct 2026 11:42:24 +0100 Subject: feat: an optional allow_archive field on a tagging rule Both readers learn it together, as the rule format requires. No version bump: the field is optional, and each writer emits it only on a rule that removes inbox, so a file without one saves unchanged. Co-Authored-By: Claude Opus 5.5 --- src/tagrules.h | 9 +++++++++ 1 file changed, 9 insertions(+) (limited to 'src/tagrules.h') diff --git a/src/tagrules.h b/src/tagrules.h index 946329a..2ceafef 100644 --- a/src/tagrules.h +++ b/src/tagrules.h @@ -43,6 +43,10 @@ struct TagRule QString move; int stage = 50; ///< Ascending. Account tags 10, topic rules 50. bool enabled = true; + /// Lets the post-new hook remove `inbox` from arriving mail for this rule + /// (item 213). Meaningless, and cleared on save, unless `remove` holds + /// `inbox`. `unread` stays refused regardless. + bool allowArchive = false; /// Fields this version of qtmaildir does not understand, kept verbatim and /// written back on save. Without this, one save from here silently strips @@ -104,6 +108,11 @@ public: /// could reach the file and never come back. static QStringList validate(const QList &rules); + /// Whether the post-new hook will skip this rule whole. Mirrors + /// PROTECTED_REMOVALS in assets/hooks/post-new: `unread` always, `inbox` + /// unless the rule opts in with allowArchive. + static bool hookWouldSkip(const TagRule &rule); + /// No file yet, as distinct from a file that would not load. A fresh /// install is not an error and must not be reported as one. bool missing() const { return m_missing; } -- cgit v1.2.3