purebred-0.1.0.0: An mail user agent built around notmuch

Safe HaskellNone
LanguageHaskell2010

Storage.Notmuch

Description

module for integrating notmuch within purebred

Synopsis

Documentation

messageTagModify Source #

Arguments

:: (Traversable t, MonadError Error m, MonadIO m) 
=> FilePath

database

-> [TagOp] 
-> t (a, NotmuchMail) 
-> m (t (a, NotmuchMail)) 

apply tag operations on all given mails and write the resulting tags to the database

tagItem :: ManageTags a => [TagOp] -> a -> a Source #

applyTagOp :: ManageTags a => TagOp -> a -> a Source #

class ManageTags a where Source #

Minimal complete definition

tags

Methods

tags :: Lens' a [Tag] Source #

setTags :: ManageTags a => [Tag] -> a -> a Source #

addTags :: ManageTags a => [Tag] -> a -> a Source #

removeTags :: ManageTags a => [Tag] -> a -> a Source #

getTags :: ManageTags a => a -> [Tag] Source #

hasTag :: ManageTags a => Tag -> a -> Bool Source #

withDatabase :: (AsNotmuchError e, Mode a, MonadError e m, MonadIO m) => FilePath -> (Database a -> ExceptT e IO c) -> m c Source #

A helper function for opening, performing work, and closing the database

withDatabaseReadOnly :: (AsNotmuchError e, MonadError e m, MonadIO m) => FilePath -> (Database RO -> ExceptT e IO c) -> m c Source #

Same as withDatabase, but the database connection is read-only

getMessages :: (MonadError Error m, MonadIO m) => Text -> NotmuchSettings FilePath -> m (Vector NotmuchMail) Source #

creates a vector of parsed mails from a not much search Note, that at this point in time only free form searches are supported. Also, we filter out the tag which we use to mark mails as new mails

getMessage :: (MonadError Error m, MonadIO m) => Database mode -> ByteString -> m (Message 0 mode) Source #

Get message by message ID, throwing MessageNotFound if not found

getThreads :: (MonadError Error m, MonadIO m) => Text -> NotmuchSettings FilePath -> m (Vector NotmuchThread) Source #

creates a vector of threads from a notmuch search

getThreadMessages :: (MonadError Error m, MonadIO m) => FilePath -> NotmuchThread -> m (Vector NotmuchMail) Source #

returns a vector of *all* messages belonging to the given thread

getThread :: (MonadError Error m, MonadIO m) => Database mode -> ByteString -> m (Thread mode) Source #

retrieve a given thread from the notmuch database by it's id Note: The notmuch API does not provide a designated endpoint for retrieving the thread by it's ID. We're cheating here by simply querying for the given thread id.