irc-dcc-2.0.1: A DCC message parsing and helper library for IRC clients

Safe HaskellNone
LanguageHaskell2010

Network.IRC.DCC

Contents

Description

DCC command parsing and encoding module.

Use the CtcpCommand type class to convert between CTCPByteStrings and typed values.

Try converting a CTCPByteString to a DccSend value:

fromCtcp ctcpMessage :: Either String DccSend

Encoding a DccSend value to a CTCPByteString:

toCtcp (Send fileName ip port (Just fileSize))
Synopsis

DCC command parsing and encoding

DCC command types

Messaging commands (DCC CHAT)

data DccChat #

Offer DCC chat session

Constructors

Chat !IPv4 !PortNumber

Text messages exchange

DCC CHAT chat <ip> <port>
ChatWhiteboard !IPv4 !PortNumber

Drawing commands exchange

DCC CHAT wboard <ip> <port>
Instances
Eq DccChat # 
Instance details

Defined in Network.IRC.DCC.Internal

Methods

(==) :: DccChat -> DccChat -> Bool #

(/=) :: DccChat -> DccChat -> Bool #

Show DccChat # 
Instance details

Defined in Network.IRC.DCC.Internal

CtcpCommand DccChat # 
Instance details

Defined in Network.IRC.DCC.Internal

data DccClose #

Signal intent to close DCC chat connection

Constructors

Close
DCC CLOSE
Instances
Eq DccClose # 
Instance details

Defined in Network.IRC.DCC.Internal

Show DccClose # 
Instance details

Defined in Network.IRC.DCC.Internal

CtcpCommand DccClose # 
Instance details

Defined in Network.IRC.DCC.Internal

File Transfer commands (DCC SEND)

data DccSend #

Offer DCC file transfer

Constructors

Send !Path !IPv4 !PortNumber !(Maybe FileOffset)

As part of the standard DCC protocol, sent by the server

DCC SEND <path> <ip> <port> (<fileSize>)
SendReverseServer !Path !IPv4 !FileOffset !Token

As part of the Reverse DCC protocol, sent by the server

DCC SEND <path> <ip> 0 <fileSize> <token>
Instances
Eq DccSend # 
Instance details

Defined in Network.IRC.DCC.Internal

Methods

(==) :: DccSend -> DccSend -> Bool #

(/=) :: DccSend -> DccSend -> Bool #

Show DccSend # 
Instance details

Defined in Network.IRC.DCC.Internal

CtcpCommand DccSend # 
Instance details

Defined in Network.IRC.DCC.Internal

data DccResume #

Signal intent to resume DCC file transfer at specific position

Constructors

Resume !Path !PortNumber !FileOffset

As part of the standard DCC protocol, sent by the client

DCC RESUME <path> <port> <position>
ResumeReverse !Path !FileOffset !Token

As part of the Reverse DCC protocol, sent by the client

DCC RESUME <path> 0 <position> <token>

data DccAccept #

Signal acceptance to resume DCC file transfer at specific position

Constructors

Accept !Path !PortNumber !FileOffset

As part of the standard DCC protocol, sent by the server

DCC ACCEPT <path> <port> <position>
AcceptReverse !Path !FileOffset !Token

As part of the Reverse DCC protocol, sent by the server

DCC ACCEPT <path> 0 <position> <token>

data DccSendReverseClient #

Tell the server to start a DCC file transfer and where it should send the data to.

Constructors

SendReverseClient !Path !IPv4 !PortNumber !FileOffset !Token

As part of the Reverse DCC protocol, sent by the client

DCC SEND <path> <ip> <port> <fileSize> <token>

Constructors from other commands

resumeFromSend :: DccSend -> FileOffset -> DccResume #

Try resuming a file offer

Protocol variant checks

matchesSend :: DccAccept -> DccSend -> Bool #

Check if a DccSend and a DccAccept command are part of the same negotiation.

Helper Types

data Path #

Instances
Eq Path # 
Instance details

Defined in Network.IRC.DCC.Internal

Methods

(==) :: Path -> Path -> Bool #

(/=) :: Path -> Path -> Bool #

Show Path # 
Instance details

Defined in Network.IRC.DCC.Internal

Methods

showsPrec :: Int -> Path -> ShowS #

show :: Path -> String #

showList :: [Path] -> ShowS #

data PathType #

Constructors

Simple

A file path without spaces

Quoted

A file path that can include spaces and will be quoted when serialized

Instances
Eq PathType # 
Instance details

Defined in Network.IRC.DCC.Internal

Show PathType # 
Instance details

Defined in Network.IRC.DCC.Internal

data FileOffset #

Instances
Bounded FileOffset # 
Instance details

Defined in Network.IRC.DCC.Internal

Enum FileOffset # 
Instance details

Defined in Network.IRC.DCC.Internal

Eq FileOffset # 
Instance details

Defined in Network.IRC.DCC.Internal

Integral FileOffset # 
Instance details

Defined in Network.IRC.DCC.Internal

Num FileOffset # 
Instance details

Defined in Network.IRC.DCC.Internal

Ord FileOffset # 
Instance details

Defined in Network.IRC.DCC.Internal

Real FileOffset # 
Instance details

Defined in Network.IRC.DCC.Internal

Show FileOffset # 
Instance details

Defined in Network.IRC.DCC.Internal

newtype Token #

An identifier for knowing which negotiation a request belongs to

Constructors

Token ByteString 
Instances
Eq Token # 
Instance details

Defined in Network.IRC.DCC.Internal

Methods

(==) :: Token -> Token -> Bool #

(/=) :: Token -> Token -> Bool #

Show Token # 
Instance details

Defined in Network.IRC.DCC.Internal

Methods

showsPrec :: Int -> Token -> ShowS #

show :: Token -> String #

showList :: [Token] -> ShowS #