diff options
| author | Danilo M. <danix@danix.xyz> | 2026-09-13 19:16:33 +0200 |
|---|---|---|
| committer | Danilo M. <danix@danix.xyz> | 2026-09-13 19:16:33 +0200 |
| commit | 2623b762a90b04c57491a5d58ab72c8807c65c80 (patch) | |
| tree | 1f968dec0965300173aec0216d76330d870f6513 /src/config.h | |
| parent | b79b5e30efcd8de95fa42d84c6ed319a0347941c (diff) | |
| download | qtmaildir-2623b762a90b04c57491a5d58ab72c8807c65c80.tar.gz qtmaildir-2623b762a90b04c57491a5d58ab72c8807c65c80.zip | |
feat(config): per-account spam folder and queries
Diffstat (limited to 'src/config.h')
| -rw-r--r-- | src/config.h | 22 |
1 files changed, 22 insertions, 0 deletions
diff --git a/src/config.h b/src/config.h index 1ab923d..aa3c332 100644 --- a/src/config.h +++ b/src/config.h @@ -80,6 +80,14 @@ struct Account /// reports a missing key through the warnings path. QString trash; + /// The account's spam folder, relative to maildir. + /// + /// MANDATORY, unlike `sent` and `drafts`. Mark spam moves a file into this + /// folder, so an account without one cannot mark spam at all, and the user + /// chose a config error over a per-account disabled state. Config::load() + /// reports a missing key through the warnings path. + QString spam; + /// The command that sends mail from this account, receiving the complete /// RFC822 message on stdin. Optional, and its ABSENCE is meaningful: /// an account without one is receive-only by construction. @@ -160,6 +168,13 @@ struct Account /// uniformly; it is Config::load() that reports the problem. QString trashQuery() const; + /// Matches this account's spam folder, or empty when `spam` is unset. + /// + /// Empty is a config error rather than a legitimate state, unlike + /// sentQuery(). The query helper still returns empty so callers compose + /// uniformly; it is Config::load() that reports the problem. + QString spamQuery() const; + /// Matches this account's inbox folder, using inboxFolder(). QString inboxQuery() const; @@ -408,6 +423,13 @@ public: /// silently answers a different question. QString allTrashQuery() const; + /// Matches every configured account's spam, or empty when none has one. + /// + /// Joins only the NON-EMPTY spamQuery() results, for the same reason + /// allTrashQuery() does: notmuch accepts a bare "or" without complaint and + /// silently answers a different question. + QString allSpamQuery() const; + /// Matches every configured account's drafts, or empty when none has one. /// /// Joins only the NON-EMPTY draftsQuery() results, for the same reason |
