]> code.delx.au - offlineimap/commitdiff
Initial stab at readFullResponse
authorJohn Goerzen <jgoerzen@complete.org>
Tue, 12 Aug 2008 15:02:29 +0000 (10:02 -0500)
committerJohn Goerzen <jgoerzen@complete.org>
Tue, 12 Aug 2008 15:02:29 +0000 (10:02 -0500)
src/Network/IMAP/Parser.hs

index c8cf6cac9a4981bec4da700d61c97079679d040e..1158c070321d30cf4e11aad322b69d31a8f15b63 100644 (file)
@@ -21,18 +21,19 @@ import Text.ParserCombinators.Parsec
 import Network.IMAP.Types
 import Text.Regex.Posix
 import Data.Int
+import Data.List
 
 {- | Read a full response from the server. -}
-{-
 readFullResponse :: Monad m => 
     IMAPConnection m ->         -- ^ The connection to the server
-    IMAPString ->               -- ^ The tag that we are awaiting
     m IMAPString
-readFullResponse conn expectedtag =
+readFullResponse conn =
     accumLines []
     where accumLines accum = 
-              do line <- getFullLine []
--}
+              do line <- getFullLine [] conn
+                 if "* " `isPrefixOf` line
+                    then accumLines (accum ++ line ++ "\r\n")
+                    else return (accum ++ line ++ "\r\n")
 
 {- | Read a full line from the server, handling any continuation stuff.