Safe Haskell | None |
---|---|
Language | Haskell2010 |
Synopsis
- data MessageData = MessageData {
- mdEditThreshold :: Maybe ServerTime
- mdShowOlderEdits :: Bool
- mdShowReactions :: Bool
- mdMessage :: Message
- mdUserName :: Maybe Text
- mdParentMessage :: Maybe Message
- mdParentUserName :: Maybe Text
- mdThreadState :: ThreadState
- mdRenderReplyParent :: Bool
- mdHighlightSet :: HighlightSet
- mdIndentBlocks :: Bool
- mdMessageWidthLimit :: Maybe Int
- mdMyUsername :: Text
- mdWrapNonhighlightedCodeBlocks :: Bool
- renderMessage :: MessageData -> Widget Name
- nameForUserRef :: ChatState -> UserRef -> Maybe Text
- renderSingleMessage :: ChatState -> HighlightSet -> Maybe ServerTime -> Message -> ThreadState -> Widget Name
- unsafeRenderMessageSelection :: (SeqDirection dir1, SeqDirection dir2) => ((Message, ThreadState), (DirectionalSeq dir1 (Message, ThreadState), DirectionalSeq dir2 (Message, ThreadState))) -> (Message -> ThreadState -> Widget Name) -> Widget Name
- renderLastMessages :: ChatState -> HighlightSet -> Maybe ServerTime -> DirectionalSeq Retrograde (Message, ThreadState) -> Widget Name
- addEllipsis :: Widget a -> Widget a
Documentation
data MessageData Source #
A bundled structure that includes all the information necessary to render a given message
MessageData | |
|
renderMessage :: MessageData -> Widget Name Source #
renderMessage performs markdown rendering of the specified message.
nameForUserRef :: ChatState -> UserRef -> Maybe Text Source #
nameForUserRef converts the UserRef into a printable name, based on the current known user data.
renderSingleMessage :: ChatState -> HighlightSet -> Maybe ServerTime -> Message -> ThreadState -> Widget Name Source #
renderSingleMessage is the main message drawing function.
The ind
argument specifies an "indicator boundary". Showing
various indicators (e.g. "edited") is not typically done for
messages that are older than this boundary value.
unsafeRenderMessageSelection :: (SeqDirection dir1, SeqDirection dir2) => ((Message, ThreadState), (DirectionalSeq dir1 (Message, ThreadState), DirectionalSeq dir2 (Message, ThreadState))) -> (Message -> ThreadState -> Widget Name) -> Widget Name Source #
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).
renderLastMessages :: ChatState -> HighlightSet -> Maybe ServerTime -> DirectionalSeq Retrograde (Message, ThreadState) -> Widget Name Source #
addEllipsis :: Widget a -> Widget a Source #