aboutsummaryrefslogtreecommitdiff
path: root/Print.hs
diff options
context:
space:
mode:
authorRaúl Benencia <rul@kalgan.cc>2013-09-03 12:29:47 -0300
committerRaúl Benencia <rul@kalgan.cc>2013-09-03 12:29:47 -0300
commitfc7a8483f4a66a3f47bbb335574a399df64d62e0 (patch)
treeee91c99a23b8999503d47635b1b404d54770e586 /Print.hs
parentac5a65d8adc1d9a683327165057493d9cba6fdb8 (diff)
Color in new emails
Diffstat (limited to 'Print.hs')
-rw-r--r--Print.hs7
1 files changed, 5 insertions, 2 deletions
diff --git a/Print.hs b/Print.hs
index cae3a45..d033bf2 100644
--- a/Print.hs
+++ b/Print.hs
@@ -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'
nihil fit ex nihilo