From f2e7bc9f1d8ec837b7c68c85d7db34a2578ea3da Mon Sep 17 00:00:00 2001 From: John Goerzen Date: Tue, 12 Aug 2008 10:02:29 -0500 Subject: [PATCH] Initial stab at readFullResponse --- src/Network/IMAP/Parser.hs | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) diff --git a/src/Network/IMAP/Parser.hs b/src/Network/IMAP/Parser.hs index c8cf6ca..1158c07 100644 --- a/src/Network/IMAP/Parser.hs +++ b/src/Network/IMAP/Parser.hs @@ -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. -- 2.39.2