Fix IMAP keyword flag handling#110
Conversation
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 991d63d444
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
| showFlag Draft = "\\Draft" | ||
| showFlag Recent = "\\Recent" | ||
| showFlag (Keyword s) = "\\" ++ s | ||
| showFlag (Keyword s) = s |
There was a problem hiding this comment.
Preserve the \ wildcard when showing flags*
When a server advertises PERMANENTFLAGS (\\*), this parser still represents the wildcard as Keyword "*" and uses that sentinel to set _isFlagWritable, but the new catch-all Show case now renders that same value as bare * instead of \\*. Bare * is not a valid keyword here (atomChar excludes *), so any caller that logs, compares round-trips, or serializes this exposed Flag value now gets an invalid IMAP flag string; special-case Keyword "*" before the bare-keyword case.
Useful? React with 👍 / 👎.
991d63d to
0bc2b70
Compare
Summary
Fix keyword flag handling according to RFC 3501 section 2.3.2:
show (Keyword "Custom")now rendersCustominstead of\CustomFixes #1.
Fixes #2.
Checks
nix shell nixpkgs#cabal-install nixpkgs#ghc --command cabal test imap-parsers --test-show-details=directnix shell nixpkgs#cabal-install nixpkgs#ghc --command cabal build allnix shell nixpkgs#cabal-install nixpkgs#ghc --command cabal check(existingCHANGELOGplacement warning only)git diff --check