matterhorn-50200.17.0: Terminal client for the Mattermost chat system
Safe HaskellNone
LanguageHaskell2010

Matterhorn.State.Common

Synopsis

System interface

runLoggedCommand Source #

Arguments

:: 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