| Safe Haskell | None |
|---|---|
| Language | Haskell2010 |
Matterhorn.Types
Synopsis
- data ConnectionStatus
- data HelpTopic = HelpTopic {}
- data MessageSelectState = MessageSelectState {}
- data ProgramOutput = ProgramOutput {}
- data MHEvent
- data InternalEvent
- data Name
- = ChannelMessages ChannelId
- | MessageInput
- | ChannelList
- | HelpViewport
- | HelpText
- | ScriptHelpText
- | ThemeHelpText
- | SyntaxHighlightHelpText
- | KeybindingHelpText
- | ChannelSelectString
- | CompletionAlternatives
- | CompletionList
- | JoinChannelList
- | UrlList
- | MessagePreviewViewport
- | ThemeListSearchInput
- | UserListSearchInput
- | JoinChannelListSearchInput
- | UserListSearchResults
- | ThemeListSearchResults
- | ViewMessageArea
- | ViewMessageReactionsArea
- | ChannelSidebar
- | ChannelSelectInput
- | AttachmentList
- | AttachmentFileBrowser
- | MessageReactionsArea
- | ReactionEmojiList
- | ReactionEmojiListInput
- | TabbedWindowTabBar
- | MuteToggleField
- | ChannelMentionsField
- | DesktopNotificationsField (WithDefault NotifyOption)
- | PushNotificationsField (WithDefault NotifyOption)
- | ChannelTopicEditor
- | ChannelTopicSaveButton
- | ChannelTopicCancelButton
- | ChannelTopicEditorPreview
- data ChannelSelectMatch = ChannelSelectMatch {}
- data StartupStateInfo = StartupStateInfo {}
- data MHError
- data AttachmentData = AttachmentData {}
- data CPUUsagePolicy
- tabbedWindow :: (Show a, Eq a) => a -> TabbedWindowTemplate a -> Mode -> (Int, Int) -> TabbedWindow a
- getCurrentTabbedWindowEntry :: (Show a, Eq a) => TabbedWindow a -> TabbedWindowEntry a
- tabbedWindowNextTab :: (Show a, Eq a) => TabbedWindow a -> MH (TabbedWindow a)
- tabbedWindowPreviousTab :: (Show a, Eq a) => TabbedWindow a -> MH (TabbedWindow a)
- runTabShowHandlerFor :: (Eq a, Show a) => a -> TabbedWindow a -> MH ()
- getServerBaseUrl :: MH TeamBaseURL
- serverBaseUrl :: ChatState -> TeamBaseURL
- data TabbedWindow a = TabbedWindow {
- twValue :: a
- twReturnMode :: Mode
- twTemplate :: TabbedWindowTemplate a
- twWindowWidth :: Int
- twWindowHeight :: Int
- data TabbedWindowEntry a = TabbedWindowEntry {}
- data TabbedWindowTemplate a = TabbedWindowTemplate {
- twtEntries :: [TabbedWindowEntry a]
- twtTitle :: a -> Widget Name
- data ConnectionInfo = ConnectionInfo {
- _ciHostname :: Text
- _ciPort :: Int
- _ciUrlPath :: Text
- _ciUsername :: Text
- _ciPassword :: Text
- _ciAccessToken :: Text
- _ciType :: ConnectionType
- data SidebarUpdate
- data PendingChannelChange
- = ChangeByChannelId ChannelId (Maybe (MH ()))
- | ChangeByUserId UserId
- data ViewMessageWindowTab
- clearChannelUnreadStatus :: ChannelId -> MH ()
- data ChannelListEntry
- data ChannelListOrientation
- channelListEntryChannelId :: ChannelListEntry -> ChannelId
- channelListEntryUserId :: ChannelListEntry -> Maybe UserId
- userIdsFromZipper :: Zipper ChannelListGroup ChannelListEntry -> [UserId]
- entryIsDMEntry :: ChannelListEntry -> Bool
- ciHostname :: Lens' ConnectionInfo Text
- ciPort :: Lens' ConnectionInfo Int
- ciUrlPath :: Lens' ConnectionInfo Text
- ciUsername :: Lens' ConnectionInfo Text
- ciPassword :: Lens' ConnectionInfo Text
- ciType :: Lens' ConnectionInfo ConnectionType
- ciAccessToken :: Lens' ConnectionInfo Text
- newChannelTopicDialog :: Text -> ChannelTopicDialogState
- data ChannelTopicDialogState = ChannelTopicDialogState {}
- channelTopicDialogEditor :: Lens' ChannelTopicDialogState (Editor Text Name)
- channelTopicDialogFocus :: Lens' ChannelTopicDialogState (FocusRing Name)
- data Config = Config {
- configUser :: Maybe Text
- configHost :: Maybe Text
- configTeam :: Maybe Text
- configPort :: Int
- configUrlPath :: Maybe Text
- configPass :: Maybe PasswordSource
- configToken :: Maybe TokenSource
- configTimeFormat :: Maybe Text
- configDateFormat :: Maybe Text
- configTheme :: Maybe Text
- configThemeCustomizationFile :: Maybe Text
- configSmartBacktick :: Bool
- configSmartEditing :: Bool
- configURLOpenCommand :: Maybe Text
- configURLOpenCommandInteractive :: Bool
- configActivityNotifyCommand :: Maybe Text
- configActivityBell :: Bool
- configShowMessageTimestamps :: Bool
- configShowBackground :: BackgroundInfo
- configShowMessagePreview :: Bool
- configShowChannelList :: Bool
- configShowExpandedChannelTopics :: Bool
- configEnableAspell :: Bool
- configAspellDictionary :: Maybe Text
- configUnsafeUseHTTP :: Bool
- configValidateServerCertificate :: Bool
- configChannelListWidth :: Int
- configLogMaxBufferSize :: Int
- configShowOlderEdits :: Bool
- configShowTypingIndicator :: Bool
- configAbsPath :: Maybe FilePath
- configUserKeys :: KeyConfig
- configHyperlinkingMode :: Bool
- configSyntaxDirs :: [FilePath]
- configDirectChannelExpirationDays :: Int
- configCpuUsagePolicy :: CPUUsagePolicy
- configDefaultAttachmentPath :: Maybe FilePath
- configChannelListOrientation :: ChannelListOrientation
- data HelpScreen
- data PasswordSource
- data TokenSource
- data MatchType
- data Mode
- = Main
- | ShowHelp HelpTopic Mode
- | ChannelSelect
- | UrlSelect
- | LeaveChannelConfirm
- | DeleteChannelConfirm
- | MessageSelect
- | MessageSelectDeleteConfirm
- | PostListOverlay PostListContents
- | UserListOverlay
- | ReactionEmojiListOverlay
- | ChannelListOverlay
- | ThemeListOverlay
- | ViewMessage
- | ManageAttachments
- | ManageAttachmentsBrowseFiles
- | EditNotifyPrefs
- | ChannelTopicWindow
- data ChannelSelectPattern
- data PostListContents
- data AuthenticationException
- data BackgroundInfo
- type RequestChan = TChan (IO (Maybe (MH ())))
- data UserFetch
- writeBChan :: MonadIO m => BChan MHEvent -> MHEvent -> m ()
- data InternalTheme = InternalTheme {}
- attrNameToConfig :: AttrName -> Text
- mkChannelZipperList :: UTCTime -> Config -> Maybe ClientConfig -> UserPreferences -> ClientChannels -> Users -> [(ChannelListGroup, [ChannelListEntry])]
- data ChannelListGroup
- channelListGroupUnread :: ChannelListGroup -> Int
- trimChannelSigil :: Text -> Text
- data ChannelSelectState = ChannelSelectState {}
- channelSelectMatches :: Lens' ChannelSelectState (Zipper ChannelListGroup ChannelSelectMatch)
- channelSelectInput :: Lens' ChannelSelectState (Editor Text Name)
- emptyChannelSelectState :: ChannelSelectState
- data ChatState
- newState :: StartupStateInfo -> IO ChatState
- csChannelTopicDialog :: Lens' ChatState ChannelTopicDialogState
- csChannelListOrientation :: Lens' ChatState ChannelListOrientation
- csResources :: Lens' ChatState ChatResources
- csFocus :: Lens' ChatState (Zipper ChannelListGroup ChannelListEntry)
- csCurrentChannel :: Lens' ChatState ClientChannel
- csCurrentChannelId :: SimpleGetter ChatState ChannelId
- csUrlList :: Lens' ChatState (List Name LinkChoice)
- csShowMessagePreview :: Lens' ChatState Bool
- csShowChannelList :: Lens' ChatState Bool
- csShowExpandedChannelTopics :: Lens' ChatState Bool
- csPostMap :: Lens' ChatState (HashMap PostId Message)
- csRecentChannel :: Lens' ChatState (Maybe ChannelId)
- csReturnChannel :: Lens' ChatState (Maybe ChannelId)
- csThemeListOverlay :: Lens' ChatState (ListOverlayState InternalTheme ())
- csPostListOverlay :: Lens' ChatState PostListOverlayState
- csUserListOverlay :: Lens' ChatState (ListOverlayState UserInfo UserSearchScope)
- csChannelListOverlay :: Lens' ChatState (ListOverlayState Channel ChannelSearchScope)
- csReactionEmojiListOverlay :: Lens' ChatState (ListOverlayState (Bool, Text) ())
- csMyTeam :: Lens' ChatState Team
- csMessageSelect :: Lens' ChatState MessageSelectState
- csConnectionStatus :: Lens' ChatState ConnectionStatus
- csWorkerIsBusy :: Lens' ChatState (Maybe (Maybe Int))
- csChannel :: ChannelId -> Traversal' ChatState ClientChannel
- csChannels :: Lens' ChatState ClientChannels
- csChannelSelectState :: Lens' ChatState ChannelSelectState
- csEditState :: Lens' ChatState ChatEditState
- csClientConfig :: Lens' ChatState (Maybe ClientConfig)
- csPendingChannelChange :: Lens' ChatState (Maybe PendingChannelChange)
- csViewedMessage :: Lens' ChatState (Maybe (Message, TabbedWindow ViewMessageWindowTab))
- csNotifyPrefs :: Lens' ChatState (Maybe (Form ChannelNotifyProps MHEvent Name))
- csMe :: Lens' ChatState User
- timeZone :: Lens' ChatState TimeZoneSeries
- whenMode :: Mode -> MH () -> MH ()
- setMode :: Mode -> MH ()
- setMode' :: Mode -> ChatState -> ChatState
- appMode :: ChatState -> Mode
- data ChatEditState
- emptyEditState :: InputHistory -> Maybe (Aspell, IO ()) -> IO ChatEditState
- cedAttachmentList :: Lens' ChatEditState (List Name AttachmentData)
- cedFileBrowser :: Lens' ChatEditState (Maybe (FileBrowser Name))
- cedYankBuffer :: Lens' ChatEditState Text
- cedSpellChecker :: Lens' ChatEditState (Maybe (Aspell, IO ()))
- cedMisspellings :: Lens' ChatEditState (Set Text)
- cedEditMode :: Lens' ChatEditState EditMode
- cedEphemeral :: Lens' ChatEditState EphemeralEditState
- cedEditor :: Lens' ChatEditState (Editor Text Name)
- cedInputHistory :: Lens' ChatEditState InputHistory
- cedAutocomplete :: Lens' ChatEditState (Maybe AutocompleteState)
- cedAutocompletePending :: Lens' ChatEditState (Maybe Text)
- cedJustCompleted :: Lens' ChatEditState Bool
- data AutocompleteState = AutocompleteState {}
- acPreviousSearchString :: Lens' AutocompleteState Text
- acCompletionList :: Lens' AutocompleteState (List Name AutocompleteAlternative)
- acCachedResponses :: Lens' AutocompleteState (HashMap Text [AutocompleteAlternative])
- acType :: Lens' AutocompleteState AutocompletionType
- data AutocompletionType
- data CompletionSource
- data AutocompleteAlternative
- autocompleteAlternativeReplacement :: AutocompleteAlternative -> Text
- data SpecialMention
- specialMentionName :: SpecialMention -> Text
- isSpecialMention :: Text -> Bool
- data PostListOverlayState
- postListSelected :: Lens' PostListOverlayState (Maybe PostId)
- postListPosts :: Lens' PostListOverlayState Messages
- data UserSearchScope
- data ChannelSearchScope = AllChannels
- data ListOverlayState a b
- listOverlaySearchResults :: forall a b. Lens' (ListOverlayState a b) (List Name a)
- listOverlaySearchInput :: forall a b. Lens' (ListOverlayState a b) (Editor Text Name)
- listOverlaySearchScope :: forall a b. Lens' (ListOverlayState a b) b
- listOverlaySearching :: forall a b. Lens' (ListOverlayState a b) Bool
- listOverlayEnterHandler :: forall a b. Lens' (ListOverlayState a b) (a -> MH Bool)
- listOverlayNewList :: forall a b. Lens' (ListOverlayState a b) (Vector a -> List Name a)
- listOverlayFetchResults :: forall a b. Lens' (ListOverlayState a b) (b -> Session -> Text -> IO (Vector a))
- listOverlayRecordCount :: forall a b. Lens' (ListOverlayState a b) (Maybe Int)
- listOverlayReturnMode :: forall a b. Lens' (ListOverlayState a b) Mode
- getUsers :: MH Users
- data ChatResources = ChatResources {
- _crSession :: Session
- _crWebsocketThreadId :: Maybe ThreadId
- _crConn :: ConnectionData
- _crRequestQueue :: RequestChan
- _crEventQueue :: BChan MHEvent
- _crSubprocessLog :: TChan ProgramOutput
- _crWebsocketActionChan :: TChan WebsocketAction
- _crTheme :: AttrMap
- _crStatusUpdateChan :: TChan [UserId]
- _crConfiguration :: Config
- _crFlaggedPosts :: Set PostId
- _crUserPreferences :: UserPreferences
- _crSyntaxMap :: SyntaxMap
- _crLogManager :: LogManager
- _crEmoji :: EmojiCollection
- crUserPreferences :: Lens' ChatResources UserPreferences
- crEventQueue :: Lens' ChatResources (BChan MHEvent)
- crTheme :: Lens' ChatResources AttrMap
- crStatusUpdateChan :: Lens' ChatResources (TChan [UserId])
- crSubprocessLog :: Lens' ChatResources (TChan ProgramOutput)
- crWebsocketActionChan :: Lens' ChatResources (TChan WebsocketAction)
- crWebsocketThreadId :: Lens' ChatResources (Maybe ThreadId)
- crRequestQueue :: Lens' ChatResources RequestChan
- crFlaggedPosts :: Lens' ChatResources (Set PostId)
- crConn :: Lens' ChatResources ConnectionData
- crConfiguration :: Lens' ChatResources Config
- crSyntaxMap :: Lens' ChatResources SyntaxMap
- crLogManager :: Lens' ChatResources LogManager
- crEmoji :: Lens' ChatResources EmojiCollection
- getSession :: MH Session
- getResourceSession :: ChatResources -> Session
- specialUserMentions :: [Text]
- data UserPreferences = UserPreferences Bool (Seq FlaggedPost) (HashMap ChannelId Bool) (HashMap UserId Bool) (Maybe TeammateNameDisplayMode)
- userPrefShowJoinLeave :: Lens' UserPreferences Bool
- userPrefFlaggedPostList :: Lens' UserPreferences (Seq FlaggedPost)
- userPrefGroupChannelPrefs :: Lens' UserPreferences (HashMap ChannelId Bool)
- userPrefDirectChannelPrefs :: Lens' UserPreferences (HashMap UserId Bool)
- userPrefTeammateNameDisplayMode :: Lens' UserPreferences (Maybe TeammateNameDisplayMode)
- dmChannelShowPreference :: UserPreferences -> UserId -> Maybe Bool
- groupChannelShowPreference :: UserPreferences -> ChannelId -> Maybe Bool
- defaultUserPreferences :: UserPreferences
- setUserPreferences :: Seq Preference -> UserPreferences -> UserPreferences
- data WebsocketAction = UserTyping UTCTime ChannelId (Maybe PostId)
- data Cmd = Cmd {}
- commandName :: Cmd -> Text
- data CmdArgs :: Type -> Type where
- data MH a
- runMHEvent :: ChatState -> MH () -> EventM Name (Next ChatState)
- scheduleUserFetches :: [UserFetch] -> MH ()
- scheduleUserStatusFetches :: [UserId] -> MH ()
- getScheduledUserFetches :: MH [UserFetch]
- getScheduledUserStatusFetches :: MH (Maybe [UserId])
- mh :: EventM Name a -> MH a
- generateUUID :: MH UUID
- generateUUID_IO :: IO UUID
- mhSuspendAndResume :: (ChatState -> IO ChatState) -> MH ()
- mhHandleEventLensed :: Lens' ChatState b -> (e -> b -> EventM Name b) -> e -> MH ()
- gets :: MonadState s m => (s -> a) -> m a
- mhError :: MHError -> MH ()
- mhLog :: LogCategory -> Text -> MH ()
- mhGetIOLogger :: MH (LogCategory -> Text -> IO ())
- ioLogWithManager :: LogManager -> Maybe LogContext -> LogCategory -> Text -> IO ()
- data LogContext = LogContext {}
- withLogContext :: (Maybe LogContext -> Maybe LogContext) -> MH a -> MH a
- withLogContextChannelId :: ChannelId -> MH a -> MH a
- getLogContext :: MH (Maybe LogContext)
- data LogMessage = LogMessage {}
- data LogCommand
- data LogCategory
- data LogManager = LogManager {}
- startLoggingToFile :: LogManager -> FilePath -> IO ()
- stopLoggingToFile :: LogManager -> IO ()
- requestLogSnapshot :: LogManager -> FilePath -> IO ()
- requestLogDestination :: LogManager -> IO ()
- sendLogMessage :: LogManager -> LogMessage -> IO ()
- requestQuit :: MH ()
- getMessageForPostId :: ChatState -> PostId -> Maybe Message
- getParentMessage :: ChatState -> Message -> Maybe Message
- getReplyRootMessage :: Message -> MH Message
- resetSpellCheckTimer :: ChatEditState -> IO ()
- withChannel :: ChannelId -> (ClientChannel -> MH ()) -> MH ()
- withChannelOrDefault :: ChannelId -> a -> (ClientChannel -> MH a) -> MH a
- userList :: ChatState -> [UserInfo]
- resetAutocomplete :: MH ()
- hasUnread :: ChatState -> ChannelId -> Bool
- hasUnread' :: ClientChannel -> Bool
- isMine :: ChatState -> Message -> Bool
- setUserStatus :: UserId -> Text -> MH ()
- myUser :: ChatState -> User
- myUsername :: ChatState -> Text
- myUserId :: ChatState -> UserId
- myTeamId :: ChatState -> TeamId
- usernameForUserId :: UserId -> ChatState -> Maybe Text
- userByUsername :: Text -> ChatState -> Maybe UserInfo
- userByNickname :: Text -> ChatState -> Maybe UserInfo
- channelIdByChannelName :: Text -> ChatState -> Maybe ChannelId
- channelIdByUsername :: Text -> ChatState -> Maybe ChannelId
- channelByName :: Text -> ChatState -> Maybe ClientChannel
- userById :: UserId -> ChatState -> Maybe UserInfo
- allUserIds :: ChatState -> [UserId]
- addNewUser :: UserInfo -> MH ()
- useNickname :: ChatState -> Bool
- useNickname' :: Maybe ClientConfig -> UserPreferences -> Bool
- displayNameForUserId :: UserId -> ChatState -> Maybe Text
- displayNameForUser :: UserInfo -> Maybe ClientConfig -> UserPreferences -> Text
- raiseInternalEvent :: InternalEvent -> MH ()
- getNewMessageCutoff :: ChannelId -> ChatState -> Maybe NewMessageIndicator
- getEditedMessageCutoff :: ChannelId -> ChatState -> Maybe ServerTime
- data HighlightSet = HighlightSet {
- hUserSet :: Set Text
- hChannelSet :: Set Text
- hSyntaxMap :: SyntaxMap
- type UserSet = Set Text
- type ChannelSet = Set Text
- getHighlightSet :: ChatState -> HighlightSet
- module Matterhorn.Types.Channels
- module Matterhorn.Types.Messages
- module Matterhorn.Types.Posts
- module Matterhorn.Types.Users
Documentation
data ConnectionStatus Source #
We're either connected or we're not.
Constructors
| Connected | |
| Disconnected |
Instances
| Eq ConnectionStatus Source # | |
Defined in Matterhorn.Types Methods (==) :: ConnectionStatus -> ConnectionStatus -> Bool # (/=) :: ConnectionStatus -> ConnectionStatus -> Bool # | |
Help topics
Constructors
| HelpTopic | |
Fields | |
data MessageSelectState Source #
The state of message selection mode.
Constructors
| MessageSelectState | |
Fields | |
data ProgramOutput Source #
Constructors
| ProgramOutput | |
Fields
| |
This represents events that we handle in the main application loop.
Constructors
| WSEvent WebsocketEvent | For events that arise from the websocket |
| WSActionResponse WebsocketActionResponse | For responses to websocket actions |
| RespEvent (MH ()) | For the result values of async IO operations |
| RefreshWebsocketEvent | Tell our main loop to refresh the websocket connection |
| WebsocketParseError String | We failed to parse an incoming websocket event |
| WebsocketDisconnect | The websocket connection went down. |
| WebsocketConnect | The websocket connection came up. |
| BGIdle | background worker is idle |
| BGBusy (Maybe Int) | background worker is busy (with n requests) |
| RateLimitExceeded Int | A request initially failed due to a rate limit but will be retried if possible. The argument is the number of seconds in which the retry will be attempted. |
| RateLimitSettingsMissing | A request denied by a rate limit could not be retried because the response contained no rate limit metadata |
| RequestDropped | A request was reattempted due to a rate limit and was rate limited again |
| IEvent InternalEvent | MH-internal events |
data InternalEvent Source #
Internal application events.
Constructors
| DisplayError MHError | Some kind of application error occurred |
| LoggingStarted FilePath | |
| LoggingStopped FilePath | |
| LogStartFailed FilePath String | |
| LogDestination (Maybe FilePath) | |
| LogSnapshotSucceeded FilePath | |
| LogSnapshotFailed FilePath String | Logging events from the logging thread |
This Name type is the type used in brick to identify various
parts of the interface.
Constructors
data ChannelSelectMatch Source #
A match in channel selection mode.
Constructors
| ChannelSelectMatch | |
Fields
| |
Instances
| Eq ChannelSelectMatch Source # | |
Defined in Matterhorn.Types Methods (==) :: ChannelSelectMatch -> ChannelSelectMatch -> Bool # (/=) :: ChannelSelectMatch -> ChannelSelectMatch -> Bool # | |
| Show ChannelSelectMatch Source # | |
Defined in Matterhorn.Types Methods showsPrec :: Int -> ChannelSelectMatch -> ShowS # show :: ChannelSelectMatch -> String # showList :: [ChannelSelectMatch] -> ShowS # | |
data StartupStateInfo Source #
Startup state information that is constructed prior to building a ChatState.
Constructors
| StartupStateInfo | |
Fields | |
Application errors.
Constructors
| GenericError Text | A generic error message constructor |
| NoSuchChannel Text | The specified channel does not exist |
| NoSuchUser Text | The specified user does not exist |
| AmbiguousName Text | The specified name matches both a user and a channel |
| ServerError MattermostError | A Mattermost server error occurred |
| ClipboardError Text | A problem occurred trying to deal with yanking or the system clipboard |
| ConfigOptionMissing Text | A missing config option is required to perform an operation |
| ProgramExecutionFailed Text Text | Args: program name, path to log file. A problem occurred when running the program. |
| NoSuchScript Text | The specified script was not found |
| NoSuchHelpTopic Text | The specified help topic was not found |
| AsyncErrEvent SomeException | For errors that arise in the course of async IO operations |
data AttachmentData Source #
An attachment.
Constructors
| AttachmentData | |
Fields | |
Instances
| Eq AttachmentData Source # | |
Defined in Matterhorn.Types Methods (==) :: AttachmentData -> AttachmentData -> Bool # (/=) :: AttachmentData -> AttachmentData -> Bool # | |
| Show AttachmentData Source # | |
Defined in Matterhorn.Types Methods showsPrec :: Int -> AttachmentData -> ShowS # show :: AttachmentData -> String # showList :: [AttachmentData] -> ShowS # | |
data CPUUsagePolicy Source #
The policy for CPU usage.
The idea is that Matterhorn can benefit from using multiple CPUs, but the exact number is application-determined. We expose this policy setting to the user in the configuration.
Constructors
| SingleCPU | Constrain the application to use one CPU. |
| MultipleCPUs | Permit the usage of multiple CPUs (the exact number is determined by the application). |
Instances
| Eq CPUUsagePolicy Source # | |
Defined in Matterhorn.Types Methods (==) :: CPUUsagePolicy -> CPUUsagePolicy -> Bool # (/=) :: CPUUsagePolicy -> CPUUsagePolicy -> Bool # | |
| Show CPUUsagePolicy Source # | |
Defined in Matterhorn.Types Methods showsPrec :: Int -> CPUUsagePolicy -> ShowS # show :: CPUUsagePolicy -> String # showList :: [CPUUsagePolicy] -> ShowS # | |
Arguments
| :: (Show a, Eq a) | |
| => a | The handle corresponding to the tab that should be selected initially. |
| -> TabbedWindowTemplate a | The template for the window to construct. |
| -> Mode | When the window is closed, return to this application mode. |
| -> (Int, Int) | The window dimensions (width, height). |
| -> TabbedWindow a |
Construct a new tabbed window from a template. This will raise an exception if the initially-selected tab does not exist in the window template, or if the window template has any duplicated tab handles.
Note that the caller is responsible for determining whether to call the initially-selected tab's on-show handler.
getCurrentTabbedWindowEntry :: (Show a, Eq a) => TabbedWindow a -> TabbedWindowEntry a Source #
Get the currently-selected tab entry for a tabbed window. Raise an exception if the window's selected tab handle is not found in its template (which is a bug in the tabbed window infrastructure).
tabbedWindowNextTab :: (Show a, Eq a) => TabbedWindow a -> MH (TabbedWindow a) Source #
Switch a tabbed window's selected tab to its next tab, cycling back to the first tab if the last tab is the selected tab. This also invokes the on-show handler for the newly-selected tab.
Note that this does nothing if the window has only one tab.
tabbedWindowPreviousTab :: (Show a, Eq a) => TabbedWindow a -> MH (TabbedWindow a) Source #
Switch a tabbed window's selected tab to its previous tab, cycling to the last tab if the first tab is the selected tab. This also invokes the on-show handler for the newly-selected tab.
Note that this does nothing if the window has only one tab.
runTabShowHandlerFor :: (Eq a, Show a) => a -> TabbedWindow a -> MH () Source #
Run the on-show handler for the window tab entry with the specified handle.
serverBaseUrl :: ChatState -> TeamBaseURL Source #
data TabbedWindow a Source #
An instantiated tab window. This is based on a template and tracks the state of the tabbed window (current tab).
Parameterized over an abstract handle type (a) for the tabs so we
can give each a unique handle.
Constructors
| TabbedWindow | |
Fields
| |
data TabbedWindowEntry a Source #
An entry in a tabbed window corresponding to a tab and its content.
Parameterized over an abstract handle type (a) for the tabs so we
can give each a unique handle.
Constructors
| TabbedWindowEntry | |
Fields
| |
data TabbedWindowTemplate a Source #
The definition of a tabbed window. Note that this does not track the *state* of the window; it merely provides a collection of tab window entries (see above). To track the state of a tabbed window, use a TabbedWindow.
Parameterized over an abstract handle type (a) for the tabs so we
can give each a unique handle.
Constructors
| TabbedWindowTemplate | |
Fields
| |
data ConnectionInfo Source #
Our ConnectionInfo contains exactly as much information as is
necessary to start a connection with a Mattermost server. This is
built up during interactive authentication and then is used to log
in.
If the access token field is non-empty, that value is used and the username and password values are ignored.
Constructors
| ConnectionInfo | |
Fields
| |
data SidebarUpdate Source #
Constructors
| SidebarUpdateImmediate | |
| SidebarUpdateDeferred |
Instances
| Eq SidebarUpdate Source # | |
Defined in Matterhorn.Types Methods (==) :: SidebarUpdate -> SidebarUpdate -> Bool # (/=) :: SidebarUpdate -> SidebarUpdate -> Bool # | |
| Show SidebarUpdate Source # | |
Defined in Matterhorn.Types Methods showsPrec :: Int -> SidebarUpdate -> ShowS # show :: SidebarUpdate -> String # showList :: [SidebarUpdate] -> ShowS # | |
data PendingChannelChange Source #
Constructors
| ChangeByChannelId ChannelId (Maybe (MH ())) | |
| ChangeByUserId UserId |
data ViewMessageWindowTab Source #
Handles for the View Message window's tabs.
Constructors
| VMTabMessage | The message tab. |
| VMTabReactions | The reactions tab. |
Instances
| Eq ViewMessageWindowTab Source # | |
Defined in Matterhorn.Types Methods (==) :: ViewMessageWindowTab -> ViewMessageWindowTab -> Bool # (/=) :: ViewMessageWindowTab -> ViewMessageWindowTab -> Bool # | |
| Show ViewMessageWindowTab Source # | |
Defined in Matterhorn.Types Methods showsPrec :: Int -> ViewMessageWindowTab -> ShowS # show :: ViewMessageWindowTab -> String # showList :: [ViewMessageWindowTab] -> ShowS # | |
clearChannelUnreadStatus :: ChannelId -> MH () Source #
data ChannelListEntry Source #
The type of channel list entries.
Constructors
| CLChannel ChannelId | A non-DM entry |
| CLUserDM ChannelId UserId | A single-user DM entry |
| CLGroupDM ChannelId | A multi-user DM entry |
Instances
| Eq ChannelListEntry Source # | |
Defined in Matterhorn.Types Methods (==) :: ChannelListEntry -> ChannelListEntry -> Bool # (/=) :: ChannelListEntry -> ChannelListEntry -> Bool # | |
| Show ChannelListEntry Source # | |
Defined in Matterhorn.Types Methods showsPrec :: Int -> ChannelListEntry -> ShowS # show :: ChannelListEntry -> String # showList :: [ChannelListEntry] -> ShowS # | |
data ChannelListOrientation Source #
Constructors
| ChannelListLeft | Show the channel list to the left of the message area. |
| ChannelListRight | Show the channel list to the right of the message area. |
Instances
| Eq ChannelListOrientation Source # | |
Defined in Matterhorn.Types Methods (==) :: ChannelListOrientation -> ChannelListOrientation -> Bool # (/=) :: ChannelListOrientation -> ChannelListOrientation -> Bool # | |
| Show ChannelListOrientation Source # | |
Defined in Matterhorn.Types Methods showsPrec :: Int -> ChannelListOrientation -> ShowS # show :: ChannelListOrientation -> String # showList :: [ChannelListOrientation] -> ShowS # | |
newChannelTopicDialog :: Text -> ChannelTopicDialogState Source #
Make a new channel topic editor window state.
data ChannelTopicDialogState Source #
The state of the channel topic editor window.
Constructors
| ChannelTopicDialogState | |
Fields
| |
This is how we represent the user's configuration. Most fields correspond to configuration file settings (see Config.hs) but some are for internal book-keeping purposes only.
Constructors
| Config | |
Fields
| |
data HelpScreen Source #
The HelpScreen type represents the set of possible Help
dialogues we have to choose from.
Constructors
| MainHelp | |
| ScriptHelp | |
| ThemeHelp | |
| SyntaxHighlightHelp | |
| KeybindingHelp |
Instances
| Eq HelpScreen Source # | |
Defined in Matterhorn.Types | |
data PasswordSource Source #
A user password is either given to us directly, or a command which we execute to find the password.
Constructors
| PasswordString Text | |
| PasswordCommand Text |
Instances
| Eq PasswordSource Source # | |
Defined in Matterhorn.Types Methods (==) :: PasswordSource -> PasswordSource -> Bool # (/=) :: PasswordSource -> PasswordSource -> Bool # | |
| Read PasswordSource Source # | |
Defined in Matterhorn.Types Methods readsPrec :: Int -> ReadS PasswordSource # readList :: ReadS [PasswordSource] # | |
| Show PasswordSource Source # | |
Defined in Matterhorn.Types Methods showsPrec :: Int -> PasswordSource -> ShowS # show :: PasswordSource -> String # showList :: [PasswordSource] -> ShowS # | |
data TokenSource Source #
An access token source.
Constructors
| TokenString Text | |
| TokenCommand Text |
Instances
| Eq TokenSource Source # | |
Defined in Matterhorn.Types | |
| Read TokenSource Source # | |
Defined in Matterhorn.Types Methods readsPrec :: Int -> ReadS TokenSource # readList :: ReadS [TokenSource] # readPrec :: ReadPrec TokenSource # readListPrec :: ReadPrec [TokenSource] # | |
| Show TokenSource Source # | |
Defined in Matterhorn.Types Methods showsPrec :: Int -> TokenSource -> ShowS # show :: TokenSource -> String # showList :: [TokenSource] -> ShowS # | |
Constructors
| Prefix | |
| Suffix | |
| Infix | |
| Equal | |
| PrefixDMOnly | |
| PrefixNonDMOnly |
The Mode represents the current dominant UI activity
Constructors
data ChannelSelectPattern Source #
Instances
| Eq ChannelSelectPattern Source # | |
Defined in Matterhorn.Types Methods (==) :: ChannelSelectPattern -> ChannelSelectPattern -> Bool # (/=) :: ChannelSelectPattern -> ChannelSelectPattern -> Bool # | |
| Show ChannelSelectPattern Source # | |
Defined in Matterhorn.Types Methods showsPrec :: Int -> ChannelSelectPattern -> ShowS # show :: ChannelSelectPattern -> String # showList :: [ChannelSelectPattern] -> ShowS # | |
data PostListContents Source #
Mode type for the current contents of the post list overlay
Constructors
| PostListFlagged | |
| PostListPinned ChannelId | |
| PostListSearch Text Bool |
Instances
| Eq PostListContents Source # | |
Defined in Matterhorn.Types Methods (==) :: PostListContents -> PostListContents -> Bool # (/=) :: PostListContents -> PostListContents -> Bool # | |
data AuthenticationException Source #
The sum type of exceptions we expect to encounter on authentication
failure. We encode them explicitly here so that we can print them in
a more user-friendly manner than just show.
Constructors
| ConnectError HostCannotConnect | |
| ResolveError HostNotResolved | |
| AuthIOError IOError | |
| LoginError LoginFailureException | |
| OtherAuthError SomeException |
Instances
| Show AuthenticationException Source # | |
Defined in Matterhorn.Types Methods showsPrec :: Int -> AuthenticationException -> ShowS # show :: AuthenticationException -> String # showList :: [AuthenticationException] -> ShowS # | |
data BackgroundInfo Source #
The state of the UI diagnostic indicator for the async worker thread.
Constructors
| Disabled | Disable (do not show) the indicator. |
| Active | Show the indicator when the thread is working. |
| ActiveCount | Show the indicator when the thread is working, but include the thread's work queue length. |
Instances
| Eq BackgroundInfo Source # | |
Defined in Matterhorn.Types Methods (==) :: BackgroundInfo -> BackgroundInfo -> Bool # (/=) :: BackgroundInfo -> BackgroundInfo -> Bool # | |
| Show BackgroundInfo Source # | |
Defined in Matterhorn.Types Methods showsPrec :: Int -> BackgroundInfo -> ShowS # show :: BackgroundInfo -> String # showList :: [BackgroundInfo] -> ShowS # | |
type RequestChan = TChan (IO (Maybe (MH ()))) Source #
A RequestChan is a queue of operations we have to perform in the
background to avoid blocking on the main loop
A user fetching strategy.
Constructors
| UserFetchById UserId | Fetch the user with the specified ID. |
| UserFetchByUsername Text | Fetch the user with the specified username. |
| UserFetchByNickname Text | Fetch the user with the specified nickname. |
data InternalTheme Source #
Constructors
| InternalTheme | |
Fields | |
attrNameToConfig :: AttrName -> Text Source #
mkChannelZipperList :: UTCTime -> Config -> Maybe ClientConfig -> UserPreferences -> ClientChannels -> Users -> [(ChannelListGroup, [ChannelListEntry])] Source #
data ChannelListGroup Source #
The type of channel list group headings. Integer arguments indicate total number of channels in the group that have unread activity.
Constructors
| ChannelGroupPublicChannels Int | |
| ChannelGroupPrivateChannels Int | |
| ChannelGroupDirectMessages Int |
Instances
| Eq ChannelListGroup Source # | |
Defined in Matterhorn.Types Methods (==) :: ChannelListGroup -> ChannelListGroup -> Bool # (/=) :: ChannelListGroup -> ChannelListGroup -> Bool # | |
trimChannelSigil :: Text -> Text Source #
channelSelectMatches :: Lens' ChannelSelectState (Zipper ChannelListGroup ChannelSelectMatch) Source #
This is the giant bundle of fields that represents the current state of our application at any given time.
csReactionEmojiListOverlay :: Lens' ChatState (ListOverlayState (Bool, Text) ()) Source #
data ChatEditState Source #
The ChatEditState value contains the editor widget itself as well
as history and metadata we need for editing-related operations.
emptyEditState :: InputHistory -> Maybe (Aspell, IO ()) -> IO ChatEditState Source #
We can initialize a new ChatEditState value with just an edit
history, which we save locally.
cedSpellChecker :: Lens' ChatEditState (Maybe (Aspell, IO ())) Source #
data AutocompleteState Source #
Constructors
| AutocompleteState | |
Fields
| |
data AutocompletionType Source #
The type of data that the autocompletion logic supports. We use this to track the kind of completion underway in case the type of completion needs to change.
Constructors
| ACUsers | |
| ACChannels | |
| ACCodeBlockLanguage | |
| ACEmoji | |
| ACCommands |
Instances
| Eq AutocompletionType Source # | |
Defined in Matterhorn.Types Methods (==) :: AutocompletionType -> AutocompletionType -> Bool # (/=) :: AutocompletionType -> AutocompletionType -> Bool # | |
| Show AutocompletionType Source # | |
Defined in Matterhorn.Types Methods showsPrec :: Int -> AutocompletionType -> ShowS # show :: AutocompletionType -> String # showList :: [AutocompletionType] -> ShowS # | |
data CompletionSource Source #
The source of an autocompletion alternative.
Instances
| Eq CompletionSource Source # | |
Defined in Matterhorn.Types Methods (==) :: CompletionSource -> CompletionSource -> Bool # (/=) :: CompletionSource -> CompletionSource -> Bool # | |
| Show CompletionSource Source # | |
Defined in Matterhorn.Types Methods showsPrec :: Int -> CompletionSource -> ShowS # show :: CompletionSource -> String # showList :: [CompletionSource] -> ShowS # | |
data AutocompleteAlternative Source #
Constructors
| UserCompletion User Bool | User, plus whether the user is in the channel that triggered the autocomplete |
| SpecialMention SpecialMention | A special mention. |
| ChannelCompletion Bool Channel | Channel, plus whether the user is a member of the channel |
| SyntaxCompletion Text | Name of a skylighting syntax definition |
| CommandCompletion CompletionSource Text Text Text | Source, name of a slash command, argspec, and description |
| EmojiCompletion Text | The text of an emoji completion |
data SpecialMention Source #
A "special" mention that does not map to a specific user, but is an alias that the server uses to notify users.
Constructors
| MentionAll | @all: notify everyone in the channel. |
| MentionChannel | @channel: notify everyone in the channel. |
isSpecialMention :: Text -> Bool Source #
data PostListOverlayState Source #
The state of the post list overlay.
data UserSearchScope Source #
The scope for searching for users in a user list overlay.
Constructors
| ChannelMembers ChannelId TeamId | |
| ChannelNonMembers ChannelId TeamId | |
| AllUsers (Maybe TeamId) |
data ChannelSearchScope Source #
The scope for searching for channels to join.
Constructors
| AllChannels |
data ListOverlayState a b Source #
The state of the search result list overlay. Type a is the type
of data in the list. Type b is the search scope type.
listOverlaySearchResults :: forall a b. Lens' (ListOverlayState a b) (List Name a) Source #
listOverlaySearchInput :: forall a b. Lens' (ListOverlayState a b) (Editor Text Name) Source #
listOverlaySearchScope :: forall a b. Lens' (ListOverlayState a b) b Source #
listOverlaySearching :: forall a b. Lens' (ListOverlayState a b) Bool Source #
listOverlayEnterHandler :: forall a b. Lens' (ListOverlayState a b) (a -> MH Bool) Source #
listOverlayNewList :: forall a b. Lens' (ListOverlayState a b) (Vector a -> List Name a) Source #
listOverlayFetchResults :: forall a b. Lens' (ListOverlayState a b) (b -> Session -> Text -> IO (Vector a)) Source #
listOverlayRecordCount :: forall a b. Lens' (ListOverlayState a b) (Maybe Int) Source #
listOverlayReturnMode :: forall a b. Lens' (ListOverlayState a b) Mode Source #
data ChatResources Source #
ChatResources represents configuration and connection-related
information, as opposed to current model or view information.
Information that goes in the ChatResources value should be limited
to information that we read or set up prior to setting up the bulk of
the application state.
Constructors
getSession :: MH Session Source #
specialUserMentions :: [Text] Source #
data UserPreferences Source #
Constructors
| UserPreferences Bool (Seq FlaggedPost) (HashMap ChannelId Bool) (HashMap UserId Bool) (Maybe TeammateNameDisplayMode) |
dmChannelShowPreference :: UserPreferences -> UserId -> Maybe Bool Source #
data WebsocketAction Source #
Actions that can be sent on the websocket to the server.
Constructors
| UserTyping UTCTime ChannelId (Maybe PostId) | user typing in the input box |
Instances
| Eq WebsocketAction Source # | |
Defined in Matterhorn.Types Methods (==) :: WebsocketAction -> WebsocketAction -> Bool # (/=) :: WebsocketAction -> WebsocketAction -> Bool # | |
| Ord WebsocketAction Source # | |
Defined in Matterhorn.Types Methods compare :: WebsocketAction -> WebsocketAction -> Ordering # (<) :: WebsocketAction -> WebsocketAction -> Bool # (<=) :: WebsocketAction -> WebsocketAction -> Bool # (>) :: WebsocketAction -> WebsocketAction -> Bool # (>=) :: WebsocketAction -> WebsocketAction -> Bool # max :: WebsocketAction -> WebsocketAction -> WebsocketAction # min :: WebsocketAction -> WebsocketAction -> WebsocketAction # | |
| Read WebsocketAction Source # | |
Defined in Matterhorn.Types Methods readsPrec :: Int -> ReadS WebsocketAction # readList :: ReadS [WebsocketAction] # | |
| Show WebsocketAction Source # | |
Defined in Matterhorn.Types Methods showsPrec :: Int -> WebsocketAction -> ShowS # show :: WebsocketAction -> String # showList :: [WebsocketAction] -> ShowS # | |
data CmdArgs :: Type -> Type where Source #
The CmdArgs type represents the arguments to a slash-command; the
type parameter represents the argument structure.
A value of type MH a represents a computation that can
manipulate the application state and also request that the
application quit
runMHEvent :: ChatState -> MH () -> EventM Name (Next ChatState) Source #
Run an MM computation, choosing whether to continue or halt based
on the resulting
scheduleUserFetches :: [UserFetch] -> MH () Source #
scheduleUserStatusFetches :: [UserId] -> MH () Source #
generateUUID :: MH UUID Source #
generateUUID_IO :: IO UUID Source #
gets :: MonadState s m => (s -> a) -> m a #
Gets specific component of the state, using a projection function supplied.
mhGetIOLogger :: MH (LogCategory -> Text -> IO ()) Source #
Get a logger suitable for use in IO. The logger always logs using the MH monad log context at the time of the call to mhGetIOLogger.
ioLogWithManager :: LogManager -> Maybe LogContext -> LogCategory -> Text -> IO () Source #
data LogContext Source #
Logging context information, in the event that metadata should accompany a log message.
Constructors
| LogContext | |
Fields | |
Instances
| Eq LogContext Source # | |
Defined in Matterhorn.Types | |
| Show LogContext Source # | |
Defined in Matterhorn.Types Methods showsPrec :: Int -> LogContext -> ShowS # show :: LogContext -> String # showList :: [LogContext] -> ShowS # | |
withLogContext :: (Maybe LogContext -> Maybe LogContext) -> MH a -> MH a Source #
Use a modified logging context for the duration of the specified MH action.
getLogContext :: MH (Maybe LogContext) Source #
Get the current logging context.
data LogMessage Source #
A log message.
Constructors
| LogMessage | |
Fields
| |
Instances
| Eq LogMessage Source # | |
Defined in Matterhorn.Types | |
| Show LogMessage Source # | |
Defined in Matterhorn.Types Methods showsPrec :: Int -> LogMessage -> ShowS # show :: LogMessage -> String # showList :: [LogMessage] -> ShowS # | |
data LogCommand Source #
A logging thread command.
Constructors
| LogToFile FilePath | Start logging to the specified path. |
| LogAMessage !LogMessage | Log the specified message. |
| StopLogging | Stop any active logging. |
| ShutdownLogging | Shut down. |
| GetLogDestination | Ask the logging thread about its active logging destination. |
| LogSnapshot FilePath | Ask the logging thread to dump the current buffer to the specified destination. |
Instances
| Show LogCommand Source # | |
Defined in Matterhorn.Types Methods showsPrec :: Int -> LogCommand -> ShowS # show :: LogCommand -> String # showList :: [LogCommand] -> ShowS # | |
data LogCategory Source #
Log message tags.
Constructors
| LogGeneral | |
| LogAPI | |
| LogWebsocket | |
| LogError | |
| LogUserMark |
Instances
| Eq LogCategory Source # | |
Defined in Matterhorn.Types | |
| Show LogCategory Source # | |
Defined in Matterhorn.Types Methods showsPrec :: Int -> LogCategory -> ShowS # show :: LogCategory -> String # showList :: [LogCategory] -> ShowS # | |
startLoggingToFile :: LogManager -> FilePath -> IO () Source #
stopLoggingToFile :: LogManager -> IO () Source #
requestLogSnapshot :: LogManager -> FilePath -> IO () Source #
requestLogDestination :: LogManager -> IO () Source #
sendLogMessage :: LogManager -> LogMessage -> IO () Source #
requestQuit :: MH () Source #
This will request that after this computation finishes the application should exit
resetSpellCheckTimer :: ChatEditState -> IO () Source #
withChannel :: ChannelId -> (ClientChannel -> MH ()) -> MH () Source #
withChannelOrDefault :: ChannelId -> a -> (ClientChannel -> MH a) -> MH a Source #
resetAutocomplete :: MH () Source #
hasUnread' :: ClientChannel -> Bool Source #
myUsername :: ChatState -> Text Source #
channelByName :: Text -> ChatState -> Maybe ClientChannel Source #
allUserIds :: ChatState -> [UserId] Source #
addNewUser :: UserInfo -> MH () Source #
useNickname :: ChatState -> Bool Source #
useNickname' :: Maybe ClientConfig -> UserPreferences -> Bool Source #
displayNameForUser :: UserInfo -> Maybe ClientConfig -> UserPreferences -> Text Source #
raiseInternalEvent :: InternalEvent -> MH () Source #
data HighlightSet Source #
The set of usernames, channel names, and language names used for highlighting when rendering messages.
Constructors
| HighlightSet | |
Fields
| |
type ChannelSet = Set Text Source #
module Matterhorn.Types.Channels
module Matterhorn.Types.Messages
module Matterhorn.Types.Posts
module Matterhorn.Types.Users