diff options
| author | Danilo M. <danix@danix.xyz> | 2026-08-26 13:28:51 +0200 |
|---|---|---|
| committer | Danilo M. <danix@danix.xyz> | 2026-08-26 13:30:22 +0200 |
| commit | 0ca4624195cdd8c78ff614e3912af5b914458497 (patch) | |
| tree | 6fc739e77fed6b5a4e178cacf76ac29fd708ab0b /src/config.cpp | |
| parent | d835cf3c554e9657fffdb91971b66e3a74aee323 (diff) | |
| download | qtmaildir-0ca4624195cdd8c78ff614e3912af5b914458497.tar.gz qtmaildir-0ca4624195cdd8c78ff614e3912af5b914458497.zip | |
feat: flag what you answered, mark what was forwarded to you
Item 68, which turned out to be three things once its premise was
measured. The note asked to extend a "passed" subject rule to "Fw:";
there was no subject rule, and the correlation it rested on did not
exist. What did exist was a gap nobody had reported.
Reply and forward now flag their source. The Maildir R and P flags,
which every other client sets and notmuch reads back as "replied" and
"passed", had never been written here: measured on the developer's
index, all 317 "replied" and all 6 "passed" came from other clients.
ComposeWindow emits sourceMessageAnswered after a successful send and
MainWindow routes it through sendMessageTagChange, message-scoped and
off the undo stack, for the reason auto mark-read is: the flag records
that the mail went, and the send cannot be undone.
ComposeContext carries sourceMessageId rather than reusing inReplyTo,
which is deliberately empty on a forward so the recipient's client does
not file it under the thread it left. Keying on it made the "passed"
half dead code that compiled and never fired. A resumed draft is
excluded: its kind records how the file was opened, not what the user is
doing, so flagging on it would set R from a guess.
A received forward gets its own mark. Derived from the subject at paint
time, storing nothing and reaching no server, because "passed" means "I
forwarded this" and setting it from a guess would assert something false
on 222 existing messages. subjectIsForwarded() shares forwardSubject()'s
prefix table so the two cannot disagree, strips a Re: chain first, and
takes extra locale spellings from [general] forward_prefixes, which
extends the built-in table rather than replacing it.
A mutation survived the first round and corrected a claim in the code:
QRegularExpression::escape already makes a punctuation prefix inert, so
the word guard is not about pattern validity. It stops a configured "-"
matching "-: x". The comment and test say that now.
Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01LXCZFLXbAii5n5wtovpdhh
Diffstat (limited to 'src/config.cpp')
| -rw-r--r-- | src/config.cpp | 32 |
1 files changed, 32 insertions, 0 deletions
diff --git a/src/config.cpp b/src/config.cpp index d91259a..8b784ba 100644 --- a/src/config.cpp +++ b/src/config.cpp @@ -170,6 +170,13 @@ QString Account::inboxQuery() const return folderQuery(maildir, inboxFolder()); } +QString Config::generatorTagFor(const QString &generator) +{ + // Delegates to the file-local table rather than repeating it, so the + // question "which tag does this filter match" has one answer. + return generatorTag(generator); +} + QString Config::allSentQuery() const { return joinAccountQueries(m_accounts, &Account::sentQuery); @@ -338,6 +345,31 @@ void Config::load(const QString &path) } } + // Extra subject prefixes that mark a message someone forwarded TO the + // user, added to the built-in table in composecontext.cpp rather than + // replacing it: the built-ins are the spellings that repo already + // measured, and a user adding Dutch should not have to restate English. + // + // Bare words, no colon. The predicate ignores anything else, so a + // malformed entry costs that entry and not the whole key. + const QStringList forwardPrefixes = + settings.value(QStringLiteral("forward_prefixes")) + .toStringList(); + for (const QString &prefix : forwardPrefixes) { + const QString trimmed = prefix.trimmed(); + if (trimmed.isEmpty()) + continue; + // Warned rather than dropped silently: the user asked for something + // and is not getting it, the same reason message_zoom warns. + if (trimmed.contains(QLatin1Char(':'))) { + addProblem(tr("Forward prefix '%1' should be written without " + "its colon; ignoring it.") + .arg(trimmed)); + continue; + } + m_forwardPrefixes << trimmed; + } + // Absent is silent, the default being 2000. Present but unparseable warns, // for the same reason message_zoom does: the user asked for something and // is not getting it. |
