aboutsummaryrefslogtreecommitdiff
path: root/Print.hs
diff options
context:
space:
mode:
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