aboutsummaryrefslogtreecommitdiff
path: root/Screen.hs
diff options
context:
space:
mode:
authorRaúl Benencia <rul@kalgan.cc>2013-09-01 13:16:54 -0300
committerRaúl Benencia <rul@kalgan.cc>2013-09-01 13:16:54 -0300
commit917de9c6df342d032e2b05238c7ea923da2772db (patch)
tree78b8f56b03ed07f4d9f055149a0e974d47609057 /Screen.hs
parent39f53d2775f38514a537f03c7b72281ec31a3c0e (diff)
towards mime library
Diffstat (limited to 'Screen.hs')
-rw-r--r--Screen.hs12
1 files changed, 6 insertions, 6 deletions
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) }
nihil fit ex nihilo