-- Hoogle documentation, generated by Haddock
-- See Hoogle, http://www.haskell.org/hoogle/
-- | Console IRC client
--
-- Console IRC client
@package glirc
@version 2.12
-- | This module manages simple text navigation and manipulation, but
-- leaves more complicated operations like yank/kill and history
-- management to Client.State.EditBox
module Client.State.EditBox.Content
-- | Zipper-ish view of the multi-line content of an EditBox.
-- Lines _above the _currentLine are stored in reverse
-- order.
data Content
above :: Lens' Content [String]
below :: Lens' Content [String]
-- | Single line Content.
singleLine :: Line -> Content
-- | Default Content value
noContent :: Content
-- | Shifts the first line off of the Content, yielding the text of
-- the line and the rest of the content.
shift :: Content -> (String, Content)
data Line
Line :: !Int -> !String -> Line
[_pos] :: Line -> !Int
[_text] :: Line -> !String
class HasLine c_aiUk where pos = (.) line pos text = (.) line text
line :: HasLine c_aiUk => Lens' c_aiUk Line
pos :: HasLine c_aiUk => Lens' c_aiUk Int
text :: HasLine c_aiUk => Lens' c_aiUk String
endLine :: String -> Line
-- | Move the cursor left, across lines if necessary.
left :: Content -> Content
-- | Move the cursor right, across lines if necessary.
right :: Content -> Content
-- | Move the cursor left to the previous word boundary.
leftWord :: Content -> Content
-- | Move the cursor right to the next word boundary.
rightWord :: Content -> Content
-- | When at beginning of line, jump to beginning of previous line.
-- Otherwise jump to beginning of current line.
jumpLeft :: Content -> Content
-- | When at end of line, jump to end of next line. Otherwise jump to end
-- of current line.
jumpRight :: Content -> Content
-- | Delete the character after/under the cursor.
delete :: Content -> Content
-- | Delete the character before the cursor.
backspace :: Content -> Content
-- | Smarter version of insertString that removes spurious newlines.
insertPastedString :: String -> Content -> Content
-- | Insert string at cursor, cursor is advanced to the end of the inserted
-- string.
insertString :: String -> Content -> Content
-- | Insert character at cursor, cursor is advanced.
insertChar :: Char -> Content -> Content
instance Client.State.EditBox.Content.HasLine Client.State.EditBox.Content.Content
instance GHC.Show.Show Client.State.EditBox.Content.Content
instance GHC.Read.Read Client.State.EditBox.Content.Content
instance Client.State.EditBox.Content.HasLine Client.State.EditBox.Content.Line
instance GHC.Show.Show Client.State.EditBox.Content.Line
instance GHC.Read.Read Client.State.EditBox.Content.Line
-- | This module parses mIRC encoded text and generates VTY images.
module Client.Image.MircFormatting
-- | Parse mIRC encoded format characters and hide the control characters.
parseIrcText :: Text -> Image
-- | Parse mIRC encoded format characters and render the control characters
-- explicitly. This view is useful when inputting control characters to
-- make it clear where they are in the text.
parseIrcTextExplicit :: Text -> Image
-- | Safely render a control character.
controlImage :: Char -> Image
-- | This module defines types for hooking into the operation of the
-- client.
module Client.Hook
-- | The possible results of a MessageHook action. A hook can
-- decline to handle a message (PassMessage), filter out a message
-- (OmitMessage), or change a message into an arbitrary other
-- message (RemapMessage).
data MessageResult
PassMessage :: MessageResult
OmitMessage :: MessageResult
RemapMessage :: IrcMsg -> MessageResult
data MessageHook
MessageHook :: Text -> Bool -> (IrcMsg -> MessageResult) -> MessageHook
-- | Identifying name for the hook
[_messageHookName] :: MessageHook -> Text
-- | Whether the remapping should affect client state
[_messageHookStateful] :: MessageHook -> Bool
-- | (Partial) message remapping action
[_messageHookAction] :: MessageHook -> IrcMsg -> MessageResult
messageHookName :: Lens' MessageHook Text
messageHookStateful :: Lens' MessageHook Bool
messageHookAction :: Lens' MessageHook (IrcMsg -> MessageResult)
-- | Apply the given message hooks to an IrcMsg. The hooks are tried
-- in order until one handles the message. A Nothing result means
-- the message was filtered out by a hook. A Just result contains
-- the actual IrcMsg to be processed.
applyMessageHooks :: [MessageHook] -> IrcMsg -> Maybe IrcMsg
instance Data.Semigroup.Semigroup Client.Hook.MessageResult
instance GHC.Base.Monoid Client.Hook.MessageResult
-- | This hook remaps output from the znc buffextras plugin to the actual
-- IRC commands they represent, so that they can show up normally in the
-- client output.
module Client.Hook.Znc.Buffextras
-- | Map ZNC's buffextras messages to native client messages. Set debugging
-- to pass through buffextras messages that the hook doesn't understand.
buffextrasHook :: Bool -> MessageHook
-- | The collection of all hooks available in the client.
module Client.Hooks
-- | All the available message hooks.
messageHooks :: HashMap Text MessageHook
-- | This module provides a prettier rendering for exceptions that are
-- common in network connects as well as hints about what causes these
-- errors.
module Client.EventLoop.Errors
-- | Compute the message message text to be used for a connection error
exceptionToLines :: SomeException -> [String]
-- | This module provides tools for producing structured configuration
-- information out of configuration values.
module Config.FromConfig
-- | Configuration parser tracking current location and for propagating
-- error information.
data ConfigParser a
-- | Parse a Value according to the method in the FromConfig
decodeConfig :: FromConfig a => Value -> Either Text a
-- | Run a top-level parser to either get the parsed value or an error
-- message.
runConfigParser :: ConfigParser a -> Either Text a
-- | A parser that always fails with the given error message.
failure :: Text -> ConfigParser a
-- | Embed a parser into an extended location. This is used when parsing
-- inside a section.
extendLoc :: Text -> ConfigParser a -> ConfigParser a
-- | Class for types that have a well-known way to parse them.
class FromConfig a
-- | Parse a value
parseConfig :: FromConfig a => Value -> ConfigParser a
parseList :: (Value -> ConfigParser a) -> Value -> ConfigParser [a]
-- | Parser for consuming key-value pairs of sections.
data SectionParser a
-- | Run a SectionParser given particular Value. This will
-- only succeed when the value is a Sections and the section
-- parser consumes all of the sections from that value.
parseSections :: SectionParser a -> Value -> ConfigParser a
-- | Parse the value at the given section or fail.
sectionReq :: FromConfig a => Text -> SectionParser a
-- | Parse the value at the given section or fail.
sectionReqWith :: (Value -> ConfigParser a) -> Text -> SectionParser a
-- |
-- sectionOpt = sectionOptWith parseConfig
--
sectionOpt :: FromConfig a => Text -> SectionParser (Maybe a)
-- | Parses the value stored at the given section with the given parser.
-- Nothing is returned if the section is missing. Just is returned if the
-- parse succeeds Error is raised if the section is present but the parse
-- fails
sectionOptWith :: (Value -> ConfigParser a) -> Text -> SectionParser (Maybe a)
-- | Lift a ConfigParser into a SectionParser leaving the
-- current section information unmodified.
liftConfigParser :: ConfigParser a -> SectionParser a
parseSectionsWith :: (a -> Text -> Value -> ConfigParser a) -> a -> Value -> ConfigParser a
instance GHC.Base.Monad Config.FromConfig.SectionParser
instance GHC.Base.Applicative Config.FromConfig.SectionParser
instance GHC.Base.Functor Config.FromConfig.SectionParser
instance GHC.Base.Monad Config.FromConfig.ConfigParser
instance GHC.Base.Applicative Config.FromConfig.ConfigParser
instance GHC.Base.Functor Config.FromConfig.ConfigParser
instance Config.FromConfig.FromConfig Data.Text.Internal.Text
instance Config.FromConfig.FromConfig GHC.Integer.Type.Integer
instance GHC.Real.Integral a => Config.FromConfig.FromConfig (GHC.Real.Ratio a)
instance Config.FromConfig.FromConfig Config.Value.Atom
instance Config.FromConfig.FromConfig a => Config.FromConfig.FromConfig [a]
-- | This module defines the top-level configuration information for the
-- client.
module Client.Configuration.Colors
-- | Parse a color. Support formats are:
--
--
-- - Number between 0-255
-- - Name of color
-- - RGB values of color as a list
--
parseColor :: Value -> ConfigParser Color
-- | Parse a text attribute. This value should be a sections with the
-- fg and/or bg attributes. Otherwise it should be a
-- color entry that will be used for the foreground color. An empty
-- sections value will result in defAttr
parseAttr :: Value -> ConfigParser Attr
-- | This module provides names for all of the colors used in the UI.
module Client.Image.Palette
-- | Color palette used for rendering the client UI
data Palette
Palette :: Vector Attr -> Attr -> Maybe Attr -> Attr -> Attr -> Attr -> Attr -> Attr -> Attr -> Attr -> Attr -> Attr -> Attr -> Attr -> Attr -> Attr -> Attr -> Attr -> Palette
-- | highlighting nicknames
[_palNicks] :: Palette -> Vector Attr
-- | own nickname(s)
[_palSelf] :: Palette -> Attr
-- | own nickname(s) in mentions
[_palSelfHighlight] :: Palette -> Maybe Attr
-- | message timestamps
[_palTime] :: Palette -> Attr
-- | coalesced metadata
[_palMeta] :: Palette -> Attr
-- | sigils (e.g. @+)
[_palSigil] :: Palette -> Attr
-- | information labels
[_palLabel] :: Palette -> Attr
-- | ping latency
[_palLatency] :: Palette -> Attr
-- | window name
[_palWindowName] :: Palette -> Attr
-- | error messages
[_palError] :: Palette -> Attr
-- | textbox markers
[_palTextBox] :: Palette -> Attr
-- | window name with activity
[_palActivity] :: Palette -> Attr
-- | window name with mention
[_palMention] :: Palette -> Attr
-- | known command
[_palCommand] :: Palette -> Attr
-- | known command with complete arguments
[_palCommandReady] :: Palette -> Attr
-- | required argument placeholder
[_palCommandRequired] :: Palette -> Attr
-- | optional argument placeholder
[_palCommandOptional] :: Palette -> Attr
-- | remaining command text placeholder
[_palCommandRemaining] :: Palette -> Attr
palNicks :: Lens' Palette (Vector Attr)
palSelf :: Lens' Palette Attr
palSelfHighlight :: Lens' Palette (Maybe Attr)
palTime :: Lens' Palette Attr
palMeta :: Lens' Palette Attr
palSigil :: Lens' Palette Attr
palLabel :: Lens' Palette Attr
palLatency :: Lens' Palette Attr
palWindowName :: Lens' Palette Attr
palError :: Lens' Palette Attr
palTextBox :: Lens' Palette Attr
palActivity :: Lens' Palette Attr
palMention :: Lens' Palette Attr
palCommand :: Lens' Palette Attr
palCommandReady :: Lens' Palette Attr
palCommandRequired :: Lens' Palette Attr
palCommandOptional :: Lens' Palette Attr
palCommandRemaining :: Lens' Palette Attr
-- | Default UI colors that look nice in my dark solarized color scheme
defaultPalette :: Palette
instance GHC.Show.Show Client.Image.Palette.Palette
-- | This module provides support for the text operations important for
-- providing a text input in the IRC client. It tracks user input
-- history, tab completion history, and provides many update operations
-- which are mapped to the keyboard in Client.EventLoop.
module Client.State.EditBox
data EditBox
-- | Default EditBox value
defaultEditBox :: EditBox
content :: Lens' EditBox Content
lastOperation :: Lens' EditBox LastOperation
data Line
Line :: !Int -> !String -> Line
-- | Single line Content.
singleLine :: Line -> Content
endLine :: String -> Line
class HasLine c_aiUk where pos = (.) line pos text = (.) line text
line :: HasLine c_aiUk => Lens' c_aiUk Line
pos :: HasLine c_aiUk => Lens' c_aiUk Int
text :: HasLine c_aiUk => Lens' c_aiUk String
-- | Zipper-ish view of the multi-line content of an EditBox.
-- Lines _above the _currentLine are stored in reverse
-- order.
data Content
-- | Shifts the first line off of the Content, yielding the text of
-- the line and the rest of the content.
shift :: Content -> (String, Content)
above :: Lens' Content [String]
below :: Lens' Content [String]
-- | Delete the character after/under the cursor.
delete :: Content -> Content
-- | Delete the character before the cursor.
backspace :: Content -> Content
-- | Jump the cursor to the beginning of the input.
home :: EditBox -> EditBox
-- | Jump the cursor to the end of the input.
end :: EditBox -> EditBox
-- | Delete all text from the cursor to the beginning and store it in the
-- yank buffer.
killHome :: EditBox -> EditBox
-- | Delete all text from the cursor to the end and store it in the yank
-- buffer.
killEnd :: EditBox -> EditBox
-- | Kill the content from the cursor back to the previous word boundary.
-- When yank is set the yank buffer will be updated.
killWordBackward :: Bool -> EditBox -> EditBox
-- | Kill the content from the curser forward to the next word boundary.
-- When yank is set the yank buffer will be updated
killWordForward :: Bool -> EditBox -> EditBox
-- | Insert the yank buffer at the cursor.
yank :: EditBox -> EditBox
-- | Move the cursor left, across lines if necessary.
left :: Content -> Content
-- | Move the cursor right, across lines if necessary.
right :: Content -> Content
-- | Move the cursor left to the previous word boundary.
leftWord :: Content -> Content
-- | Move the cursor right to the next word boundary.
rightWord :: Content -> Content
-- | Insert a character at the cursor and advance the cursor.
insert :: Char -> EditBox -> EditBox
insertPaste :: String -> EditBox -> EditBox
-- | Insert string at cursor, cursor is advanced to the end of the inserted
-- string.
insertString :: String -> Content -> Content
-- | Update the editbox to reflect the earlier element in the history.
earlier :: EditBox -> Maybe EditBox
-- | Update the editbox to reflect the later element in the history.
later :: EditBox -> Maybe EditBox
-- | Indicate that the contents of the text box were successfully used by
-- the program. This clears the first line of the contents and updates
-- the history.
success :: EditBox -> EditBox
data LastOperation
TabOperation :: String -> LastOperation
KillOperation :: LastOperation
OtherOperation :: LastOperation
instance Client.State.EditBox.Content.HasLine Client.State.EditBox.EditBox
instance GHC.Show.Show Client.State.EditBox.EditBox
instance GHC.Read.Read Client.State.EditBox.EditBox
instance GHC.Show.Show Client.State.EditBox.LastOperation
instance GHC.Read.Read Client.State.EditBox.LastOperation
-- | This module defines the settings used for an individual IRC
-- connection. These are static settings that are not expected change
-- over the lifetime of a connection.
module Client.Configuration.ServerSettings
-- | Static server-level settings
data ServerSettings
ServerSettings :: !Text -> !Text -> !Text -> !Text -> !(Maybe Text) -> !(Maybe Text) -> !(Maybe Text) -> !HostName -> !(Maybe PortNumber) -> !UseTls -> !(Maybe FilePath) -> !(Maybe FilePath) -> ![Text] -> !(Maybe HostName) -> !PortNumber -> ![FilePath] -> ![Identifier] -> !Rational -> !Rational -> ![Text] -> !(Maybe Text) -> ServerSettings
-- | connection nickname
[_ssNick] :: ServerSettings -> !Text
-- | connection username
[_ssUser] :: ServerSettings -> !Text
-- | connection realname / GECOS
[_ssReal] :: ServerSettings -> !Text
-- | CTCP userinfo
[_ssUserInfo] :: ServerSettings -> !Text
-- | server password
[_ssPassword] :: ServerSettings -> !(Maybe Text)
-- | SASL username
[_ssSaslUsername] :: ServerSettings -> !(Maybe Text)
-- | SASL password
[_ssSaslPassword] :: ServerSettings -> !(Maybe Text)
-- | server hostname
[_ssHostName] :: ServerSettings -> !HostName
-- | server port
[_ssPort] :: ServerSettings -> !(Maybe PortNumber)
-- | use TLS to connect
[_ssTls] :: ServerSettings -> !UseTls
-- | path to client TLS certificate
[_ssTlsClientCert] :: ServerSettings -> !(Maybe FilePath)
-- | path to client TLS key
[_ssTlsClientKey] :: ServerSettings -> !(Maybe FilePath)
-- | raw IRC messages to transmit upon successful connection
[_ssConnectCmds] :: ServerSettings -> ![Text]
-- | hostname of SOCKS proxy
[_ssSocksHost] :: ServerSettings -> !(Maybe HostName)
-- | port of SOCKS proxy
[_ssSocksPort] :: ServerSettings -> !PortNumber
-- | additional CA certificates for validating server
[_ssServerCerts] :: ServerSettings -> ![FilePath]
-- | Channels with chanserv permissions
[_ssChanservChannels] :: ServerSettings -> ![Identifier]
-- | Flood limiter penalty (seconds)
[_ssFloodPenalty] :: ServerSettings -> !Rational
-- | Flood limited threshold (seconds)
[_ssFloodThreshold] :: ServerSettings -> !Rational
-- | Initial message hooks
[_ssMessageHooks] :: ServerSettings -> ![Text]
-- | The name referencing the server in commands
[_ssName] :: ServerSettings -> !(Maybe Text)
ssNick :: Lens' ServerSettings Text
ssUser :: Lens' ServerSettings Text
ssReal :: Lens' ServerSettings Text
ssUserInfo :: Lens' ServerSettings Text
ssPassword :: Lens' ServerSettings (Maybe Text)
ssSaslUsername :: Lens' ServerSettings (Maybe Text)
ssSaslPassword :: Lens' ServerSettings (Maybe Text)
ssHostName :: Lens' ServerSettings HostName
ssPort :: Lens' ServerSettings (Maybe PortNumber)
ssTls :: Lens' ServerSettings UseTls
ssTlsClientCert :: Lens' ServerSettings (Maybe FilePath)
ssTlsClientKey :: Lens' ServerSettings (Maybe FilePath)
ssConnectCmds :: Lens' ServerSettings [Text]
ssSocksHost :: Lens' ServerSettings (Maybe HostName)
ssSocksPort :: Lens' ServerSettings PortNumber
ssServerCerts :: Lens' ServerSettings [FilePath]
ssChanservChannels :: Lens' ServerSettings [Identifier]
ssFloodPenalty :: Lens' ServerSettings Rational
ssFloodThreshold :: Lens' ServerSettings Rational
ssMessageHooks :: Lens' ServerSettings [Text]
ssName :: Lens' ServerSettings (Maybe Text)
-- | Load the defaults for server settings based on the environment
-- variables.
--
-- USER, IRCPASSSWORD, and SASLPASSWORD are
-- used.
loadDefaultServerSettings :: IO ServerSettings
data UseTls
-- | TLS connection
UseTls :: UseTls
-- | TLS connection without certificate checking
UseInsecureTls :: UseTls
-- | Plain connection
UseInsecure :: UseTls
instance GHC.Show.Show Client.Configuration.ServerSettings.ServerSettings
instance GHC.Show.Show Client.Configuration.ServerSettings.UseTls
-- | This module provides the tab-completion logic used for nicknames and
-- channels.
module Client.Commands.WordCompletion
class (IsString a, Ord a) => Prefix a
-- | Perform word completion on a text box.
--
-- The leading update operation is applied to the result of
-- tab-completion when tab completing from the beginning of the text box.
-- This is useful when auto-completing a nick and including a trailing
-- colon.
--
-- The reversed parameter indicates that tab-completion should
-- return the previous entry. When starting a fresh tab completion the
-- priority completions will be considered in order before resorting to
-- the set of possible completions.
wordComplete :: Prefix a => (String -> String) -> Bool -> [a] -> [a] -> EditBox -> Maybe EditBox
instance Client.Commands.WordCompletion.Prefix Irc.Identifier.Identifier
instance Client.Commands.WordCompletion.Prefix Data.Text.Internal.Text
-- | This module is able to parse commands with inline variables and then
-- to evaluate those variables to produce a complete command that varies
-- by the current context.
module Client.Commands.Interpolation
-- | Parsed chunk of an expandable command
data ExpansionChunk
-- | regular text
LiteralChunk :: Text -> ExpansionChunk
-- | inline variable $x or ${x y}
VariableChunk :: Text -> ExpansionChunk
-- | inline variable $1 or ${1}
IntegerChunk :: Integer -> ExpansionChunk
parseExpansion :: Text -> Maybe [ExpansionChunk]
resolveExpansions :: (Text -> Maybe Text) -> (Integer -> Maybe Text) -> [ExpansionChunk] -> Maybe Text
instance GHC.Show.Show Client.Commands.Interpolation.ExpansionChunk
-- | This module defines the top-level configuration information for the
-- client.
module Client.Configuration
-- | Top-level client configuration information. When connecting to a
-- server configuration from _configServers is used where
-- possible, otherwise _configDefaults is used.
data Configuration
Configuration :: ServerSettings -> (HashMap Text ServerSettings) -> Palette -> Text -> HashSet Identifier -> Maybe Integer -> Maybe FilePath -> HashMap Text [[ExpansionChunk]] -> [FilePath] -> Configuration
-- | Default connection settings
[_configDefaults] :: Configuration -> ServerSettings
-- | Host-specific settings
[_configServers] :: Configuration -> (HashMap Text ServerSettings)
[_configPalette] :: Configuration -> Palette
-- | Names of windows, used when alt-jumping)
[_configWindowNames] :: Configuration -> Text
-- | Extra highlight nicks/terms
[_configExtraHighlights] :: Configuration -> HashSet Identifier
-- | Padding of nicks
[_configNickPadding] :: Configuration -> Maybe Integer
-- | manually specified configuration path, used for reloading
[_configConfigPath] :: Configuration -> Maybe FilePath
-- | command macros
[_configMacros] :: Configuration -> HashMap Text [[ExpansionChunk]]
-- | paths to shared library
[_configExtensions] :: Configuration -> [FilePath]
data ConfigurationFailure
ConfigurationParseFailed :: String -> ConfigurationFailure
ConfigurationMalformed :: String -> ConfigurationFailure
ConfigurationReadFailed :: String -> ConfigurationFailure
configDefaults :: Lens' Configuration ServerSettings
configServers :: Lens' Configuration (HashMap Text ServerSettings)
configPalette :: Lens' Configuration Palette
configWindowNames :: Lens' Configuration Text
configNickPadding :: Lens' Configuration (Maybe Integer)
configConfigPath :: Lens' Configuration (Maybe FilePath)
configMacros :: Lens' Configuration (HashMap Text [[ExpansionChunk]])
configExtensions :: Lens' Configuration [FilePath]
configExtraHighlights :: Lens' Configuration (HashSet Identifier)
-- | Load the configuration file defaulting to
-- ~.glircconfig.
loadConfiguration :: Maybe FilePath -> IO (Either ConfigurationFailure Configuration)
-- | Resolve relative paths starting at the home directory rather than the
-- current directory of the client.
resolveConfigurationPath :: FilePath -> IO FilePath
instance GHC.Show.Show Client.Configuration.ConfigurationFailure
instance GHC.Exception.Exception Client.Configuration.ConfigurationFailure
instance GHC.Show.Show Client.Configuration.Configuration
-- | This module is responsible for creating Connection values for a
-- particular server as specified by a ServerSettings. This
-- involves setting up certificate stores an mapping network settings
-- from the client configuration into the network connection library.
module Client.Network.Connect
-- | Create a new Connection which will be closed when the
-- continuation finishes.
withConnection :: ConnectionContext -> ServerSettings -> (Connection -> IO a) -> IO a
-- | This module creates network connections and thread to manage those
-- connections. Events on these connections will be written to a given
-- event queue, and outgoing messages are recieved on an incoming event
-- queue.
--
-- These network connections are rate limited for outgoing messages per
-- the rate limiting algorithm given in the IRC RFC.
--
-- Incoming network event messages are assumed to be framed by newlines.
--
-- When a network connection terminates normally its final messages will
-- be NetworkClose. When it terminates abnormally its final
-- message will be NetworkError.
module Client.Network.Async
-- | Handle for a network connection
data NetworkConnection
-- | Identifier used to match connection events to connections.
type NetworkId = Int
-- | The sum of incoming events from a network connection. All events are
-- annotated with a network ID matching that given when the connection
-- was created as well as the time at which the message was recieved.
data NetworkEvent
-- | Event for a new recieved line (newline removed)
NetworkLine :: !NetworkId -> !ZonedTime -> !ByteString -> NetworkEvent
-- | Final message indicating the network connection failed
NetworkError :: !NetworkId -> !ZonedTime -> !SomeException -> NetworkEvent
-- | Final message indicating the network connection finished
NetworkClose :: !NetworkId -> !ZonedTime -> NetworkEvent
-- | Initiate a new network connection according to the given
-- ServerSettings. All events on this connection will be added to
-- the given queue. The resulting NetworkConnection value can be
-- used for sending outgoing messages and for early termination of the
-- connection.
createConnection :: Int -> NetworkId -> ConnectionContext -> ServerSettings -> TQueue NetworkEvent -> IO NetworkConnection
-- | Schedule a message to be transmitted on the network connection. These
-- messages are sent unmodified. The message should contain a newline
-- terminator.
send :: NetworkConnection -> ByteString -> IO ()
-- | Force the given connection to terminate.
abortConnection :: TerminationReason -> NetworkConnection -> IO ()
-- | Exceptions used to kill connections manually.
data TerminationReason
-- | sent when ping timer expires
PingTimeout :: TerminationReason
-- | sent when client commands force disconnect
ForcedDisconnect :: TerminationReason
instance GHC.Show.Show Client.Network.Async.TerminationReason
instance GHC.Show.Show Client.Network.Async.NetworkConnection
instance GHC.Exception.Exception Client.Network.Async.TerminationReason
-- | This module renders the lines used in the channel mask list. A mask
-- list can show channel bans, quiets, invites, and exceptions.
module Client.Commands.Exec
data ExecCmd
ExecCmd :: Maybe String -> Maybe String -> String -> String -> [String] -> ExecCmd
[_execOutputNetwork] :: ExecCmd -> Maybe String
[_execOutputChannel] :: ExecCmd -> Maybe String
[_execCommand] :: ExecCmd -> String
[_execStdIn] :: ExecCmd -> String
[_execArguments] :: ExecCmd -> [String]
execStdIn :: Lens' ExecCmd String
execOutputNetwork :: Lens' ExecCmd (Maybe String)
execOutputChannel :: Lens' ExecCmd (Maybe String)
execCommand :: Lens' ExecCmd String
execArguments :: Lens' ExecCmd [String]
emptyExecCmd :: ExecCmd
options :: [OptDescr (ExecCmd -> ExecCmd)]
parseExecCmd :: String -> Either [String] ExecCmd
runExecCmd :: ExecCmd -> IO (Either [String] [String])
instance GHC.Show.Show Client.Commands.Exec.ExecCmd
instance GHC.Read.Read Client.Commands.Exec.ExecCmd
-- | This module provides a description for the arguments expected by
-- command commands as well as a way to parse those arguments.
module Client.Commands.Arguments
-- | Description of a command's arguments indexed by the result of parsing
-- those arguments. Arguments are annotated with a String
-- describing the argument.
data ArgumentSpec :: * -> *
-- | A required space-delimited token
[ReqTokenArg] :: String -> ArgumentSpec rest -> ArgumentSpec (String, rest)
-- | An optional space-delimited token
[OptTokenArg] :: String -> ArgumentSpec rest -> ArgumentSpec (Maybe (String, rest))
-- | Take all the remaining text in free-form
[RemainingArg] :: String -> ArgumentSpec String
-- | No arguments
[NoArg] :: ArgumentSpec ()
-- | Parse the given input string using an argument specification. The
-- arguments should start with a space but might have more.
parseArguments :: ArgumentSpec a -> String -> Maybe a
-- | This module provides image rendering for the textbox in the context of
-- command argument processing.
module Client.Image.Arguments
argumentsImage :: Palette -> ArgumentSpec a -> String -> Image
plainText :: String -> Image
-- | The client has a primary message window whose contents are determined
-- by a Focus. In order to provide different views of channels the
-- Subfocus breaks down channel focus into different subviews.
module Client.State.Focus
-- | Currently focused window
data Focus
-- | No network
Unfocused :: Focus
-- | Network
NetworkFocus :: !Text -> Focus
-- | Network Channel/Nick
ChannelFocus :: !Text -> !Identifier -> Focus
-- | Subfocus view
data Subfocus
-- | Show messages
FocusMessages :: Subfocus
-- | Show channel metadata
FocusInfo :: Subfocus
-- | Show channel user list
FocusUsers :: Subfocus
-- | Show channel mask list for given mode
FocusMasks :: !Char -> Subfocus
-- | Show client windows
FocusWindows :: Subfocus
-- | Return the network associated with the current focus
focusNetwork :: Focus -> Maybe Text
_ChannelFocus :: Prism' Focus (Text, Identifier)
_NetworkFocus :: Prism' Focus Text
_Unfocused :: Prism' Focus ()
_FocusMessages :: Prism' Subfocus ()
_FocusInfo :: Prism' Subfocus ()
_FocusUsers :: Prism' Subfocus ()
_FocusMasks :: Prism' Subfocus Char
_FocusWindows :: Prism' Subfocus ()
instance GHC.Classes.Ord Client.State.Focus.Focus
instance GHC.Show.Show Client.State.Focus.Subfocus
instance GHC.Classes.Eq Client.State.Focus.Subfocus
instance GHC.Show.Show Client.State.Focus.Focus
instance GHC.Classes.Eq Client.State.Focus.Focus
-- | This module is responsible for tracking the state of an individual IRC
-- channel while the client is connected to it. When the client joins a
-- channel a new channel session is created and when the client leaves a
-- channel is it destroyed.
module Client.State.Channel
-- | Dynamic information about the state of an IRC channel
data ChannelState
ChannelState :: !Text -> !(Maybe TopicProvenance) -> !(Maybe Text) -> !(HashMap Identifier String) -> !(Map Char Text) -> !(Map Char (HashMap Text MaskListEntry)) -> !(Maybe UTCTime) -> ![RawIrcMsg] -> ChannelState
-- | topic text
[_chanTopic] :: ChannelState -> !Text
-- | author and timestamp for topic
[_chanTopicProvenance] :: ChannelState -> !(Maybe TopicProvenance)
-- | channel URL
[_chanUrl] :: ChannelState -> !(Maybe Text)
-- | user list and sigils
[_chanUsers] :: ChannelState -> !(HashMap Identifier String)
-- | channel settings and parameters
[_chanModes] :: ChannelState -> !(Map Char Text)
-- | mode, mask, setter, set time
[_chanLists] :: ChannelState -> !(Map Char (HashMap Text MaskListEntry))
-- | creation time of channel
[_chanCreation] :: ChannelState -> !(Maybe UTCTime)
-- | delayed op messages
[_chanQueuedModeration] :: ChannelState -> ![RawIrcMsg]
chanTopic :: Lens' ChannelState Text
chanTopicProvenance :: Lens' ChannelState (Maybe TopicProvenance)
chanUrl :: Lens' ChannelState (Maybe Text)
chanUsers :: Lens' ChannelState (HashMap Identifier String)
chanModes :: Lens' ChannelState (Map Char Text)
chanLists :: Lens' ChannelState (Map Char (HashMap Text MaskListEntry))
chanCreation :: Lens' ChannelState (Maybe UTCTime)
chanQueuedModeration :: Lens' ChannelState [RawIrcMsg]
data MaskListEntry
MaskListEntry :: {-# UNPACK #-} !Text -> {-# UNPACK #-} !UTCTime -> MaskListEntry
[_maskListSetter] :: MaskListEntry -> {-# UNPACK #-} !Text
[_maskListTime] :: MaskListEntry -> {-# UNPACK #-} !UTCTime
maskListSetter :: Lens' MaskListEntry Text
maskListTime :: Lens' MaskListEntry UTCTime
data TopicProvenance
TopicProvenance :: !UserInfo -> !UTCTime -> TopicProvenance
[_topicAuthor] :: TopicProvenance -> !UserInfo
[_topicTime] :: TopicProvenance -> !UTCTime
topicAuthor :: Lens' TopicProvenance UserInfo
topicTime :: Lens' TopicProvenance UTCTime
-- | Construct an empty ChannelState
newChannel :: ChannelState
-- | Set the channel topic
setTopic :: Text -> ChannelState -> ChannelState
-- | Add a user to the user list
joinChannel :: Identifier -> ChannelState -> ChannelState
-- | Remove a user from the user list
partChannel :: Identifier -> ChannelState -> ChannelState
-- | Rename a user in the user list
nickChange :: Identifier -> Identifier -> ChannelState -> ChannelState
instance GHC.Show.Show Client.State.Channel.ChannelState
instance GHC.Show.Show Client.State.Channel.MaskListEntry
instance GHC.Show.Show Client.State.Channel.TopicProvenance
-- | 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.
module Client.State.Network
-- | State tracked for each IRC connection
data NetworkState
NetworkState :: !NetworkId -> !(HashMap Identifier ChannelState) -> !NetworkConnection -> !ModeTypes -> ![Char] -> !Transaction -> ![Char] -> ![Char] -> !ServerSettings -> !UserInfo -> !(HashMap Identifier UserAndHost) -> !Int -> !Text -> !(Maybe UTCTime) -> !PingStatus -> ![Text] -> NetworkState
-- | network connection identifier
[_csNetworkId] :: NetworkState -> !NetworkId
-- | joined channels
[_csChannels] :: NetworkState -> !(HashMap Identifier ChannelState)
-- | network socket
[_csSocket] :: NetworkState -> !NetworkConnection
-- | channel mode meanings
[_csModeTypes] :: NetworkState -> !ModeTypes
-- | channel identifier prefixes
[_csChannelTypes] :: NetworkState -> ![Char]
-- | state for multi-message sequences
[_csTransaction] :: NetworkState -> !Transaction
-- | modes for the connected user
[_csModes] :: NetworkState -> ![Char]
-- | modes that prefix statusmsg channel names
[_csStatusMsg] :: NetworkState -> ![Char]
-- | settings used for this connection
[_csSettings] :: NetworkState -> !ServerSettings
-- | usermask used by the server for this connection
[_csUserInfo] :: NetworkState -> !UserInfo
-- | user and hostname for other nicks
[_csUsers] :: NetworkState -> !(HashMap Identifier UserAndHost)
-- | maximum mode changes per MODE command
[_csModeCount] :: NetworkState -> !Int
-- | name of network connection
[_csNetwork] :: NetworkState -> !Text
-- | time for next ping event
[_csNextPingTime] :: NetworkState -> !(Maybe UTCTime)
-- | state of ping timer
[_csPingStatus] :: NetworkState -> !PingStatus
-- | names of message hooks to apply to this connection
[_csMessageHooks] :: NetworkState -> ![Text]
newNetworkState :: NetworkId -> Text -> ServerSettings -> NetworkConnection -> PingStatus -> NetworkState
csNick :: Lens' NetworkState Identifier
csChannels :: Lens' NetworkState (HashMap Identifier ChannelState)
csSocket :: Lens' NetworkState NetworkConnection
csModeTypes :: Lens' NetworkState ModeTypes
csChannelTypes :: Lens' NetworkState [Char]
csTransaction :: Lens' NetworkState Transaction
csModes :: Lens' NetworkState [Char]
csStatusMsg :: Lens' NetworkState [Char]
csSettings :: Lens' NetworkState ServerSettings
csUserInfo :: Lens' NetworkState UserInfo
csUsers :: Lens' NetworkState (HashMap Identifier UserAndHost)
csUser :: Functor f => Identifier -> LensLike' f NetworkState (Maybe UserAndHost)
csModeCount :: Lens' NetworkState Int
csNetworkId :: Lens' NetworkState NetworkId
csNetwork :: Lens' NetworkState Text
csNextPingTime :: Lens' NetworkState (Maybe UTCTime)
csPingStatus :: Lens' NetworkState PingStatus
csMessageHooks :: Lens' NetworkState [Text]
-- | Pair of username and hostname. Empty strings represent missing
-- information.
data UserAndHost
-- | username hostname
UserAndHost :: {-# UNPACK #-} !Text -> {-# UNPACK #-} !Text -> UserAndHost
data Transaction
NoTransaction :: Transaction
NamesTransaction :: [Text] -> Transaction
BanTransaction :: [(Text, MaskListEntry)] -> Transaction
WhoTransaction :: [UserInfo] -> Transaction
isChannelIdentifier :: NetworkState -> Identifier -> Bool
-- | Predicate to test if the connection has op in a given channel.
iHaveOp :: Identifier -> NetworkState -> Bool
sendMsg :: NetworkState -> RawIrcMsg -> IO ()
initialMessages :: NetworkState -> [RawIrcMsg]
applyMessage :: ZonedTime -> IrcMsg -> NetworkState -> ([RawIrcMsg], NetworkState)
-- | 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.
squelchIrcMsg :: IrcMsg -> Bool
-- | Status of the ping timer
data PingStatus
-- | ping sent waiting for pong
PingSent :: !UTCTime -> PingStatus
-- | latency in seconds for last ping
PingLatency :: !Double -> PingStatus
-- | no ping sent
PingNever :: PingStatus
-- | number of attempts, last known connection time
PingConnecting :: !Int -> !(Maybe UTCTime) -> PingStatus
-- | Timer-based events
data TimedAction
-- | terminate the connection due to timeout
TimedDisconnect :: TimedAction
-- | transmit a ping to the server
TimedSendPing :: TimedAction
-- | Compute the earliest timed action for a connection, if any
nextTimedAction :: NetworkState -> Maybe (UTCTime, TimedAction)
-- | Apply the given TimedAction to a connection state.
applyTimedAction :: TimedAction -> NetworkState -> IO NetworkState
instance GHC.Show.Show Client.State.Network.TimedAction
instance GHC.Classes.Ord Client.State.Network.TimedAction
instance GHC.Classes.Eq Client.State.Network.TimedAction
instance GHC.Show.Show Client.State.Network.NetworkState
instance GHC.Show.Show Client.State.Network.Transaction
instance GHC.Show.Show Client.State.Network.PingStatus
instance GHC.Show.Show Client.State.Network.UserAndHost
-- | This module provides the type used to track messages just before they
-- are added to a window.
module Client.Message
data ClientMessage
ClientMessage :: !Text -> !MessageBody -> !ZonedTime -> ClientMessage
[_msgNetwork] :: ClientMessage -> !Text
[_msgBody] :: ClientMessage -> !MessageBody
[_msgTime] :: ClientMessage -> !ZonedTime
msgNetwork :: Lens' ClientMessage Text
msgBody :: Lens' ClientMessage MessageBody
msgTime :: Lens' ClientMessage ZonedTime
data MessageBody
IrcBody :: !IrcMsg -> MessageBody
ErrorBody :: {-# UNPACK #-} !Text -> MessageBody
NormalBody :: {-# UNPACK #-} !Text -> MessageBody
_IrcBody :: Prism' MessageBody IrcMsg
_ErrorBody :: Prism' MessageBody Text
_NormalBody :: Prism' MessageBody Text
-- | Compute a searchable text representation of the message
msgText :: MessageBody -> Text
-- | This module defines types and operations used to store messages for
-- display in the client's buffers.
module Client.State.Window
-- | A Window tracks all of the messages and metadata for a
-- particular message buffer.
data Window
Window :: ![WindowLine] -> !Int -> !Int -> !Bool -> Window
-- | Messages to display, newest first
[_winMessages] :: Window -> ![WindowLine]
-- | Messages added since buffer was visible
[_winUnread] :: Window -> !Int
-- | Messages in buffer
[_winTotal] :: Window -> !Int
-- | Indicates an important event is unread
[_winMention] :: Window -> !Bool
winMessages :: Lens' Window [WindowLine]
winUnread :: Lens' Window Int
winTotal :: Lens' Window Int
winMention :: Lens' Window Bool
-- | A single message to be displayed in a window
data WindowLine
WindowLine :: !MessageBody -> {-# UNPACK #-} !Text -> !Image -> !Image -> WindowLine
-- | Original Haskell value
[_wlBody] :: WindowLine -> !MessageBody
-- | Searchable text form
[_wlText] :: WindowLine -> {-# UNPACK #-} !Text
-- | Normal rendered image
[_wlImage] :: WindowLine -> !Image
-- | Detailed rendered image
[_wlFullImage] :: WindowLine -> !Image
wlBody :: Lens' WindowLine MessageBody
wlText :: Lens' WindowLine Text
wlImage :: Lens' WindowLine Image
wlFullImage :: Lens' WindowLine Image
-- | Flag for the important of a message being added to a window
data WindowLineImportance
-- | Don't update unread count
WLBoring :: WindowLineImportance
-- | Increment unread count
WLNormal :: WindowLineImportance
-- | Increment unread count and set important flag
WLImportant :: WindowLineImportance
-- | A window with no messages
emptyWindow :: Window
-- | Adds a given line to a window as the newest message. Window's unread
-- count will be updated according to the given importance.
addToWindow :: WindowLineImportance -> WindowLine -> Window -> Window
-- | Update the window clearing the unread count and important flag.
windowSeen :: Window -> Window
instance GHC.Show.Show Client.State.Window.WindowLineImportance
instance GHC.Classes.Eq Client.State.Window.WindowLineImportance
-- | This module provides image renderers for messages.
module Client.Image.Message
-- | Parameters used when rendering messages
data MessageRendererParams
MessageRendererParams :: [Char] -> [Char] -> HashSet Identifier -> HashSet Identifier -> Palette -> Maybe Integer -> MessageRendererParams
-- | restricted message sigils
[rendStatusMsg] :: MessageRendererParams -> [Char]
-- | sender sigils
[rendUserSigils] :: MessageRendererParams -> [Char]
-- | nicknames to highlight
[rendNicks] :: MessageRendererParams -> HashSet Identifier
-- | nicknames to highlight in red
[rendMyNicks] :: MessageRendererParams -> HashSet Identifier
-- | nick color palette
[rendPalette] :: MessageRendererParams -> Palette
-- | nick padding
[rendNickPadding] :: MessageRendererParams -> Maybe Integer
-- | Level of detail to use when rendering
data RenderMode
-- | only render nicknames
NormalRender :: RenderMode
-- | render full user info
DetailedRender :: RenderMode
data IdentifierColorMode
-- | An identifier in a PRIVMSG
PrivmsgIdentifier :: IdentifierColorMode
-- | An identifier somewhere else
NormalIdentifier :: IdentifierColorMode
-- | Default MessageRenderParams with no sigils or nicknames
-- specified
defaultRenderParams :: MessageRendererParams
-- | Construct a message given the time the message was received and its
-- render parameters.
msgImage :: RenderMode -> ZonedTime -> MessageRendererParams -> MessageBody -> Image
-- | Returns image and identifier to be used when collapsing metadata
-- messages.
metadataImg :: IrcMsg -> Maybe (Image, Identifier, Maybe Identifier)
-- | Image used when treating ignored chat messages as metadata
ignoreImage :: Image
-- | Render an identifier without using colors. This is useful for
-- metadata.
quietIdentifier :: Palette -> Identifier -> Image
-- | Render an a full user. In normal mode only the nickname will be
-- rendered. If detailed mode the full user info including the username
-- and hostname parts will be rendered. The nickname will be colored.
coloredUserInfo :: Palette -> RenderMode -> HashSet Identifier -> UserInfo -> Image
-- | Render a nickname in its hash-based color.
coloredIdentifier :: Palette -> IdentifierColorMode -> HashSet Identifier -> Identifier -> Image
-- | Marshaling types and functions for the C API
module Client.CApi.Types
-- |
-- struct glirc_extension
--
data FgnExtension
FgnExtension :: FunPtr StartExtension -> FunPtr StopExtension -> FunPtr ProcessMessage -> FunPtr ProcessCommand -> CString -> CInt -> FgnExtension
-- | Optional callback
[fgnStart] :: FgnExtension -> FunPtr StartExtension
-- | Optional callback
[fgnStop] :: FgnExtension -> FunPtr StopExtension
-- | Optional callback
[fgnMessage] :: FgnExtension -> FunPtr ProcessMessage
-- | Optional callback
[fgnCommand] :: FgnExtension -> FunPtr ProcessCommand
-- | Null-terminated name
[fgnName] :: FgnExtension -> CString
[fgnMajorVersion, fgnMinorVersion] :: FgnExtension -> CInt
type StartExtension = Ptr () api token -> CString path to extension -> IO (Ptr ()) initialized extension state
type StopExtension = Ptr () api token -> Ptr () extension state -> IO ()
type ProcessMessage = Ptr () api token -> Ptr () extention state -> Ptr FgnMsg message to send -> IO MessageResult
type ProcessCommand = Ptr () api token -> Ptr () extension state -> Ptr FgnCmd command -> IO ()
-- |
-- struct glirc_string
--
data FgnStringLen
FgnStringLen :: !CString -> !CSize -> FgnStringLen
-- |
-- struct glirc_message
--
data FgnMsg
FgnMsg :: FgnStringLen -> FgnStringLen -> FgnStringLen -> FgnStringLen -> FgnStringLen -> Ptr FgnStringLen -> CSize -> Ptr FgnStringLen -> Ptr FgnStringLen -> CSize -> FgnMsg
[fmNetwork] :: FgnMsg -> FgnStringLen
[fmPrefixNick] :: FgnMsg -> FgnStringLen
[fmPrefixUser] :: FgnMsg -> FgnStringLen
[fmPrefixHost] :: FgnMsg -> FgnStringLen
[fmCommand] :: FgnMsg -> FgnStringLen
-- | array
[fmParams] :: FgnMsg -> Ptr FgnStringLen
-- | array length
[fmParamN] :: FgnMsg -> CSize
-- | array
[fmTagKeys] :: FgnMsg -> Ptr FgnStringLen
-- | array
[fmTagVals] :: FgnMsg -> Ptr FgnStringLen
-- | array length
[fmTagN] :: FgnMsg -> CSize
-- |
-- struct glirc_command
--
data FgnCmd
FgnCmd :: Ptr FgnStringLen -> CSize -> FgnCmd
-- | array
[fcParams] :: FgnCmd -> Ptr FgnStringLen
-- | array length
[fcParamN] :: FgnCmd -> CSize
-- | Type of dynamic function pointer wrappers.
type Dynamic a = FunPtr a -> a
runStartExtension :: Dynamic StartExtension
runStopExtension :: Dynamic StopExtension
runProcessMessage :: Dynamic ProcessMessage
runProcessCommand :: Dynamic ProcessCommand
newtype MessageCode
MessageCode :: CInt -> MessageCode
normalMessage :: MessageCode
errorMessage :: MessageCode
newtype MessageResult
MessageResult :: CInt -> MessageResult
passMessage :: MessageResult
dropMessage :: MessageResult
instance GHC.Classes.Eq Client.CApi.Types.MessageResult
instance GHC.Classes.Eq Client.CApi.Types.MessageCode
instance Foreign.Storable.Storable Client.CApi.Types.FgnExtension
instance Foreign.Storable.Storable Client.CApi.Types.FgnMsg
instance Foreign.Storable.Storable Client.CApi.Types.FgnCmd
instance Foreign.Storable.Storable Client.CApi.Types.FgnStringLen
-- | Foreign interface to the IRC client via a simple C API and dynamically
-- loaded modules.
module Client.CApi
-- | Information about a loaded extension including the handle to the
-- loaded shared object, and state value returned by the startup
-- callback, and the loaded extension record.
data ActiveExtension
ActiveExtension :: !FgnExtension -> !DL -> !(Ptr ()) -> !Text -> !Int -> ActiveExtension
-- | Struct of callback function pointers
[aeFgn] :: ActiveExtension -> !FgnExtension
-- | Handle of dynamically linked extension
[aeDL] :: ActiveExtension -> !DL
-- | State value generated by start callback
[aeSession] :: ActiveExtension -> !(Ptr ())
[aeName] :: ActiveExtension -> !Text
[aeMajorVersion, aeMinorVersion] :: ActiveExtension -> !Int
-- | The symbol that is loaded from an extension object.
--
-- Extensions are expected to export:
--
--
-- struct galua_extension extension;
--
extensionSymbol :: String
-- | Load the extension from the given path and call the start callback.
-- The result of the start callback is saved to be passed to any
-- subsequent calls into the extension.
activateExtension :: Ptr () -> FilePath -> IO ActiveExtension
-- | Call the stop callback of the extension if it is defined and unload
-- the shared object.
deactivateExtension :: Ptr () -> ActiveExtension -> IO ()
-- | Call all of the process message callbacks in the list of extensions.
-- This operation marshals the IRC message once and shares that across
-- all of the callbacks.
notifyExtensions :: Ptr () -> Text -> RawIrcMsg -> [ActiveExtension] -> IO Bool
commandExtension :: Ptr () -> [Text] -> ActiveExtension -> IO ()
-- | This module provides the core logic of the IRC client. The client
-- state tracks everything about the client.
module Client.State
-- | All state information for the IRC client
data ClientState
ClientState :: !(Map Focus Window) -> !Focus -> !Focus -> !Subfocus -> !(IntMap NetworkState) -> !Int -> !ConnectionContext -> !(TQueue NetworkEvent) -> !(HashMap Text NetworkId) -> !Vty -> !EditBox -> !Int -> !Int -> !Configuration -> !Int -> !Bool -> !Bool -> !(HashSet Identifier) -> !ExtensionState -> ClientState
-- | client message buffers
[_clientWindows] :: ClientState -> !(Map Focus Window)
-- | previously focused buffer
[_clientPrevFocus] :: ClientState -> !Focus
-- | currently focused buffer
[_clientFocus] :: ClientState -> !Focus
-- | sec
[_clientSubfocus] :: ClientState -> !Subfocus
-- | state of active connections
[_clientConnections] :: ClientState -> !(IntMap NetworkState)
[_clientNextConnectionId] :: ClientState -> !Int
-- | network connection context
[_clientConnectionContext] :: ClientState -> !ConnectionContext
-- | incoming network event queue
[_clientEvents] :: ClientState -> !(TQueue NetworkEvent)
-- | network name to connection ID
[_clientNetworkMap] :: ClientState -> !(HashMap Text NetworkId)
-- | VTY handle
[_clientVty] :: ClientState -> !Vty
-- | primary text box
[_clientTextBox] :: ClientState -> !EditBox
-- | current terminal width
[_clientWidth] :: ClientState -> !Int
-- | current terminal height
[_clientHeight] :: ClientState -> !Int
-- | client configuration
[_clientConfig] :: ClientState -> !Configuration
-- | buffer scroll lines
[_clientScroll] :: ClientState -> !Int
-- | use detailed rendering mode
[_clientDetailView] :: ClientState -> !Bool
-- | sound a bell next draw
[_clientBell] :: ClientState -> !Bool
-- | ignored nicknames
[_clientIgnores] :: ClientState -> !(HashSet Identifier)
[_clientExtensions] :: ClientState -> !ExtensionState
clientWindows :: Lens' ClientState (Map Focus Window)
clientTextBox :: Lens' ClientState EditBox
clientConnections :: Lens' ClientState (IntMap NetworkState)
clientWidth :: Lens' ClientState Int
clientHeight :: Lens' ClientState Int
clientEvents :: Lens' ClientState (TQueue NetworkEvent)
clientVty :: Lens' ClientState Vty
clientFocus :: Lens' ClientState Focus
clientConnectionContext :: Lens' ClientState ConnectionContext
clientConfig :: Lens' ClientState Configuration
clientScroll :: Lens' ClientState Int
clientDetailView :: Lens' ClientState Bool
clientSubfocus :: Lens' ClientState Subfocus
clientNextConnectionId :: Lens' ClientState Int
clientNetworkMap :: Lens' ClientState (HashMap Text NetworkId)
clientIgnores :: Lens' ClientState (HashSet Identifier)
-- | Traversal for finding the NetworkState associated with a
-- given network if that connection is currently active.
clientConnection :: Applicative f => Text -> LensLike' f ClientState NetworkState
clientBell :: Lens' ClientState Bool
clientExtensions :: Lens' ClientState ExtensionState
-- | Construct an initial ClientState using default values.
withClientState :: Configuration -> (ClientState -> IO a) -> IO a
clientShutdown :: ClientState -> IO ()
-- | Start extensions after ensuring existing ones are stopped
clientStartExtensions :: ClientState -> IO ClientState
clientPark :: ClientState -> (Ptr () -> IO a) -> IO (ClientState, a)
-- | Construct a text matching predicate used to filter the message window.
clientMatcher :: ClientState -> Text -> Bool
-- | Add the textbox input to the edit history and clear the textbox.
consumeInput :: ClientState -> ClientState
-- | Returns the current network's channels and current channel's users.
currentCompletionList :: ClientState -> [Identifier]
-- | Predicate for messages that should be ignored based on the
-- configurable ignore list
ircIgnorable :: IrcMsg -> ClientState -> Maybe Identifier
-- | The full top-most line that would be executed
clientFirstLine :: ClientState -> String
-- | The line under the cursor in the edit box.
clientLine :: ClientState -> (Int, String)
-- | Forcefully terminate the connection currently associated with a given
-- network name.
abortNetwork :: Text -> ClientState -> IO ClientState
-- | Start a new connection. The delay is used for reconnections.
addConnection :: Int -> Maybe UTCTime -> Text -> ClientState -> IO ClientState
-- | 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.
removeNetwork :: NetworkId -> ClientState -> (NetworkState, ClientState)
-- | Function applied to the client state every redraw.
clientTick :: ClientState -> ClientState
applyMessageToClientState :: ZonedTime -> IrcMsg -> NetworkId -> NetworkState -> ClientState -> ([RawIrcMsg], ClientState)
clientHighlights :: NetworkState -> ClientState -> HashSet Identifier
-- | Add a message to the window associated with a given channel
recordChannelMessage :: Text -> Identifier -> ClientMessage -> ClientState -> ClientState
-- | Record a message on a network window
recordNetworkMessage :: ClientMessage -> ClientState -> ClientState
-- | Record a message in the windows corresponding to the given target
recordIrcMessage :: Text -> MessageTarget -> ClientMessage -> ClientState -> ClientState
changeFocus :: Focus -> ClientState -> ClientState
changeSubfocus :: Subfocus -> ClientState -> ClientState
-- | Return to previously focused window.
returnFocus :: ClientState -> ClientState
-- | Step focus to the next window when on message view. Otherwise switch
-- to message view.
advanceFocus :: ClientState -> ClientState
-- | Step focus to the previous window when on message view. Otherwise
-- switch to message view.
retreatFocus :: ClientState -> ClientState
-- | Jump the focus of the client to a buffer that has unread activity.
-- Some events like errors or chat messages mentioning keywords are
-- considered important and will be jumped to first.
jumpToActivity :: ClientState -> ClientState
-- | Jump the focus directly to a window based on its zero-based index.
jumpFocus :: Int -> ClientState -> ClientState
-- | Scroll the current buffer to show older messages
pageUp :: ClientState -> ClientState
-- | Scroll the current buffer to show newer messages
pageDown :: ClientState -> ClientState
data ExtensionState
esActive :: Lens' ExtensionState [ActiveExtension]
-- | This module exports the C functions that extensions can used to query
-- the state of the client.
module Client.CApi.Exports
-- | Network, command, and parameters are used when transmitting a message.
type Glirc_send_message = Ptr () api token -> Ptr FgnMsg pointer to message -> IO CInt 0 on success
type Glirc_print = Ptr () api token -> MessageCode enum message_code -> CString message -> CSize message length -> IO CInt 0 on success
-- | The resulting strings and array of strings are malloc'd and the caller
-- must free them. NULL returned on failure.
type Glirc_list_networks = Ptr () api token -> IO (Ptr CString) null terminated array of null terminated strings
-- | The resulting strings and array of strings are malloc'd and the caller
-- must free them. NULL returned on failure.
type Glirc_list_channels = Ptr () api token -> CString network -> CSize network len -> IO (Ptr CString) null terminated array of null terminated strings
-- | The resulting strings and array of strings are malloc'd and the caller
-- must free them. NULL returned on failure.
type Glirc_list_channel_users = Ptr () api token -> CString network -> CSize network len -> CString channel -> CSize channel len -> IO (Ptr CString) null terminated array of null terminated strings
-- | The resulting string is malloc'd and the caller must free it. NULL
-- returned on failure.
type Glirc_my_nick = Ptr () api token -> CString network name -> CSize network name length -> IO CString
type Glirc_identifier_cmp = CString identifier 1 -> CSize identifier 1 len -> CString identifier 2 -> CSize identifier 2 len -> IO CInt
-- | Mark a window as being seen clearing the new message counter. To clear
-- the client window send an empty network name. To clear a network
-- window send an empty channel name.
type Glirc_mark_seen = Ptr () api token -> CString network name -> CSize network name length -> CString channel name -> CSize channel name length -> IO ()
-- | Mark a window as being seen clearing the new message counter. To clear
-- the client window send an empty network name. To clear a network
-- window send an empty channel name.
type Glirc_clear_window = Ptr () api token -> CString network name -> CSize network name length -> CString channel name -> CSize channel name length -> IO ()
-- | This module implements a renderer for the window that shows channel
-- metadata.
module Client.Image.ChannelInfo
-- | Render the lines used in a channel mask list
channelInfoImages :: Text -> Identifier -> ClientState -> [Image]
-- | This module renders the lines used in the channel mask list. A mask
-- list can show channel bans, quiets, invites, and exceptions.
module Client.Image.MaskList
-- | Render the lines used in a channel mask list
maskListImages :: Char -> Text -> Identifier -> ClientState -> [Image]
-- | This module provides image renderers used to construct the status
-- image that sits between text input and the message window.
module Client.Image.StatusLine
statusLineImage :: ClientState -> Image
-- | This module renders the lines used in the channel user list.
module Client.Image.UserList
-- | Render the lines used in a simple user list window.
userListImages :: Text -> Identifier -> ClientState -> [Image]
userListImages' :: NetworkState -> Identifier -> ClientState -> [Image]
-- | Render lines for detailed channel user list which shows full user
-- info.
userInfoImages :: Text -> Identifier -> ClientState -> [Image]
userInfoImages' :: NetworkState -> Identifier -> ClientState -> [Image]
-- | This module implements the rendering of the client window list.
module Client.Image.Windows
windowsImages :: ClientState -> [Image]
-- | This module renders the lines used in the channel mask list. A mask
-- list can show channel bans, quiets, invites, and exceptions.
module Client.Commands
-- | Possible results of running a command
data CommandResult
-- | Continue running the client, consume input if command was from input
CommandSuccess :: ClientState -> CommandResult
-- | Continue running the client, report an error
CommandFailure :: ClientState -> CommandResult
-- | Client should close
CommandQuit :: ClientState -> CommandResult
-- | Interpret the given chat message or command. Leading /
-- indicates a command. Otherwise if a channel or user query is focused a
-- chat message will be sent.
execute :: String -> ClientState -> IO CommandResult
-- | Execute command provided by user, resolve aliases if necessary.
executeUserCommand :: String -> ClientState -> IO CommandResult
-- | Respond to the TAB key being pressed. This can dispatch to a command
-- specific completion mode when relevant. Otherwise this will complete
-- input based on the users of the channel related to the current buffer.
tabCompletion :: Bool -> ClientState -> IO CommandResult
-- | Pair of a command and it's argument specification
data Command
Command :: (ArgumentSpec a) -> (CommandImpl a) -> Command
commands :: HashMap Text Command
-- | This module provides the renderer for the client's text box input.
module Client.Image.Textbox
textboxImage :: ClientState -> (Int, Image)
renderContent :: Palette -> Content -> (String, Image)
-- | Compute the number of code-points that will be visible when the given
-- string is truncated to fit in the given number of terminal columns.
computeCharWidth :: Int -> String -> Int
-- | Version of wcwidth that accounts for how control characters are
-- rendered
myWcwidth :: Char -> Int
-- | Version of wcswidth that accounts for how control characters
-- are rendered
myWcswidth :: String -> Int
renderLine :: Palette -> String -> Image
-- | This module provides the renderer for the client's UI.
module Client.Image
-- | Generate a Picture for the current client state. The resulting
-- client state is updated for render specific information like
-- scrolling.
clientPicture :: ClientState -> (Picture, ClientState)
-- | This module is responsible for dispatching user-input, network, and
-- timer events to the correct module. It renders the user interface once
-- per event.
module Client.EventLoop
-- | Apply this function to an initial ClientState to launch the
-- client.
eventLoop :: ClientState -> IO ()
-- | This module process command-line arguments provided when launching the
-- client.
module Client.CommandArguments
-- | Command-line arguments
data CommandArguments
CommandArguments :: Maybe FilePath -> [Text] -> Bool -> Bool -> CommandArguments
-- | configuration file path
[_cmdArgConfigFile] :: CommandArguments -> Maybe FilePath
-- | initial networks
[_cmdArgInitialNetworks] :: CommandArguments -> [Text]
-- | show help message
[_cmdArgShowHelp] :: CommandArguments -> Bool
-- | show version message
[_cmdArgShowVersion] :: CommandArguments -> Bool
cmdArgConfigFile :: Lens' CommandArguments (Maybe FilePath)
cmdArgInitialNetworks :: Lens' CommandArguments [Text]
-- | Load command line arguments. This action will terminate early in the
-- case of the version flag, help flag, or an error.
getCommandArguments :: IO CommandArguments