diff options
author | Raúl Benencia <rul@kalgan.cc> | 2013-09-03 12:29:47 -0300 |
---|---|---|
committer | Raúl Benencia <rul@kalgan.cc> | 2013-09-03 12:29:47 -0300 |
commit | fc7a8483f4a66a3f47bbb335574a399df64d62e0 (patch) | |
tree | ee91c99a23b8999503d47635b1b404d54770e586 /Print.hs | |
parent | ac5a65d8adc1d9a683327165057493d9cba6fdb8 (diff) |
Color in new emails
Diffstat (limited to 'Print.hs')
-rw-r--r-- | Print.hs | 7 |
1 files changed, 5 insertions, 2 deletions
@@ -10,11 +10,10 @@ module Print where import Data.Char (isSpace) import Data.List (intercalate) -import Network.Email.Mailbox(Flag(..), Flags) -import Text.ParserCombinators.Parsec.Rfc2822(NameAddr(..)) import Email import Rfc1342 +import Types(Flag(..), Flags) unquote xs= if (head xs == '"' && last xs == '"') then (tail . init) xs else xs @@ -26,12 +25,16 @@ ppField = flat . decodeField fromLen :: Int fromLen = 20 +maxFlags :: Int +maxFlags = 4 + flat xs = intercalate " " $ map (dropWhile isSpace) $ map (filter (/= '\r')) $ lines xs ppFlags :: Flags -> String ppFlags = map ppFlag ppFlag :: Flag -> Char +ppFlag NEW = 'N' ppFlag SEEN = 'S' ppFlag ANSWERED = 'A' ppFlag FLAGGED = 'F' |