Safe Haskell | Safe-Inferred |
---|---|
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
- mdRenderReplyIndent :: Bool
- mdHighlightSet :: HighlightSet
- mdIndentBlocks :: Bool
- mdTruncateVerbatimBlocks :: Maybe Int
- mdMessageWidthLimit :: Maybe Int
- mdMyUsername :: Text
- mdMyUserId :: UserId
- mdWrapNonhighlightedCodeBlocks :: Bool
- mdClickableNameTag :: Name
- renderMessage :: MessageData -> Widget Name
- printableNameForUserRef :: ChatState -> UserRef -> Maybe Text
- renderSingleMessage :: ChatState -> HighlightSet -> Bool -> Maybe ServerTime -> Message -> ThreadState -> Name -> Widget Name
- unsafeRenderMessageSelection :: (SeqDirection dir1, SeqDirection dir2) => ((Message, ThreadState), (DirectionalSeq dir1 (Message, ThreadState), DirectionalSeq dir2 (Message, ThreadState))) -> (Message -> ThreadState -> Name -> Widget Name) -> Name -> Widget Name
- renderLastMessages :: ChatState -> HighlightSet -> Maybe ServerTime -> Bool -> Name -> DirectionalSeq Retrograde (Message, ThreadState) -> Widget Name
- addEllipsis :: Widget a -> Widget a
- mkClickableInline :: Maybe MessageId -> Name -> Int -> Inline -> Maybe Name
Documentation
data MessageData Source #
A bundled structure that includes all the information necessary to render a given message
MessageData | |
|
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.
:: 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 #
:: (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).
renderLastMessages :: ChatState -> HighlightSet -> Maybe ServerTime -> Bool -> Name -> DirectionalSeq Retrograde (Message, ThreadState) -> Widget Name Source #
addEllipsis :: Widget a -> Widget a Source #