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 --- Screen.hs | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) (limited to 'Screen.hs') diff --git a/Screen.hs b/Screen.hs index eaa87cf..90954b1 100644 --- a/Screen.hs +++ b/Screen.hs @@ -9,12 +9,12 @@ module Screen where +import Codec.MIME.Type(MIMEValue(..)) import Control.Monad.Trans(liftIO) import Control.Monad.Reader import Control.Monad.State import Data.List(isPrefixOf) import System.Exit -import Text.ParserCombinators.Parsec.Rfc2822(Message(..)) import UI.NCurses -- Local imports @@ -22,7 +22,7 @@ import Config import qualified Handlers as EH import Lazymail import Maildir -import Email +import Email(lookupField, getBody, getHeaders) import Print import Rfc1342 import State @@ -148,16 +148,16 @@ drawEmailHelper = do drawEmailHeader = do st <- get liftUpdate $ do - let fs = getFields $ currentEmail . emailState $ st + let hs = getHeaders $ currentEmail . emailState $ st let cropWith xs = normalizeLen $ (screenColumns st) - (length xs) let row = curRowAsInteger st setColor $ headerColorID . colorStyle $ st moveCursor row (colPadAsInteger st) - drawCroppedString st $ ("From: " ++) $ ppNameAddr . getFrom $ fs + drawCroppedString st $ ("From: " ++) . ppField $ lookupField "from" hs moveCursor (row + 1) (colPadAsInteger st) - drawCroppedString st $ ("To: " ++) $ ppNameAddr . getTo $ fs + drawCroppedString st $ ("To: " ++) . ppField $ lookupField "to" hs moveCursor (row + 2) (colPadAsInteger st) - drawCroppedString st $ ("Subject: " ++) $ ppSubject . getSubject $ fs + drawCroppedString st $ ("Subject: " ++) . ppField $ lookupField "subject" hs setColor $ baseColorID . colorStyle $ st put $ st { currentRow = (4 + currentRow st) } -- cgit v1.2.3