| Copyright | (c) Eric Mertens, 2016 |
|---|---|
| License | ISC |
| Maintainer | emertens@gmail.com |
| Safe Haskell | None |
| Language | Haskell2010 |
Client.State
Description
This module provides the core logic of the IRC client. The client state tracks everything about the client.
- type NetworkName = Text
- data ClientState = ClientState {
- _clientWindows :: !(Map ClientFocus Window)
- _clientFocus :: !ClientFocus
- _clientSubfocus :: !ClientSubfocus
- _clientConnections :: !(IntMap ConnectionState)
- _clientNextConnectionId :: !Int
- _clientConnectionContext :: !ConnectionContext
- _clientEvents :: !(TQueue NetworkEvent)
- _clientNetworkMap :: !(HashMap NetworkName NetworkId)
- _clientVty :: !Vty
- _clientTextBox :: !EditBox
- _clientWidth :: !Int
- _clientHeight :: !Int
- _clientConfig :: !Configuration
- _clientScroll :: !Int
- _clientDetailView :: !Bool
- _clientIgnores :: !(HashSet Identifier)
- clientWindows :: Lens' ClientState (Map ClientFocus Window)
- clientTextBox :: Lens' ClientState EditBox
- clientConnections :: Lens' ClientState (IntMap ConnectionState)
- clientWidth :: Lens' ClientState Int
- clientHeight :: Lens' ClientState Int
- clientEvents :: Lens' ClientState (TQueue NetworkEvent)
- clientVty :: Lens' ClientState Vty
- clientFocus :: Lens' ClientState ClientFocus
- clientConnectionContext :: Lens' ClientState ConnectionContext
- clientConfig :: Lens' ClientState Configuration
- clientScroll :: Lens' ClientState Int
- clientDetailView :: Lens' ClientState Bool
- clientSubfocus :: Lens' ClientState ClientSubfocus
- clientNextConnectionId :: Lens' ClientState Int
- clientNetworkMap :: Lens' ClientState (HashMap NetworkName NetworkId)
- clientIgnores :: Lens' ClientState (HashSet Identifier)
- clientConnection :: Applicative f => NetworkName -> LensLike' f ClientState ConnectionState
- initialClientState :: Configuration -> Vty -> IO ClientState
- clientMatcher :: ClientState -> Text -> Bool
- consumeInput :: ClientState -> ClientState
- currentUserList :: ClientState -> [Identifier]
- ircIgnorable :: IrcMsg -> ClientState -> Maybe Identifier
- clientInput :: ClientState -> String
- abortNetwork :: NetworkName -> ClientState -> IO ClientState
- addConnection :: Text -> ClientState -> IO ClientState
- removeNetwork :: NetworkId -> ClientState -> (ConnectionState, ClientState)
- clientTick :: ClientState -> IO ClientState
- recordChannelMessage :: NetworkName -> Identifier -> ClientMessage -> ClientState -> ClientState
- recordNetworkMessage :: ClientMessage -> ClientState -> ClientState
- recordIrcMessage :: NetworkName -> MessageTarget -> ClientMessage -> ClientState -> ClientState
- data ClientFocus
- data ClientSubfocus
- focusNetwork :: ClientFocus -> Maybe NetworkName
- changeFocus :: ClientFocus -> ClientState -> ClientState
- changeSubfocus :: ClientSubfocus -> ClientState -> ClientState
- advanceFocus :: ClientState -> ClientState
- retreatFocus :: ClientState -> ClientState
- windowNames :: [Char]
Client state type
type NetworkName = Text Source #
data ClientState Source #
All state information for the IRC client
Constructors
| ClientState | |
Fields
| |
clientConnection :: Applicative f => NetworkName -> LensLike' f ClientState ConnectionState Source #
initialClientState :: Configuration -> Vty -> IO ClientState Source #
Client operations
clientMatcher :: ClientState -> Text -> Bool Source #
currentUserList :: ClientState -> [Identifier] Source #
ircIgnorable :: IrcMsg -> ClientState -> Maybe Identifier Source #
Predicate for messages that should be ignored based on the configurable ignore list
clientInput :: ClientState -> String Source #
abortNetwork :: NetworkName -> ClientState -> IO ClientState Source #
addConnection :: Text -> ClientState -> IO ClientState Source #
removeNetwork :: NetworkId -> ClientState -> (ConnectionState, ClientState) Source #
Remove a network connection and unlink it from the network map. This operation assumes that the networkconnection exists and should only be applied once per connection.
clientTick :: ClientState -> IO ClientState Source #
Add messages to buffers
recordChannelMessage :: NetworkName -> Identifier -> ClientMessage -> ClientState -> ClientState Source #
recordIrcMessage :: NetworkName -> MessageTarget -> ClientMessage -> ClientState -> ClientState Source #
Focus information
data ClientFocus Source #
Constructors
| Unfocused | |
| NetworkFocus !NetworkName | |
| ChannelFocus !NetworkName !Identifier |
Instances
| Eq ClientFocus Source # | |
| Ord ClientFocus Source # | Unfocused first, followed by focuses sorted by network. Within the same network the network focus comes first and then the channels are ordered by channel identifier |
changeFocus :: ClientFocus -> ClientState -> ClientState Source #
windowNames :: [Char] Source #