-- Hoogle documentation, generated by Haddock -- See Hoogle, http://www.haskell.org/hoogle/ -- | A DCC message parsing and helper library for IRC clients -- -- DCC (Direct Client-to-Client) is an IRC sub-protocol for establishing -- and maintaining direct connections to exchange messages and files. -- -- See http://www.irchelp.org/irchelp/rfc/ctcpspec.html for more -- details. @package irc-dcc @version 1.2.0 -- | Functions for receiving files. -- -- Each chunk is acknowledged by sending the total sum of bytes received -- for a file. See the CTCP specification. module Network.IRC.DCC.FileTransfer -- | Accept a DCC file offer acceptFile :: Integral a => OfferFile -> (PortNumber -> ExceptT String IO ()) -> (a -> IO ()) -> ReaderT (Maybe PortNumber) (ExceptT String IO) () -- | Accept a DCC file offer for a partially downloaded file resumeFile :: Integral a => AcceptResumeFile -> (PortNumber -> ExceptT String IO ()) -> (a -> IO ()) -> ReaderT (Maybe PortNumber) (ExceptT String IO) () -- | DCC command parsing and encoding module. -- -- Example of parsing an offer file command: -- --
--   runParser parseOfferFile ctcpMessage
--   
-- -- Example of encoding an offer file command: -- --
--   encodeCtcp offerFile
--   
module Network.IRC.DCC -- | Class for types that can be sent as CTCP commands class CtcpCommand a encodeCtcp :: CtcpCommand a => a -> CTCPByteString -- | Type of DCC service offered data Service -- | Offer chat session Messaging :: OpenChat -> Service -- | Offer file transfer FileTransfer :: OfferFile -> Service -- | Type of DCC chat to open data OpenChat -- | Text messages exchange -- --
--   DCC CHAT chat <ip> <port>
--   
Chat :: IPv4 -> PortNumber -> OpenChat -- | Drawing commands exchange -- --
--   DCC CHAT wboard <ip> <port>
--   
Whiteboard :: IPv4 -> PortNumber -> OpenChat -- | Signal intent to close DCC chat connection data CloseChat -- |
--   DCC CLOSE
--   
CloseChat :: CloseChat -- | DCC file transfer instructions data OfferFile -- | DCC: -- --
--   DCC SEND <fileName> <ip> <port> (<fileSize>)
--   
-- -- Reverse DCC: -- --
--   DCC SEND <fileName> <ip> 0 <fileSize> <token>
--   
OfferFile :: TransferType -> FileMetadata -> OfferFile -- | Signal intent to resume DCC file transfer at specific position data TryResumeFile -- | DCC: -- --
--   DCC RESUME <fileName> <port> <position>
--   
-- -- Reverse DCC: -- --
--   DCC RESUME <fileName> 0 <position> <token>
--   
TryResumeFile :: TransferType -> FileMetadata -> FileOffset -> TryResumeFile -- | Signal acceptance to resume DCC file transfer at specific position data AcceptResumeFile -- | DCC: -- --
--   DCC ACCEPT <fileName> <port> <position>
--   
-- -- Reverse DCC: -- --
--   DCC ACCEPT <fileName> 0 <position> <token>
--   
AcceptResumeFile :: TransferType -> FileMetadata -> FileOffset -> AcceptResumeFile -- | Signal readiness to accept a connection (only Reverse DCC) data OfferFileSink -- | Reverse DCC: -- --
--   DCC SEND <fileName> <ip> <port> <fileSize> <token>
--   
OfferFileSink :: Token -> FileMetadata -> IPv4 -> PortNumber -> OfferFileSink -- | Type of a DCC file transfer connection data TransferType -- | Connection where the owner of the file offers a socket to connect to Active :: IPv4 -> PortNumber -> TransferType -- | Connection where the recipient of the file offers a socket to connect -- to Passive :: IPv4 -> Token -> TransferType -- | Properties of a file data FileMetadata FileMetadata :: Path Rel File -> Maybe FileOffset -> FileMetadata [fileName] :: FileMetadata -> Path Rel File [fileSize] :: FileMetadata -> Maybe FileOffset -- | An identifier for knowing which negotiation a request belongs to newtype Token Token :: ByteString -> Token data FileOffset runParser :: Parser a -> CTCPByteString -> Either String a parseService :: Parser Service parseOpenChat :: Parser OpenChat parseCloseChat :: Parser CloseChat parseOfferFile :: Parser OfferFile parseTryResumeFile :: OfferFile -> Parser TryResumeFile parseAcceptResumeFile :: TryResumeFile -> Parser AcceptResumeFile parseOfferFileSink :: AcceptResumeFile -> Parser (Maybe OfferFileSink)