| Copyright | (c) Eric Mertens, 2016 |
|---|---|
| License | ISC |
| Maintainer | emertens@gmail.com |
| Safe Haskell | None |
| Language | Haskell2010 |
Client.ConnectionState
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.
- data ConnectionState
- csNick :: Lens' ConnectionState Identifier
- csChannels :: Lens' ConnectionState (HashMap Identifier ChannelState)
- csSocket :: Lens' ConnectionState NetworkConnection
- csModeTypes :: Lens' ConnectionState ModeTypes
- csChannelTypes :: Lens' ConnectionState [Char]
- csTransaction :: Lens' ConnectionState Transaction
- csModes :: Lens' ConnectionState [Char]
- csStatusMsg :: Lens' ConnectionState [Char]
- csSettings :: Lens' ConnectionState ServerSettings
- csUserInfo :: Lens' ConnectionState UserInfo
- csUsers :: Lens' ConnectionState (HashMap Identifier (Maybe Text, Maybe Text))
- csUser :: Functor f => Identifier -> LensLike' f ConnectionState (Maybe Text, Maybe Text)
- csModeCount :: Lens' ConnectionState Int
- csNetworkId :: Lens' ConnectionState NetworkId
- csNetwork :: Lens' ConnectionState Text
- csNextPingTime :: Lens' ConnectionState (Maybe UTCTime)
- csPingStatus :: Lens' ConnectionState PingStatus
- newConnectionState :: NetworkId -> Text -> ServerSettings -> NetworkConnection -> ConnectionState
- isChannelIdentifier :: ConnectionState -> Identifier -> Bool
- iHaveOp :: Identifier -> ConnectionState -> Bool
- sendMsg :: ConnectionState -> RawIrcMsg -> IO ()
- initialMessages :: ConnectionState -> [RawIrcMsg]
- applyMessage :: ZonedTime -> IrcMsg -> ConnectionState -> ([RawIrcMsg], ConnectionState)
- squelchIrcMsg :: IrcMsg -> Bool
- data PingStatus
- data TimedAction
- nextTimedAction :: ConnectionState -> Maybe (UTCTime, TimedAction)
Connection state type
data ConnectionState Source #
Instances
csTransaction :: Lens' ConnectionState Transaction Source #
newConnectionState :: NetworkId -> Text -> ServerSettings -> NetworkConnection -> ConnectionState Source #
Connection predicates
isChannelIdentifier :: ConnectionState -> Identifier -> Bool Source #
iHaveOp :: Identifier -> ConnectionState -> Bool Source #
Predicate to test if the connection has op in a given channel.
Messages interactions
initialMessages :: ConnectionState -> [RawIrcMsg] Source #
applyMessage :: ZonedTime -> IrcMsg -> ConnectionState -> ([RawIrcMsg], ConnectionState) Source #
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
nextTimedAction :: ConnectionState -> Maybe (UTCTime, TimedAction) Source #