From fc7a8483f4a66a3f47bbb335574a399df64d62e0 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ra=C3=BAl=20Benencia?= Date: Tue, 3 Sep 2013 12:29:47 -0300 Subject: Color in new emails --- Print.hs | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) (limited to 'Print.hs') 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' -- cgit v1.2.3