glirc-2.33.1: Console IRC client

Copyright(c) Ruben Astudillo 2019
LicenseISC
Maintainerruben.astud@gmail.com
Safe HaskellNone
LanguageHaskell2010

Client.State.DCC

Contents

Description

This module provides ADTs and functions to deal with DCC SEND/ACCEPT request and how start such transfers.

Synopsis

Documentation

DCC offers

data DCCOffer Source #

All the necessary information to start the download

Constructors

DCCOffer 

Fields

Instances
Eq DCCOffer Source # 
Instance details

Defined in Client.State.DCC

Show DCCOffer Source # 
Instance details

Defined in Client.State.DCC

DCC transfer

data DCCTransfer Source #

Structure with information of a download accepted via "/dcc accept" or "/dcc resume"

Constructors

DCCTransfer 

Fields

DCC Update

Transfer a DCCOffer

supervisedDownload :: FilePath -> Key -> TChan DCCUpdate -> DCCState -> IO DCCState Source #

Launch a supervisor thread for downloading the offer referred by Key and return the DCCState accordingly.

Parser for DCC request

parseSEND :: Text -> UserInfo -> Text -> Either String DCCOffer Source #

Parse a "DCC SEND" command.

parseACCEPT :: DCCState -> UserInfo -> Text -> Maybe DCCUpdate Source #

Parse a "DCC RESUME" command.

DCC RESUME functionality

resumeMsg Source #

Arguments

:: Word32

offset

-> DCCOffer

offer

-> (String, String)

(target, txt)

Craft a CTCP message indicating we want to resume a download at the offset.

acceptUpdate :: DCCUpdate -> DCCState -> DCCState Source #

Modify the DCCState following the corresponding DCCUpdate

Miscellaneous

statusAtKey :: Key -> DCCState -> ConnectionStatus Source #

Check the status of a download at Key by checking the invariants at DCCState

reportStopWithStatus :: Key -> ConnectionStatus -> DCCState -> DCCState Source #

This function can only be called after a cancel has been issued on the supervisor thread at Key

isSend :: Text -> Bool Source #

Check if the payload of a DCC CTCP message is SEND