summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--test5.hs28
1 files changed, 13 insertions, 15 deletions
diff --git a/test5.hs b/test5.hs
index 09892f0..d91f5e7 100644
--- a/test5.hs
+++ b/test5.hs
@@ -531,7 +531,7 @@ attachFilesToDraft q@State{..} = case getMessage (Z.label cursor) of
]
>>= attachFiles filenames
>>= return . removeHeader "Date"
- >>= addDateHeader
+ >>= return . addDateHeader now
>>= M.renderMail'
>>= Notmuch.notmuchWithInput
[ "insert"
@@ -602,7 +602,7 @@ replyToAll q@State{..} = case getMessage (Z.label cursor) of
-- else abort
draft <-
M.renderMail' =<<
- addDateHeader =<<
+ return . addDateHeader now =<<
return . readMail =<<
T.readFile path
-- TODO use TagOps
@@ -772,19 +772,17 @@ withTempFile' s f = do
withTempFile tmpdir (logname ++ "_much_" ++ s) f
-addDateHeader :: M.Mail -> IO M.Mail
-addDateHeader m@M.Mail{..} = do
- t <- getCurrentTime
- return m
- { M.mailHeaders =
- ( "Date"
- , T.pack $
- formatTime defaultTimeLocale
- rfc822DateFormat
- t
- ) :
- mailHeaders
- }
+addDateHeader :: UTCTime -> M.Mail -> M.Mail
+addDateHeader t m@M.Mail{..} = do
+ m { M.mailHeaders =
+ ( "Date"
+ , T.pack $
+ formatTime defaultTimeLocale
+ rfc822DateFormat
+ t
+ ) :
+ mailHeaders
+ }
removeHeader :: CI BS.ByteString -> M.Mail -> M.Mail
removeHeader h m@M.Mail{..} =