imap 0.3.0.5 → 0.3.0.6
raw patch · 3 files changed
+21/−5 lines, 3 filesPVP: minor bump suggested
API additions: PVP suggests at least a minor version bump
API changes (from Hackage documentation)
+ Network.IMAP: uidCopy :: (MonadPlus m, MonadIO m, Universe m) => IMAPConnection -> Text -> Text -> m CommandResult
+ Network.IMAP: uidStore :: (MonadPlus m, MonadIO m, Universe m) => IMAPConnection -> Text -> Text -> [Flag] -> m CommandResult
Files
- imap.cabal +1/−1
- src/Network/IMAP.hs +17/−1
- src/Network/IMAP/Parsers/Untagged.hs +3/−3
imap.cabal view
@@ -2,7 +2,7 @@ -- see http://haskell.org/cabal/users-guide/ name: imap-version: 0.3.0.5+version: 0.3.0.6 synopsis: An efficient IMAP client library, with SSL and streaming license: BSD3 license-file: LICENSE
src/Network/IMAP.hs view
@@ -50,7 +50,9 @@ fetchG, uidFetchG, store,+ uidStore, copy,+ uidCopy, simpleFormat ) where @@ -294,7 +296,7 @@ fetch conn query = sendCommand conn $ encodeUtf8 command where command = T.intercalate " " ["FETCH", query, "BODY[]"] --- |Fetch message body my message UID+-- |Fetch message body by message UID uidFetch :: (MonadPlus m, MonadIO m, Universe m) => IMAPConnection -> T.Text -> m CommandResult uidFetch conn query = sendCommand conn $ encodeUtf8 command@@ -319,12 +321,26 @@ encodeUtf8 dataItem, flagsToText flagList] sendCommand conn command +uidStore :: (MonadPlus m, MonadIO m, Universe m) => IMAPConnection ->+ T.Text -> T.Text -> [Flag] -> m CommandResult+uidStore conn sequenceSet dataItem flagList = do+ let command = BSC.intercalate " " ["UID STORE", encodeUtf8 sequenceSet,+ encodeUtf8 dataItem, flagsToText flagList]+ sendCommand conn command + copy :: (MonadPlus m, MonadIO m, Universe m) => IMAPConnection -> T.Text -> T.Text -> m CommandResult copy conn sequenceSet mailboxName = sendCommand conn command where command = BSC.intercalate " " ["COPY", encodeUtf8 sequenceSet, encodeUtf8 mailboxName]++-- |Copy message by message UID+uidCopy :: (MonadPlus m, MonadIO m, Universe m) => IMAPConnection ->+ T.Text -> T.Text -> m CommandResult+uidCopy conn sequenceSet mailboxName = sendCommand conn $ encodeUtf8 command+ where command = T.intercalate " " ["UID COPY", sequenceSet, mailboxName]+ -- |Return the untagged replies or an error message if the tagged reply -- is of type NO or BAD. Also return all untagged replies received if
src/Network/IMAP/Parsers/Untagged.hs view
@@ -184,7 +184,7 @@ parseSearchResult :: Parser (Either ErrorMessage UntaggedResult) parseSearchResult = do- string "SEARCH "- msgIds <- AP.takeWhile1 isDigit `sepBy` char ' '- let parsedIds = mapM toInt msgIds+ string "SEARCH"+ msgIds <- AP.takeWhile isDigit `sepBy` char ' '+ let parsedIds = mapM toInt (filter (/= "") msgIds) return $ liftM Search parsedIds