module Network.IRC.DCC (
CtcpCommand(..)
, DccChat(..)
, DccClose(..)
, DccSend(..)
, DccResume(..)
, DccAccept(..)
, acceptedPosition
, DccSendReverseClient(..)
, resumeFromSend
, matchesSend
, Path(..)
, fromPath
, PathType(..)
, FileOffset
, Token(..)
) where
import Network.IRC.DCC.Internal
resumeFromSend :: DccSend -> FileOffset -> DccResume
resumeFromSend (Send path' _ port _) pos =
Resume path' port pos
resumeFromSend (SendReverseServer path' _ _ token') pos =
ResumeReverse path' pos token'
matchesSend :: DccAccept -> DccSend -> Bool
matchesSend (Accept pathA portA _) (Send pathS _ portS _) =
pathS == pathA && portS == portA
matchesSend (AcceptReverse pathA _ tokenA) (SendReverseServer pathS _ _ tokenS) =
pathS == pathA && tokenS == tokenA
matchesSend _ _ = False