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

Matterhorn.Draw.Messages

Synopsis

Documentation

data MessageData Source #

A bundled structure that includes all the information necessary to render a given message

Constructors

MessageData 

Fields

renderMessage :: MessageData -> Widget Name Source #

This performs rendering of the specified message according to settings in MessageData.

printableNameForUserRef :: ChatState -> UserRef -> Maybe Text Source #

printableNameForUserRef converts the UserRef into a printable name, based on the current known user data.

renderSingleMessage Source #

Arguments

:: ChatState

The application state

-> HighlightSet

The highlight set to use when rendering this message

-> Bool

Whether to render reply indentations

-> Maybe ServerTime

This specifies an "indicator boundary". Showing various indicators (e.g. "edited") is not typically done for messages that are older than this boundary value.

-> Message

The message to render

-> ThreadState

The thread state in which to render the message

-> Name

Clickable name tag

-> Widget Name 

renderSingleMessage is the main message drawing function.

unsafeRenderMessageSelection Source #

Arguments

:: (SeqDirection dir1, SeqDirection dir2) 
=> ((Message, ThreadState), (DirectionalSeq dir1 (Message, ThreadState), DirectionalSeq dir2 (Message, ThreadState)))

The message to render, the messages before it, and after it, respectively

-> (Message -> ThreadState -> Name -> Widget Name)

A per-message rendering function to use

-> Name

Clickable name tag

-> Widget Name 

Render a selected message with focus, including the messages before and the messages after it. The foldable parameters exist because (depending on the situation) we might use either of the message list types for the before and after (i.e. the chronological or retrograde message sequences).