aboutsummaryrefslogtreecommitdiff
path: root/Maildir.hs
diff options
context:
space:
mode:
authorRaúl Benencia <rul@kalgan.cc>2013-08-27 15:03:04 -0300
committerRaúl Benencia <rul@kalgan.cc>2013-08-27 15:03:04 -0300
commitfab15274bae93611f85dd4cc221ce07b1661a081 (patch)
tree1023af4c4b664ade52466babadf3dc95864aab1e /Maildir.hs
parentf21a1f23ab53ab628ed2677c8d85869fa7e22b45 (diff)
Smoother scrolling in index mode
Diffstat (limited to 'Maildir.hs')
-rw-r--r--Maildir.hs8
1 files changed, 6 insertions, 2 deletions
diff --git a/Maildir.hs b/Maildir.hs
index f76695a..ede0f44 100644
--- a/Maildir.hs
+++ b/Maildir.hs
@@ -29,8 +29,12 @@ getMaildirEmails md = do
n <- (getNewEmails md)
return $ r ++ n
-getReadEmails md = getDirectoryContents $ md </> "cur"
-getNewEmails md = getDirectoryContents $ md </> "new"
+getReadEmails md = getEmails $ md </> "cur"
+getNewEmails md = getEmails $ md </> "new"
+
+getEmails fp = do
+ contents <- getDirectoryContents fp
+ return $ map (fp </>) $ filter (`notElem` [".", ".."]) contents
{- | Returns information about specific messages. -}
getMessages :: Maildir -> [FilePath] -> IO [(FilePath, Flags, String)]
nihil fit ex nihilo