Safe Haskell | None |
---|---|
Language | Haskell2010 |
Synopsis
- openFilePath :: FilePath -> MH Bool
- openWithOpener :: MH String -> MH Bool
- runLoggedCommand :: TChan ProgramOutput -> String -> [String] -> Maybe String -> Maybe (MVar ProgramOutput) -> IO ()
- fetchFile :: FileId -> Session -> IO String
- fetchFileAtPath :: FileId -> Session -> FilePath -> IO ()
- installMessagesFromPosts :: Maybe TeamId -> Posts -> MH Messages
- updatePostMap :: Maybe TeamId -> Posts -> MH ()
- postInfoMessage :: Text -> MH ()
- postErrorMessageIO :: Text -> ChatState -> IO ChatState
- postErrorMessage' :: Text -> MH ()
- addEmoteFormatting :: Text -> Text
- removeEmoteFormatting :: Text -> Text
- fetchMentionedUsers :: Set MentionedUser -> MH ()
- doPendingUserFetches :: MH ()
- doPendingUserStatusFetches :: MH ()
- module Matterhorn.State.Async
System interface
:: TChan ProgramOutput | The output channel to send the output to |
-> String | The program name |
-> [String] | Arguments |
-> Maybe String | The stdin to send, if any |
-> Maybe (MVar ProgramOutput) | Where to put the program output when it is ready |
-> IO () |
fetchFile :: FileId -> Session -> IO String Source #
Given a file ID and server session, fetch the file into a temporary location and return its path. The caller is responsible for deleting the file.
fetchFileAtPath :: FileId -> Session -> FilePath -> IO () Source #
Given a file ID and server session, fetch the file and save it to the specified destination path. The destination path must refer to the path to the file itself, not its parent directory. This function will create only the parent directory in the specified path; it will not create all path entries recursively. If the file already exists, this function will overwrite the file.
The caller is responsible for catching all exceptions.
Posts
installMessagesFromPosts :: Maybe TeamId -> Posts -> MH Messages Source #
Given a collection of posts from the server, save the posts in the global post map. Also convert the posts to Matterhorn's Message type and return them along with the set of all usernames mentioned in the text of the resulting messages.
This also sets the mFlagged field of each message based on whether its post ID is a flagged post according to crFlaggedPosts at the time of this call.
Utilities
postInfoMessage :: Text -> MH () Source #
Add a new ClientMessage
representing an error message to
the current channel's message list
postErrorMessage' :: Text -> MH () Source #
Add a new ClientMessage
representing an error message to
the current channel's message list
addEmoteFormatting :: Text -> Text Source #
removeEmoteFormatting :: Text -> Text Source #
fetchMentionedUsers :: Set MentionedUser -> MH () Source #
doPendingUserFetches :: MH () Source #
doPendingUserStatusFetches :: MH () Source #
module Matterhorn.State.Async