glirc-2.12: Console IRC client

Copyright(c) Eric Mertens, 2016
LicenseISC
Maintaineremertens@gmail.com
Safe HaskellNone
LanguageHaskell2010

Client.State.Network

Contents

Description

This module is responsible for tracking the state of an individual IRC connection while the client is connected to it. This state includes user information, server settings, channel membership, and more.

This module is more complicated than many of the other modules in the client because it is responsible for interpreting each IRC message from the server and updating the connection state accordingly.

Synopsis

Connection state

data NetworkState Source #

State tracked for each IRC connection

Constructors

NetworkState 

Fields

User information

data UserAndHost Source #

Pair of username and hostname. Empty strings represent missing information.

Constructors

UserAndHost !Text !Text

username hostname

Cross-message state

Connection predicates

iHaveOp :: Identifier -> NetworkState -> Bool Source #

Predicate to test if the connection has op in a given channel.

Messages interactions

squelchIrcMsg :: IrcMsg -> Bool Source #

Return True for messages that should be hidden outside of full detail view. These messages are interpreted by the client so the user shouldn't need to see them directly to get the relevant information.

Timer information

data PingStatus Source #

Status of the ping timer

Constructors

PingSent !UTCTime

ping sent waiting for pong

PingLatency !Double

latency in seconds for last ping

PingNever

no ping sent

PingConnecting !Int !(Maybe UTCTime)

number of attempts, last known connection time

nextTimedAction :: NetworkState -> Maybe (UTCTime, TimedAction) Source #

Compute the earliest timed action for a connection, if any

applyTimedAction :: TimedAction -> NetworkState -> IO NetworkState Source #

Apply the given TimedAction to a connection state.