-- Hoogle documentation, generated by Haddock -- See Hoogle, http://www.haskell.org/hoogle/ -- | Console IRC client -- -- Console IRC client -- -- glirc is a console IRC client with an emphasis on providing dynamic -- views into the model of your IRC connections. -- -- Documentation Wiki @package glirc @version 2.41 module Client.Authentication.Ecdh data Phase1 mechanismName :: Text clientFirst :: Maybe Text -> Text -> Text -> Maybe (AuthenticatePayload, Phase1) clientResponse :: Phase1 -> ByteString -> Maybe AuthenticatePayload -- | Implementation of ECDSA-NIST256P-CHALLENGE SASL authentication mode as -- implemented at https://github.com/kaniini/ecdsatool. -- -- Using this mode requires that the ecdsa utility program is -- available in your search path. module Client.Authentication.Ecdsa -- | Identifier for SASL ECDSA challenge response authentication using -- curve NIST256P. -- --
--   ECDSA-NIST256P-CHALLENGE
--   
authenticationMode :: Text -- | Encode a username as specified in this authentication mode. encodeAuthentication :: Maybe Text -> Text -> AuthenticatePayload -- | Compute the response for a given challenge using the -- ecdsatool executable which must be available in -- PATH. computeResponse :: FilePath -> Text -> IO (Either String Text) module Client.Authentication.Scram -- | SCRAM state waiting for server-first-message data Phase1 -- | SCRAM state waiting for server-final-message data Phase2 -- | Construct client-first-message and extra parameters needed for -- addServerFirst. initiateScram :: ScramDigest -> ByteString -> ByteString -> ByteString -> ByteString -> (AuthenticatePayload, Phase1) -- | Add server-first-message to current SCRAM transaction, compute -- client-final-message and next state for addServerFinal. addServerFirst :: Phase1 -> ByteString -> Maybe (AuthenticatePayload, Phase2) -- | Add server-final-message to transaction and compute validatity of the -- whole transaction. addServerFinal :: Phase2 -> ByteString -> Bool data ScramDigest ScramDigestSha1 :: ScramDigest ScramDigestSha2_256 :: ScramDigest ScramDigestSha2_512 :: ScramDigest mechanismName :: ScramDigest -> Text instance GHC.Show.Show Client.Authentication.Scram.ScramDigest -- | Marshaling types and functions for the C API module Client.CApi.Types -- | Information describing an extension's entry-points and metadata. data FgnExtension FgnExtension :: FunPtr StartExtension -> FunPtr StopExtension -> FunPtr ProcessMessage -> FunPtr ProcessChat -> FunPtr ProcessCommand -> CString -> CInt -> FgnExtension -- | Optional startup callback [fgnStart] :: FgnExtension -> FunPtr StartExtension -- | Optional shutdown callback [fgnStop] :: FgnExtension -> FunPtr StopExtension -- | Optional message received callback [fgnMessage] :: FgnExtension -> FunPtr ProcessMessage -- | Optional message send callback [fgnChat] :: FgnExtension -> FunPtr ProcessChat -- | Optional client command callback [fgnCommand] :: FgnExtension -> FunPtr ProcessCommand -- | Null-terminated name [fgnName] :: FgnExtension -> CString -- | extension version -- | extension version [fgnMajorVersion, fgnMinorVersion] :: FgnExtension -> CInt -- |
--   typedef void *start(void *glirc, const char *path)
--   
type StartExtension = Ptr () {-^ api token -} -> CString {-^ path to extension -} -> Ptr FgnStringLen {-^ array of arguments -} -> CSize {-^ number of arguments -} -> IO (Ptr ()) {-^ initialized extension state -} -- |
--   typedef void stop(void *glirc, void *S)
--   
type StopExtension = Ptr () {-^ extension state -} -> IO () -- |
--   typedef enum process_result process_message(void *glirc, void *S, const struct glirc_message *)
--   
type ProcessMessage = Ptr () {-^ extention state -} -> Ptr FgnMsg {-^ message to send -} -> IO ProcessResult -- |
--   typedef void process_command(void *glirc, void *S, const struct glirc_command *)
--   
type ProcessCommand = Ptr () {-^ extension state -} -> Ptr FgnCmd {-^ command -} -> IO () -- |
--   typedef void process_chat(void *glirc, void *S, const struct glirc_chat *)
--   
type ProcessChat = Ptr () {-^ extension state -} -> Ptr FgnChat {-^ chat info -} -> IO ProcessResult -- | Callback function when timer triggers type TimerCallback = Ptr () {-^ timer state -} -> TimerId {-^ timer ID -} -> IO () -- | Integer type of timer IDs type TimerId = Int64 -- |
--   typedef void thread_finish(void *glirc, void *S)
--   
type ThreadFinish = Ptr () {-^ thread result -} -> IO () -- | Pointer to UTF-8 encoded string and as string length. Strings are -- null-terminated. The null-terminator is not counted in the length. 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 -- | Used to pass arguments from /extension EXT_NAME client -- command into an extension. data FgnCmd FgnCmd :: FgnStringLen -> FgnCmd [fcCommand] :: FgnCmd -> FgnStringLen -- | Chat message data containing the source network, window target, and -- message body. data FgnChat FgnChat :: FgnStringLen -> FgnStringLen -> FgnStringLen -> FgnChat [fhNetwork] :: FgnChat -> FgnStringLen [fhTarget] :: FgnChat -> FgnStringLen [fhMessage] :: FgnChat -> FgnStringLen -- | Type of dynamic function pointer wrappers. These convert C -- function-pointers into Haskell functions. type Dynamic a = FunPtr a -> a -- | Dynamic import for StartExtension. runStartExtension :: Dynamic StartExtension -- | Dynamic import for StopExtension. runStopExtension :: Dynamic StopExtension -- | Dynamic import for ProcessMessage. runProcessMessage :: Dynamic ProcessMessage -- | Dynamic import for ProcessCommand. runProcessCommand :: Dynamic ProcessCommand -- | Dynamic import for ProcessChat. runProcessChat :: Dynamic ProcessChat -- | Dynamic import for timer callback runTimerCallback :: Dynamic TimerCallback -- | Dynamic import for thread starts runThreadStart :: Dynamic ThreadStart -- | Dynamic import for ThreadFinish. runThreadFinish :: Dynamic ThreadFinish -- | Tag for describing the kind of message to display in the client as -- used in glirc_print. See normalMessage and -- errorMessage. -- --
--   enum message_code;
--   
newtype MessageCode MessageCode :: Word32 -> MessageCode -- | Normal client message. Unread counter increments, but no client bell -- or error status update. normalMessage :: MessageCode -- | Important client message. Unread counter increments, bell rings, and -- error status updates. errorMessage :: MessageCode -- | Result used to determine what to do after processing a message with -- the ProcessMessage callback. -- -- | enum process_result newtype ProcessResult ProcessResult :: Word32 -> ProcessResult -- | Allow the message to proceed through the client logic. passMessage :: ProcessResult -- | Drop the message from further processing. dropMessage :: ProcessResult -- | Marshal a text as a temporary null-terminated CStringLen withText0 :: Text -> (CStringLen -> IO a) -> IO a -- | Marshal a text as a malloced null-terminated CStringLen exportText :: Ptr CString -> Ptr CSize -> Text -> IO () -- | Like poke except it doesn't write to NULL poke' :: Storable a => Ptr a -> a -> IO () instance GHC.Classes.Eq Client.CApi.Types.MessageCode instance GHC.Classes.Eq Client.CApi.Types.ProcessResult instance Foreign.Storable.Storable Client.CApi.Types.FgnExtension instance Foreign.Storable.Storable Client.CApi.Types.FgnMsg instance Foreign.Storable.Storable Client.CApi.Types.FgnChat instance Foreign.Storable.Storable Client.CApi.Types.FgnCmd instance Foreign.Storable.Storable Client.CApi.Types.FgnStringLen module Client.Commands.Arguments.Spec type Args r = Ap (Arg r) simpleToken :: String -> Args r String remainingArg :: String -> Args r String optionalArg :: Args r a -> Args r (Maybe a) tokenList :: [String] -> [String] -> Args r [String] numberArg :: Args r Int optionalNumberArg :: Args r (Maybe Int) extensionArg :: String -> (r -> String -> Maybe (Args r a)) -> Args r a tokenArg :: String -> (r -> String -> Maybe a) -> Args r a mapArgEnv :: (r -> s) -> Args s a -> Args r a data ArgumentShape TokenArgument :: ArgumentShape RemainingArgument :: ArgumentShape data Arg :: Type -> Type -> Type [Argument] :: ArgumentShape -> String -> (r -> String -> Maybe a) -> Arg r a [Optional] :: Args r a -> Arg r (Maybe a) [Extension] :: String -> (r -> String -> Maybe (Args r a)) -> Arg r a [MapEnv] :: (r -> s) -> Args s a -> Arg r a module Client.Commands.Arguments.Parser parse :: r -> Args r a -> String -> Maybe a -- | 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 -- | Settings for /exec command. -- -- When no network or channel are specified the output is sent to the -- client window. -- -- When only a network is specified the output is sent as raw IRC -- commands to that network. -- -- When only a channel is specified the output is sent as messages on the -- current network to the given channel. -- -- When the network and channel are specified the output is sent as -- messages to the given channel on the given network. data ExecCmd ExecCmd :: Target String -> Target String -> String -> String -> [String] -> Bool -> ExecCmd -- | output network [_execOutputNetwork] :: ExecCmd -> Target String -- | output channel [_execOutputChannel] :: ExecCmd -> Target String -- | command filename [_execCommand] :: ExecCmd -> String -- | stdin source [_execStdIn] :: ExecCmd -> String -- | command arguments [_execArguments] :: ExecCmd -> [String] -- | ignore the process exit code [_execIgnoreError] :: ExecCmd -> Bool data Target a Unspecified :: Target a Current :: Target a Specified :: a -> Target a execOutputNetwork :: Lens' ExecCmd (Target String) execOutputChannel :: Lens' ExecCmd (Target String) -- | Parse the arguments to /exec looking for various flags and -- the command and its arguments. parseExecCmd :: String -> Either [String] ExecCmd -- | Execute the requested command synchronously and return the output. runExecCmd :: ExecCmd -> IO (Either [String] [String]) instance GHC.Base.Functor Client.Commands.Exec.Target instance GHC.Classes.Ord a => GHC.Classes.Ord (Client.Commands.Exec.Target a) instance GHC.Classes.Eq a => GHC.Classes.Eq (Client.Commands.Exec.Target a) instance GHC.Read.Read a => GHC.Read.Read (Client.Commands.Exec.Target a) instance GHC.Show.Show a => GHC.Show.Show (Client.Commands.Exec.Target a) instance GHC.Show.Show Client.Commands.Exec.ExecCmd instance GHC.Read.Read Client.Commands.Exec.ExecCmd -- | 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. -- -- Variables are built from 1 or more letters. -- -- Optional arguments are suffixed with a ? -- -- Remaining text arguments are suffixed with a * 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 -- | bracketed variable with default ${x|lit} DefaultChunk :: ExpansionChunk -> Text -> ExpansionChunk -- | Parse a Text searching for the expansions as specified in -- ExpansionChunk. $$ is used to escape a single -- $. parseExpansion :: Text -> Either Text [ExpansionChunk] -- | Attempt to expand all of the elements in the given list using the two -- expansion functions. If the expansion of any chunk fails the whole -- expansion fails. resolveMacroExpansions :: Alternative f => (Text -> f Text) -> (Integer -> f Text) -> [ExpansionChunk] -> f Text data Macro Macro :: Text -> MacroSpec -> [[ExpansionChunk]] -> Macro [macroName] :: Macro -> Text [macroSpec] :: Macro -> MacroSpec [macroCommands] :: Macro -> [[ExpansionChunk]] data MacroSpec [MacroSpec] :: (forall r. Args r [String]) -> MacroSpec parseMacroSpecs :: Text -> Either Text MacroSpec -- | Specification used when unspecified, no arguments. noMacroArguments :: MacroSpec instance GHC.Show.Show Client.Commands.Interpolation.ExpansionChunk instance GHC.Show.Show Client.Commands.Interpolation.Macro instance GHC.Show.Show Client.Commands.Interpolation.MacroSpec -- | This module implements a trie for recognizing valid commands. This -- allows entered strings to be classified as either a valid command -- (with an associated value), the prefix of a valid command, or invalid. module Client.Commands.Recognizer -- | A map from Text values to a values that is capable of -- yielding more detailed information when looking up keys that are not -- actually in the map. data Recognizer a -- | Attempt to recognize a string, yielding a Recognition result. recognize :: Text -> Recognizer a -> Recognition a -- | Possible results of recognizing text. data Recognition a -- | text matched exactly, yielding the given value Exact :: a -> Recognition a -- | text would be recognized if joined to the given suffixes Prefix :: [Text] -> Recognition a -- | text could not possibly be recognized Invalid :: Recognition a -- | Create a Recognizer from an association list. If a key appears -- twice, the earliest associated value will be used. fromCommands :: [(Text, a)] -> Recognizer a -- | Add a key-value pair to a Recognizer. This will override the -- value already present if one exists. addCommand :: Text -> a -> Recognizer a -> Recognizer a -- | Compute all strings that will be recognized by a Recognizer. keys :: Recognizer a -> [Text] instance Data.Foldable.Foldable Client.Commands.Recognizer.Recognizer instance GHC.Base.Functor Client.Commands.Recognizer.Recognizer instance GHC.Show.Show a => GHC.Show.Show (Client.Commands.Recognizer.Recognizer a) instance GHC.Base.Functor Client.Commands.Recognizer.Recognition instance GHC.Show.Show a => GHC.Show.Show (Client.Commands.Recognizer.Recognition a) instance GHC.Base.Monoid (Client.Commands.Recognizer.Recognizer a) instance GHC.Base.Semigroup (Client.Commands.Recognizer.Recognizer a) -- | This module defines the top-level configuration information for the -- client. module Client.Configuration.Colors -- | Parse a color. Support formats are: -- -- colorSpec :: ValueSpec 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 attrSpec :: ValueSpec Attr module Client.Configuration.Macros macroMapSpec :: ValueSpec (Recognizer Macro) macroCommandSpec :: ValueSpec [ExpansionChunk] module Client.Configuration.Notifications data NotifyWith NotifyWithCustom :: [String] -> NotifyWith NotifyWithNotifySend :: NotifyWith NotifyWithOsaScript :: NotifyWith NotifyWithTerminalNotifier :: NotifyWith notifyCmd :: NotifyWith -> Maybe ((Text, Text) -> ProcessConfig () () ()) notifySpec :: ValueSpec NotifyWith notifyWithDefault :: NotifyWith instance GHC.Show.Show Client.Configuration.Notifications.NotifyWith module Client.Configuration.Sts data StsPolicy StsPolicy :: !UTCTime -> !Int -> StsPolicy [_stsExpiration] :: StsPolicy -> !UTCTime [_stsPort] :: StsPolicy -> !Int stsExpiration :: Lens' StsPolicy UTCTime stsPort :: Lens' StsPolicy Int readPolicyFile :: IO StsPolicies savePolicyFile :: StsPolicies -> IO () instance GHC.Show.Show Client.Configuration.Sts.StsPolicy -- | This module adds the requisite functions to load and parse a subset of -- AsciiDoc and embed it using Template Haskell. module Client.Docs type Docs = HashMap String Text loadDoc :: (String -> String) -> FilePath -> Q Docs lookupDoc :: Text -> String -> Docs -> Q Exp makeHeader :: Text -> Text -- | This module contains definitions for all of glirc's command docs. module Client.Commands.Docs cmdDoc :: Docs -> String -> Q Exp chanopDocs :: Docs chatDocs :: Docs clientDocs :: Docs integrationDocs :: Docs netDocs :: Docs operDocs :: Docs queriesDocs :: Docs togglesDocs :: Docs windowDocs :: Docs module Client.EventLoop.Actions -- | Actions that can be invoked using the keyboard. data Action ActBackspace :: Action ActDelete :: Action ActLeft :: Action ActRight :: Action ActHome :: Action ActEnd :: Action ActOlderLine :: Action ActNewerLine :: Action ActScrollUp :: Action ActScrollDown :: Action ActScrollUpSmall :: Action ActScrollDownSmall :: Action ActBackWord :: Action ActForwardWord :: Action ActYank :: Action ActKillHome :: Action ActKillEnd :: Action ActKillWordBack :: Action ActKillWordForward :: Action ActToggle :: Action ActBold :: Action ActColor :: Action ActItalic :: Action ActUnderline :: Action ActStrikethrough :: Action ActReverseVideo :: Action ActMonospace :: Action ActClearFormat :: Action ActInsertEnter :: Action ActDigraph :: Action ActRetreatFocus :: Action ActAdvanceFocus :: Action ActAdvanceNetwork :: Action ActJumpToActivity :: Action ActJumpPrevious :: Action ActJump :: Char -> Action ActTabComplete :: Action ActTabCompleteBack :: Action ActEnter :: Action ActReset :: Action ActRefresh :: Action ActCommand :: Text -> Action ActInsert :: Char -> Action ActIgnored :: Action -- | Lookup table for keyboard events to actions. Use with keyToAction. data KeyMap -- | Lookup the action to perform in response to a particular key event. keyToAction :: KeyMap -> [Modifier] -> Text -> [Modifier] -> Key -> Action -- | Default key bindings initialKeyMap :: KeyMap -- | Bind a keypress event to a new action. addKeyBinding :: [Modifier] -> Key -> Action -> KeyMap -> KeyMap -- | Unbind the action associated with a key. removeKeyBinding :: [Modifier] -> Key -> KeyMap -> KeyMap keyMapEntries :: KeyMap -> [([Modifier], Key, Action)] parseKey :: String -> Maybe ([Modifier], Key) prettyModifierKey :: [Modifier] -> Key -> String -- | Render action as human-readable text. actionName :: Action -> Text instance GHC.Show.Show Client.EventLoop.Actions.Action instance GHC.Read.Read Client.EventLoop.Actions.Action instance GHC.Classes.Ord Client.EventLoop.Actions.Action instance GHC.Classes.Eq Client.EventLoop.Actions.Action instance GHC.Show.Show Client.EventLoop.Actions.KeyMap instance Config.Schema.Spec.HasSpec Client.EventLoop.Actions.Action -- | 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 -> NonEmpty String -- | 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 -- | continue processing PassMessage :: MessageResult -- | stop processing and drop message OmitMessage :: MessageResult -- | stop processing and return new message 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 GHC.Show.Show Client.Hook.MessageResult instance GHC.Base.Semigroup Client.Hook.MessageResult instance GHC.Base.Monoid Client.Hook.MessageResult -- | Matterbridge is a simple multi-protocol chat bridge, supporting dozens -- of different protocols. This hook makes Matterbridged messages appear -- native in the client. -- -- message-hooks configuration takes one of two forms; to operate on all -- channels: -- --
--   ["matterbridge", "nick"]
--   
-- -- or, to operate only on selected channels: -- --
--   ["matterbridge", "nick", "#chan1", "#chan2", ..., "#chann"]
--   
-- -- This hook assumes the Matterbridge RemoteNickFormat is simply -- "{NICK} ". module Client.Hook.Matterbridge matterbridgeHook :: [Text] -> Maybe MessageHook -- | 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 :: [Text] -> Maybe MessageHook -- | This module provides a more memory efficient way to store images. module Client.Image.PackedImage -- | Packed, strict version of Image used for long-term storage of -- images. data Image' unpackImage :: Image' -> Image char :: Attr -> Char -> Image' text' :: Attr -> Text -> Image' string :: Attr -> String -> Image' -- | Width in terms of terminal columns imageWidth :: Image' -> Int splitImage :: Int -> Image' -> (Image', Image') imageText :: Image' -> Text resizeImage :: Int -> Image' -> Image' instance GHC.Show.Show Client.Image.PackedImage.Image' instance GHC.Base.Monoid Client.Image.PackedImage.Image' instance GHC.Base.Semigroup Client.Image.PackedImage.Image' instance Data.String.IsString Client.Image.PackedImage.Image' -- | Provides utilities for line wrapping images. module Client.Image.LineWrap lineWrap :: Int -> Image' -> [Image'] lineWrapPrefix :: Int -> Image' -> Image' -> [Image'] -- | This version of line wrap wraps without regard for word boundaries. fullLineWrap :: Int -> Image' -> [Image'] -- | Trailing space with default attributes deals with bug in VTY where the -- formatting will continue past the end of chat messages. This adds an -- extra space if a line doesn't end on the terminal edge. terminate :: Int -> Image -> Image -- | 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 -> HashMap Identifier Attr -> Attr -> Attr -> Attr -> Attr -> Attr -> Attr -> Attr -> Attr -> Attr -> Attr -> Attr -> Attr -> Attr -> Attr -> Attr -> Attr -> Attr -> Attr -> Attr -> Attr -> Attr -> Attr -> Attr -> Attr -> Attr -> Attr -> Attr -> Palette -- | highlighting identifiers [_palNicks] :: Palette -> Vector Attr -- | overrides for specific identifiers [_palIdOverride] :: Palette -> HashMap Identifier Attr -- | own nickname(s) [_palSelf] :: Palette -> Attr -- | own nickname(s) in mentions [_palSelfHighlight] :: Palette -> 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 -- | prefix of known command [_palCommandPrefix] :: Palette -> Attr -- | unknown command [_palCommandError] :: Palette -> Attr -- | command argument placeholder [_palCommandPlaceholder] :: Palette -> Attr -- | Divider between split windows [_palWindowDivider] :: Palette -> Attr -- | Divider between new and old messages [_palLineMarker] :: Palette -> Attr -- | color of nickname when away [_palAway] :: Palette -> Attr -- | rendering of monospace formatting text [_palMonospace] :: Palette -> Attr -- | mode lines [_palModes] :: Palette -> Attr [_palJoin] :: Palette -> Attr [_palPart] :: Palette -> Attr [_palUsrChg] :: Palette -> Attr [_palIgnore] :: Palette -> Attr -- | color of TAGMSG sigil [_palTagmsg] :: Palette -> Attr data NetworkPalette NetworkPalette :: HashMap Char Attr -> HashMap Char Attr -> HashMap Char Attr -> NetworkPalette -- | channel mode attributes [_palCModes] :: NetworkPalette -> HashMap Char Attr -- | user mode attributes [_palUModes] :: NetworkPalette -> HashMap Char Attr -- | snotice mask attributes [_palSnomask] :: NetworkPalette -> HashMap Char Attr palNicks :: Lens' Palette (Vector Attr) palSelf :: Lens' Palette Attr palSelfHighlight :: Lens' Palette 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 palCommandPlaceholder :: Lens' Palette Attr palCommandPrefix :: Lens' Palette Attr palCommandError :: Lens' Palette Attr palWindowDivider :: Lens' Palette Attr palLineMarker :: Lens' Palette Attr palAway :: Lens' Palette Attr palMonospace :: Lens' Palette Attr palJoin :: Lens' Palette Attr palPart :: Lens' Palette Attr palModes :: Lens' Palette Attr palUsrChg :: Lens' Palette Attr palIgnore :: Lens' Palette Attr palTagmsg :: Lens' Palette Attr palCModes :: Lens' NetworkPalette (HashMap Char Attr) palUModes :: Lens' NetworkPalette (HashMap Char Attr) palSnomask :: Lens' NetworkPalette (HashMap Char Attr) palIdOverride :: Lens' Palette (HashMap Identifier Attr) -- | List of palette entry names and lenses for accessing that component of -- the palette. paletteMap :: [(Text, ReifiedLens' Palette Attr)] -- | Combine one NetworkPalette with another. unifyNetworkPalette :: NetworkPalette -> NetworkPalette -> NetworkPalette -- | Default UI colors defaultPalette :: Palette defaultNetworkPalette :: NetworkPalette instance GHC.Show.Show Client.Image.Palette.Palette instance GHC.Show.Show Client.Image.Palette.NetworkPalette -- | 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 :: Palette -> 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. parseIrcText' :: Bool -> Palette -> Text -> Image' -- | Render a String with default attributes and replacing all of -- the control characters with reverse-video letters corresponding to -- caret notation. plainText :: String -> Image' -- | Safely render a control character. controlImage :: Char -> Image' mircColor :: Int -> Maybe (MaybeDefault Color) mircColors :: Vector Color module Client.Commands.Arguments.Renderer render :: Palette -> r -> Bool -> Args r a -> String -> Image' module Client.Mask data Mask -- | Determine if a given Mask matches a given UserInfo matchMask :: Mask -> UserInfo -> Bool -- | Compile a list of masks down to a single, reuseable Mask value -- suitable for being used with matchMask. -- -- Masks can match zero-to-many arbitrary characters with *. -- -- Masks can match one arbitrary character with ?. -- -- Literal * ? and | can be matched with a -- preceding @@. -- -- Missing host or username components of a mask will automatically be -- treated as wildcards. buildMask :: [Identifier] -> Mask -- | 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 data IrcSummary JoinSummary :: {-# UNPACK #-} !Identifier -> IrcSummary QuitSummary :: {-# UNPACK #-} !Identifier -> !QuitKind -> IrcSummary PartSummary :: {-# UNPACK #-} !Identifier -> IrcSummary NickSummary :: {-# UNPACK #-} !Identifier -> {-# UNPACK #-} !Identifier -> IrcSummary ReplySummary :: {-# UNPACK #-} !ReplyCode -> IrcSummary ChatSummary :: {-# UNPACK #-} !UserInfo -> IrcSummary CtcpSummary :: {-# UNPACK #-} !Identifier -> IrcSummary -- | Chghost command ChngSummary :: {-# UNPACK #-} !Identifier -> IrcSummary -- | Account command AcctSummary :: {-# UNPACK #-} !Identifier -> IrcSummary AwaySummary :: {-# UNPACK #-} !Identifier -> !Bool -> IrcSummary -- | TAGMSG command TagmSummary :: {-# UNPACK #-} !Identifier -> IrcSummary -- | MONITOR numeric replies MonSummary :: {-# UNPACK #-} !Identifier -> !Bool -> IrcSummary NoSummary :: IrcSummary msgSummary :: MessageBody -> IrcSummary summaryActor :: IrcSummary -> Maybe Identifier data QuitKind -- | User quit NormalQuit :: QuitKind -- | Mass event like a netsplit MassQuit :: QuitKind -- | Compute a searchable text representation of the message msgText :: MessageBody -> Text instance GHC.Show.Show Client.Message.QuitKind instance GHC.Classes.Eq Client.Message.QuitKind instance GHC.Show.Show Client.Message.IrcSummary instance GHC.Classes.Eq Client.Message.IrcSummary -- | 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 :: !Bool -> !Text -> !Maybe TopicProvenance -> !Maybe Text -> !HashMap Identifier String -> !Map Char Text -> !Map Char (HashMap Text MaskListEntry) -> !Maybe UTCTime -> ![RawIrcMsg] -> ChannelState -- | client is currently connected to this channel [_chanJoined] :: ChannelState -> !Bool -- | 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] chanCreation :: Lens' ChannelState (Maybe UTCTime) chanJoined :: Lens' ChannelState Bool chanLists :: Lens' ChannelState (Map Char (HashMap Text MaskListEntry)) chanModes :: Lens' ChannelState (Map Char Text) chanQueuedModeration :: Lens' ChannelState [RawIrcMsg] chanTopic :: Lens' ChannelState Text chanTopicProvenance :: Lens' ChannelState (Maybe TopicProvenance) chanUrl :: Lens' ChannelState (Maybe Text) chanUsers :: Lens' ChannelState (HashMap Identifier String) 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.TopicProvenance instance GHC.Show.Show Client.State.Channel.MaskListEntry instance GHC.Show.Show Client.State.Channel.ChannelState -- | 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 :: !Text -> !Identifier -> Subfocus -- | Show channel user list FocusUsers :: !Text -> !Identifier -> Subfocus -- | Show channel mask list for given mode FocusMasks :: !Text -> !Identifier -> !Char -> Subfocus -- | Show client windows FocusWindows :: WindowsFilter -> Subfocus -- | Show current palette FocusPalette :: Subfocus -- | Show all mentions FocusMentions :: Subfocus -- | Show all digraphs FocusDigraphs :: Subfocus -- | Show key bindings FocusKeyMap :: Subfocus -- | Show help window FocusHelp :: Subfocus -- | Show GHC RTS statistics FocusRtsStats :: Subfocus -- | Show ignored masks FocusIgnoreList :: Subfocus -- | Show rendered certificate FocusCert :: Subfocus -- | Show channel list FocusChanList :: !Text -> Maybe Int -> Maybe Int -> Subfocus -- | Show last reply to a WHO query FocusWho :: !Text -> Subfocus -- | Filter argument for FocusWindows data WindowsFilter -- | no filter AllWindows :: WindowsFilter -- | only network windows NetworkWindows :: WindowsFilter -- | only channel windows ChannelWindows :: WindowsFilter -- | only user windows UserWindows :: WindowsFilter -- | Parses a single focus name given a default network. parseFocus :: Maybe Text -> String -> Maybe Focus -- | Return the network associated with the current focus focusNetwork :: Focus -> Maybe Text -- | Returns what focus a subfocus is actually for. actualFocus :: Subfocus -> Focus -> Focus isPrefixOfFocus :: String -> Focus -> Bool _ChannelFocus :: Prism' Focus (Text, Identifier) _NetworkFocus :: Prism' Focus Text _Unfocused :: Prism' Focus () instance GHC.Show.Show Client.State.Focus.WindowsFilter instance GHC.Classes.Eq Client.State.Focus.WindowsFilter instance GHC.Show.Show Client.State.Focus.Subfocus instance GHC.Classes.Eq Client.State.Focus.Subfocus instance GHC.Classes.Ord Client.State.Focus.Focus instance GHC.Show.Show Client.State.Focus.Focus instance GHC.Classes.Eq Client.State.Focus.Focus -- | The help buffer is basically a glorified list of Image's with -- some additional bookkeeping data. module Client.State.Help -- | Cached help query and rendered help text. data HelpState data HelpQuery HelpList :: HelpQuery HelpCmd :: Text -> HelpQuery HelpNet :: Text -> Text -> HelpQuery HelpNetPartial :: Text -> Text -> Maybe Text -> HelpQuery hsQuery :: Lens' HelpState HelpQuery hsImages :: Lens' HelpState [Image'] helpQueryToText :: HelpQuery -> Maybe Text makeHelp :: Maybe Text -> [Image'] -> HelpState awaitHelp :: Text -> Text -> HelpState awaitingHelp :: HelpState -> Maybe Text applyHelpReply :: Palette -> IrcMsg -> HelpState -> HelpState -- | This module contains glirc-specific overrides of the message routing -- provided by irc-core. module Client.State.Target data MessageTarget -- | Do not record the message anywhere. TargetDrop :: MessageTarget -- | Record the message in all channels/PMs shared with the user. TargetUser :: !Identifier -> MessageTarget -- | Directed message to channel or from user. TargetWindow :: !Identifier -> MessageTarget -- | As TargetWindow but only for existing windows. TargetExisting :: !Identifier -> MessageTarget -- | Record the message in the network window. TargetNetwork :: MessageTarget msgTarget :: Identifier -> IrcMsg -> MessageTarget -- | 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 :: !Char -> !WindowLines -> !Maybe Int -> !Int -> !Int -> !WindowLineImportance -> !Bool -> !Bool -> !ActivityFilter -> Window -- | Shortcut name (or NUL) [_winName'] :: Window -> !Char -- | Messages to display, newest first [_winMessages] :: Window -> !WindowLines -- | Location of line drawn to indicate newer messages [_winMarker] :: Window -> !Maybe Int -- | Messages added since buffer was visible [_winUnread] :: Window -> !Int -- | Messages in buffer [_winTotal] :: Window -> !Int -- | Indicates an important event is unread [_winMention] :: Window -> !WindowLineImportance -- | Hide metadata messages [_winHideMeta] :: Window -> !Bool -- | Remove from jump rotation [_winHidden] :: Window -> !Bool -- | Filters for activity [_winActivityFilter] :: Window -> !ActivityFilter winName :: Lens' Window (Maybe Char) winMessages :: Lens' Window WindowLines winUnread :: Lens' Window Int winTotal :: Lens' Window Int winMention :: Lens' Window WindowLineImportance winMarker :: Lens' Window (Maybe Int) winHideMeta :: Lens' Window Bool winHidden :: Lens' Window Bool winActivityFilter :: Lens' Window ActivityFilter data WindowLines (:-) :: {-# UNPACK #-} !WindowLine -> WindowLines -> WindowLines Nil :: WindowLines -- | A single message to be displayed in a window. The normal message line -- consists of the image prefix and the image. This allows line wrapping -- to be applied separately to the image and prefix so that wrapped -- messages can fall to the right side of the prefix. data WindowLine WindowLine :: !IrcSummary -> !Image' -> !Image' -> !Image' -> !WindowLineImportance -> {-# UNPACK #-} !PackedTime -> WindowLine -- | Summary value [_wlSummary] :: WindowLine -> !IrcSummary -- | Normal rendered image prefix [_wlPrefix] :: WindowLine -> !Image' -- | Normal rendered image [_wlImage] :: WindowLine -> !Image' -- | Detailed rendered image [_wlFullImage] :: WindowLine -> !Image' -- | Importance of message [_wlImportance] :: WindowLine -> !WindowLineImportance [_wlTimestamp] :: WindowLine -> {-# UNPACK #-} !PackedTime wlSummary :: Lens' WindowLine IrcSummary wlText :: Getter WindowLine Text wlPrefix :: Lens' WindowLine Image' wlImage :: Lens' WindowLine Image' wlFullImage :: Lens' WindowLine Image' wlImportance :: Lens' WindowLine WindowLineImportance wlTimestamp :: Lens' WindowLine PackedTime data ActivityFilter AFSilent :: ActivityFilter AFQuieter :: ActivityFilter AFQuiet :: ActivityFilter AFImpOnly :: ActivityFilter AFLoud :: ActivityFilter AFLouder :: ActivityFilter -- | 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 activityFilterStrings :: [String] applyActivityFilter :: ActivityFilter -> WindowLineImportance -> WindowLineImportance readActivityFilter :: String -> Maybe ActivityFilter -- | 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. Additionally -- returns True if this window becomes important as a result of this -- line. addToWindow :: WindowLine -> Window -> (Window, Bool) -- | Update the window clearing the unread count and important flag. windowSeen :: Window -> Window -- | Update the window when it first becomes active. If only boring -- messages have been added since last time the marker will be hidden. windowActivate :: Window -> Window -- | Update the window when it becomes inactive. This resets the activity -- marker to the bottom of the window. windowDeactivate :: Window -> Window windowClear :: Window -> Window data PackedTime packZonedTime :: ZonedTime -> PackedTime unpackUTCTime :: PackedTime -> UTCTime unpackTimeOfDay :: PackedTime -> TimeOfDay instance Control.Lens.Each.Each Client.State.Window.WindowLines Client.State.Window.WindowLines Client.State.Window.WindowLine Client.State.Window.WindowLine instance GHC.Show.Show Client.State.Window.ActivityLevel instance GHC.Read.Read Client.State.Window.ActivityLevel instance GHC.Classes.Ord Client.State.Window.ActivityLevel instance GHC.Classes.Eq Client.State.Window.ActivityLevel instance GHC.Enum.Enum Client.State.Window.WindowLineImportance instance GHC.Read.Read Client.State.Window.WindowLineImportance instance GHC.Show.Show Client.State.Window.WindowLineImportance instance GHC.Classes.Ord Client.State.Window.WindowLineImportance instance GHC.Classes.Eq Client.State.Window.WindowLineImportance instance GHC.Enum.Enum Client.State.Window.ActivityFilter instance GHC.Classes.Ord Client.State.Window.ActivityFilter instance GHC.Classes.Eq Client.State.Window.ActivityFilter instance GHC.Show.Show Client.State.Window.ActivityFilter module Client.UserHost -- | Pair of username and hostname. Empty strings represent missing -- information. data UserAndHost UserAndHost :: {-# UNPACK #-} !Text -> {-# UNPACK #-} !Text -> {-# UNPACK #-} !Text -> UserAndHost -- | username [_uhUser] :: UserAndHost -> {-# UNPACK #-} !Text -- | hostname [_uhHost] :: UserAndHost -> {-# UNPACK #-} !Text -- | services account [_uhAccount] :: UserAndHost -> {-# UNPACK #-} !Text uhUser :: Lens' UserAndHost Text uhHost :: Lens' UserAndHost Text uhAccount :: Lens' UserAndHost Text instance GHC.Show.Show Client.UserHost.UserAndHost instance GHC.Read.Read Client.UserHost.UserAndHost -- | Lines for the /palette command. This view shows all the -- colors of the current palette as well as the colors available in the -- terminal. module Client.View.Palette -- | Generate lines used for /palette. These lines show all the -- colors used in the current palette as well as the colors available for -- use in palettes. paletteViewLines :: Palette -> [Image'] -- | 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) toStrings :: Content -> NonEmpty String fromStrings :: NonEmpty String -> Content data Line Line :: !Int -> !String -> Line [_pos] :: Line -> !Int [_text] :: Line -> !String class HasLine c_a1i3r line :: HasLine c_a1i3r => Lens' c_a1i3r Line pos :: HasLine c_a1i3r => Lens' c_a1i3r Int text :: HasLine c_a1i3r => Lens' c_a1i3r 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 toggle :: Content -> Content -- | Use the two characters preceeding the cursor as a digraph and replace -- them with the corresponding character. digraph :: Map Digraph Text -> Content -> Maybe 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 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_a1i3r line :: HasLine c_a1i3r => Lens' c_a1i3r Line pos :: HasLine c_a1i3r => Lens' c_a1i3r Int text :: HasLine c_a1i3r => Lens' c_a1i3r 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 :: (Char -> Bool) -> 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 :: (Char -> Bool) -> Bool -> EditBox -> EditBox -- | Insert the yank buffer at the cursor. yank :: EditBox -> EditBox toggle :: Content -> Content -- | 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 insertDigraph :: Map Digraph Text -> EditBox -> Maybe 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.LastOperation instance GHC.Read.Read Client.State.EditBox.LastOperation instance GHC.Show.Show Client.State.EditBox.EditBox instance GHC.Read.Read Client.State.EditBox.EditBox -- | This module provides the tab-completion logic used for nicknames and -- channels. module Client.Commands.WordCompletion -- | Class for types that are isomorphic to String and which can -- support a total order and a prefix predicate. -- --
--   toString (fromString x) == x
--   fromString (toString x) == x
--   isPrefix x y ==> x <= y
--   
class (IsString a, Ord a) => Prefix a -- | Check if the first argument is a lexicographic prefix of the second. isPrefix :: Prefix a => a -> a -> Bool -- | Convert to a String. toString :: Prefix a => a -> String -- | 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 => (Char -> Bool) -> WordCompletionMode -> Bool -> [a] -> [a] -> EditBox -> Maybe EditBox -- | Word completion prefix and suffix data WordCompletionMode WordCompletionMode :: String -> WordCompletionMode [wcmStartPrefix, wcmStartSuffix, wcmMiddlePrefix, wcmMiddleSuffix] :: WordCompletionMode -> String -- | Word completion without adding any prefix or suffix plainWordCompleteMode :: WordCompletionMode -- | Word completion adding a ": " suffix at the beginning of lines defaultNickWordCompleteMode :: WordCompletionMode -- | Word completion using a "@" prefix intended slackNickWordCompleteMode :: WordCompletionMode data CaseText caseText :: Text -> CaseText instance GHC.Show.Show Client.Commands.WordCompletion.WordCompletionMode instance GHC.Read.Read Client.Commands.WordCompletion.CaseText instance GHC.Show.Show Client.Commands.WordCompletion.CaseText instance GHC.Classes.Ord Client.Commands.WordCompletion.CaseText instance GHC.Classes.Eq Client.Commands.WordCompletion.CaseText instance Data.String.IsString Client.Commands.WordCompletion.CaseText instance Client.Commands.WordCompletion.Prefix Client.Commands.WordCompletion.CaseText instance Client.Commands.WordCompletion.Prefix Irc.Identifier.Identifier instance Client.Commands.WordCompletion.Prefix Data.Text.Internal.Text -- | 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 :: !NonEmpty Text -> !Text -> !Text -> !Maybe Secret -> !Maybe SaslMechanism -> !HostName -> !Maybe PortNumber -> !TlsMode -> !TlsVerify -> !Maybe FilePath -> !Maybe FilePath -> !Maybe Secret -> !Maybe FilePath -> String -> Maybe String -> !Maybe Fingerprint -> !Maybe Fingerprint -> !Bool -> ![[ExpansionChunk]] -> !Maybe HostName -> !PortNumber -> !Maybe Text -> !Maybe Secret -> ![Identifier] -> !Rational -> !Rational -> ![HookConfig] -> !Maybe Text -> !Int -> !Maybe KnownRegex -> !Bool -> WordCompletionMode -> Maybe FilePath -> Maybe HostName -> !Bool -> ![Text] -> Map Focus WindowHint -> NetworkPalette -> ServerSettings -- | connection nicknames [_ssNicks] :: ServerSettings -> !NonEmpty Text -- | connection username [_ssUser] :: ServerSettings -> !Text -- | connection realname / GECOS [_ssReal] :: ServerSettings -> !Text -- | server password [_ssPassword] :: ServerSettings -> !Maybe Secret -- | SASL mechanism [_ssSaslMechanism] :: ServerSettings -> !Maybe SaslMechanism -- | server hostname [_ssHostName] :: ServerSettings -> !HostName -- | server port [_ssPort] :: ServerSettings -> !Maybe PortNumber -- | use TLS to connect [_ssTls] :: ServerSettings -> !TlsMode -- | verify TLS hostname [_ssTlsVerify] :: ServerSettings -> !TlsVerify -- | path to client TLS certificate [_ssTlsClientCert] :: ServerSettings -> !Maybe FilePath -- | path to client TLS key [_ssTlsClientKey] :: ServerSettings -> !Maybe FilePath -- | client key PEM password [_ssTlsClientKeyPassword] :: ServerSettings -> !Maybe Secret -- | additional CA certificates for validating server [_ssTlsServerCert] :: ServerSettings -> !Maybe FilePath -- | OpenSSL cipher suite [_ssTlsCiphers] :: ServerSettings -> String -- | OpenSSL TLS 1.3 cipher suite [_ssTls13Ciphers] :: ServerSettings -> Maybe String -- | optional acceptable public key fingerprint [_ssTlsPubkeyFingerprint] :: ServerSettings -> !Maybe Fingerprint -- | optional acceptable certificate fingerprint [_ssTlsCertFingerprint] :: ServerSettings -> !Maybe Fingerprint -- | Honor STS policies when true [_ssSts] :: ServerSettings -> !Bool -- | commands to execute upon successful connection [_ssConnectCmds] :: ServerSettings -> ![[ExpansionChunk]] -- | hostname of SOCKS proxy [_ssSocksHost] :: ServerSettings -> !Maybe HostName -- | port of SOCKS proxy [_ssSocksPort] :: ServerSettings -> !PortNumber [_ssSocksUsername] :: ServerSettings -> !Maybe Text [_ssSocksPassword] :: ServerSettings -> !Maybe Secret -- | 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 -> ![HookConfig] -- | The name referencing the server in commands [_ssName] :: ServerSettings -> !Maybe Text -- | The number of reconnect attempts to make on error [_ssReconnectAttempts] :: ServerSettings -> !Int -- | Regular expression for ERROR messages that trigger reconnect [_ssReconnectError] :: ServerSettings -> !Maybe KnownRegex -- | Connect to this network on server startup [_ssAutoconnect] :: ServerSettings -> !Bool -- | Nick completion mode for this server [_ssNickCompletion] :: ServerSettings -> WordCompletionMode -- | Directory to save logs of chat [_ssLogDir] :: ServerSettings -> Maybe FilePath -- | Local bind host [_ssBindHostName] :: ServerSettings -> Maybe HostName -- | Render account names [_ssShowAccounts] :: ServerSettings -> !Bool -- | Extra capabilities to unconditionally request [_ssCapabilities] :: ServerSettings -> ![Text] [_ssWindowHints] :: ServerSettings -> Map Focus WindowHint [_ssPalette] :: ServerSettings -> NetworkPalette -- | Hook name and configuration arguments data HookConfig HookConfig :: Text -> [Text] -> HookConfig serverSpec :: ValueSpec (Maybe Text, ServerSettings -> ServerSettings) identifierSpec :: ValueSpec Identifier ssNicks :: Lens' ServerSettings (NonEmpty Text) ssUser :: Lens' ServerSettings Text ssReal :: Lens' ServerSettings Text ssPassword :: Lens' ServerSettings (Maybe Secret) ssSaslMechanism :: Lens' ServerSettings (Maybe SaslMechanism) ssHostName :: Lens' ServerSettings HostName ssPort :: Lens' ServerSettings (Maybe PortNumber) ssTls :: Lens' ServerSettings TlsMode ssTlsVerify :: Lens' ServerSettings TlsVerify ssTlsClientCert :: Lens' ServerSettings (Maybe FilePath) ssTlsClientKey :: Lens' ServerSettings (Maybe FilePath) ssTlsClientKeyPassword :: Lens' ServerSettings (Maybe Secret) ssTlsServerCert :: Lens' ServerSettings (Maybe FilePath) ssTlsCiphers :: Lens' ServerSettings String ssTls13Ciphers :: Lens' ServerSettings (Maybe String) ssConnectCmds :: Lens' ServerSettings [[ExpansionChunk]] ssSocksHost :: Lens' ServerSettings (Maybe HostName) ssSocksPort :: Lens' ServerSettings PortNumber ssSocksUsername :: Lens' ServerSettings (Maybe Text) ssSocksPassword :: Lens' ServerSettings (Maybe Secret) ssChanservChannels :: Lens' ServerSettings [Identifier] ssFloodPenalty :: Lens' ServerSettings Rational ssFloodThreshold :: Lens' ServerSettings Rational ssMessageHooks :: Lens' ServerSettings [HookConfig] ssName :: Lens' ServerSettings (Maybe Text) ssReconnectAttempts :: Lens' ServerSettings Int ssReconnectError :: Lens' ServerSettings (Maybe KnownRegex) ssAutoconnect :: Lens' ServerSettings Bool ssNickCompletion :: Lens' ServerSettings WordCompletionMode ssLogDir :: Lens' ServerSettings (Maybe FilePath) ssBindHostName :: Lens' ServerSettings (Maybe HostName) ssSts :: Lens' ServerSettings Bool ssTlsPubkeyFingerprint :: Lens' ServerSettings (Maybe Fingerprint) ssTlsCertFingerprint :: Lens' ServerSettings (Maybe Fingerprint) ssShowAccounts :: Lens' ServerSettings Bool ssCapabilities :: Lens' ServerSettings [Text] ssWindowHints :: Lens' ServerSettings (Map Focus WindowHint) ssPalette :: Lens' ServerSettings NetworkPalette -- | SASL mechanisms and configuration data. data SaslMechanism -- | SASL PLAIN RFC4616 - authzid authcid password SaslPlain :: Maybe Text -> Text -> Secret -> SaslMechanism -- | SASL NIST - https://github.com/kaniini/ecdsatool - authzid -- keypath SaslEcdsa :: Maybe Text -> Text -> FilePath -> SaslMechanism -- | SASL EXTERNAL RFC4422 - authzid SaslExternal :: Maybe Text -> SaslMechanism -- | SASL SCRAM-SHA-256 RFC7677 - authzid authcid password SaslScram :: ScramDigest -> Maybe Text -> Text -> Secret -> SaslMechanism -- | SASL ECDH-X25519-CHALLENGE - authzid authcid private-key SaslEcdh :: Maybe Text -> Text -> Secret -> SaslMechanism _SaslExternal :: Prism' SaslMechanism (Maybe Text) _SaslEcdsa :: Prism' SaslMechanism (Maybe Text, Text, FilePath) _SaslPlain :: Prism' SaslMechanism (Maybe Text, Text, Secret) _SaslScram :: Prism' SaslMechanism (ScramDigest, Maybe Text, Text, Secret) data Secret -- | Constant text SecretText :: Text -> Secret -- | Command to generate text SecretCommand :: NonEmpty Text -> Secret data SecretException SecretException :: String -> String -> SecretException -- | Run the secret commands in a server configuration replacing them with -- secret text. Throws SecretException loadSecrets :: ServerSettings -> IO ServerSettings data WindowHint WindowHint :: Maybe Char -> Maybe Bool -> Maybe Bool -> Maybe ActivityFilter -> WindowHint [windowHintName] :: WindowHint -> Maybe Char [windowHintHideMeta] :: WindowHint -> Maybe Bool [windowHintHidden] :: WindowHint -> Maybe Bool [windowHintActivity] :: WindowHint -> Maybe ActivityFilter -- | The defaults for server settings. defaultServerSettings :: ServerSettings -- | Security setting for network connection data UseTls -- | TLS connection UseTls :: UseTls -- | TLS connection without certificate checking UseInsecureTls :: UseTls -- | Plain connection UseInsecure :: UseTls -- | Fingerprint used to validate server certificates. data Fingerprint -- | SHA-1 fingerprint FingerprintSha1 :: ByteString -> Fingerprint -- | SHA-2 256-bit fingerprint FingerprintSha256 :: ByteString -> Fingerprint -- | SHA-2 512-bit fingerprint FingerprintSha512 :: ByteString -> Fingerprint data TlsMode TlsYes :: TlsMode TlsNo :: TlsMode TlsStart :: TlsMode -- | Regular expression matched with original source to help with -- debugging. data KnownRegex KnownRegex :: Text -> Regex -> KnownRegex getRegex :: KnownRegex -> Regex instance GHC.Show.Show Client.Configuration.ServerSettings.SecretException instance GHC.Exception.Type.Exception Client.Configuration.ServerSettings.SecretException instance Config.Schema.Spec.HasSpec Client.Configuration.ServerSettings.Secret instance GHC.Show.Show Client.Configuration.ServerSettings.TlsMode instance GHC.Show.Show Client.Configuration.ServerSettings.Secret instance GHC.Show.Show Client.Configuration.ServerSettings.SaslMechanism instance GHC.Show.Show Client.Configuration.ServerSettings.WindowHint instance GHC.Show.Show Client.Configuration.ServerSettings.HookConfig instance GHC.Show.Show Client.Configuration.ServerSettings.UseTls instance GHC.Show.Show Client.Configuration.ServerSettings.Fingerprint instance GHC.Show.Show Client.Configuration.ServerSettings.ServerSettings instance GHC.Show.Show Client.Configuration.ServerSettings.KnownRegex -- | 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 :: ServerSettings -> (Connection -> IO a) -> IO a ircPort :: ServerSettings -> PortNumber tlsParams :: ServerSettings -> TlsParams -- | 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 -- | 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 successful connection to host (certificate lines) NetworkOpen :: !ZonedTime -> NetworkEvent -- | Event indicating TLS is in effect NetworkTLS :: [Text] -> NetworkEvent -- | Event for a new recieved line (newline removed) NetworkLine :: !ZonedTime -> !ByteString -> NetworkEvent -- | Report an error on network connection network connection failed NetworkError :: !ZonedTime -> !SomeException -> NetworkEvent -- | Final message indicating the network connection finished NetworkClose :: !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 -> ServerSettings -> 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 () -- | Insert a message to be transmitted on the network connection -- immediately. These messages are sent unmodified. The message should -- contain a newline terminator. This should be used for very high -- priority messages that must not get stuck in the queue. sendNext :: NetworkConnection -> ByteString -> IO () recv :: NetworkConnection -> STM [NetworkEvent] -- | Signals that the server is ready to initiate the TLS handshake. This -- is a no-op when not in a starttls state. upgrade :: NetworkConnection -> 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 -- | sent when the client disconnects due to sts policy StsUpgrade :: TerminationReason -- | STARTTLS was expected by server had an error StartTLSFailed :: TerminationReason BadCertFingerprint :: ByteString -> Maybe ByteString -> TerminationReason BadPubkeyFingerprint :: ByteString -> Maybe ByteString -> TerminationReason instance GHC.Show.Show Client.Network.Async.TerminationReason instance GHC.Exception.Type.Exception Client.Network.Async.TerminationReason instance GHC.Show.Show Client.Network.Async.NetworkConnection -- | 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 -> [Identifier] -> [Identifier] -> PaddingMode -> Recognizer Macro -> [ExtensionConfiguration] -> Maybe UrlOpener -> [Text] -> Bool -> Bool -> Bool -> KeyMap -> LayoutMode -> Bool -> [Modifier] -> Map Digraph Text -> NotifyWith -> Configuration -- | Default connection settings [_configDefaults] :: Configuration -> ServerSettings -- | Host-specific settings [_configServers] :: Configuration -> HashMap Text ServerSettings -- | User-customized color palette [_configPalette] :: Configuration -> Palette -- | Names of windows, used when alt-jumping) [_configWindowNames] :: Configuration -> Text -- | Extra highlight nicks/terms [_configExtraHighlights] :: Configuration -> [Identifier] -- | Never highlight nicks/terms [_configNeverHighlights] :: Configuration -> [Identifier] -- | Padding of nicks in messages [_configNickPadding] :: Configuration -> PaddingMode -- | command macros [_configMacros] :: Configuration -> Recognizer Macro -- | extensions to load [_configExtensions] :: Configuration -> [ExtensionConfiguration] -- | paths to url opening executable [_configUrlOpener] :: Configuration -> Maybe UrlOpener -- | initial ignore mask list [_configIgnores] :: Configuration -> [Text] -- | initially visibility of the activity bar [_configActivityBar] :: Configuration -> Bool -- | notify terminal on mention [_configBellOnMention] :: Configuration -> Bool -- | default setting for hidemeta on new windows [_configHideMeta] :: Configuration -> Bool -- | keyboard bindings [_configKeyMap] :: Configuration -> KeyMap -- | Default layout on startup [_configLayout] :: Configuration -> LayoutMode -- | visibility of ping time [_configShowPing] :: Configuration -> Bool -- | Modifier used for jumping windows [_configJumpModifier] :: Configuration -> [Modifier] -- | Extra digraphs [_configDigraphs] :: Configuration -> Map Digraph Text [_configNotifications] :: Configuration -> NotifyWith -- | Failure cases when loading a configuration file. data ConfigurationFailure -- | Error message from reading configuration file ConfigurationReadFailed :: String -> ConfigurationFailure -- | Error message from parser or lexer ConfigurationParseFailed :: FilePath -> String -> ConfigurationFailure -- | Error message from loading parsed configuration ConfigurationMalformed :: FilePath -> String -> ConfigurationFailure data LayoutMode -- | Vertically stack all windows in a single column OneColumn :: LayoutMode -- | Vertically stack extra windows in a second column TwoColumn :: LayoutMode data EditMode SingleLineEditor :: EditMode MultiLineEditor :: EditMode -- | Setting for how to pad the message prefix. data PaddingMode -- | Whitespace add to the left side of chat prefix LeftPadding :: !Int -> PaddingMode -- | Whitespace add to the right side of chat prefix RightPadding :: !Int -> PaddingMode -- | No whitespace added NoPadding :: PaddingMode -- | Configuration information for run-time loaded dynamic library -- extensions. data ExtensionConfiguration ExtensionConfiguration :: FilePath -> [RTLDFlags] -> [Text] -> ExtensionConfiguration -- | path to shared object [_extensionPath] :: ExtensionConfiguration -> FilePath -- | dynamic linker flags [_extensionRtldFlags] :: ExtensionConfiguration -> [RTLDFlags] -- | arguments to the extension on startup [_extensionArgs] :: ExtensionConfiguration -> [Text] configDefaults :: Lens' Configuration ServerSettings configServers :: Lens' Configuration (HashMap Text ServerSettings) configPalette :: Lens' Configuration Palette configWindowNames :: Lens' Configuration Text configNickPadding :: Lens' Configuration PaddingMode configMacros :: Lens' Configuration (Recognizer Macro) configExtensions :: Lens' Configuration [ExtensionConfiguration] configExtraHighlights :: Lens' Configuration [Identifier] configNeverHighlights :: Lens' Configuration [Identifier] configUrlOpener :: Lens' Configuration (Maybe UrlOpener) configIgnores :: Lens' Configuration [Text] configActivityBar :: Lens' Configuration Bool configBellOnMention :: Lens' Configuration Bool configHideMeta :: Lens' Configuration Bool configKeyMap :: Lens' Configuration KeyMap configLayout :: Lens' Configuration LayoutMode configShowPing :: Lens' Configuration Bool configJumpModifier :: Lens' Configuration [Modifier] configDigraphs :: Lens' Configuration (Map Digraph Text) configNotifications :: Lens' Configuration NotifyWith -- | Returns a NetworkPalette for the given network name. configNetworkPalette :: Text -> Configuration -> NetworkPalette extensionPath :: Lens' ExtensionConfiguration FilePath extensionRtldFlags :: Lens' ExtensionConfiguration [RTLDFlags] extensionArgs :: Lens' ExtensionConfiguration [Text] -- | Load the configuration file defaulting to -- ~.glircconfig. -- -- Given configuration path is optional and actual path used will be -- returns on success loadConfiguration :: Maybe FilePath -> IO (Either ConfigurationFailure (FilePath, Configuration)) -- | Uses getXdgDirectory XdgConfig to find -- ~.configglirc/config getConfigPath :: IO FilePath configurationSpec :: ValueSpec (ServerSettings -> Configuration) data FilePathContext newFilePathContext :: FilePath -> IO FilePathContext resolveFilePath :: FilePathContext -> FilePath -> FilePath data UrlOpener UrlOpener :: FilePath -> [UrlArgument] -> UrlOpener data UrlArgument UrlArgLiteral :: String -> UrlArgument UrlArgUrl :: UrlArgument instance GHC.Show.Show Client.Configuration.UrlArgument instance GHC.Show.Show Client.Configuration.UrlOpener instance GHC.Show.Show Client.Configuration.PaddingMode instance GHC.Show.Show Client.Configuration.LayoutMode instance GHC.Show.Show Client.Configuration.EditMode instance GHC.Show.Show Client.Configuration.ConfigurationFailure instance GHC.Show.Show Client.Configuration.ExtensionConfiguration instance GHC.Show.Show Client.Configuration.Configuration instance GHC.Exception.Type.Exception Client.Configuration.ConfigurationFailure -- | This module provides image renderers for messages. module Client.Image.Message -- | Parameters used when rendering messages data MessageRendererParams MessageRendererParams :: [Char] -> [Char] -> HashMap Identifier Highlight -> Palette -> Maybe (HashMap Identifier UserAndHost) -> NetworkPalette -> [Char] -> MessageRendererParams -- | restricted message sigils [rendStatusMsg] :: MessageRendererParams -> [Char] -- | sender sigils [rendUserSigils] :: MessageRendererParams -> [Char] -- | words to highlight [rendHighlights] :: MessageRendererParams -> HashMap Identifier Highlight -- | nick color palette [rendPalette] :: MessageRendererParams -> Palette [rendAccounts] :: MessageRendererParams -> Maybe (HashMap Identifier UserAndHost) [rendNetPalette] :: MessageRendererParams -> NetworkPalette -- | A list of valid channel name prefixes. [rendChanTypes] :: MessageRendererParams -> [Char] -- | 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 MessageRendererParams with no sigils or nicknames -- specified defaultRenderParams :: MessageRendererParams -- | Construct a message given the time the message was received and its -- render parameters. msgImage :: ZonedTime -> MessageRendererParams -> MessageBody -> (Image', Image', Image') -- | Returns image and identifier to be used when collapsing metadata -- messages. metadataImg :: Palette -> IrcSummary -> Maybe (Image', Identifier, Maybe Identifier) -- | Image used when treating ignored chat messages as metadata ignoreImage :: Palette -> 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 -> HashMap Identifier Highlight -> UserInfo -> Image' -- | Render a nickname in its hash-based color. coloredIdentifier :: Palette -> IdentifierColorMode -> HashMap Identifier Highlight -> Identifier -> Image' cleanText :: Text -> Text cleanChar :: Char -> Char -- | Optionally add padding to an input image according to the specified -- mode. If the input image is already wider than the specified padding -- mode, the image is returned unmodified. nickPad :: PaddingMode -> Image' -> Image' -- | Render a ZonedTime as time using quiet attributes -- --
--   23:15
--   
timeImage :: Palette -> TimeOfDay -> Image' -- | Render the normal view of a chat message line padded and wrapped. drawWindowLine :: Palette -> Int -> PaddingMode -> WindowLine -> [Image'] modesImage :: Attr -> HashMap Char Attr -> String -> Image' -- | Render string representing seconds into days, hours, minutes, and -- seconds. prettyTime :: Int -> String -> String -- | Parse message text to construct an image. If the text has formatting -- control characters in it then the text will be rendered according to -- the formatting codes. Otherwise the nicknames in the message are -- highlighted. parseIrcTextWithNicks :: Palette -> HashMap Identifier Highlight -> Bool -> Text -> Image' data Highlight HighlightMe :: Highlight HighlightNick :: Highlight HighlightError :: Highlight HighlightNone :: Highlight instance GHC.Classes.Eq Client.Image.Message.Highlight -- | Because WHOX allows for a LOT of fiddliness regarding parameters, this -- is extracted from Client.State.Network and given its own module. module Client.WhoReply data WhoReply data WhoReplyItem newWhoReply :: Text -> String -> WhoReply finishWhoReply :: WhoReply -> WhoReply recordWhoReply :: [Text] -> WhoReply -> WhoReply recordWhoXReply :: [Text] -> WhoReply -> WhoReply mapJoinWhoFields :: WhoReplyItem -> (UserInfo -> a) -> (Identifier -> a) -> (Text -> a) -> (Identifier -> a) -> a -> (Text -> a) -> (Int -> a) -> (String -> a) -> (Text -> a) -> (Text -> a) -> [a] whoFilterText :: WhoReplyItem -> Text whoQuery :: Lens' WhoReply (Text, Maybe Text) whoFields :: Lens' WhoReply (Set Char) whoToken :: Lens' WhoReply String whoDone :: Lens' WhoReply Bool whoItems :: Lens' WhoReply [WhoReplyItem] whoUserInfo :: Lens' WhoReplyItem UserInfo whoIp :: Lens' WhoReplyItem Text whoServer :: Lens' WhoReplyItem Identifier whoAway :: Lens' WhoReplyItem (Maybe Bool) whoMiscFlags :: Lens' WhoReplyItem Text whoHops :: Lens' WhoReplyItem (Maybe Int) whoIdleSecs :: Lens' WhoReplyItem String whoAcct :: Lens' WhoReplyItem Identifier whoOpLvl :: Lens' WhoReplyItem Text whoRealname :: Lens' WhoReplyItem Text instance GHC.Classes.Ord Client.WhoReply.WhoReplyItem instance GHC.Classes.Eq Client.WhoReply.WhoReplyItem -- | This module renders the lines used to list the ignore masks. module Client.View.IgnoreList -- | Render the lines used in a channel mask list. ignoreListLines :: HashSet Identifier -> Palette -> [Image'] -- | This module provides provides logging functionality for IRC traffic. module Client.Log -- | Log entry queued in client to be written by the event loop data LogLine LogLine :: FilePath -> Day -> Text -> Text -> LogLine -- | log directory from server settings [logBaseDir] :: LogLine -> FilePath -- | localtime day [logDay] :: LogLine -> Day -- | channel or nickname [logTarget] :: LogLine -> Text -- | formatted log message text [logLine] :: LogLine -> Text -- | Write the given log entry to the filesystem. writeLogLine :: LogLine -> IO () -- | Ignore all IOErrors ignoreProblems :: IO () -> IO () -- | Construct a LogLine for the given ClientMessage when -- appropriate. Only chat messages result in a log line. renderLogLine :: ClientMessage -> FilePath -> [Char] -> Identifier -> Maybe LogLine -- | 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 -> !IntPSQ UTCTime TimerEntry -> !Int -> !Int -> !Bool -> 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 [aeTimers] :: ActiveExtension -> !IntPSQ UTCTime TimerEntry [aeNextTimer] :: ActiveExtension -> !Int [aeThreads] :: ActiveExtension -> !Int [aeLive] :: ActiveExtension -> !Bool -- | 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. openExtension :: ExtensionConfiguration -> IO ActiveExtension startExtension :: Ptr () -> ExtensionConfiguration -> ActiveExtension -> IO (Ptr ()) stopExtension :: 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. -- -- Returns True to pass message to client. Returns 'False to drop -- message. notifyExtension :: ActiveExtension -> Ptr FgnMsg -> IO Bool -- | Notify an extension of a client command with the given parameters. commandExtension :: Text -> ActiveExtension -> IO () -- | Call all of the process chat callbacks in the list of extensions. This -- operation marshals the IRC message once and shares that across all of -- the callbacks. -- -- Returns True to pass message to client. Returns 'False to drop -- message. chatExtension :: ActiveExtension -> Ptr FgnChat -> IO Bool data ThreadEntry ThreadEntry :: !FunPtr ThreadFinish -> !Ptr () -> ThreadEntry -- | Notify an extension that one of its threads has finished. threadFinish :: ThreadEntry -> IO () -- | Find the earliest timer ready to run if any are available. popTimer :: ActiveExtension -> Maybe (UTCTime, TimerId, FunPtr TimerCallback, Ptr (), ActiveExtension) -- | Schedue a new timer event for the given extension. pushTimer :: UTCTime -> FunPtr TimerCallback -> Ptr () -> ActiveExtension -> (Int, ActiveExtension) -- | Remove a timer from the schedule by ID cancelTimer :: Int -> ActiveExtension -> Maybe (Ptr (), ActiveExtension) -- | Return the bracket IO action. evalNestedIO :: NestedIO a -> IO a withChat :: Text -> Text -> Text -> NestedIO (Ptr FgnChat) -- | Marshal a RawIrcMsg into a FgnMsg which will be valid -- for the remainder of the computation. withRawIrcMsg :: Text -> RawIrcMsg -> NestedIO (Ptr FgnMsg) instance Control.Monad.IO.Class.MonadIO Client.CApi.NestedIO instance GHC.Base.Monad Client.CApi.NestedIO instance GHC.Base.Applicative Client.CApi.NestedIO instance GHC.Base.Functor Client.CApi.NestedIO -- | This module process command-line options provided when launching the -- client. module Client.Options -- | Command-line options data Options Options :: Maybe FilePath -> [Text] -> Bool -> Bool -> Bool -> Bool -> Bool -> Options -- | configuration file path [_optConfigFile] :: Options -> Maybe FilePath -- | initial networks [_optInitialNetworks] :: Options -> [Text] -- | disable autoconnect [_optNoConnect] :: Options -> Bool -- | show help message [_optShowHelp] :: Options -> Bool -- | show version message [_optShowVersion] :: Options -> Bool -- | show version of ALL transitive dependencies [_optShowFullVersion] :: Options -> Bool -- | show configuration file format [_optShowConfigFormat] :: Options -> Bool optConfigFile :: Lens' Options (Maybe FilePath) optInitialNetworks :: Lens' Options [Text] optNoConnect :: Lens' Options Bool -- | Load command line options. This action will terminate early in the -- case of the version flag, help flag, or an error. getOptions :: IO Options -- | Lines for the /rtsstats command. module Client.View.RtsStats -- | Generate lines used for /rtsstats. rtsStatsLines :: Maybe Stats -> Palette -> [Image'] -- | These sorting rules are based on the solanum server notices. module Client.Hook.Snotice snoticeHook :: MessageHook -- | The #dronebl channels use a bot to relay messages from other networks. -- This hook integrates those messages into the native format. module Client.Hook.DroneBLRelay -- | Hook for mapping messages in #dronebl to appear like native messages. droneblRelayHook :: [Text] -> Maybe MessageHook instance (Client.Hook.DroneBLRelay.RuleArg a, Client.Hook.DroneBLRelay.Rule b) => Client.Hook.DroneBLRelay.Rule (a -> b) instance Client.Hook.DroneBLRelay.RuleArg Data.Text.Internal.Text instance Client.Hook.DroneBLRelay.Rule Irc.Message.IrcMsg -- | The collection of all hooks available in the client. module Client.Hooks -- | All the available message hooks. messageHooks :: HashMap Text ([Text] -> Maybe MessageHook) -- | 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 :: !HashMap Identifier ChannelState -> !ChannelList -> !WhoReply -> !NetworkConnection -> !ModeTypes -> !ModeTypes -> ![Char] -> !Transaction -> ![Char] -> ![Char] -> ![Char] -> !ServerSettings -> !UserInfo -> !HashMap Identifier UserAndHost -> !Int -> !Text -> ![MessageHook] -> !AuthenticateState -> !Bool -> !Maybe UTCTime -> !Maybe NominalDiffTime -> !PingStatus -> !Maybe UTCTime -> ![Text] -> StdGen -> NetworkState -- | joined channels [_csChannels] :: NetworkState -> !HashMap Identifier ChannelState -- | cached ELIST parameter and /list output [_csChannelList] :: NetworkState -> !ChannelList -- | cached reply from the last WHO query [_csWhoReply] :: NetworkState -> !WhoReply -- | network socket [_csSocket] :: NetworkState -> !NetworkConnection -- | channel mode meanings [_csModeTypes] :: NetworkState -> !ModeTypes -- | user mode meanings [_csUmodeTypes] :: NetworkState -> !ModeTypes -- | channel identifier prefixes [_csChannelTypes] :: NetworkState -> ![Char] -- | state for multi-message sequences [_csTransaction] :: NetworkState -> !Transaction -- | modes for the connected user [_csModes] :: NetworkState -> ![Char] -- | server notice modes for the connected user [_csSnomask] :: 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 -- | names of message hooks to apply to this connection [_csMessageHooks] :: NetworkState -> ![MessageHook] [_csAuthenticationState] :: NetworkState -> !AuthenticateState -- | Tracks when you are marked away [_csAway] :: NetworkState -> !Bool -- | time for next ping event [_csNextPingTime] :: NetworkState -> !Maybe UTCTime -- | latency calculated from previous pong [_csLatency] :: NetworkState -> !Maybe NominalDiffTime -- | state of ping timer [_csPingStatus] :: NetworkState -> !PingStatus -- | time of last message received [_csLastReceived] :: NetworkState -> !Maybe UTCTime [_csCertificate] :: NetworkState -> ![Text] [_csSeed] :: NetworkState -> StdGen -- | State of the authentication transaction data AuthenticateState -- | no active transaction AS_None :: AuthenticateState -- | PLAIN mode initiated AS_PlainStarted :: AuthenticateState -- | ECDSA-NIST mode initiated AS_EcdsaStarted :: AuthenticateState -- | ECDSA-NIST user sent waiting for challenge AS_EcdsaWaitChallenge :: AuthenticateState -- | EXTERNAL mode initiated AS_ExternalStarted :: AuthenticateState AS_ScramStarted :: AuthenticateState AS_Scram1 :: Phase1 -> AuthenticateState AS_Scram2 :: Phase2 -> AuthenticateState AS_EcdhStarted :: AuthenticateState AS_EcdhWaitChallenge :: Phase1 -> AuthenticateState data ConnectRestriction -- | no message restriction NoRestriction :: ConnectRestriction -- | STARTTLS hasn't finished StartTLSRestriction :: ConnectRestriction -- | No messages allowed until TLS starts WaitTLSRestriction :: ConnectRestriction -- | Construct a new network state using the given settings and default -- values as specified by the IRC specification. newNetworkState :: Text -> ServerSettings -> NetworkConnection -> PingStatus -> StdGen -> NetworkState csNick :: Lens' NetworkState Identifier csChannels :: Lens' NetworkState (HashMap Identifier ChannelState) csChannelList :: Lens' NetworkState ChannelList csWhoReply :: Lens' NetworkState WhoReply csSocket :: Lens' NetworkState NetworkConnection csModeTypes :: Lens' NetworkState ModeTypes csChannelTypes :: Lens' NetworkState [Char] csTransaction :: Lens' NetworkState Transaction csModes :: Lens' NetworkState [Char] csSnomask :: 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 csNetwork :: Lens' NetworkState Text csNextPingTime :: Lens' NetworkState (Maybe UTCTime) csPingStatus :: Lens' NetworkState PingStatus csLatency :: Lens' NetworkState (Maybe NominalDiffTime) csLastReceived :: Lens' NetworkState (Maybe UTCTime) csCertificate :: Lens' NetworkState [Text] csMessageHooks :: Lens' NetworkState [MessageHook] csAuthenticationState :: Lens' NetworkState AuthenticateState csSeed :: Lens' NetworkState StdGen csAway :: Lens' NetworkState Bool csJoinedChannels :: Fold NetworkState ChannelState clsElist :: Lens' ChannelList (Maybe Text) clsDone :: Lens' ChannelList Bool clsItems :: Lens' ChannelList [(Identifier, Int, Text)] data Transaction NoTransaction :: Transaction NamesTransaction :: [Text] -> Transaction BanTransaction :: [(Text, MaskListEntry)] -> Transaction WhoTransaction :: [UserInfo] -> Transaction CapLsTransaction :: [(Text, Maybe Text)] -> Transaction isChannelIdentifier :: NetworkState -> Identifier -> Bool -- | Predicate to test if the connection has op in a given channel. iHaveOp :: Identifier -> NetworkState -> Bool -- | Transmit a RawIrcMsg on the connection associated with the -- given network. For PRIVMSG and NOTICE overlong -- commands are detected and transmitted as multiple messages. sendMsg :: NetworkState -> RawIrcMsg -> IO () initialMessages :: NetworkState -> [RawIrcMsg] -- | 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 data Apply Apply :: [RawIrcMsg] -> NetworkState -> Apply applyMessage :: ZonedTime -> IrcMsg -> NetworkState -> Apply hideMessage :: IrcMsg -> Bool -- | Status of the ping timer data PingStatus -- | ping sent at given time, waiting for pong PingSent :: !UTCTime -> PingStatus -- | not waiting for a pong PingNone :: PingStatus -- | number of attempts, last known connection time PingConnecting :: !Int -> !Maybe UTCTime -> !ConnectRestriction -> PingStatus _PingConnecting :: Prism' PingStatus (Int, Maybe UTCTime, ConnectRestriction) -- | Timer-based events data TimedAction -- | terminate the connection due to timeout TimedDisconnect :: TimedAction -- | transmit a ping to the server TimedSendPing :: TimedAction -- | erase latency (when it is outdated) TimedForgetLatency :: 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 useChanServ :: Identifier -> NetworkState -> Bool -- | Used to send commands that require ops to perform. If this channel is -- one that the user has chanserv access and ops are needed then ops are -- requested and the commands are queued, otherwise send them directly. sendModeration :: Identifier -> [RawIrcMsg] -> NetworkState -> IO NetworkState sendTopic :: Identifier -> Text -> NetworkState -> IO () instance GHC.Show.Show Client.State.Network.ConnectRestriction instance GHC.Show.Show Client.State.Network.PingStatus 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.Transaction -- | 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 -> !Maybe Focus -> !Focus -> !Subfocus -> ![(Focus, Subfocus)] -> !HashMap Text NetworkState -> !TQueue NetworkEvent -> TQueue (Int, ThreadEntry) -> !Configuration -> !FilePath -> !EditBox -> !Int -> !Int -> !Int -> !Int -> !Bool -> !Bool -> !Bool -> Maybe Matcher -> LayoutMode -> EditMode -> Bool -> [(Text, Text)] -> !Bool -> !Bool -> !HashSet Identifier -> Mask -> !ExtensionState -> ![LogLine] -> Maybe Text -> Maybe Stats -> !HashMap Text StsPolicy -> !HashMap Identifier Highlight -> !HelpState -> ClientState -- | client message buffers [_clientWindows] :: ClientState -> !Map Focus Window -- | previously focused buffer [_clientPrevFocus] :: ClientState -> !Focus -- | focus prior to jumping to activity [_clientActivityReturn] :: ClientState -> !Maybe Focus -- | currently focused buffer [_clientFocus] :: ClientState -> !Focus -- | current view mode [_clientSubfocus] :: ClientState -> !Subfocus -- | extra messages windows to view [_clientExtraFocus] :: ClientState -> ![(Focus, Subfocus)] -- | state of active connections [_clientConnections] :: ClientState -> !HashMap Text NetworkState -- | incoming network event queue [_clientEvents] :: ClientState -> !TQueue NetworkEvent -- | Finished threads ready to report [_clientThreadJoins] :: ClientState -> TQueue (Int, ThreadEntry) -- | client configuration [_clientConfig] :: ClientState -> !Configuration -- | client configuration file path [_clientConfigPath] :: ClientState -> !FilePath -- | primary text box [_clientTextBox] :: ClientState -> !EditBox -- | size to crop from left of text box [_clientTextBoxOffset] :: ClientState -> !Int -- | current terminal width [_clientWidth] :: ClientState -> !Int -- | current terminal height [_clientHeight] :: ClientState -> !Int -- | buffer scroll lines [_clientScroll] :: ClientState -> !Int -- | use detailed rendering mode [_clientDetailView] :: ClientState -> !Bool -- | visible activity bar [_clientActivityBar] :: ClientState -> !Bool -- | visible ping time [_clientShowPing] :: ClientState -> !Bool -- | optional persistent filter [_clientRegex] :: ClientState -> Maybe Matcher -- | layout mode for split screen [_clientLayout] :: ClientState -> LayoutMode -- | editor rendering mode [_clientEditMode] :: ClientState -> EditMode -- | editor locked and won't send [_clientEditLock] :: ClientState -> Bool -- | notifications to send next draw [_clientNotifications] :: ClientState -> [(Text, Text)] -- | terminal bell on next redraw [_clientBell] :: ClientState -> !Bool -- | whether the UI is focused; used by notifications [_clientUiFocused] :: ClientState -> !Bool -- | ignored masks [_clientIgnores] :: ClientState -> !HashSet Identifier -- | precomputed ignore regular expression (lazy) [_clientIgnoreMask] :: ClientState -> Mask -- | state of loaded extensions [_clientExtensions] :: ClientState -> !ExtensionState -- | log lines ready to write [_clientLogQueue] :: ClientState -> ![LogLine] -- | transient error box text [_clientErrorMsg] :: ClientState -> Maybe Text -- | most recent GHC RTS stats [_clientRtsStats] :: ClientState -> Maybe Stats -- | STS policy entries [_clientStsPolicy] :: ClientState -> !HashMap Text StsPolicy -- | highlights [_clientHighlights] :: ClientState -> !HashMap Identifier Highlight -- | cached help text [_clientHelp] :: ClientState -> !HelpState clientWindows :: Lens' ClientState (Map Focus Window) clientTextBox :: Lens' ClientState EditBox clientTextBoxOffset :: Lens' ClientState Int clientConnections :: Lens' ClientState (HashMap Text NetworkState) clientThreadJoins :: Lens' ClientState (TQueue (Int, ThreadEntry)) clientWidth :: Lens' ClientState Int clientHeight :: Lens' ClientState Int clientEvents :: Lens' ClientState (TQueue NetworkEvent) clientFocus :: Lens' ClientState Focus clientPrevFocus :: Lens' ClientState Focus clientExtraFocus :: Lens' ClientState [(Focus, Subfocus)] clientConfig :: Lens' ClientState Configuration clientScroll :: Lens' ClientState Int clientDetailView :: Lens' ClientState Bool clientActivityBar :: Lens' ClientState Bool clientShowPing :: Lens' ClientState Bool clientSubfocus :: Lens' ClientState Subfocus clientIgnores :: Lens' ClientState (HashSet Identifier) clientIgnoreMask :: Lens' ClientState Mask -- | ReifiedTraversal for finding the NetworkState associated -- with a given network if that connection is currently active. clientConnection :: Applicative f => Text -> LensLike' f ClientState NetworkState clientNotifications :: Lens' ClientState [(Text, Text)] clientBell :: Lens' ClientState Bool clientUiFocused :: Lens' ClientState Bool clientExtensions :: Lens' ClientState ExtensionState clientRegex :: Lens' ClientState (Maybe Matcher) clientLogQueue :: Lens' ClientState [LogLine] clientActivityReturn :: Lens' ClientState (Maybe Focus) clientErrorMsg :: Lens' ClientState (Maybe Text) clientLayout :: Lens' ClientState LayoutMode clientEditMode :: Lens' ClientState EditMode clientEditLock :: Lens' ClientState Bool clientRtsStats :: Lens' ClientState (Maybe Stats) clientConfigPath :: Lens' ClientState FilePath clientStsPolicy :: Lens' ClientState (HashMap Text StsPolicy) clientHighlights :: Lens' ClientState (HashMap Identifier Highlight) -- | Construct an initial ClientState using default values. withClientState :: FilePath -> Configuration -> (ClientState -> IO a) -> IO a clientIsFiltered :: ClientState -> Bool clientFilter :: ClientState -> (a -> Text) -> [a] -> [a] clientFilterChannels :: ClientState -> Maybe Int -> Maybe Int -> [(Identifier, Int, Text)] -> [(Identifier, Int, Text)] -- | Generates the NetworkPalette for the current focus. clientNetworkPalette :: ClientState -> NetworkPalette buildMatcher :: String -> Maybe Matcher -- | Toggle the hide metadata setting for the focused window. clientToggleHideMeta :: ClientState -> ClientState channelUserList :: Text -> Identifier -> ClientState -> [Identifier] -- | 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 nicknames to determine if messages should be ignored. identIgnored :: UserInfo -> ClientState -> Bool -- | 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 -> Maybe Int -> Text -> ClientState -> IO ClientState -- | Remove a network connection and unlink it from the network map. This -- operation assumes that the network connection exists and should only -- be applied once per connection. removeNetwork :: Text -> ClientState -> (NetworkState, ClientState) -- | Function applied to the client state every redraw. clientTick :: ClientState -> ClientState applyMessageToClientState :: ZonedTime -> IrcMsg -> Text -> NetworkState -> ClientState -> ([RawIrcMsg], ClientState) clientHighlightsFocus :: Focus -> ClientState -> HashMap Identifier Highlight -- | Produce the list of window names configured for the client. clientWindowNames :: ClientState -> [Char] -- | Produce the list of window names configured for the client. clientPalette :: ClientState -> Palette -- | Returns the list of network names that requested autoconnection. clientAutoconnects :: ClientState -> [Text] -- | Compute the command and arguments currently in the textbox. clientActiveCommand :: ClientState -> Maybe (String, String) clientNextWindowName :: Maybe WindowHint -> ClientState -> Char clientWindowHint :: Focus -> ClientState -> Maybe WindowHint clientHelp :: Lens' ClientState HelpState -- | List of extra focuses to display as split windows clientExtraFocuses :: ClientState -> [(Focus, Subfocus)] -- | Returns the WordCompletionMode associated with the current -- network. currentNickCompletionMode :: ClientState -> WordCompletionMode -- | 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 recordError :: ZonedTime -> Text -> Text -> ClientState -> ClientState -- | Record a message in the windows corresponding to the given target recordIrcMessage :: Text -> MessageTarget -> ClientMessage -> ClientState -> ClientState recordSuccess :: ZonedTime -> ClientState -> Text -> ClientState -- | Change the window focus to the given value, reset the subfocus to -- message view, reset the scroll, remember the previous focus if it -- changed. changeFocus :: Focus -> ClientState -> ClientState -- | Change the subfocus to the given value, preserve the focus, reset the -- scroll. 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 next window when on message view. Otherwise switch -- to message view. advanceNetworkFocus :: 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 -- while ignoring hidden windows. jumpFocus :: Char -> ClientState -> ClientState -- | Unified logic for assigning to the extra focuses field that activates -- and deactivates windows as needed. setExtraFocus :: [(Focus, Subfocus)] -> ClientState -> ClientState -- | Scroll the current buffer to show newer messages scrollClient :: Int -> ClientState -> ClientState -- | State of the extension API including loaded extensions and the -- mechanism used to support reentry into the Haskell runtime from the C -- API. -- -- When executing inside an extension the mvar will contain the client -- state and the ID of the running extension. data ExtensionState esActive :: Lens' ExtensionState (IntMap ActiveExtension) esMVar :: Lens' ExtensionState (MVar ParkState) esStablePtr :: Lens' ExtensionState (StablePtr (MVar ParkState)) -- | This module renders the lines used in /who replies. module Client.View.Who -- | | Render the lines used by the /who command in normal mode. whoLines :: Text -> Int -> ClientState -> [Image'] -- | This module renders the lines used in the channel user list. module Client.View.UserList -- | Render the lines used by the /users command in normal mode. -- These lines show the count of users having each channel mode in -- addition to the nicknames of the users. userListImages :: Text -> Identifier -> Int -> ClientState -> [Image'] -- | Render lines for the /users command in detailed view. Each -- user will be rendered on a separate line with username and host -- visible when known. userInfoImages :: Text -> Identifier -> ClientState -> [Image'] -- | This module returns the chat messages for the currently focused window -- in message view and gathers metadata entries into single lines. module Client.View.Messages chatMessageImages :: Focus -> Int -> 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.View.MaskList -- | Render the lines used in a channel mask list maskListImages :: Char -> Text -> Identifier -> Int -> ClientState -> [Image'] -- | This module provides a view of the key bindings map module Client.View.KeyMap -- | Show the client keybindings keyMapLines :: ClientState -> [Image'] -- | This module provides a view of the built-in digraph list. module Client.View.Digraphs -- | Render the lines of a table showing all of the available digraph -- entries digraphLines :: Int -> ClientState -> [Image'] -- | This module renders the lines used in the channel user list. module Client.View.ChannelList -- | | Render the lines used by the /list command in normal mode. channelListLines :: Text -> Int -> ClientState -> (Maybe Int, Maybe Int) -> [Image'] -- | This module implements a renderer for the window that shows channel -- metadata. module Client.View.ChannelInfo -- | Render the lines used in a channel mask list channelInfoImages :: Text -> Identifier -> ClientState -> [Image'] module Client.View.Cert -- | Render the lines used in a channel mask list certViewLines :: ClientState -> [Image'] module Client.State.Url -- | A URL and identifiers of those who provided that URL. type UrlPair = (Text, [Identifier]) -- | Generate a list of URLs from the current focus and subfocus. urlList :: ClientState -> [UrlPair] -- | This module provides a list of the URLs found in the current message -- window in order to assist in selecting one to open with /url module Client.View.UrlSelection -- | Generate the lines used for the view when typing /url urlSelectionView :: Int -> Focus -> String -> ClientState -> [Image'] -- | This module implements the interaction between the client and its -- extensions. This includes aspects of the extension system that depend -- on the current client state. module Client.State.Extensions -- | Dispatch chat messages through extensions before sending to server. clientChatExtension :: Text -> Text -> Text -> ClientState -> IO (ClientState, Bool) -- | Dispatch /extension command to correct extension. Returns -- Nothing when no matching extension is available. clientCommandExtension :: Text -> Text -> ClientState -> IO (Maybe ClientState) -- | Start extensions after ensuring existing ones are stopped clientStartExtensions :: ClientState -> IO ClientState -- | Dispatch incoming IRC message through extensions clientNotifyExtensions :: Text -> RawIrcMsg -> ClientState -> IO (ClientState, Bool) -- | Unload all active extensions. clientStopExtensions :: ClientState -> IO ClientState -- | Run the next available timer event on a particular extension. clientExtTimer :: Int -> ClientState -> IO ClientState -- | Run the thread join action on a given extension. clientThreadJoin :: Int -> ThreadEntry -> ClientState -> IO ClientState -- | This module provides image renderers used to construct the labels for -- window names and activity boxes. module Client.Image.Focus data FocusLabelType FocusLabelJump :: FocusLabelType FocusLabelShort :: FocusLabelType FocusLabelLong :: FocusLabelType focusLabel :: FocusLabelType -> ClientState -> Focus -> Image' windowLabel :: ClientState -> (Focus, Window) -> Image' -- | This module implements the rendering of the client window list. module Client.View.Windows -- | Draw the image lines associated with the /windows command. windowsImages :: WindowsFilter -> ClientState -> [Image'] -- | This module renders lines used in the preview for /c module Client.View.WindowSwitch -- | Render the lines used by the /c command. windowSwitchImages :: String -> Int -> 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 -- | Renders the status line between messages and the textbox. statusLineImage :: Int -> ClientState -> Image -- | The minor status line is used when rendering the /splits and -- /mentions views to show the associated window name. minorStatusLineImage :: Focus -> Subfocus -> Int -> Bool -> ClientState -> Image' clientTitle :: ClientState -> String -- | This module provides the lines that have been highlighted across the -- client in sorted order. module Client.View.Mentions -- | Generate the list of message lines marked important ordered by time. -- Each run of lines from the same channel will be grouped together. -- Messages are headed by their window, network, and channel. mentionsViewLines :: Int -> ClientState -> [Image'] -- | This module selects the correct view based on the current state. module Client.View viewLines :: Focus -> Subfocus -> Int -> ClientState -> [Image'] module Client.Commands.Types -- | 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 -- | Type of commands that always work type ClientCommand a = ClientState -> a {-^ arguments -} -> IO CommandResult -- | Type of commands that operate on a window type WindowCommand a = Focus -> ClientCommand a -- | Type of commands that require an active network to be focused type NetworkCommand a = NetworkState {-^ current network -} -> ClientCommand a -- | Type of commands that require an active network to be focused and -- maybe a chat window. type MaybeChatCommand a = Maybe Identifier {-^ focused channel -} -> NetworkCommand a -- | Type of commands that require an active channel to be focused type ChannelCommand a = Identifier {-^ focused channel -} -> NetworkCommand a -- | Pair of implementations for executing a command and tab completing -- one. The tab-completion logic is extended with a Bool indicating that -- tab completion should be reversed data CommandImpl a -- | no requirements ClientCommand :: ClientCommand a -> (Bool -> ClientCommand String) -> CommandImpl a -- | operates on a window WindowCommand :: WindowCommand a -> (Bool -> WindowCommand String) -> CommandImpl a -- | requires an active network NetworkCommand :: NetworkCommand a -> (Bool -> NetworkCommand String) -> CommandImpl a -- | requires an active network and maybe a chat window MaybeChatCommand :: MaybeChatCommand a -> (Bool -> MaybeChatCommand String) -> CommandImpl a -- | requires an active chat window ChatCommand :: ChannelCommand a -> (Bool -> ChannelCommand String) -> CommandImpl a -- | requires an active channel window ChannelCommand :: ChannelCommand a -> (Bool -> ChannelCommand String) -> CommandImpl a -- | Data available to the arguments parser at the time of parsing. data ArgsContext ArgsContext :: ClientState -> Focus -> ArgsContext [argsContextSt] :: ArgsContext -> ClientState [argsContextFocus] :: ArgsContext -> Focus makeArgsContext :: ClientState -> ArgsContext -- | A command is a list of aliases, an argument specification, -- implementation, and documentation. The arguments and implementation -- must match so that the parsed arguments will match what the -- implementation expects. data Command Command :: NonEmpty Text -> Args ArgsContext a -> Text -> CommandImpl a -> Command -- | Names of this command, first in the list is the "primary" name [cmdNames] :: Command -> NonEmpty Text -- | Specification of the arguments of the command [cmdArgumentSpec] :: Command -> Args ArgsContext a -- | Multi-line IRC-formatted documentation text used for /help [cmdDocumentation] :: Command -> Text -- | Implementation of the command for both execution and tab completion [cmdImplementation] :: Command -> CommandImpl a -- | A command section is a logical grouping of commands. This allows for -- showing more structure in the help menu system. data CommandSection CommandSection :: Text -> [Command] -> CommandSection [cmdSectionName] :: CommandSection -> Text [cmdSectionCmds] :: CommandSection -> [Command] -- | Consider the text entry successful and resume the client commandSuccess :: Monad m => ClientState -> m CommandResult -- | Consider the text entry successful, and resume the client with a -- particular network updated. commandSuccessUpdateCS :: NetworkState -> ClientState -> IO CommandResult -- | Consider the text entry a failure and resume the client commandFailure :: Monad m => ClientState -> m CommandResult -- | Command failure with an error message printed to client window commandFailureMsg :: Text -> ClientState -> IO CommandResult module Client.Commands.TabCompletion -- | Provides no tab completion for client commands noClientTab :: Bool -> ClientCommand String -- | Provides no tab completion for network commands noNetworkTab :: Bool -> NetworkCommand String -- | Provides no tab completion for channel commands noChannelTab :: Bool -> ChannelCommand String -- | Provides nickname based tab completion for client commands simpleClientTab :: Bool -> ClientCommand String -- | Provides nickname based tab completion for network commands simpleNetworkTab :: Bool -> NetworkCommand String -- | Provides nickname based tab completion for channel commands simpleChannelTab :: Bool -> ChannelCommand String simpleTabCompletion :: Prefix a => WordCompletionMode -> [a] -> [a] -> Bool -> ClientState -> IO CommandResult simpleTabCompletion' :: Prefix a => (Char -> Bool) -> WordCompletionMode -> [a] -> [a] -> Bool -> ClientState -> IO CommandResult -- | Complete the nickname at the current cursor position using the -- userlist for the currently focused channel (if any) nickTabCompletion :: Bool -> ClientState -> IO CommandResult isNickChar :: Char -> Bool activeNicks :: ClientState -> [Identifier] module Client.Commands.ZNC zncCommands :: CommandSection module Client.Commands.Window windowCommands :: CommandSection -- | Parses a single focus name given a default network. parseFocus :: Maybe Text -> String -> Maybe Focus focusNames :: ClientState -> [Text] module Client.Commands.Toggles togglesCommands :: CommandSection module Client.Commands.Queries queryCommands :: CommandSection module Client.Commands.Operator operatorCommands :: CommandSection -- | Implements the /help command, which is responsible for managing the -- help buffer. Unfortunately, this makes this command somewhat unique in -- that it's responsible for rendering. module Client.Commands.Help -- | Implementation of /help command. cmdHelp :: [CommandSection] -> Recognizer Command -> WindowCommand (Maybe String) module Client.Commands.Connection connectionCommands :: CommandSection module Client.Commands.Chat chatCommands :: CommandSection -- | Common logic for /msg and /notice returning the -- client state chatCommand' :: (Source -> Identifier -> IrcMsg) -> [Text] -> NetworkState -> ClientState -> IO ClientState -- | Treat the current text input as a chat message and send it. executeChat :: Focus -> String -> ClientState -> IO CommandResult -- | Implementation of /ctcp cmdCtcp :: NetworkCommand (String, String, String) module Client.Commands.Channel channelCommands :: CommandSection module Client.Commands.Certificate newCertificateCommand :: Command -- | 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. Leading spaces before the / are -- ignored when checking for commands. execute :: String -> ClientState -> IO CommandResult -- | Execute command provided by user, resolve aliases if necessary. -- -- The last disconnection time is stored in text form and is available -- for substitutions in macros. It is only provided when running startup -- commands during a reconnect event. executeUserCommand :: Maybe Text -> String -> ClientState -> IO CommandResult -- | Compute the replacement value for the given expansion variable. commandExpansion :: Maybe Focus -> Maybe Text -> ClientState -> Text -> Maybe Text -- | 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 -- | A command section is a logical grouping of commands. This allows for -- showing more structure in the help menu system. data CommandSection CommandSection :: Text -> [Command] -> CommandSection [cmdSectionName] :: CommandSection -> Text [cmdSectionCmds] :: CommandSection -> [Command] -- | A command is a list of aliases, an argument specification, -- implementation, and documentation. The arguments and implementation -- must match so that the parsed arguments will match what the -- implementation expects. data Command Command :: NonEmpty Text -> Args ArgsContext a -> Text -> CommandImpl a -> Command -- | Names of this command, first in the list is the "primary" name [cmdNames] :: Command -> NonEmpty Text -- | Specification of the arguments of the command [cmdArgumentSpec] :: Command -> Args ArgsContext a -- | Multi-line IRC-formatted documentation text used for /help [cmdDocumentation] :: Command -> Text -- | Implementation of the command for both execution and tab completion [cmdImplementation] :: Command -> CommandImpl a -- | Pair of implementations for executing a command and tab completing -- one. The tab-completion logic is extended with a Bool indicating that -- tab completion should be reversed data CommandImpl a -- | no requirements ClientCommand :: ClientCommand a -> (Bool -> ClientCommand String) -> CommandImpl a -- | operates on a window WindowCommand :: WindowCommand a -> (Bool -> WindowCommand String) -> CommandImpl a -- | requires an active network NetworkCommand :: NetworkCommand a -> (Bool -> NetworkCommand String) -> CommandImpl a -- | requires an active network and maybe a chat window MaybeChatCommand :: MaybeChatCommand a -> (Bool -> MaybeChatCommand String) -> CommandImpl a -- | requires an active chat window ChatCommand :: ChannelCommand a -> (Bool -> ChannelCommand String) -> CommandImpl a -- | requires an active channel window ChannelCommand :: ChannelCommand a -> (Bool -> ChannelCommand String) -> CommandImpl a -- | Map of built-in client commands to their implementations, tab -- completion logic, and argument structures. commands :: Recognizer Command -- | Raw list of commands in the order used for /help commandsList :: [CommandSection] -- | This module provides the renderer for the client's text box input. module Client.Image.Textbox textboxImage :: Int -> Int -> ClientState -> (Int, Int, Int, Image) module Client.Image.Layout -- | Compute the number of lines in a page at the current window size scrollAmount :: ClientState -> Int -- | Compute the combined image for all the visible message windows. drawLayout :: ClientState -> (Int, Int, Int, Int, 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) -- | While most network messages only affect the model of that network -- connection, some messages will affect the mutable state of the client -- itself. module Client.EventLoop.Network -- | Client-level responses to specific IRC messages. This is in contrast -- to the connection state tracking logic in Client.NetworkState clientResponse :: ZonedTime -> IrcMsg -> NetworkState -> ClientState -> IO 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 :: Vty -> ClientState -> IO () -- | Update the height and width fields of the client state updateTerminalSize :: Vty -> ClientState -> IO ClientState -- | Sum of the five possible event types the event loop handles data ClientEvent -- | Key presses and resizing VtyEvent :: InternalEvent -> ClientEvent -- | Incoming network events NetworkEvents :: NonEmpty (Text, NetworkEvent) -> ClientEvent -- | Timed action and the applicable network TimerEvent :: Text -> TimedAction -> ClientEvent -- | extension ID ExtTimerEvent :: Int -> ClientEvent ThreadEvent :: Int -> ThreadEntry -> ClientEvent -- | This module exports the C functions that extensions can used to query -- the state of the client. -- -- C Extensions can include glirc-api.h module Client.CApi.Exports -- | Type of glirc_send_message extension entry-point type Glirc_send_message = Ptr () {-^ api token -} -> Ptr FgnMsg {-^ pointer to message -} -> IO CInt {-^ 0 on success -} -- | Entry-point into the client when an extern extension wants send an IRC -- command to a connected server. glirc_send_message :: Glirc_send_message -- | Type of glirc_print extension entry-point type Glirc_print = Ptr () {-^ api token -} -> MessageCode {-^ enum message_code -} -> CString {-^ message -} -> CSize {-^ message length -} -> IO CInt {-^ 0 on success -} -- | Entry-point for extensions to append a message to the client buffer. -- The message_code can be used to render the message normally -- or to cause the client to draw attention to the message as an error. glirc_print :: Glirc_print -- | Type of glirc_list_networks extension entry-point type Glirc_list_networks = Ptr () {-^ api token -} -> IO (Ptr CString) {-^ null terminated array of null terminated strings -} -- | This extension entry-point allocates a list of all the identifiers for -- the active networks on the client. NULL returned on failure. -- The caller is responsible for freeing successful result with -- glirc_free_strings. glirc_list_networks :: Glirc_list_networks -- | Type of glirc_list_channels extension entry-point type Glirc_list_channels = Ptr () {-^ api token -} -> CString {-^ network -} -> CSize {-^ network len -} -> IO (Ptr CString) {-^ null terminated array of null terminated strings -} -- | Generate a list of connected channels for the network identified in -- the arguments. NULL returned on failure. Caller is -- responsible for freeing successful result with -- glirc_free_strings. glirc_list_channels :: Glirc_list_channels -- | Type of glirc_list_channel_users extension entry-point 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 -} -- | Generate a list of IRC nicknames currently connected to the identified -- channel on the identified network. NULL returned on failure. -- Caller is responsible for freeing successful result with -- glirc_free_strings. glirc_list_channel_users :: Glirc_list_channel_users -- | Type of glirc_my_nick extension entry-point type Glirc_my_nick = Ptr () {-^ api token -} -> CString {-^ network name -} -> CSize {-^ network name length -} -> IO CString -- | Return the IRC nickname associated with the active network connection -- identified in the arguments. NULL returned on failure. Caller -- is responsible for freeing successful result with -- glirc_free_string. glirc_my_nick :: Glirc_my_nick -- | Type of glirc_user_account extension entry-point type Glirc_user_account = Ptr () {-^ api token -} -> CString {-^ network name -} -> CSize {-^ network name length -} -> CString {-^ nickname -} -> CSize {-^ nickname length -} -> IO CString -- | Return the services account name associated with a nickname on a -- server as tracked by the client. Caller is responsible for freeing -- successful result with glirc_free_string. If no account is -- known, NULL is returned. glirc_user_account :: Glirc_user_account -- | Type of glirc_user_account extension entry-point type Glirc_user_channel_modes = Ptr () {-^ api token -} -> CString {-^ network name -} -> CSize {-^ network name length -} -> CString {-^ channel -} -> CSize {-^ channel length -} -> CString {-^ nickname -} -> CSize {-^ nickname length -} -> IO CString -- | Return the sigils associated with a nickname on a particular channel. -- Caller is responsible for freeing successful result with -- glirc_free_string. If user is on channel without any sigils -- an empty string is returned. If user is not on channel NULL -- is returned. glirc_user_channel_modes :: Glirc_user_channel_modes -- | Type of glirc_channel_modes extension entry-point type Glirc_channel_modes = Ptr () {-^ api token -} -> CString {-^ network name -} -> CSize {-^ network name length -} -> CString {-^ channel -} -> CSize {-^ channel length -} -> IO (Ptr CString) -- | Return all of the modes of a given channel. The first letter of each -- string returned is the mode. Any remaining characters are the mode -- argument. Caller is responsible for freeing successful result with -- glirc_free_strings. If the user is not on a channel -- NULL is returned. The modes might not be known to the client -- for a particular channel which can result in an empty list of modes -- being returned. glirc_channel_modes :: Glirc_channel_modes -- | Type of glirc_channel_masks extension entry-point type Glirc_channel_masks = Ptr () {-^ api token -} -> CString {-^ network name -} -> CSize {-^ network name length -} -> CString {-^ channel -} -> CSize {-^ channel length -} -> CChar {-^ mode -} -> IO (Ptr CString) -- | Return all of the modes of a given channel. The first letter of each -- string returned is the mode. Any remaining characters are the mode -- argument. Caller is responsible for freeing successful result with -- glirc_free_strings. If the user is not on a channel -- NULL is returned. The modes might not be known to the client -- for a particular channel which can result in an empty list of modes -- being returned. glirc_channel_masks :: Glirc_channel_masks -- | Type of glirc_identifier_cmp extension entry-point type Glirc_identifier_cmp = CString {-^ identifier 1 -} -> CSize {-^ identifier 1 len -} -> CString {-^ identifier 2 -} -> CSize {-^ identifier 2 len -} -> IO CInt -- | Case insensitive comparison suitable for use on channels and -- nicknames. Returns -1 if the first identifier is less than the second -- Returns 0 if the first identifier is equal to the second Returns 1 if -- the first identifier is greater than the second glirc_identifier_cmp :: Glirc_identifier_cmp -- | Type of glirc_is_channel extension entry-point type Glirc_is_channel = Ptr () {-^ api token -} -> CString {-^ network name -} -> CSize {-^ network length -} -> CString {-^ target name -} -> CSize {-^ target length -} -> IO CInt {-^ boolean -} -- | Returns 1 when the given target on the given network is a -- channel name, otherwise returns 0. -- -- If the given network is not currently active this returns 0. glirc_is_channel :: Glirc_is_channel -- | Type of glirc_is_logged_on extension entry-point type Glirc_is_logged_on = Ptr () {-^ api token -} -> CString {-^ network name -} -> CSize {-^ network length -} -> CString {-^ target name -} -> CSize {-^ target length -} -> IO CInt {-^ boolean -} -- | Returns 1 when the given target on the given network shares a -- channel with the user, 0 otherwise. -- -- If the given network is not currently active this returns 0. glirc_is_logged_on :: Glirc_is_logged_on -- | Type of glirc_mark_seen extension entry-point 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 -- specify the client window send an empty network name. To specify a -- network window send an empty channel name. glirc_mark_seen :: Glirc_mark_seen -- | Type of glirc_clear_window extension entry-point type Glirc_clear_window = Ptr () {-^ api token -} -> CString {-^ network name -} -> CSize {-^ network name length -} -> CString {-^ channel name -} -> CSize {-^ channel name length -} -> IO () -- | Clear contents of a specified window. To specify the client window -- send an empty network name. To specify a network window send an empty -- channel name. glirc_clear_window :: Glirc_clear_window -- | Type of glirc_current_focus extension entry-point type Glirc_current_focus = Ptr () {-^ api token -} -> Ptr CString {-^ OUT: newly allocated network string -} -> Ptr CSize {-^ OUT: network length -} -> Ptr CString {-^ OUT: newly allocated target string -} -> Ptr CSize {-^ OUT: target length -} -> IO () -- | Find the network and target identifier associated with the currently -- focused window. -- -- Free the allocated strings with glirc_free_string. -- -- Strings set to NULL if there is no current network or no -- current target. glirc_current_focus :: Glirc_current_focus -- | Type of glirc_set_focus extension entry-point type Glirc_set_focus = Ptr () {-^ api token -} -> CString {-^ network -} -> CSize {-^ network length -} -> CString {-^ target -} -> CSize {-^ target length -} -> IO () -- | Assign window focus to a new value. -- -- Set to client window if network is empty. -- -- Set to network window if channel is empty. -- -- Set to chat window otherwise. glirc_set_focus :: Glirc_set_focus -- | Type of glirc_free_string extension entry-point type Glirc_free_string = CString {-^ glirc allocated string -} -> IO () -- | Free one of the heap allocated strings found as a return value from -- the extension API. If argument is NULL, nothing happens. glirc_free_string :: Glirc_free_string -- | Type of glirc_free_strings extension entry-point type Glirc_free_strings = Ptr CString {-^ glirc allocated strings, null-terminated -} -> IO () -- | Free an array of heap allocated strings found as a return value from -- the extension API. If argument is NULL, nothing happens. glirc_free_strings :: Glirc_free_strings -- | Type of glirc_inject_chat extension entry-point. type Glirc_inject_chat = Ptr () {-^ api token -} -> CString {-^ network -} -> CSize {-^ network length -} -> CString {-^ source -} -> CSize {-^ source length -} -> CString {-^ target -} -> CSize {-^ target length -} -> CString {-^ message -} -> CSize {-^ message length -} -> IO CInt {-^ 0 on success -} -- | Add a message to a chat window as if it was received directly from the -- IRC server. This is useful when implementing extensions that intercept -- incoming chat messages and transform them before showing the user. glirc_inject_chat :: Glirc_inject_chat -- | Type of glirc_resolve_path extension entry-point type Glirc_resolve_path = Ptr () {-^ api token -} -> CString {-^ path -} -> CSize {-^ path length -} -> IO CString {-^ resolved path -} -- | Resolve the given string to an absolute path. This expands ~ -- for the home directory and computes paths relative to the -- configuration file. -- -- Free the allocated string with glirc_free_string. glirc_resolve_path :: Glirc_resolve_path -- | Type of glirc_set_timer extension entry-point type Glirc_set_timer = Ptr () {-^ api token -} -> CULong {-^ milliseconds delay -} -> FunPtr TimerCallback {-^ function -} -> Ptr () {-^ callback state -} -> IO TimerId {-^ timer ID -} -- | Register a function to be called after a given number of milliseconds -- of delay. The returned timer ID can be used to cancel the timer. glirc_set_timer :: Glirc_set_timer -- | Type of glirc_cancel_timer extension entry-point type Glirc_cancel_timer = Ptr () {-^ api token -} -> TimerId {-^ timer ID -} -> IO (Ptr ()) {-^ returns held callback state -} -- | Register a function to be called after a given number of milliseconds -- of delay. The returned timer ID can be used to cancel the timer. glirc_cancel_timer :: Glirc_cancel_timer -- | Type of glirc_window_lines extension entry-point type Glirc_window_lines = Ptr () {-^ api token -} -> CString {-^ network name -} -> CSize {-^ network length -} -> CString {-^ target name -} -> CSize {-^ target length -} -> CInt {-^ use filter -} -> IO (Ptr CString) {-^ null terminated array of null terminated strings -} -- | This extension entry-point allocates a list of all the window lines -- for the requested window. The lines are presented with newest line at -- the head of the list. The caller is responsible for freeing successful -- result with glirc_free_strings. glirc_window_lines :: Glirc_window_lines -- | Type of glirc_thread extension entry-point type Glirc_thread = Ptr () {-^ api token -} -> FunPtr (Ptr () -> IO (Ptr ())) {-^ start -} -> FunPtr (Ptr () -> IO ()) {-^ finish -} -> Ptr () {-^ start argument -} -> IO () {-^ null terminated array of null terminated strings -} -- | This extension entry-point allocates a list of all the window lines -- for the requested window. The lines are presented with newest line at -- the head of the list. The caller is responsible for freeing successful -- result with glirc_free_strings. glirc_thread :: Glirc_thread