From 917de9c6df342d032e2b05238c7ea923da2772db Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ra=C3=BAl=20Benencia?= Date: Sun, 1 Sep 2013 13:16:54 -0300 Subject: towards mime library --- Print.hs | 16 ++++------------ 1 file changed, 4 insertions(+), 12 deletions(-) (limited to 'Print.hs') diff --git a/Print.hs b/Print.hs index 8916e55..8f40491 100644 --- a/Print.hs +++ b/Print.hs @@ -16,20 +16,12 @@ import Text.ParserCombinators.Parsec.Rfc2822(NameAddr(..)) import Email import Rfc1342 -nameLen = 20 -ppNameAddr nas = intercalate ", " $ map ppNameAddr' nas - where ppNameAddr' na = case nameAddr_name na of - Nothing -> nameAddr_addr na - Just n -> unquote (decodeField n) ++ " <" ++ nameAddr_addr na ++ ">" - -ppIndexNameAddr nas = normalizeLen nameLen $ concat $ map ppNameAddr' nas - where ppNameAddr' na = case nameAddr_name na of - Nothing -> nameAddr_addr na - Just n -> unquote (decodeField n) - unquote xs= if (head xs == '"' && last xs == '"') then (tail . init) xs else xs -ppSubject = flat . decodeField +ppField = flat . decodeField + +fromLen :: Int +fromLen = 20 flat xs = intercalate " " $ map (dropWhile isSpace) $ map (filter (/= '\r')) $ lines xs -- cgit v1.2.3